{"type":"api","title":"Get Mops Jobs with filter","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/b95772dc6c621d9842faced8610ee58b0cb9cb02/c0404d8d-ff8e-36e9-bb59-ee336d247534","info":{"title":"Crosswork Change Automation API","version":"7.1.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"},"description":"A web server dedicated to RESTful queries into the Crosswork Change Automation application."},"x-parser-conf":{"overview":{"markdownPath":"reference/CAHI/change_automation.overview.md"}},"openapi":"3.1.0","servers":[{"url":"https://{server_ip}:30603/crosswork/nca/v1","description":"Generated server url"}]},"spec":{"summary":"Get Mops Jobs with filter","operationId":"NCA_GetMopJobs","tags":["NCA"],"requestBody":{"description":"Argument to get Mop Execution job(s)","required":true,"content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Jobs Read Request","properties":{"limit":{"type":"integer","format":"int64","description":"Denotes the number of mopjobs per page requested by user."},"page":{"type":"integer","format":"int64","title":"The page number of the result. Page number subtracted by 1 and multiplied\nby the limit determines the offset from which records are returned","description":"The page number of the result. Page number subtracted by 1 and multiplied\nby the limit determines the offset from which records are returned"},"mop_id":{"type":"string","description":"Filter results by MoP ID."},"device":{"type":"string","description":"Filter results by device."},"status":{"type":"string","description":"Filter results by status of a job."},"set_id":{"type":"string","description":"Filter results by job set ID."},"name":{"type":"string","description":"Filter results by job set name."},"tags":{"type":"array","items":{"type":"string"},"description":"Filter results by job tags."},"sort_by":{"title":"Sort by one of the available fields","type":"string","description":"Change Automation Mop Jobs Read Request Sort By","enum":["UNKNOWN","created_at","status","exec_end_time","check_start_time","exec_start_time","update_time","created_by","devices"],"default":"UNKNOWN","$$ref":"#/components/schemas/change_automationMopJobsReadReqSortBy"},"order":{"description":"Ordering for the sort. Used when a sort_by is specified.","type":"string","enum":["asc","desc"],"default":"asc","title":"- asc: Sort in ascending order by default\n - desc: Sort in decending order","$$ref":"#/components/schemas/change_automationOrder"}},"$$ref":"#/components/schemas/change_automationMopJobsReadReq"},"example":{"limit":20,"page":1,"mop_id":"mop123","device":"Switch-5","status":"completed","set_id":"set5678","name":"Upgrade Jobs","tags":["network","maintenance"],"sort_by":"status","order":"asc"}}}},"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Jobs Read Response","properties":{"result":{"type":"array","items":{"type":"object","description":"Change Automation Mop Job","properties":{"execution_id":{"type":"string","title":"A unique ID to track the execution of MOP","description":"A unique ID to track the execution"},"mop_id":{"type":"string","title":"ID of the mop to be executed","description":"ID of the mop to be executed"},"check_start_time":{"type":"integer","format":"uint64","description":"Time at which pre-checks should start for the job. Default is now, i.e. as\nsoon as possible."},"exec_start_time":{"type":"integer","format":"uint64","description":"Time at which the actual execution, i.e. maintenance tasks should begin.\nDefault is now, i.e. as soon as possible."},"execution_params":{"type":"string","description":"JSON object specifying the execution parameters for the MoP job."},"execution_policy":{"title":"JSON object specifying the execution policy in key-value format","type":"object","description":"Change Automation Mop Execution Policy","properties":{"execution_strategy":{"title":"Type of execution of playbook","type":"string","enum":["STRATEGY_UNKNOWN","STRATEGY_CONTINUOUS","STRATEGY_SINGLE_STEP","STRATEGY_DRY_RUN"],"default":"STRATEGY_UNKNOWN","description":"Mop Execution Policy Exec Strategy Type","$$ref":"#/components/schemas/MopExecutionPolicyExecStrategyType"},"pause_on_tasks":{"type":"array","description":"ID's of the tasks on which the execution should pause when in single\nstepping mode","items":{"type":"integer","format":"int64"},"title":"ID's of the tasks on which the execution should pause when in single\nstepping mode"},"on_failure":{"title":"Action that the user wishes to take on task failure","type":"string","enum":["ON_FAILURE_UNKNOWN","ON_FAILURE_PAUSE","ON_FAILURE_COMPLETE_ROLLBACK","ON_FAILURE_ABORT"],"default":"ON_FAILURE_UNKNOWN","description":"Mop Execution Policy On Failure Action Type","$$ref":"#/components/schemas/MopExecutionPolicyOnFailureActionType"},"collect_syslog":{"type":"boolean","title":"Denotes whether to collect device syslogs or not","description":"Denotes whether to collect device syslogs or not"},"timeout":{"type":"string","title":"MoP timeout","description":"MoP timeout"}},"$$ref":"#/components/schemas/change_automationMopExecutionPolicy"},"devices":{"type":"array","items":{"type":"string"},"description":"List of devices on which the mop is executed."},"status":{"type":"string","title":"Current Status of the mop execution","description":"Current Status of the mop execution"},"exec_end_time":{"type":"integer","format":"uint64","description":"Denotes the time at which mop execution was completed. This field will be\npopulated only after the execition is complete."},"created_at":{"type":"integer","format":"uint64","title":"Time at which mop got scheduled for execution with infra","description":"Time at which mop got scheduled for execution with infra"},"update_time":{"type":"integer","format":"uint64","title":"Update time is a rolling field which stores the time of the latest update\nto the mopjob instance. If can be a reflection of any of the time fields","description":"Update time is a rolling field which stores the time of the latest update\nto the mopjob instance. If can be a reflection of any of the time fields"},"update_desc":{"type":"string","title":"Update desc contains the description of the rolling update_time field.\nExample, when update_time reflects created_at, update_desc can contain\nsomething like, \"Time at which mopjob was created\"","description":"Update desc contains the description of the rolling update_time field.\nExample, when update_time reflects created_at, update_desc can contain\nsomething like, \"Time at which mopjob was created\""},"created_by":{"type":"string","description":"The user who submitted the request."},"last_updated_task":{"type":"integer","format":"int64","title":"ID of the last task that was executed. If the MOP is in running state, this\nfield will contain the ID of the task that is being executed currently","description":"ID of the last task that was executed. If the MOP is in running state, this\nfield will contain the ID of the task that is being executed currently"},"parsed_pb":{"description":"A detailed task level breakdown of the playbook.","type":"object","properties":{"continuous":{"type":"array","items":{"type":"object","description":"Change Automation Playbook Task","properties":{"idx":{"type":"integer","format":"int64","title":"ID of the task","description":"ID of the task"},"name":{"type":"string","title":"Name of the task","description":"Name of the task"},"verb":{"type":"string","description":"ID of the verb the task invokes."}},"$$ref":"#/components/schemas/change_automationPlaybookTask"},"title":"List of all continuous tasks in the playbook","description":"List of all continuous tasks in the playbook"},"pre_maintenance":{"type":"array","items":{"type":"object","description":"Change Automation Playbook Task","properties":{"idx":{"type":"integer","format":"int64","title":"ID of the task","description":"ID of the task"},"name":{"type":"string","title":"Name of the task","description":"Name of the task"},"verb":{"type":"string","description":"ID of the verb the task invokes."}},"$$ref":"#/components/schemas/change_automationPlaybookTask"},"title":"List of all pre-maintenance tasks in the playbook","description":"List of all pre-maintenance tasks in the playbook"},"maintenance":{"type":"array","items":{"type":"object","description":"Change Automation Playbook Task","properties":{"idx":{"type":"integer","format":"int64","title":"ID of the task","description":"ID of the task"},"name":{"type":"string","title":"Name of the task","description":"Name of the task"},"verb":{"type":"string","description":"ID of the verb the task invokes."}},"$$ref":"#/components/schemas/change_automationPlaybookTask"},"title":"List of all maintenance tasks in the playbook","description":"List of all maintenance tasks in the playbook"},"post_maintenance":{"type":"array","items":{"type":"object","description":"Change Automation Playbook Task","properties":{"idx":{"type":"integer","format":"int64","title":"ID of the task","description":"ID of the task"},"name":{"type":"string","title":"Name of the task","description":"Name of the task"},"verb":{"type":"string","description":"ID of the verb the task invokes."}},"$$ref":"#/components/schemas/change_automationPlaybookTask"},"title":"List of all post-maintenance tasks in the playbook","description":"List of all post-maintenance tasks in the playbook"}},"$$ref":"#/components/schemas/change_automationPlaybookPhases"},"set_id":{"type":"string","description":"An identifier for a job set to which this job belongs."},"mop_name":{"type":"string","title":"Name of the MoP executed","description":"Name of the MoP executed"}},"$$ref":"#/components/schemas/change_automationMopJob"},"title":"List of mopjobs that were retrieved as a result of the query","description":"List of mopjobs that were retrieved as a result of the query"},"count":{"type":"integer","format":"int64","title":"Count of total number of mop jobs returned","description":"Count of total number of mop jobs returned"},"current_count":{"type":"integer","format":"int64","title":"Count of current number of mop jobs returned","description":"Count of current number of mop jobs returned"}},"example":{"result":[{"execution_id":"1687426280907-75acbf9b-044b-44fe-bc5f-7b9cf107b825","mop_id":"router_check_accessibility","check_start_time":1687426641,"exec_start_time":1687426641,"execution_params":"{\"1\":{},\"2\":{}}","execution_policy":{"execution_strategy":"STRATEGY_CONTINUOUS","on_failure":"ON_FAILURE_ABORT","timeout":"3600s"},"devices":["xrv9k-1"],"status":"COMPLETED","exec_end_time":1687426659,"created_at":1687426641,"update_time":1687426659,"update_desc":"MoP job completed","created_by":"admin","parsed_pb":{"maintenance":[{"idx":1,"name":"Check IP connectivity","verb":"op_check_ip_connectivity"},{"idx":2,"name":"Check JsonRpc connectivity to managing NSO","verb":"op_check_nso_connectivity"}]},"mop_name":"Check accessibility to router"}],"count":1,"current_count":1},"$$ref":"#/components/schemas/change_automationMopJobsReadResp"}}}},"400":{"description":"Bad Request. The request is malformed in some way and the server cannot process it.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Error 400","required":["code","severity","message"],"properties":{"code":{"type":"string","description":"HTTP return code","example":"400"},"severity":{"type":"string","description":"Error severity level","enum":["Critical","Warning","Fatal"]},"message":{"type":"string","description":"Error message","example":"top level error string"},"data":{"type":"string","description":"Details of the error","example":"detailed description of the error"}},"example":{"code":"400","severity":"Critical","message":"error message","data":"detailed description of the error"},"$$ref":"#/components/schemas/change_automationError400"}}}},"500":{"description":"Internal Server Error. The server could not fulfill the request.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Error 500","required":["code","severity","message"],"properties":{"code":{"type":"string","description":"HTTP return code","example":"500"},"severity":{"type":"string","description":"Error severity level","enum":["Critical","Warning","Fatal"]},"message":{"type":"string","description":"Error message","example":"top level error string"},"data":{"type":"string","description":"Error detailed description"}},"example":{"code":"500","severity":"Critical","message":"error message","data":"Server Error. detailed description of the error"},"$$ref":"#/components/schemas/change_automationError500"}}}}},"method":"post","path":"/mopjobs/query"}}