{"type":"api","title":"Get Templates","meta":{"id":"/apps/pubhub/media/edm-api-v2/a2a30bcc9ecab5281b65761ae61df7e0031d5691/22db37d1-bb2c-3814-9940-2f648c7f33ab","swagger":"2.0","info":{"contact":{"email":"devmgmt@cisco.com"},"description":"This is the IoT device management core service. The service is responsible for managing the lifecycle of various IoT gateways and endpoints deployed as part of the Field Area Networks","license":{"name":"Licensing is primarily subscription based. Call Andy now!","url":"https://www.cisco.com"},"termsOfService":"http://swagger.io/terms/","title":"IoT Device Lifecycle Management","version":"4.0.0"},"host":"us.ciscoiot.com","basePath":"/nbapi/edm/v2","schemes":["https"],"securityDefinitions":{"bearerAuth":{"description":"This is the bearer Auth token.","in":"header","name":"Authorization","type":"apiKey"}},"security":[{"bearerAuth":[]}],"x-parser-conf":{"apiKeyGenerator":{"$remoteModule":"./config/apikey.js"}}},"spec":{"description":"Returns a list of templates that matches the query conditions (in a paginated way).\u003cbr /\u003e One of the below permissions is needed to invoke this API\u003cbr /\u003e- Tenant Management\u003cbr /\u003e- Manage Devices\u003cbr /\u003e- Manage Groups\u003cbr /\u003e- Manage Templates\u003cbr /\u003e- Add Devices","operationId":"getTemplates","parameters":[{"description":"The uuid of the tenant in whose context we are calling the api.","format":"uuid","in":"header","name":"x-tenant-id","required":true,"type":"string"},{"description":"deviceType based on which the group info to be returned","in":"query","name":"deviceType","required":false,"type":"string"},{"description":"filter query for templates search. Expected values - “deviceType:\u003cvalue\u003e name:\u003cvalue\u003e”","in":"query","name":"filter","required":false,"type":"string"},{"description":"free form string used to perform search on template name","in":"query","name":"search","required":false,"type":"string"},{"description":"Expected values - “deviceType:\u003cvalue\u003e name:\u003cvalue\u003e”","in":"query","name":"sortBy","required":false,"type":"string"},{"description":"Expected values - “ASC | DESC”","in":"query","name":"sortDir","required":false,"type":"string"},{"default":0,"description":"page number requested to be displayed","in":"query","minimum":0,"name":"page","required":false,"type":"integer"},{"default":20,"description":"The numbers of items to return","in":"query","maximum":200,"minimum":1,"name":"size","required":false,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"successful retrieval","schema":{"discriminator":"objectType","properties":{"page":{"description":"Page number","example":0,"type":"integer"},"size":{"description":"Size of page in the response","example":4,"type":"integer"},"total":{"description":"Total number of records available","example":4,"type":"integer"},"results":{"items":{"properties":{"configModel":{"example":"IOS","type":"string"},"description":{"example":"Basic default template of kind ie","type":"string"},"deviceType":{"example":"IE","type":"string"},"deviceTypeText":{"example":"IE","type":"string"},"isDefault":{"example":true,"type":"boolean"},"isFormBased":{"example":false,"type":"boolean"},"name":{"example":"default-ie","type":"string"},"templateDetails":{"items":{"properties":{"templateLastUpdated":{"example":"2023-02-14 04:37:47","type":"string"},"templateProperties":{"properties":{"sections":{"items":{"properties":{"enabled":{"type":"boolean"},"info":{"items":{"properties":{"border":{"type":"boolean"},"closeButton":{"type":"boolean"},"filled":{"type":"boolean"},"flavor":{"type":"string"},"iconType":{"type":"string"},"placement":{"type":"string"},"text":{"type":"string"},"type":{"type":"string"}},"type":"object","$$ref":"#/definitions/TemplateVariablesInfo"},"type":"array"},"items":{"items":{"properties":{"cardinality":{"type":"integer"},"default":{"description":"Default Value for the variable","type":"object"},"displayCondition":{"description":"Condition based on which this field should be displayed","type":"string"},"errorMessage":{"description":"populate error message if there is any back end exception","type":"string"},"hiddenCondition":{"items":{"properties":{"field":{"type":"string"},"value":{"description":"can be any data type","type":"object"}},"type":"object","$$ref":"#/definitions/TemplateVariablesHiddenCondition"},"type":"array"},"hiddenConditionOperator":{"description":"logical operator used to evaluate hiddenCondition if more than one field","type":"string"},"info":{"items":{"properties":{"border":{"type":"boolean"},"closeButton":{"type":"boolean"},"filled":{"type":"boolean"},"flavor":{"type":"string"},"iconType":{"type":"string"},"placement":{"type":"string"},"text":{"type":"string"},"type":{"type":"string"}},"type":"object","$$ref":"#/definitions/TemplateVariablesInfo"},"type":"array"},"key":{"description":"Template Variable Key","type":"string"},"linkSectionKey":{"description":"Section Key for Hyperlink","type":"string"},"linkText":{"description":"Hyperlink Text","type":"string"},"maxLength":{"type":"integer"},"minLength":{"type":"integer"},"readOnly":{"type":"boolean"},"required":{"type":"boolean"},"secure":{"type":"boolean"},"seedValues":{"items":{"properties":{"key":{"type":"string"},"value":{"type":"string"}},"type":"object","$$ref":"#/definitions/TemplateVariablesSeedValues"},"type":"array"},"tableColumns":{"items":{"$ref":"#/definitions/TemplateVariablesItem"},"type":"array"},"title":{"type":"string"},"type":{"description":"Template Variable Data Type","type":"string"},"validationType":{"description":"Validation type to be enforced for the variable","type":"string"},"value":{"description":"Current Value assigned for the variable","type":"object"}},"type":"object","$$ref":"#/definitions/TemplateVariablesItem"},"type":"array"},"key":{"description":"Section Key","type":"string"},"readOnly":{"type":"boolean"},"section":{"description":"Section Title","type":"string"},"sections":{"items":{"$ref":"#/definitions/TemplateVariablesSection"},"type":"array"},"showInTree":{"type":"boolean"},"showToggle":{"type":"boolean"},"templateType":{"description":"Template Type","items":{"enum":["CONFIG","EMBEDDED_AP_CONFIG","ROUTER_TUNNEL_ADD","HER_TUNNEL_ADD","HER_TUNNEL_DELETE","FACTORY_CONFIG","ROUTER_TUNNEL_DELETE","GATEWAY_TUNNEL_ADD","GATEWAY_TUNNEL_DELETE"],"type":"string"},"type":"array"}},"type":"object","$$ref":"#/definitions/TemplateVariablesSection"},"type":"array"}},"type":"object","$$ref":"#/definitions/TemplateVariablesResponse"},"templateRevision":{"type":"integer"},"templateType":{"enum":["CONFIG","EMBEDDED_AP_CONFIG","ROUTER_TUNNEL_ADD","HER_TUNNEL_ADD","HER_TUNNEL_DELETE","FACTORY_CONFIG","ROUTER_TUNNEL_DELETE","GATEWAY_TUNNEL_ADD","GATEWAY_TUNNEL_DELETE"],"example":"FACTORY_CONFIG","type":"string"},"templateTypeStr":{"example":"Bootstrap Configuration","type":"string"},"templateUuid":{"example":null,"type":"string"},"templateValid":{"example":true,"type":"boolean"},"templateValidationMessage":{"example":null,"type":"string"},"templateValue":{"example":"\u003c#-- Default BootStrap Configuration --\u003e\n\u003c#if far.isRunningIos()\u003e\n \u003c#assign sublist = far.eid?split(\"+\")[0..1]\u003e\n \u003c#assign pid = sublist[0]\u003e\n \u003c#assign model = pid[0..4]\u003e\n\u003c#if isRollbackConfig?has_content && isRollbackConfig == true\u003e\n.......","type":"string"}},"type":"object","$$ref":"#/definitions/TemplateDetail"},"type":"array"},"uuid":{"example":"59d8c85e-59f1-497f-8e45-6abfa668bf2c","type":"string"}},"required":["uuid","name","description","deviceType","deviceTypeText","isFormBased","configModel","templateDetails","isDefault"],"type":"object","$$ref":"#/definitions/TemplateVo"},"type":"array"}},"required":["page","size","total_count","results"],"type":"object","$$ref":"#/definitions/PagedTemplateListVo"}},"400":{"description":"Bad request","schema":{"description":"Specifies the error that occured during the request.","example":{"code":"10000","message":"Short message about the error","meta":"more information about that error"},"properties":{"code":{"description":"The error code that occured in application level.","type":"number"},"message":{"description":"A user readable message that describes the error in details.","type":"string"},"meta":{"description":"Contains more information about the error message. For example when a validation error occurs, this field describes the fields that were invalid and the validation error that occured. The content of this object can vary based on the type of error.\n","type":"object"}},"required":["code","message"],"type":"object","$$ref":"#/definitions/error"}},"401":{"description":"Unauthorized","schema":{"example":"Unauthorized","type":"string"}},"403":{"description":"Forbidden","schema":{"example":"Permission denied to access the resource","type":"string"}},"404":{"description":"Not found","schema":{"example":"Templates not found","type":"string"}}},"summary":"Get existing templates based on certain criteria","tags":["templatesv2"],"__originalOperationId":"getTemplates","security":[{"bearerAuth":[]}],"method":"get","path":"/templates"}}