{"type":"api","title":"Create Template","meta":{"id":"/apps/pubhub/media/edm-api-v2/a2a30bcc9ecab5281b65761ae61df7e0031d5691/f67a4e01-0023-334a-9a4a-7e606c2ef1a2","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/v1","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 Devices\u003cbr /\u003e- Troubleshoot Devices","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"},{"in":"body","name":"body","required":true,"schema":{"properties":{"cliType":{"enum":["IOS","IGMA","IDA","IOS_IGMA"],"type":"string"},"commandType":{"enum":["EXEC","CONFIG","REBOOT","REFRESH_METRICS","ASYNC","FACTORY_RESET"],"type":"string"},"description":{"type":"string"},"deviceType":{"type":"string"},"name":{"type":"string"},"templateCategory":{"enum":["DEVICE","ETHERNET","WIFI","CELLULAR","SECURITY","CISCO_TAC","SEA"],"type":"string"},"templateValue":{"type":"string"}},"required":["name","description","deviceType","templateValue","templateCategory","commandType","cliType"],"type":"object","$$ref":"#/definitions/CreateTroubleshootTemplateRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"successful retrieval","schema":{"properties":{"commandType":{"enum":["EXEC","CONFIG","REBOOT","REFRESH_METRICS","MACFILTER","ASYNC","FACTORY_RESET"],"example":"CONFIG","type":"string"},"commandTypeStr":{"example":"config","type":"string"},"description":{"example":"GigabitEthernet 0/0","type":"string"},"id":{"example":10050,"format":"int64","type":"integer"},"isDefault":{"example":true,"type":"boolean"},"lastUpdated":{"example":"2022-05-20T09:13:00.000Z","type":"string"},"name":{"example":"GigEthernet0Toggle","type":"string"},"revision":{"example":0,"type":"integer"},"templateCategory":{"enum":["DEVICE","ETHERNET","WIFI","CELLULAR","SECURITY","MACFILTER","CISCO_TAC","SEA","SERIAL"],"example":"ETHERNET","type":"string"},"templateCategoryStr":{"example":"Ethernet","type":"string"},"templateValid":{"example":true,"type":"boolean"},"templateValidationMessage":{"example":null,"type":"string"},"templateValue":{"example":"[\n {\n \"name\": \"Interface\",\n \"value\": {\n \"GigabitEthernet\": [\n.....","type":"string"},"templateVariables":{"items":{"properties":{"cardinality":{"example":null,"type":"integer"},"default":{"description":"Default Value for the variable","example":"30 minutes","type":"object"},"displayCondition":{"description":"Condition based on which this field should be displayed","example":null,"type":"string"},"errorMessage":{"description":"populate error message if there is any back end exception","example":null,"type":"string"},"hiddenCondition":{"example":null,"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":{"example":null,"items":{"properties":{"border":{"example":null,"type":"boolean"},"closeButton":{"example":null,"type":"boolean"},"filled":{"example":false,"type":"boolean"},"flavor":{"example":null,"type":"string"},"iconType":{"example":"information","type":"string"},"placement":{"example":"right","type":"string"},"text":{"example":"Configure cellular settings to establish connectivity to service provider network","type":"string"},"type":{"example":"tooltip","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":{"example":604800,"type":"integer"},"minLength":{"example":300,"type":"integer"},"readOnly":{"type":"boolean"},"required":{"type":"boolean"},"secure":{"type":"boolean"},"seedValues":{"items":{"properties":{"key":{"example":"Minutes","type":"string"},"value":{"example":"minutes","type":"string"}},"type":"object","$$ref":"#/definitions/TemplateVariablesSeedValues"},"type":"array"},"tableColumns":{"example":null,"items":{"$ref":"#/definitions/TemplateVariablesItem"},"type":"array"},"title":{"example":"Mark device OFFLINE after (5 minutes to 7 days)","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","example":"7 days","type":"object"}},"type":"object","$$ref":"#/definitions/TemplateVariablesItem"},"type":"array"}},"type":"object","$$ref":"#/definitions/TroubleshootTemplateVo"}},"400":{"description":"Bad request","schema":{"description":"Specifies the error that occurred 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 occurred 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 occurred. 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":["troubleshoot"],"__originalOperationId":"createTemplate","security":[{"bearerAuth":[]}],"method":"post","path":"/troubleshoot/templates"}}