{"type":"api","title":"Get Sensor Templates","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/b44e8ba1-6566-34bf-b4f1-d28c15d76254","info":{"title":"Crosswork Collection Service APIs","description":"Crosswork Collector Services APIs manage application intents for collection jobs across multiple devices and different collection types, including SNMP, CLI, TRAP, MDT, GNMI, and SYSLOG.","version":"1.0.0","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"}},"x-parser-conf":{"overview":{"markdownPath":"reference/INFRA/COLLECTIONS/collection-service-overview.md"}},"swagger":"2.0","basePath":"/crosswork/collection/v1","schemes":["https","http"],"securityDefinitions":{"bearerAuth":{"type":"apiKey","description":"bearer auth","name":"Authorization","in":"header"}}},"spec":{"summary":"Get Sensor Templates","operationId":"CollectionService_GetTemplate","responses":{"200":{"description":"OK. The request was successful. The result is contained in the response body","schema":{"type":"object","properties":{"sensor_templates":{"type":"array","items":{"type":"object","properties":{"sensor_template_id":{"type":"string","title":"Unique handle to identify a sensor template"},"collection_type":{"title":"Style of collection. At this time only app-managed lifetimetype is supported for templatized jobs","type":"string","enum":["UNKNOWN_COLLECTOR","MDT_COLLECTOR","SNMP_COLLECTOR","CLI_COLLECTOR","TRAP_COLLECTOR","GNMI_COLLECTOR","SYSLOG_COLLECTOR"],"default":"UNKNOWN_COLLECTOR","$$ref":"#/definitions/common_collection_dataCollectionType"},"sensor_template_Definition":{"title":"Specify the sensor template information e.g. path and parameters","type":"object","properties":{"cli_sensor_template":{"type":"object","properties":{"template_command":{"title":"Example show interface\nshow interface .{{interface_name}}\nshow interface | utility egrep expr .{{interface_name}}","type":"object","properties":{"templatecommand":{"type":"string"},"template_variables":{"type":"array","items":{"type":"string"}}},"$$ref":"#/definitions/common_collection_dataTemplateCommand"},"template_device_package":{"title":"Total size is limited to 512 characters","type":"object","properties":{"device_package_name":{"type":"string","title":"XDE device package name"},"function_name":{"type":"string","title":"XDE function name within package"},"template_params":{"type":"array","items":{"type":"string"},"title":"Template params in Device package\nAll params of device package function are mandatory templatized params"}},"$$ref":"#/definitions/common_collection_dataTemplateDevicePackage"}},"title":"Use with Cli Sensor\nThe message accepts templatized CLI command or a templatized device package with parameters specified wihin curly brackets(see ex below)\nThe message also accepts a list of valid parameter keys to be accepted","$$ref":"#/definitions/common_collection_dataCliSensorTemplate"},"gnmi_sensor_template":{"type":"object","properties":{"gnmi_path":{"type":"string","title":"String encoded GNMI path with template variables specified\nExample: \"Cisco-IOS-XR-l2vpn-oper:l2vpnv2/active/xconnects/xconnect[xconnect-name=.{{xconnect}}]/.{{segment}}/pseudo-wire/state\""},"template_variables":{"type":"array","items":{"type":"string"},"title":"List of paramaters applicable to the sensor specified in go template format : \"{{ .FieldName }}\"\nIf vraibles can be directly be inferred from the path then not needed"}},"title":"Reference: gNMI Specification Section 3.5.1.3\nThis is used when large number of leaf level collections need to be done\nThe message accepts a string encoded GNMI path with parameters specified wihin curly brackets (see ex below)\nThe message also accepts a list of valid parameter keys to be accepted","$$ref":"#/definitions/common_collection_dataGnmiSensorTemplate"}},"$$ref":"#/definitions/common_collection_dataSensorTemplateDefinition"},"cadence_in_millisec":{"type":"string","format":"uint64","title":"Specify the cadence at which path is to be collected"}},"title":"SensorTemplate contains details of templated sensor per collect type","$$ref":"#/definitions/common_collection_dataSensorTemplate"},"title":"Returns the template objects matching the template_id you specify"},"result":{"type":"object","properties":{"request_result":{"description":"The result values indicates whether the request was accepted or rejected, not the outcome of the work itself.","type":"string","enum":["UNKNOWN_RESULT","REJECTED","ACCEPTED"],"default":"UNKNOWN_RESULT","$$ref":"#/definitions/collection_serviceRequestResult"},"error":{"description":"A text message describing the reason for rejection. It can be safely passed on to the operator through logs or the UI.","type":"object","properties":{"error":{"type":"string","description":"Message is a textual description of the reason for rejection. You can safely pass it on to the operator through logs or the UI."}},"title":"Error associated with an object","$$ref":"#/definitions/collection_serviceError"}},"description":"Result is used to convey whether an operation (individual or in a batch) has been accepted or rejected.\nFor sync APIs, an error or rejection indicates failure of the operation.\nA string error message accompanies rejection to support troubleshooting.\nFor notification objects, rejection represents failure to do intended operation.","$$ref":"#/definitions/collection_serviceResult","title":"Sync Request reply, indicating whether the request was accepted or rejected"},"query_options":{"type":"object","properties":{"page_token":{"type":"string","title":"Page token used to echo back to get the next page. If collection_job_device_sets is empty or the page token are empty, there are no more results"},"page_size":{"type":"integer","format":"int64","title":"page_size"},"filter_list":{"type":"array","items":{"type":"object","properties":{"operator":{"description":"The filter logical or conditional operator (such as AND, OR, \u003e, \u003c).","type":"string","enum":["UNKNOWN_OPERATOR","OPERATOR_OR","OPERATOR_AND","OPERATOR_EQ","OPERATOR_REGEX","OPERATOR_CONTAINS"],"default":"UNKNOWN_OPERATOR","$$ref":"#/definitions/collection_serviceFilterOperator"},"field_list":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The name of the field to filter on. Only CollectionState String is supported."},"value":{"type":"string","description":"The field value to filter on. For non-strings, the backend will convert it to honor actual DB type."}},"$$ref":"#/definitions/collection_serviceFilterField"},"title":"The list of filter criteria"}},"title":"Filter","$$ref":"#/definitions/collection_serviceFilter"},"title":"filtering options"},"filter_query":{"type":"string","description":"Reserved for future use."}},"title":"Query Options","$$ref":"#/definitions/collection_serviceQueryOptions"}},"example":{"sensor_templates":[{"sensor_template_id":"template-test-version-template","collection_type":"CLI_COLLECTOR","sensor_template_Definition":{"cli_sensor_template":{"template_command":{"templatecommand":"show interfaces","template_variables":["command"]}}},"cadence_in_millisec":"10000"}],"result":{"request_result":"ACCEPTED","error":{"error":""}},"query_options":null},"$$ref":"#/definitions/collection_serviceGetTemplateResponse"}},"default":{"description":"An unexpected error response.","schema":{"type":"object","properties":{"sensor_templates":{"type":"array","items":{"type":"object","properties":{"sensor_template_id":{"type":"string","title":"Unique handle to identify a sensor template"},"collection_type":{"title":"Style of collection. At this time only app-managed lifetimetype is supported for templatized jobs","type":"string","enum":["UNKNOWN_COLLECTOR","MDT_COLLECTOR","SNMP_COLLECTOR","CLI_COLLECTOR","TRAP_COLLECTOR","GNMI_COLLECTOR","SYSLOG_COLLECTOR"],"default":"UNKNOWN_COLLECTOR","$$ref":"#/definitions/common_collection_dataCollectionType"},"sensor_template_Definition":{"title":"Specify the sensor template information e.g. path and parameters","type":"object","properties":{"cli_sensor_template":{"type":"object","properties":{"template_command":{"title":"Example show interface\nshow interface .{{interface_name}}\nshow interface | utility egrep expr .{{interface_name}}","type":"object","properties":{"templatecommand":{"type":"string"},"template_variables":{"type":"array","items":{"type":"string"}}},"$$ref":"#/definitions/common_collection_dataTemplateCommand"},"template_device_package":{"title":"Total size is limited to 512 characters","type":"object","properties":{"device_package_name":{"type":"string","title":"XDE device package name"},"function_name":{"type":"string","title":"XDE function name within package"},"template_params":{"type":"array","items":{"type":"string"},"title":"Template params in Device package\nAll params of device package function are mandatory templatized params"}},"$$ref":"#/definitions/common_collection_dataTemplateDevicePackage"}},"title":"Use with Cli Sensor\nThe message accepts templatized CLI command or a templatized device package with parameters specified wihin curly brackets(see ex below)\nThe message also accepts a list of valid parameter keys to be accepted","$$ref":"#/definitions/common_collection_dataCliSensorTemplate"},"gnmi_sensor_template":{"type":"object","properties":{"gnmi_path":{"type":"string","title":"String encoded GNMI path with template variables specified\nExample: \"Cisco-IOS-XR-l2vpn-oper:l2vpnv2/active/xconnects/xconnect[xconnect-name=.{{xconnect}}]/.{{segment}}/pseudo-wire/state\""},"template_variables":{"type":"array","items":{"type":"string"},"title":"List of paramaters applicable to the sensor specified in go template format : \"{{ .FieldName }}\"\nIf vraibles can be directly be inferred from the path then not needed"}},"title":"Reference: gNMI Specification Section 3.5.1.3\nThis is used when large number of leaf level collections need to be done\nThe message accepts a string encoded GNMI path with parameters specified wihin curly brackets (see ex below)\nThe message also accepts a list of valid parameter keys to be accepted","$$ref":"#/definitions/common_collection_dataGnmiSensorTemplate"}},"$$ref":"#/definitions/common_collection_dataSensorTemplateDefinition"},"cadence_in_millisec":{"type":"string","format":"uint64","title":"Specify the cadence at which path is to be collected"}},"title":"SensorTemplate contains details of templated sensor per collect type","$$ref":"#/definitions/common_collection_dataSensorTemplate"},"title":"Returns the template objects matching the template_id you specify"},"result":{"type":"object","properties":{"request_result":{"description":"The result values indicates whether the request was accepted or rejected, not the outcome of the work itself.","type":"string","enum":["UNKNOWN_RESULT","REJECTED","ACCEPTED"],"default":"UNKNOWN_RESULT","$$ref":"#/definitions/collection_serviceRequestResult"},"error":{"description":"A text message describing the reason for rejection. It can be safely passed on to the operator through logs or the UI.","type":"object","properties":{"error":{"type":"string","description":"Message is a textual description of the reason for rejection. You can safely pass it on to the operator through logs or the UI."}},"title":"Error associated with an object","$$ref":"#/definitions/collection_serviceError"}},"description":"Result is used to convey whether an operation (individual or in a batch) has been accepted or rejected.\nFor sync APIs, an error or rejection indicates failure of the operation.\nA string error message accompanies rejection to support troubleshooting.\nFor notification objects, rejection represents failure to do intended operation.","$$ref":"#/definitions/collection_serviceResult","title":"Sync Request reply, indicating whether the request was accepted or rejected"},"query_options":{"type":"object","properties":{"page_token":{"type":"string","title":"Page token used to echo back to get the next page. If collection_job_device_sets is empty or the page token are empty, there are no more results"},"page_size":{"type":"integer","format":"int64","title":"page_size"},"filter_list":{"type":"array","items":{"type":"object","properties":{"operator":{"description":"The filter logical or conditional operator (such as AND, OR, \u003e, \u003c).","type":"string","enum":["UNKNOWN_OPERATOR","OPERATOR_OR","OPERATOR_AND","OPERATOR_EQ","OPERATOR_REGEX","OPERATOR_CONTAINS"],"default":"UNKNOWN_OPERATOR","$$ref":"#/definitions/collection_serviceFilterOperator"},"field_list":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The name of the field to filter on. Only CollectionState String is supported."},"value":{"type":"string","description":"The field value to filter on. For non-strings, the backend will convert it to honor actual DB type."}},"$$ref":"#/definitions/collection_serviceFilterField"},"title":"The list of filter criteria"}},"title":"Filter","$$ref":"#/definitions/collection_serviceFilter"},"title":"filtering options"},"filter_query":{"type":"string","description":"Reserved for future use."}},"title":"Query Options","$$ref":"#/definitions/collection_serviceQueryOptions"}},"example":{"sensor_templates":[],"result":{"request_result":"REJECTED","error":{"error":"Template for the given TemplateId does not exist"}},"query_options":null},"$$ref":"#/definitions/gettemplateErrorResponse"}}},"parameters":[{"name":"body","in":"body","description":"Get Template Job.","required":true,"schema":{"type":"object","properties":{"template_id":{"type":"string","description":"Specify the template_id to be queried. \nIf you use a wildcard pattern, any template_id that contains the pattern is a match.\nThe template_id is required; if not specified, nothing is returned."},"query_options":{"type":"object","properties":{"page_token":{"type":"string","title":"Page token used to echo back to get the next page. If collection_job_device_sets is empty or the page token are empty, there are no more results"},"page_size":{"type":"integer","format":"int64","title":"page_size"},"filter_list":{"type":"array","items":{"type":"object","properties":{"operator":{"description":"The filter logical or conditional operator (such as AND, OR, \u003e, \u003c).","type":"string","enum":["UNKNOWN_OPERATOR","OPERATOR_OR","OPERATOR_AND","OPERATOR_EQ","OPERATOR_REGEX","OPERATOR_CONTAINS"],"default":"UNKNOWN_OPERATOR","$$ref":"#/definitions/collection_serviceFilterOperator"},"field_list":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The name of the field to filter on. Only CollectionState String is supported."},"value":{"type":"string","description":"The field value to filter on. For non-strings, the backend will convert it to honor actual DB type."}},"$$ref":"#/definitions/collection_serviceFilterField"},"title":"The list of filter criteria"}},"title":"Filter","$$ref":"#/definitions/collection_serviceFilter"},"title":"filtering options"},"filter_query":{"type":"string","description":"Reserved for future use."}},"title":"Query Options","$$ref":"#/definitions/collection_serviceQueryOptions"}},"example":{"template_id":"template-test-version-template","query_options":{"page_token":"0","page_size":100,"filter_list":[],"filter_query":""}},"$$ref":"#/definitions/collection_serviceGetTemplateRequest"}}],"tags":["CollectionService"],"__originalOperationId":"CollectionService_GetTemplate","consumes":["application/json"],"produces":["application/json"],"method":"post","path":"/template"}}