{"type":"api","title":"Get Template Collection Job State","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 Template Collection Job State","description":"GetTemplateCollectionJobState returns the overall state of the template collection job.\nThe lifecycle state for template jobs only considers the control state and not the data plane statuses, as these are available only on an on-demand basis.","operationId":"CollectionService_GetTemplateCollectionJobState","responses":{"200":{"description":"OK. The request was successful. The result is contained in the response body","schema":{"type":"object","properties":{"collection_life_cycle_states":{"type":"array","items":{"type":"object","properties":{"life_cycle_state":{"description":"The actual collection job lifetime cycle state.","type":"string","enum":["UNKNOWN_LIFE_CYCLE_STATE","SCHEDULED_LIFE_CYCLE_STATE","CREATING_LIFE_CYCLE_STATE","SUCCESS_LIFE_CYCLE_STATE","DEGRADED_LIFE_CYCLE_STATE","DELETING_LIFE_CYCLE_STATE","DELETE_FAILED_LIFE_CYCLE_STATE","NO_DATA_LIFE_CYCLE_STATE"],"default":"UNKNOWN_LIFE_CYCLE_STATE","$$ref":"#/definitions/collection_serviceLifeCycleState"},"application_context":{"description":"The application_context is a handle that uniquely identifies your application's collection job. It serves as the key to the object on which CRUD operations are performed.\nThe combination of application_id and context_id should be unique globally.","type":"object","properties":{"application_id":{"type":"string","description":"The application_id is a unique ID that identifies your application. Crosswork applications always prefix the application_id with “cw“."},"context_id":{"type":"string","description":"The context_id is a unique ID that identifies your application subscription across all collection jobs. We recommend that you use the device UUID for the context_id."}},"$$ref":"#/definitions/collection_serviceApplicationContext"},"creation_time":{"type":"string","format":"uint64","title":"The time when the request was created. Specified as UTC epoch time, in milliseconds"},"state_evaluation_time":{"type":"string","format":"uint64","title":"The last job lifecycle state evaluation time"}},"description":"CollectionState aggregates an ApplicationContext to a state.","$$ref":"#/definitions/collection_serviceCollectionLifeCycleState"},"description":"Unique identifier for requested states associated to a collection job."},"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","description":"Pagination and other query options."},"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"}},"example":{"collection_life_cycle_states":[{"life_cycle_state":"SUCCESS_LIFE_CYCLE_STATE","application_context":{"application_id":"proto_template_test_app","context_id":"proto_template_test_context"},"creation_time":"1739196040440","state_evaluation_time":"1739199296887"}],"query_options":{"page_token":"3b4397871516f2a22ffd508a3500c436b7639004","page_size":100,"filter_list":[],"filter_query":""},"result":{"request_result":"ACCEPTED","error":{"error":""}}},"$$ref":"#/definitions/collection_serviceGetTemplateCollectionJobLifeCycleStateResponse"}},"default":{"description":"An unexpected error response.","schema":{"type":"object","properties":{"collection_life_cycle_states":{"type":"array","items":{"type":"object","properties":{"life_cycle_state":{"description":"The actual collection job lifetime cycle state.","type":"string","enum":["UNKNOWN_LIFE_CYCLE_STATE","SCHEDULED_LIFE_CYCLE_STATE","CREATING_LIFE_CYCLE_STATE","SUCCESS_LIFE_CYCLE_STATE","DEGRADED_LIFE_CYCLE_STATE","DELETING_LIFE_CYCLE_STATE","DELETE_FAILED_LIFE_CYCLE_STATE","NO_DATA_LIFE_CYCLE_STATE"],"default":"UNKNOWN_LIFE_CYCLE_STATE","$$ref":"#/definitions/collection_serviceLifeCycleState"},"application_context":{"description":"The application_context is a handle that uniquely identifies your application's collection job. It serves as the key to the object on which CRUD operations are performed.\nThe combination of application_id and context_id should be unique globally.","type":"object","properties":{"application_id":{"type":"string","description":"The application_id is a unique ID that identifies your application. Crosswork applications always prefix the application_id with “cw“."},"context_id":{"type":"string","description":"The context_id is a unique ID that identifies your application subscription across all collection jobs. We recommend that you use the device UUID for the context_id."}},"$$ref":"#/definitions/collection_serviceApplicationContext"},"creation_time":{"type":"string","format":"uint64","title":"The time when the request was created. Specified as UTC epoch time, in milliseconds"},"state_evaluation_time":{"type":"string","format":"uint64","title":"The last job lifecycle state evaluation time"}},"description":"CollectionState aggregates an ApplicationContext to a state.","$$ref":"#/definitions/collection_serviceCollectionLifeCycleState"},"description":"Unique identifier for requested states associated to a collection job."},"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","description":"Pagination and other query options."},"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"}},"example":{"collection_life_cycle_states":[],"query_options":null,"result":{"request_result":"REJECTED","error":{"error":"empty request"}}},"$$ref":"#/definitions/templatecollectionjobstatequeryErrorResponse"}}},"parameters":[{"name":"body","in":"body","description":"Get Template Collection Job State.","required":true,"schema":{"type":"object","properties":{"application_context":{"description":"The application_context is a handle that uniquely identifies your application's collection job. It serves as the key to the object on which CRUD operations are performed.\nThe combination of application_id and context_id should be unique globally.","type":"object","properties":{"application_id":{"type":"string","description":"The application_id is a unique ID that identifies your application. Crosswork applications always prefix the application_id with “cw“."},"context_id":{"type":"string","description":"The context_id is a unique ID that identifies your application subscription across all collection jobs. We recommend that you use the device UUID for the context_id."}},"$$ref":"#/definitions/collection_serviceApplicationContext"},"v_cdg_id":{"type":"string","description":"Virtual ID of the Crosswork Data Gateway (CDG)."},"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","description":"Pagination and other query options."}},"example":{"application_context":{"application_id":"proto_template_test_app","context_id":"proto_template_test_context"},"v_cdg_id":"virtual-cdg-id-12345","query_options":{"page_token":"","page_size":500,"filter_list":[],"filter_query":""}},"description":"GetTemplateCollectionJobLifeCycleStateRequest encapsulates requests for the lifetime cycle state of associated template collection jobs.","$$ref":"#/definitions/collection_serviceGetTemplateCollectionJobLifeCycleStateRequest"}}],"tags":["CollectionService"],"__originalOperationId":"CollectionService_GetTemplateCollectionJobState","consumes":["application/json"],"produces":["application/json"],"method":"post","path":"/templatecollectionjob/state/query"}}