{"type":"api","title":"Get MoP execution job set(s)","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-1/f445c17e25a1120e8fbde4bd413083d0fd88b2b3/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 MoP execution job set(s)","operationId":"NCA_GetMopJobSets","tags":["NCA"],"requestBody":{"description":"Argument to get Specific Mop Execution details","required":true,"content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Job Sets Read Request","properties":{"limit":{"type":"integer","format":"int64","description":"Denotes the number of job sets per page requested by user."},"page":{"type":"integer","format":"int64","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."},"set_id":{"type":"string","description":"Filter results by job set ID."},"mop_id":{"type":"string","description":"Filter results by MoP ID."},"status":{"type":"string","description":"Filter results by status of job set."},"device_group":{"type":"string","description":"Filter results by device group on which the job set was run."},"name":{"type":"string","description":"Filter results by user provided job set name."},"label":{"type":"string","description":"Filter results by user provided job set label."},"created_by":{"type":"string","description":"Filter results by the user who created the job set."},"tags":{"type":"array","items":{"type":"string"},"description":"Filter results by job tags."},"sort_by":{"title":"Sort by one of the available fields","type":"string","enum":["UNKNOWN","last_updated_at","label","name","mop_id","status","created_by","created_at"],"default":"UNKNOWN","description":" - UNKNOWN: Default sort. Results will be sorted on created at with running and\nscheduled states at top\n - last_updated_at: Sort by last updated at time.\n - label: Sort by label.\n - name: Sort by name.\n - mop_id: Sort by mopId.\n - status: Sort by job status.\n - created_by: Sort by user who created the job.\n - created_at: Sort by created at time.","$$ref":"#/components/schemas/change_automationMopJobSetsReadReqSortBy"},"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"},"start_time":{"title":"Filter results by a range of start times for the sets","type":"object","description":"Time Range Struct","properties":{"from":{"type":"string","format":"uint64","description":"Starting time stamp for the filter."},"till":{"type":"string","format":"uint64","title":"End time stamp for the filter. This should be greater than time_from","description":"End time stamp for the filter. This should be greater than time_from"}},"$$ref":"#/components/schemas/MopJobSetsReadReqTimeRange"},"mop_name":{"type":"string","title":"Filter by Mop Name","description":"Filter by MopName"}},"$$ref":"#/components/schemas/change_automationMopJobSetsReadReq"},"example":{"limit":10,"page":1,"set_id":"set1234","mop_id":"mop5678","status":"in_progress","device_group":"GroupA","name":"Deployment Set","label":"HighPriority","created_by":"admin_user","tags":["urgent","night_shift"],"sort_by":"name","order":"desc","start_time":{"start":"123456","end":"123456"},"mop_name":"System Upgrade"}}}},"responses":{"200":{"description":"A successful response.","content":{"application/json":{"schema":{"type":"object","description":"Change Automation Mop Job Sets Read Response","properties":{"sets":{"type":"array","items":{"type":"object","properties":{"set_id":{"type":"string","description":"A unique ID to identify a set of MoP job(s)."},"status":{"type":"string","description":"Status of the job set."},"created_at":{"type":"integer","format":"uint64","title":"Time at which this job set was created","description":"Time at which this job set was created"},"last_updated_at":{"type":"integer","format":"uint64","description":"Time at which there was an update to the job set, w.r.t jobs in this set."},"last_update":{"type":"string","description":"Last update description for this job set."},"name":{"type":"string","description":"Name for the job set."},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for the job set."},"label":{"type":"string","description":"Label for the job set, derived from the user provided name."},"mop_id":{"type":"string","description":"A unique identifier for a playbook which is the name of the playbook file\nwithout the extension."},"execution_params":{"type":"string","description":"JSON object specifying the execution parameters for the MoP job."},"execution_policy":{"title":"JSON formatted string of playbook execution policy","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"},"created_by":{"type":"string","title":"User who started the job set","description":"User who started the job set"},"start_time":{"type":"integer","format":"uint64","title":"Start time for the job set","description":"Start time for the job set"},"device_group":{"type":"string","description":"Device group name (DLM tag) selected for the job set, if any."},"devices":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"description":"List of device hostnames."}},"description":"List of devices on which the job will be executed.\nIf multiple devices are provided for a playbook targeting one device at a\ntime, one job will be executed in parallel for each device in list. If\nmultiple devices are provided for a playbook targeting multiple devices, one\njob will be executed. Either device group or devices must be specified.","$$ref":"#/components/schemas/change_automationDevicesIds"},"mop_name":{"type":"string","title":"Name of the playbook that was used for this set","description":"Name of the playbook that was used for this set"},"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"}},"description":"MopJobSet represents an aggregate of related MoP jobs with common inputs,\ntarget devices and schedule. Jobs could be related by a device group.","$$ref":"#/components/schemas/change_automationMopJobSet"},"description":"List of MoP job sets."},"count":{"type":"integer","format":"int64","title":"Count of total number of mop job sets returned","description":"Count of total number of mop job sets returned"},"current_count":{"type":"integer","format":"int64","title":"Count of current number of mop job sets returned","description":"Count of current number of mop job sets returned"}},"example":{"sets":[{"set_id":"5c38ecf9-c32d-4a97-bebd-08f50571ef3a","status":"SUCCEEDED","created_at":1687426280,"last_updated_at":1687426293,"last_update":"1/1 MoP jobs completed","label":"test-f50571ef3a","mop_id":"router_check_accessibility","execution_params":"{\"1\":{},\"2\":{}}","execution_policy":{"execution_strategy":"STRATEGY_CONTINUOUS","on_failure":"ON_FAILURE_ABORT","timeout":"3600s"},"created_by":"admin","start_time":1687426280,"devices":{"ids":["xrv9k-1"]},"mop_name":"Check accessibility to router","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"}]}}],"count":1,"current_count":1},"$$ref":"#/components/schemas/change_automationMopJobSetsReadResp"}}}},"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/sets/query"}}