{"type":"api","title":"Create Template","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":{"consumes":["application/json"],"description":"Returns the newly created templates in the system.\u003cbr /\u003e One of the below permissions is needed to invoke this API\u003cbr /\u003e- Tenant Management\u003cbr /\u003e- Manage Groups\u003cbr /\u003e- Manage Templates.","operationId":"createTemplate","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":"set preview filter to get validated template","in":"query","name":"preview","required":false,"type":"boolean"},{"in":"body","name":"body","required":true,"schema":{"properties":{"description":{"example":"","type":"string"},"deviceType":{"example":"ir800","type":"string"},"name":{"example":"test1","type":"string"},"templateCli":{"items":{"properties":{"templateType":{"description":"Template Type","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"},"templateValue":{"description":"Template Value(CLI or Fremmarker template)","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"}},"required":["templateType","templateValue"],"type":"object","$$ref":"#/definitions/CreateCliTemplateItem"},"type":"array"},"templateForm":{"items":{"properties":{"referenceTemplateUuid":{"description":"uuid of the reference template used for variable template","type":"string"},"templateVariables":{"items":{"properties":{"key":{"type":"string"},"templateType":{"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"},"value":{"type":"string"}},"type":"object","$$ref":"#/definitions/TemplateVariablesData"},"type":"array"}},"required":["referenceTemplateUuid","templateVariables"],"type":"object","$$ref":"#/definitions/CreateVariableTemplateItem"},"type":"array"}},"required":["name","description","deviceType"],"type":"object","$$ref":"#/definitions/CreateTemplateRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"successful retrieval","schema":{"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"}},"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":"Authentication Token is invalid","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":"Create a new base template in the system","tags":["templatesv2"],"__originalOperationId":"createTemplate","security":[{"bearerAuth":[]}],"method":"post","path":"/templates"}}