From 6854e05a5f5e90e1ba2b05d9dd1cc9a547b71395 Mon Sep 17 00:00:00 2001 From: Brian Curtin Date: Tue, 24 Jan 2017 12:17:46 -0500 Subject: [PATCH] Add docs for the workflow service Initial docs for workflow. Doesn't include a user guide as I don't know how to use it. Change-Id: I7fa19fbb4cd6684782b8fc7a424d871a8b5d93ad --- doc/source/users/index.rst | 2 ++ doc/source/users/proxies/workflow.rst | 16 ++++++++++++++++ doc/source/users/resources/workflow/index.rst | 8 ++++++++ .../users/resources/workflow/v2/execution.rst | 12 ++++++++++++ .../users/resources/workflow/v2/workflow.rst | 12 ++++++++++++ openstack/workflow/v2/execution.py | 11 +++++++++++ openstack/workflow/v2/workflow.py | 10 ++++++++++ 7 files changed, 71 insertions(+) create mode 100644 doc/source/users/proxies/workflow.rst create mode 100644 doc/source/users/resources/workflow/index.rst create mode 100644 doc/source/users/resources/workflow/v2/execution.rst create mode 100644 doc/source/users/resources/workflow/v2/workflow.rst diff --git a/doc/source/users/index.rst b/doc/source/users/index.rst index b03cb4c92..1d60513c9 100644 --- a/doc/source/users/index.rst +++ b/doc/source/users/index.rst @@ -80,6 +80,7 @@ but listed below are the ones provided by this SDK by default. Object Store Orchestration Telemetry + Workflow Resource Interface ****************** @@ -108,6 +109,7 @@ The following services have exposed *Resource* classes. Orchestration Object Store Telemetry + Workflow Low-Level Classes ***************** diff --git a/doc/source/users/proxies/workflow.rst b/doc/source/users/proxies/workflow.rst new file mode 100644 index 000000000..9fea0c466 --- /dev/null +++ b/doc/source/users/proxies/workflow.rst @@ -0,0 +1,16 @@ +Workflow API +============ + +For details on how to use block_store, see :doc:`/users/guides/block_store` + +.. automodule:: openstack.workflow.v2._proxy + +The Workflow Class +------------------ + +The workflow high-level interface is available through the ``workflow`` +member of a :class:`~openstack.connection.Connection` object. +The ``workflow`` member will only be added if the service is detected. + +.. autoclass:: openstack.workflow.v2._proxy.Proxy + :members: diff --git a/doc/source/users/resources/workflow/index.rst b/doc/source/users/resources/workflow/index.rst new file mode 100644 index 000000000..30221b15d --- /dev/null +++ b/doc/source/users/resources/workflow/index.rst @@ -0,0 +1,8 @@ +Object Store Resources +====================== + +.. toctree:: + :maxdepth: 1 + + v2/execution + v2/workflow diff --git a/doc/source/users/resources/workflow/v2/execution.rst b/doc/source/users/resources/workflow/v2/execution.rst new file mode 100644 index 000000000..a0f2aac65 --- /dev/null +++ b/doc/source/users/resources/workflow/v2/execution.rst @@ -0,0 +1,12 @@ +openstack.workflow.v2.execution +=============================== + +.. automodule:: openstack.workflow.v2.execution + +The Execution Class +------------------- + +The ``Execution`` class inherits from :class:`~openstack.resource.Resource`. + +.. autoclass:: openstack.workflow.v2.execution + :members: diff --git a/doc/source/users/resources/workflow/v2/workflow.rst b/doc/source/users/resources/workflow/v2/workflow.rst new file mode 100644 index 000000000..115cb9f33 --- /dev/null +++ b/doc/source/users/resources/workflow/v2/workflow.rst @@ -0,0 +1,12 @@ +openstack.workflow.v2.workflow +============================== + +.. automodule:: openstack.workflow.v2.workflow + +The Workflow Class +------------------ + +The ``Workflow`` class inherits from :class:`~openstack.resource.Resource`. + +.. autoclass:: openstack.workflow.v2.workflow + :members: diff --git a/openstack/workflow/v2/execution.py b/openstack/workflow/v2/execution.py index ef4a4a394..d54160f1e 100644 --- a/openstack/workflow/v2/execution.py +++ b/openstack/workflow/v2/execution.py @@ -30,15 +30,26 @@ class Execution(resource.Resource): 'marker', 'limit', 'sort_keys', 'sort_dirs', 'fields', 'params', 'include_output') + #: The name of the workflow workflow_name = resource.Body("workflow_name") + #: The ID of the workflow workflow_id = resource.Body("workflow_id") + #: A description of the workflow execution description = resource.Body("description") + #: A reference to the parent task execution task_execution_id = resource.Body("task_execution_id") + #: Status can be one of: IDLE, RUNNING, SUCCESS, ERROR, or PAUSED status = resource.Body("state") + #: An optional information string about the status status_info = resource.Body("state_info") + #: A JSON structure containing workflow input values + # TODO(briancurtin): type=dict input = resource.Body("input") + #: The output of the workflow output = resource.Body("output") + #: The time at which the Execution was created created_at = resource.Body("created_at") + #: The time at which the Execution was updated updated_at = resource.Body("updated_at") def create(self, session, prepend_key=True): diff --git a/openstack/workflow/v2/workflow.py b/openstack/workflow/v2/workflow.py index 3039dd7df..6624c87b3 100644 --- a/openstack/workflow/v2/workflow.py +++ b/openstack/workflow/v2/workflow.py @@ -29,13 +29,23 @@ class Workflow(resource.Resource): _query_mapping = resource.QueryParameters( 'marker', 'limit', 'sort_keys', 'sort_dirs', 'fields') + #: The name of this Workflow name = resource.Body("name") + #: The inputs for this Workflow input = resource.Body("input") + #: A Workflow definition using the Mistral v2 DSL definition = resource.Body("definition") + #: A list of values associated with a workflow that users can use + #: to group workflows by some criteria + # TODO(briancurtin): type=list tags = resource.Body("tags") + #: Can be either "private" or "public" scope = resource.Body("scope") + #: The ID of the associated project project_id = resource.Body("project_id") + #: The time at which the workflow was created created_at = resource.Body("created_at") + #: The time at which the workflow was created updated_at = resource.Body("updated_at") def create(self, session, prepend_key=True):