Add namespace parameter to Workbook API doc

Update API documentation to include namespace parameter details.
Update quickstart guide to latest client outputs.
And minor typo fixes.

Change-Id: I0a2324d0386d5543387ea4bff1d2569b50ad22dd
Implements: blueprint mistral-namespace-for-actions-workbooks
This commit is contained in:
hardikj 2018-07-30 14:48:26 +05:30
parent b01d6c6642
commit 9e2074d1eb
3 changed files with 70 additions and 59 deletions

View File

@ -75,11 +75,11 @@ Use the *Mistral CLI* to create the workflow::
The output should look similar to this:: The output should look similar to this::
+------------------------------------+-------------+--------+---------+---------------------+------------+ +------------------------------------+-------------+-----------+--------+-------+---------------------+------------+
|ID | Name | Tags | Input | Created at | Updated at | |ID | Name | Namespace | Tags | Input | Created at | Updated at |
+------------------------------------+-------------+--------+---------+---------------------+------------+ +------------------------------------+-------------+-----------+--------+-------+---------------------+------------+
|9b719d62-2ced-47d3-b500-73261bb0b2ad| my_workflow | <none> | names | 2015-08-13 08:44:49 | None | |9b719d62-2ced-47d3-b500-73261bb0b2ad| my_workflow | | <none> | names | 2015-08-13 08:44:49 | None |
+------------------------------------+-------------+--------+---------+---------------------+------------+ +------------------------------------+-------------+-----------+--------+-------+---------------------+------------+
Run the workflow and check the result Run the workflow and check the result
@ -92,49 +92,53 @@ as JSON::
Make sure the output is like the following:: Make sure the output is like the following::
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
| Field | Value | | Field | Value |
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
| ID | 49213eb5-196c-421f-b436-775849b55040 | | ID | 49213eb5-196c-421f-b436-775849b55040 |
| Workflow ID | 9b719d62-2ced-47d3-b500-73261bb0b2ad | | Workflow ID | 9b719d62-2ced-47d3-b500-73261bb0b2ad |
| Workflow name | my_workflow | | Workflow name | my_workflow |
| Workflow namespace | |
| Description | | | Description | |
| Task Execution ID | <none> | | Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | RUNNING | | State | RUNNING |
| State info | None | | State info | None |
| Created at | 2017-03-06 11:24:10 | | Created at | 2017-03-06 11:24:10 |
| Updated at | 2017-03-06 11:24:10 | | Updated at | 2017-03-06 11:24:10 |
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
After a moment, check the status of the workflow execution (replace the After a moment, check the status of the workflow execution (replace the
example execution id with the ID output above):: example execution id with the ID output above)::
$ mistral execution-get 49213eb5-196c-421f-b436-775849b55040 $ mistral execution-get 49213eb5-196c-421f-b436-775849b55040
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
| Field | Value | | Field | Value |
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
| ID | 49213eb5-196c-421f-b436-775849b55040 | | ID | 49213eb5-196c-421f-b436-775849b55040 |
| Workflow ID | 9b719d62-2ced-47d3-b500-73261bb0b2ad | | Workflow ID | 9b719d62-2ced-47d3-b500-73261bb0b2ad |
| Workflow name | my_workflow | | Workflow name | my_workflow |
| Workflow namespace | |
| Description | | | Description | |
| Task Execution ID | <none> | | Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | SUCCESS | | State | SUCCESS |
| State info | None | | State info | None |
| Created at | 2017-03-06 11:24:10 | | Created at | 2017-03-06 11:24:10 |
| Updated at | 2017-03-06 11:24:20 | | Updated at | 2017-03-06 11:24:20 |
+-------------------+--------------------------------------+ +--------------------+--------------------------------------+
The status of each **task** also can be checked:: The status of each **task** also can be checked::
$ mistral task-list 49213eb5-196c-421f-b436-775849b55040 $ mistral task-list 49213eb5-196c-421f-b436-775849b55040
+--------------------------------------+-------+---------------+--------------------------------------+---------+------------+---------------------+---------------------+ +--------------------------------------+-------+---------------+--------------------+--------------------------------------+---------+------------+---------------------+---------------------+
| ID | Name | Workflow name | Execution ID | State | State info | Created at | Updated at | | ID | Name | Workflow name | Workflow namespace | Execution ID | State | State info | Created at | Updated at |
+--------------------------------------+-------+---------------+--------------------------------------+---------+------------+---------------------+---------------------+ +--------------------------------------+-------+---------------+--------------------+--------------------------------------+---------+------------+---------------------+---------------------+
| f639e7a9-9609-468e-aa08-7650e1472efe | task1 | my_workflow | 49213eb5-196c-421f-b436-775849b55040 | SUCCESS | None | 2017-03-06 11:24:11 | 2017-03-06 11:24:17 | | f639e7a9-9609-468e-aa08-7650e1472efe | task1 | my_workflow | | 49213eb5-196c-421f-b436-775849b55040 | SUCCESS | None | 2017-03-06 11:24:11 | 2017-03-06 11:24:17 |
| d565c5a0-f46f-4ebe-8655-9eb6796307a3 | task2 | my_workflow | 49213eb5-196c-421f-b436-775849b55040 | SUCCESS | None | 2017-03-06 11:24:17 | 2017-03-06 11:24:18 | | d565c5a0-f46f-4ebe-8655-9eb6796307a3 | task2 | my_workflow | | 49213eb5-196c-421f-b436-775849b55040 | SUCCESS | None | 2017-03-06 11:24:17 | 2017-03-06 11:24:18 |
+--------------------------------------+-------+---------------+--------------------------------------+---------+------------+---------------------+---------------------+ +--------------------------------------+-------+---------------+--------------------+--------------------------------------+---------+------------+---------------------+---------------------+
Check the result of task *'task1'*:: Check the result of task *'task1'*::
@ -152,14 +156,14 @@ If needed, we can go deeper and look at a list of the results of the
$ mistral action-execution-list f639e7a9-9609-468e-aa08-7650e1472efe $ mistral action-execution-list f639e7a9-9609-468e-aa08-7650e1472efe
+--------------------------------------+----------+---------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+ +--------------------------------------+----------+---------------+--------------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+
| ID | Name | Workflow name | Task name | Task ID | State | Accepted | Created at | Updated at | | ID | Name | Workflow name | Workflow namespace | Task name | Task ID | State | Accepted | Created at | Updated at |
+--------------------------------------+----------+---------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+ +--------------------------------------+----------+---------------+--------------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+
| 4e0a60be-04df-42d7-aa59-5107e599d079 | std.echo | my_workflow | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 | | 4e0a60be-04df-42d7-aa59-5107e599d079 | std.echo | my_workflow | | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 |
| 5bd95da4-9b29-4a79-bcb1-298abd659bd6 | std.echo | my_workflow | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 | | 5bd95da4-9b29-4a79-bcb1-298abd659bd6 | std.echo | my_workflow | | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 |
| 6ae6c19e-b51b-4910-9e0e-96c788093715 | std.echo | my_workflow | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 | | 6ae6c19e-b51b-4910-9e0e-96c788093715 | std.echo | my_workflow | | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:16 |
| bed5a6a2-c1d8-460f-a2a5-b36f72f85e19 | std.echo | my_workflow | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:17 | | bed5a6a2-c1d8-460f-a2a5-b36f72f85e19 | std.echo | my_workflow | | task1 | f639e7a9-9609-468e-aa08-7650e1472efe | SUCCESS | True | 2017-03-06 11:24:12 | 2017-03-06 11:24:17 |
+--------------------------------------+----------+---------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+ +--------------------------------------+----------+---------------+--------------------+-----------+--------------------------------------+---------+----------+---------------------+---------------------+
Check the result of the first **action_execution**:: Check the result of the first **action_execution**::

