From ba07f467ed40c47c7445190fcb7debfdf9a9ebbe Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Wed, 11 Jan 2017 16:04:17 -0500 Subject: [PATCH 1/2] add help text templates for remaining workflow endpoints --- awx/api/templates/api/workflow_job_cancel.md | 12 +++++++ .../templates/api/workflow_job_relaunch.md | 5 +++ .../api/workflow_job_template_copy.md | 33 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 awx/api/templates/api/workflow_job_cancel.md create mode 100644 awx/api/templates/api/workflow_job_relaunch.md create mode 100644 awx/api/templates/api/workflow_job_template_copy.md diff --git a/awx/api/templates/api/workflow_job_cancel.md b/awx/api/templates/api/workflow_job_cancel.md new file mode 100644 index 0000000000..01cc11d537 --- /dev/null +++ b/awx/api/templates/api/workflow_job_cancel.md @@ -0,0 +1,12 @@ +# Cancel Workflow Job + +Make a GET request to this resource to determine if the workflow job can be +cancelled. The response will include the following field: + +* `can_cancel`: Indicates whether this workflow job is in a state that can + be canceled (boolean, read-only) + +Make a POST request to this endpoint to submit a request to cancel a pending +or running workflow job. The response status code will be 202 if the +request to cancel was successfully submitted, or 405 if the workflow job +cannot be canceled. diff --git a/awx/api/templates/api/workflow_job_relaunch.md b/awx/api/templates/api/workflow_job_relaunch.md new file mode 100644 index 0000000000..f9a9b2c31c --- /dev/null +++ b/awx/api/templates/api/workflow_job_relaunch.md @@ -0,0 +1,5 @@ +Relaunch a workflow job: + +Make a POST request to this endpoint to launch a workflow job identical to the parent workflow job. This will spawn jobs, project updates, or inventory updates based on the unified job templates referenced in the workflow nodes in the workflow job. No POST data is accepted for this action. + +If successful, the response status code will be 201 and serialized data of the new workflow job will be returned. \ No newline at end of file diff --git a/awx/api/templates/api/workflow_job_template_copy.md b/awx/api/templates/api/workflow_job_template_copy.md new file mode 100644 index 0000000000..238741879d --- /dev/null +++ b/awx/api/templates/api/workflow_job_template_copy.md @@ -0,0 +1,33 @@ +Copy a Workflow Job Template: + +Make a GET request to this resource to determine if the workflow_job_template +can be copied and whether any passwords are required to launch the +workflow_job_template. The response will include the following fields: + +* `can_copy`: Flag indicating whether the active user has permission to make + a copy of this workflow_job_template, provides same content as the + workflow_job_template detail view summary_fields.user_capabilities.copy + (boolean, read-only) +* `can_copy_without_user_input`: Flag indicating if the user should be + prompted for confirmation before the copy is executed (boolean, read-only) +* `templates_unable_to_copy`: Names of job templates, projects, and inventory + sources that the active user lacks permission to use and will be missing in + workflow nodes of the copy (array, read-only) +* `inventories_unable_to_copy`: Names of inventories that the active user + lacks permission to use and will be missing in the workflow nodes of the + copy (array, read-only) +* `credentials_unable_to_copy`: Names of credentials that the active user + lacks permission to use and will be missing in the workflow nodes of the + copy (array, read-only) + +Make a POST request to this endpoint to save a copy of this +workflow_job_template. No POST data is accepted for this action. + +If successful, the response status code will be 201. The response body will +contain serialized data about the new workflow_job_template, which will be +similar to the original workflow_job_template, but with an additional `@` +and a timestamp in the name. + +All workflow nodes and connections in the original will also exist in the +copy. The nodes will be missing related resources if the user did not have +access to use them. From ca704cdb5cb2e8d88b809be596ba1a532594b6b2 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 17 Jan 2017 14:35:30 -0500 Subject: [PATCH 2/2] update copy API help text for recent changes --- awx/api/templates/api/workflow_job_cancel.md | 2 +- .../api/workflow_job_template_copy.md | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/awx/api/templates/api/workflow_job_cancel.md b/awx/api/templates/api/workflow_job_cancel.md index 01cc11d537..bcdd347d36 100644 --- a/awx/api/templates/api/workflow_job_cancel.md +++ b/awx/api/templates/api/workflow_job_cancel.md @@ -1,7 +1,7 @@ # Cancel Workflow Job Make a GET request to this resource to determine if the workflow job can be -cancelled. The response will include the following field: +canceled. The response will include the following field: * `can_cancel`: Indicates whether this workflow job is in a state that can be canceled (boolean, read-only) diff --git a/awx/api/templates/api/workflow_job_template_copy.md b/awx/api/templates/api/workflow_job_template_copy.md index 238741879d..f28d6466ba 100644 --- a/awx/api/templates/api/workflow_job_template_copy.md +++ b/awx/api/templates/api/workflow_job_template_copy.md @@ -1,8 +1,9 @@ Copy a Workflow Job Template: -Make a GET request to this resource to determine if the workflow_job_template -can be copied and whether any passwords are required to launch the -workflow_job_template. The response will include the following fields: +Make a GET request to this resource to determine if the current user has +permission to copy the workflow_job_template and whether any linked +templates or prompted fields will be ignored due to permissions problems. +The response will include the following fields: * `can_copy`: Flag indicating whether the active user has permission to make a copy of this workflow_job_template, provides same content as the @@ -10,15 +11,15 @@ workflow_job_template. The response will include the following fields: (boolean, read-only) * `can_copy_without_user_input`: Flag indicating if the user should be prompted for confirmation before the copy is executed (boolean, read-only) -* `templates_unable_to_copy`: Names of job templates, projects, and inventory - sources that the active user lacks permission to use and will be missing in - workflow nodes of the copy (array, read-only) -* `inventories_unable_to_copy`: Names of inventories that the active user - lacks permission to use and will be missing in the workflow nodes of the - copy (array, read-only) -* `credentials_unable_to_copy`: Names of credentials that the active user - lacks permission to use and will be missing in the workflow nodes of the - copy (array, read-only) +* `templates_unable_to_copy`: List of node ids of nodes that have a related + job template, project, or inventory that the current user lacks permission + to use and will be missing in workflow nodes of the copy (array, read-only) +* `inventories_unable_to_copy`: List of node ids of nodes that have a related + prompted inventory that the current user lacks permission + to use and will be missing in workflow nodes of the copy (array, read-only) +* `credentials_unable_to_copy`: List of node ids of nodes that have a related + prompted credential that the current user lacks permission + to use and will be missing in workflow nodes of the copy (array, read-only) Make a POST request to this endpoint to save a copy of this workflow_job_template. No POST data is accepted for this action.