openapi: 3.2.0 info: title: AWX Ad Hoc Commands API version: v2 description: AWX API Documentation contact: email: ansible-community@redhat.com license: name: Apache License tags: - name: ad_hoc_commands paths: /api/v2/ad_hoc_commands/: get: operationId: ad_hoc_commands_list parameters: - in: query name: order schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - in: query name: order_by schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: query name: role_level schema: type: string description: Filter by role level for RBAC - name: search required: false in: query description: A search term. schema: type: string - in: query name: type schema: type: string description: Filter by object type. Supports comma-separated values for multiple types. tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedAdHocCommandListList' description: '' x-ai-description: Returns a paginated list of all ad hoc command runs. Ad hoc commands execute a single Ansible module without a playbook. summary: Ad hoc commands list x-summary-source: derived post: operationId: ad_hoc_commands_create tags: - ad_hoc_commands requestBody: content: application/json: schema: $ref: '#/components/schemas/AdHocCommandListRequest' responses: '201': content: application/json: schema: $ref: '#/components/schemas/AdHocCommandList' description: '' x-ai-description: Run an ad hoc command. Executes a single Ansible module on specified hosts without a playbook. summary: Ad hoc commands create x-summary-source: derived /api/v2/ad_hoc_commands/{id}/: get: operationId: ad_hoc_commands_retrieve description: Special handling when deleting a running unified job object. parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/AdHocCommandDetail' description: '' x-ai-description: Retrieve an ad hoc command summary: Ad hoc commands retrieve x-summary-source: derived delete: operationId: ad_hoc_commands_destroy description: Special handling when deleting a running unified job object. parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '204': description: No response body x-ai-description: Delete an ad hoc command summary: Ad hoc commands destroy x-summary-source: derived /api/v2/ad_hoc_commands/{id}/activity_stream/: get: operationId: ad_hoc_commands_activity_stream_list parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true - in: query name: order schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - in: query name: order_by schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: query name: role_level schema: type: string description: Filter by role level for RBAC - name: search required: false in: query description: A search term. schema: type: string - in: query name: type schema: type: string description: Filter by object type. Supports comma-separated values for multiple types. tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedActivityStreamList' description: '' x-ai-description: List activity stream of an ad hoc command summary: Ad hoc commands activity stream list x-summary-source: derived /api/v2/ad_hoc_commands/{id}/cancel/: get: operationId: ad_hoc_commands_cancel_retrieve parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/AdHocCommandCancel' description: '' x-ai-description: Cancel an ad hoc command summary: Ad hoc commands cancel retrieve x-summary-source: derived post: operationId: ad_hoc_commands_cancel_create parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/AdHocCommandCancel' description: '' x-ai-description: Cancel an ad hoc command summary: Ad hoc commands cancel create x-summary-source: derived /api/v2/ad_hoc_commands/{id}/events/: get: operationId: ad_hoc_commands_events_list parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true - in: query name: order schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - in: query name: order_by schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: query name: role_level schema: type: string description: Filter by role level for RBAC - name: search required: false in: query description: A search term. schema: type: string - in: query name: type schema: type: string description: Filter by object type. Supports comma-separated values for multiple types. tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedAdHocCommandEventList' description: '' x-ai-description: List events of an ad hoc command summary: Ad hoc commands events list x-summary-source: derived /api/v2/ad_hoc_commands/{id}/notifications/: get: operationId: ad_hoc_commands_notifications_list parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true - in: query name: order schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - in: query name: order_by schema: type: string description: Order results by field name. Prefix with '-' for descending order. Supports comma-separated values for multiple fields. - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - in: query name: role_level schema: type: string description: Filter by role level for RBAC - name: search required: false in: query description: A search term. schema: type: string - in: query name: type schema: type: string description: Filter by object type. Supports comma-separated values for multiple types. tags: - ad_hoc_commands responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedNotificationList' description: '' x-ai-description: List notifications of an ad hoc command summary: Ad hoc commands notifications list x-summary-source: derived /api/v2/ad_hoc_commands/{id}/relaunch/: get: operationId: ad_hoc_commands_relaunch_retrieve parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': description: No response body x-ai-description: Return passwords needed to start an ad hoc command summary: Ad hoc commands relaunch retrieve x-summary-source: derived post: operationId: ad_hoc_commands_relaunch_create parameters: - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': description: No response body x-ai-description: Relaunch an ad hoc command summary: Ad hoc commands relaunch create x-summary-source: derived /api/v2/ad_hoc_commands/{id}/stdout/: get: operationId: ad_hoc_commands_stdout_retrieve parameters: - in: query name: format schema: type: string enum: - ansi - ansi_download - html - json - txt - txt_download - in: path name: id schema: type: string pattern: ^[0-9]+$ required: true tags: - ad_hoc_commands responses: '200': content: text/html: schema: $ref: '#/components/schemas/UnifiedJobStdout' text/plain: schema: $ref: '#/components/schemas/UnifiedJobStdout' application/json: schema: $ref: '#/components/schemas/UnifiedJobStdout' description: '' x-ai-description: Retrieve a stdout output of an ad hoc command summary: Ad hoc commands stdout retrieve x-summary-source: derived components: schemas: PaginatedNotificationList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/Notification' PaginatedActivityStreamList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/ActivityStream' ActivityStream: type: object properties: id: type: integer readOnly: true type: type: string readOnly: true url: type: string readOnly: true related: type: string readOnly: true summary_fields: type: string readOnly: true timestamp: type: string format: date-time readOnly: true operation: enum: - create - update - delete - associate - disassociate - null type: - string - 'null' x-spec-enum-id: d1cf1307b8aa394e description: 'The action taken with respect to the given object(s). * `create` - Entity Created * `update` - Entity Updated * `delete` - Entity Deleted * `associate` - Entity Associated with another Entity * `disassociate` - Entity was Disassociated with another Entity' changes: type: string readOnly: true description: A summary of the new and changed values when an object is created, updated, or deleted object1: type: - string - 'null' description: For create, update, and delete events this is the object type that was affected. For associate and disassociate events this is the object type associated or disassociated with object2. object2: type: - string - 'null' description: Unpopulated for create, update, and delete events. For associate and disassociate events this is the object type that object1 is being associated with. object_association: type: string readOnly: true description: When present, shows the field name of the role or relationship that changed. action_node: type: string readOnly: true description: The cluster node the activity took place on. object_type: type: string readOnly: true description: When present, shows the model on which the role or relationship was defined. required: - object1 - object2 - operation AdHocCommandList: type: object properties: id: type: integer readOnly: true type: type: string readOnly: true url: type: string readOnly: true related: type: string readOnly: true summary_fields: type: string readOnly: true created: type: string readOnly: true modified: type: string readOnly: true name: type: - string - 'null' readOnly: true launch_type: enum: - manual - relaunch - callback - scheduled - dependency - workflow - webhook - sync - scm type: string description: '* `manual` - Manual * `relaunch` - Relaunch * `callback` - Callback * `scheduled` - Scheduled * `dependency` - Dependency * `workflow` - Workflow * `webhook` - Webhook * `sync` - Sync * `scm` - SCM Update' x-spec-enum-id: e5bed25c2e652da3 readOnly: true status: enum: - new - pending - waiting - running - successful - failed - error - canceled type: string description: '* `new` - New * `pending` - Pending * `waiting` - Waiting * `running` - Running * `successful` - Successful * `failed` - Failed * `error` - Error * `canceled` - Canceled' x-spec-enum-id: 6021859c28387823 readOnly: true execution_environment: type: - integer - 'null' description: The container image to be used for execution. failed: type: boolean readOnly: true started: type: - string - 'null' format: date-time readOnly: true description: The date and time the job was queued for starting. finished: type: - string - 'null' format: date-time readOnly: true description: The date and time the job finished execution. canceled_on: type: - string - 'null' format: date-time readOnly: true description: The date and time when the cancel request was sent. elapsed: type: string format: decimal pattern: ^-?\d{0,9}(?:\.\d{0,3})?$ readOnly: true description: Elapsed time in seconds that the job ran. job_explanation: type: string readOnly: true description: A status field to indicate the state of the job if it wasn't able to run and capture stdout execution_node: type: string readOnly: true description: The node the job executed on. controller_node: type: string readOnly: true description: The instance that managed the execution environment. launched_by: type: string readOnly: true work_unit_id: type: - string - 'null' readOnly: true description: The Receptor work unit ID associated with this job. job_type: enum: - run - check - null type: - string - 'null' description: '* `run` - Run * `check` - Check' x-spec-enum-id: 726608a431c1f104 default: run inventory: type: - integer - 'null' limit: type: - string - 'null' default: '' credential: type: - integer - 'null' module_name: enum: - command - shell - yum - apt - apt_key - apt_repository - apt_rpm - service - group - user - mount - ping - selinux - setup - win_ping - win_service - win_updates - win_group - win_user type: string description: '* `command` - command * `shell` - shell * `yum` - yum * `apt` - apt * `apt_key` - apt_key * `apt_repository` - apt_repository * `apt_rpm` - apt_rpm * `service` - service * `group` - group * `user` - user * `mount` - mount * `ping` - ping * `selinux` - selinux * `setup` - setup * `win_ping` - win_ping * `win_service` - win_service * `win_updates` - win_updates * `win_group` - win_group * `win_user` - win_user' x-spec-enum-id: 857230cdbb58eda2 default: command module_args: type: - string - 'null' default: '' forks: type: integer maximum: 9223372036854775807 minimum: 0 format: int64 default: 0 verbosity: enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer description: '* `0` - 0 (Normal) * `1` - 1 (Verbose) * `2` - 2 (More Verbose) * `3` - 3 (Debug) * `4` - 4 (Connection Debug) * `5` - 5 (WinRM Debug)' x-spec-enum-id: 8cfb81af905b865a default: 0 minimum: 0 maximum: 9223372036854775807 extra_vars: type: - string - 'null' default: '' become_enabled: type: - boolean - 'null' default: false diff_mode: type: - boolean - 'null' default: false PaginatedAdHocCommandEventList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/AdHocCommandEvent' UnifiedJobStdout: type: object properties: result_stdout: type: string readOnly: true AdHocCommandEvent: type: object properties: id: type: integer readOnly: true type: type: string readOnly: true url: type: string readOnly: true related: type: string readOnly: true summary_fields: type: string readOnly: true created: type: string readOnly: true modified: type: string readOnly: true ad_hoc_command: type: integer readOnly: true event: enum: - runner_on_failed - runner_on_ok - runner_on_unreachable - runner_on_skipped - debug - verbose - deprecated - warning - system_warning - error - null type: - string - 'null' description: '* `runner_on_failed` - Host Failed * `runner_on_ok` - Host OK * `runner_on_unreachable` - Host Unreachable * `runner_on_skipped` - Host Skipped * `debug` - Debug * `verbose` - Verbose * `deprecated` - Deprecated * `warning` - Warning * `system_warning` - System Warning * `error` - Error' x-spec-enum-id: 3c8188cd2c554d8a counter: type: integer minimum: 0 readOnly: true event_display: type: string readOnly: true event_data: default: {} failed: type: boolean readOnly: true changed: type: boolean readOnly: true uuid: type: string readOnly: true host: type: - integer - 'null' readOnly: true host_name: type: string readOnly: true stdout: type: string readOnly: true start_line: type: integer minimum: 0 readOnly: true end_line: type: integer minimum: 0 readOnly: true verbosity: type: integer minimum: 0 readOnly: true required: - event AdHocCommandDetail: type: object properties: id: type: integer readOnly: true type: type: string readOnly: true url: type: string readOnly: true related: type: string readOnly: true summary_fields: type: string readOnly: true created: type: string readOnly: true modified: type: string readOnly: true name: type: - string - 'null' readOnly: true launch_type: enum: - manual - relaunch - callback - scheduled - dependency - workflow - webhook - sync - scm type: string description: '* `manual` - Manual * `relaunch` - Relaunch * `callback` - Callback * `scheduled` - Scheduled * `dependency` - Dependency * `workflow` - Workflow * `webhook` - Webhook * `sync` - Sync * `scm` - SCM Update' x-spec-enum-id: e5bed25c2e652da3 readOnly: true status: enum: - new - pending - waiting - running - successful - failed - error - canceled type: string description: '* `new` - New * `pending` - Pending * `waiting` - Waiting * `running` - Running * `successful` - Successful * `failed` - Failed * `error` - Error * `canceled` - Canceled' x-spec-enum-id: 6021859c28387823 readOnly: true execution_environment: type: - integer - 'null' description: The container image to be used for execution. failed: type: boolean readOnly: true started: type: - string - 'null' format: date-time readOnly: true description: The date and time the job was queued for starting. finished: type: - string - 'null' format: date-time readOnly: true description: The date and time the job finished execution. canceled_on: type: - string - 'null' format: date-time readOnly: true description: The date and time when the cancel request was sent. elapsed: type: string format: decimal pattern: ^-?\d{0,9}(?:\.\d{0,3})?$ readOnly: true description: Elapsed time in seconds that the job ran. job_args: type: string readOnly: true job_cwd: type: string readOnly: true job_env: readOnly: true job_explanation: type: string readOnly: true description: A status field to indicate the state of the job if it wasn't able to run and capture stdout execution_node: type: string readOnly: true description: The node the job executed on. controller_node: type: string readOnly: true description: The instance that managed the execution environment. result_traceback: type: string readOnly: true event_processing_finished: type: boolean readOnly: true description: Indicates whether all of the events generated by this unified job have been saved to the database. launched_by: type: string readOnly: true work_unit_id: type: - string - 'null' readOnly: true description: The Receptor work unit ID associated with this job. job_type: enum: - run - check - null type: - string - 'null' description: '* `run` - Run * `check` - Check' x-spec-enum-id: 726608a431c1f104 default: run inventory: type: - integer - 'null' limit: type: - string - 'null' default: '' credential: type: - integer - 'null' module_name: enum: - command - shell - yum - apt - apt_key - apt_repository - apt_rpm - service - group - user - mount - ping - selinux - setup - win_ping - win_service - win_updates - win_group - win_user type: string description: '* `command` - command * `shell` - shell * `yum` - yum * `apt` - apt * `apt_key` - apt_key * `apt_repository` - apt_repository * `apt_rpm` - apt_rpm * `service` - service * `group` - group * `user` - user * `mount` - mount * `ping` - ping * `selinux` - selinux * `setup` - setup * `win_ping` - win_ping * `win_service` - win_service * `win_updates` - win_updates * `win_group` - win_group * `win_user` - win_user' x-spec-enum-id: 857230cdbb58eda2 default: command module_args: type: - string - 'null' default: '' forks: type: integer maximum: 9223372036854775807 minimum: 0 format: int64 default: 0 verbosity: enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer description: '* `0` - 0 (Normal) * `1` - 1 (Verbose) * `2` - 2 (More Verbose) * `3` - 3 (Debug) * `4` - 4 (Connection Debug) * `5` - 5 (WinRM Debug)' x-spec-enum-id: 8cfb81af905b865a default: 0 minimum: 0 maximum: 9223372036854775807 extra_vars: type: - string - 'null' default: '' become_enabled: type: - boolean - 'null' default: false diff_mode: type: - boolean - 'null' default: false host_status_counts: readOnly: true description: Playbook stats from the Ansible playbook_on_stats event. AdHocCommandCancel: type: object properties: can_cancel: type: boolean readOnly: true PaginatedAdHocCommandListList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/AdHocCommandList' AdHocCommandListRequest: type: object properties: execution_environment: type: - integer - 'null' description: The container image to be used for execution. job_type: enum: - run - check - null type: - string - 'null' description: '* `run` - Run * `check` - Check' x-spec-enum-id: 726608a431c1f104 default: run inventory: type: - integer - 'null' limit: type: - string - 'null' default: '' credential: type: - integer - 'null' module_name: enum: - command - shell - yum - apt - apt_key - apt_repository - apt_rpm - service - group - user - mount - ping - selinux - setup - win_ping - win_service - win_updates - win_group - win_user type: string description: '* `command` - command * `shell` - shell * `yum` - yum * `apt` - apt * `apt_key` - apt_key * `apt_repository` - apt_repository * `apt_rpm` - apt_rpm * `service` - service * `group` - group * `user` - user * `mount` - mount * `ping` - ping * `selinux` - selinux * `setup` - setup * `win_ping` - win_ping * `win_service` - win_service * `win_updates` - win_updates * `win_group` - win_group * `win_user` - win_user' x-spec-enum-id: 857230cdbb58eda2 default: command module_args: type: - string - 'null' default: '' forks: type: integer maximum: 9223372036854775807 minimum: 0 format: int64 default: 0 verbosity: enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer description: '* `0` - 0 (Normal) * `1` - 1 (Verbose) * `2` - 2 (More Verbose) * `3` - 3 (Debug) * `4` - 4 (Connection Debug) * `5` - 5 (WinRM Debug)' x-spec-enum-id: 8cfb81af905b865a default: 0 minimum: 0 maximum: 9223372036854775807 extra_vars: type: - string - 'null' default: '' become_enabled: type: - boolean - 'null' default: false diff_mode: type: - boolean - 'null' default: false Notification: type: object properties: id: type: integer readOnly: true type: type: string readOnly: true url: type: string readOnly: true related: type: string readOnly: true summary_fields: type: string readOnly: true created: type: string readOnly: true modified: type: string readOnly: true notification_template: type: integer readOnly: true error: type: string readOnly: true status: enum: - pending - successful - failed type: string description: '* `pending` - Pending * `successful` - Successful * `failed` - Failed' x-spec-enum-id: 91d6a0571e1ae0e7 readOnly: true notifications_sent: type: integer readOnly: true notification_type: enum: - awssns - email - grafana - irc - mattermost - pagerduty - rocketchat - slack - twilio - webhook - null type: - string - 'null' description: '* `awssns` - AWS SNS * `email` - Email * `grafana` - Grafana * `irc` - IRC * `mattermost` - Mattermost * `pagerduty` - Pagerduty * `rocketchat` - Rocket.Chat * `slack` - Slack * `twilio` - Twilio * `webhook` - Webhook' x-spec-enum-id: 867d131dea32a033 recipients: type: string readOnly: true subject: type: string readOnly: true body: type: string readOnly: true description: Notification body required: - notification_type