View File

@ -47,12 +47,12 @@ class WorkbooksController(rest.RestController, hooks.HookController):
def get(self, name, namespace=''): def get(self, name, namespace=''):
"""Return the named workbook. """Return the named workbook.
:param name: Name of workbook to retrieve :param name: Name of workbook to retrieve.
:param namespace: Namespace of workbook to retrieve :param namespace: Optional. Namespace of workbook to retrieve.
""" """
acl.enforce('workbooks:get', context.ctx()) acl.enforce('workbooks:get', context.ctx())
LOG.debug("Fetch workbook [name=%s]", name) LOG.debug("Fetch workbook [name=%s, namespace=%s]", name, namespace)
# Use retries to prevent possible failures. # Use retries to prevent possible failures.
r = rest_utils.create_db_retry_object() r = rest_utils.create_db_retry_object()
@ -65,7 +65,11 @@ class WorkbooksController(rest.RestController, hooks.HookController):
@rest_utils.wrap_pecan_controller_exception @rest_utils.wrap_pecan_controller_exception
@pecan.expose(content_type="text/plain") @pecan.expose(content_type="text/plain")
def put(self, namespace=''): def put(self, namespace=''):
"""Update a workbook.""" """Update a workbook.
:param namespace: Optional. Namespace of workbook to update.
"""
acl.enforce('workbooks:update', context.ctx()) acl.enforce('workbooks:update', context.ctx())
definition = pecan.request.text definition = pecan.request.text
@ -118,11 +122,12 @@ class WorkbooksController(rest.RestController, hooks.HookController):
def delete(self, name, namespace=''): def delete(self, name, namespace=''):
"""Delete the named workbook. """Delete the named workbook.
:param name: Name of workbook to delete :param name: Name of workbook to delete.
:param namespace: Optional. Namespace of workbook to delete.
""" """
acl.enforce('workbooks:delete', context.ctx()) acl.enforce('workbooks:delete', context.ctx())
LOG.debug("Delete workbook [name=%s]", name) LOG.debug("Delete workbook [name=%s, namespace=%s]", name, namespace)
rest_utils.rest_retry_on_db_error(db_api.delete_workbook)( rest_utils.rest_retry_on_db_error(db_api.delete_workbook)(
name, name,
@ -163,6 +168,8 @@ class WorkbooksController(rest.RestController, hooks.HookController):
time and date. time and date.
:param updated_at: Optional. Keep only resources with specific latest :param updated_at: Optional. Keep only resources with specific latest
update time and date. update time and date.
:param namespace: Optional. Keep only resources with specific
namespace.
""" """
acl.enforce('workbooks:list', context.ctx()) acl.enforce('workbooks:list', context.ctx())

View File

@ -104,12 +104,12 @@ class WorkflowsController(rest.RestController, hooks.HookController):
:param identifier: Optional. If provided, it's UUID of a workflow. :param identifier: Optional. If provided, it's UUID of a workflow.
Only one workflow can be updated with identifier param. Only one workflow can be updated with identifier param.
:param namespace: Optional. If provided int's the namespace of the :param namespace: Optional. If provided, it's the namespace of the
workflow/workflows. currently namespace cannot be workflow/workflows. Currently, namespace cannot be
changed. changed.
The text is allowed to have definitions of multiple workflows. In this The text is allowed to have definitions of multiple workflows. In such
case they all will be updated. case, they all will be updated.
""" """
acl.enforce('workflows:update', context.ctx()) acl.enforce('workflows:update', context.ctx())
@ -139,12 +139,12 @@ class WorkflowsController(rest.RestController, hooks.HookController):
def post(self, namespace=''): def post(self, namespace=''):
"""Create a new workflow. """Create a new workflow.
NOTE: The text is allowed to have definitions
of multiple workflows. In this case they all will be created.
:param namespace: Optional. The namespace to create the workflow :param namespace: Optional. The namespace to create the workflow
in. Workflows with the same name can be added to a given in. Workflows with the same name can be added to a given
project if are in two different namespaces. project if they are in two different namespaces.
The text is allowed to have definitions of multiple workflows.
In such case, they all will be created.
""" """
acl.enforce('workflows:create', context.ctx()) acl.enforce('workflows:create', context.ctx())