diff options
Diffstat (limited to 'docs/modelingconcepts/workflow.rst')
-rw-r--r-- | docs/modelingconcepts/workflow.rst | 338 |
1 files changed, 170 insertions, 168 deletions
diff --git a/docs/modelingconcepts/workflow.rst b/docs/modelingconcepts/workflow.rst index 8216819ac..9b9bd5220 100644 --- a/docs/modelingconcepts/workflow.rst +++ b/docs/modelingconcepts/workflow.rst @@ -6,19 +6,19 @@ .. _workflow: Workflow ---------- +-------- .. note:: **Workflow Scope within CDS Framework** - The workflow is within the scope of the micro provisioning and configuration - management in **controller domain** and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project. + The workflow is within the scope of the micro provisioning and configuration + management in **controller domain** and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project. -A workflow defines an overall action to be taken on the service, hence is an +A workflow defines an overall action to be taken on the service, hence is an entry-point for the run-time execution of the :ref:`CBA Package <cba>`. -A workflow also defines **inputs** and **outputs** that will defined the **payload contract** +A workflow also defines **inputs** and **outputs** that will defined the **payload contract** of the **request** and **response** (see :ref:`Dynamic API`) A workflow can be **composed** of one or multiple **sub-actions** to execute. @@ -32,10 +32,10 @@ Single action The workflow is directly backed by a component (see :ref:`node_type` -> Component). -In the example bellow, the target of the workflow's steps resource-assignment is ``resource-assignment`` +In the example bellow, the target of the workflow's steps resource-assignment is ``resource-assignment`` which actually is the name of the ``node_template`` defined after, of type ``component-resource-resolution``. -`Link to example +`Link to example <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L40-L71>`_ @@ -43,168 +43,170 @@ which actually is the name of the ``node_template`` defined after, of type ``com :caption: **Example** . . . - "topology_template": { - "workflows": { - "resource-assignment": { - "steps": { - "resource-assignment": { - "description": "Resource Assign Workflow", - "target": "resource-assignment" - ] + "topology_template": { + "workflows": { + "resource-assignment": { + "steps": { + "resource-assignment": { + "description": "Resource Assign Workflow", + "target": "resource-assignment" + } } - }, - "inputs": { + }, + "inputs": { "resource-assignment-properties": { - "description": "Dynamic PropertyDefinition for workflow(resource-assignment).", - "required": true, - "type": "dt-resource-assignment-properties" + "description": "Dynamic PropertyDefinition for workflow(resource-assignment).", + "required": true, + "type": "dt-resource-assignment-properties" } - }, - "outputs": { + }, + "outputs": { "meshed-template": { - "type": "json", - "value": { - "get_attribute": [ + "type": "json", + "value": { + "get_attribute": [ "resource-assignment", "assignment-params" - ] - } + ] + } } - } - }, - "node_templates": { - "resource-assignment": { - "type": "component-resource-resolution", - "interfaces": { - "ResourceResolutionComponent": { - "operations": { - "process": { - "inputs": { - "artifact-prefix-names": [ - "vf-module-1" - ] + } + }, + "node_templates": { + "resource-assignment": { + "type": "component-resource-resolution", + "interfaces": { + "ResourceResolutionComponent": { + "operations": { + "process": { + "inputs": { + "artifact-prefix-names": [ + "vf-module-1" + ] + } } - } - } - } - }, - "artifacts": { - "vf-module-1-template": { - "type": "artifact-template-velocity", - "file": "Templates/vf-module-1-template.vtl" + } + } }, - "vf-module-1-mapping": { - "type": "artifact-mapping-resource", - "file": "Templates/vf-module-1-mapping.json" + "artifacts": { + "vf-module-1-template": { + "type": "artifact-template-velocity", + "file": "Templates/vf-module-1-template.vtl" + }, + "vf-module-1-mapping": { + "type": "artifact-mapping-resource", + "file": "Templates/vf-module-1-mapping.json" + } } - } - } + } + } } - . . . + . . . .. _workflow_multiple_actions: Multiple sub-actions ********************** -The workflow is backed by a Directed Graph engine, dg-generic (see :ref:`node_type` -> DG, +The workflow is backed by a Directed Graph engine, dg-generic (see :ref:`node_type` -> DG, and is an **imperative** workflow. -A DG used as workflow for CDS is composed of multiple execute nodes; each individual +A DG used as workflow for CDS is composed of multiple execute nodes; each individual execute node refers to an modelled Component (see :ref:`node_type` -> Component) instance. -In the example above, you can see the target of the workflow's steps execute-script is +In the example above, you can see the target of the workflow's steps execute-script is ``execute-remote-ansible-process``, which is a node_template of type ``dg_generic`` -`Link of example -<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json#L184-L204>`_ +`Link of example +<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json#L184-L204>`_ .. code-block:: json :caption: **workflow plan example** - . . . - "topology_template": { + . . . + "topology_template": { "workflows": { - "execute-remote-ansible": { - "steps": { + "execute-remote-ansible": { + "steps": { "execute-script": { - "description": "Execute Remote Ansible Script", - "target": "execute-remote-ansible-process" - ] + "description": "Execute Remote Ansible Script", + "target": "execute-remote-ansible-process" } - }, - "inputs": { - "ip": { - "required": false, - "type": "string" - }, - "username": { - "required": false, - "type": "string" - }, - "password": { - "required": false, - "type": "string" - }, - "execute-remote-ansible-properties": { - "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).", - "required": true, - "type": "dt-execute-remote-ansible-properties" + } + }, + "inputs": { + "ip": { + "required": false, + "type": "string" + }, + "username": { + "required": false, + "type": "string" + }, + "password": { + "required": false, + "type": "string" + }, + "execute-remote-ansible-properties": { + "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).", + "required": true, + "type": "dt-execute-remote-ansible-properties" + } + }, + "outputs": { + "ansible-variable-resolution": { + "type": "json", + "value": { + "get_attribute": [ + "resolve-ansible-vars", + "assignment-params" + ] } - }, - "outputs": { - "ansible-variable-resolution": { - "type": "json", - "value": { - "get_attribute": [ - "resolve-ansible-vars", - "assignment-params" - ] - } - }, - "prepare-environment-logs": { - "type": "string", - "value": { - "get_attribute": [ - "execute-remote-ansible", - "prepare-environment-logs" - ] - } - }, - "execute-command-logs": { - "type": "string", - "value": { - "get_attribute": [ - "execute-remote-ansible", - "execute-command-logs" - ] - } + }, + "prepare-environment-logs": { + "type": "string", + "value": { + "get_attribute": [ + "execute-remote-ansible", + "prepare-environment-logs" + ] + } + }, + "execute-command-logs": { + "type": "string", + "value": { + "get_attribute": [ + "execute-remote-ansible", + "execute-command-logs" + ] } - } - } - }, - "node_templates": { - "execute-remote-ansible-process": { - "type": "dg-generic", - "properties": { - "content": { - "get_artifact": [ - "SELF", - "dg-execute-remote-ansible-process" - ] + } + }, + "node_templates": { + "execute-remote-ansible-process": { + "type": "dg-generic", + "properties": { + "content": { + "get_artifact": [ + "SELF", + "dg-execute-remote-ansible-process" + ] + }, + "dependency-node-templates": [ + "resolve-ansible-vars", + "execute-remote-ansible" + ] }, - "dependency-node-templates": [ - "resolve-ansible-vars", - "execute-remote-ansible" - ] - }, - "artifacts": { - "dg-execute-remote-ansible-process": { - "type": "artifact-directed-graph", - "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml" + "artifacts": { + "dg-execute-remote-ansible-process": { + "type": "artifact-directed-graph", + "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml" + } } - } - } + } + } + } + } Properties of a workflow ************************** @@ -219,12 +221,12 @@ Properties of a workflow - Defines the name of the action that can be triggered by external system * - inputs - | They are two types of inputs, the dynamic ones, and the static one. - | + | .. tabs:: - + .. tab:: static - + Specified at workflow level * can be inputs for the Component(s), see the inputs section of the component of interest. @@ -233,8 +235,8 @@ Properties of a workflow These will end up under ``${actionName}-request`` section of the payload (see Dynamic API) .. tab:: dynamic - - Represent the resources defined as input (see :ref:`node_type` -> Source -> Input) + + Represent the resources defined as input (see :ref:`node_type` -> Source -> Input) within mapping definition files (see :ref:`artifact_type` -> Mapping). The **enrichment process** will (see :ref:`enrichment`) @@ -265,17 +267,17 @@ Properties of a workflow - value resolvable using :ref:`expression` -> get_attribute * - steps - | Defines the actual step to execute as part of the workflow - | + | .. list-table:: :widths: 25 25 50 - :header-rows: 1 - + :header-rows: 1 + * - step-name - description - target * - name of the step - step description - - | a node_template implementing on of the supported Node Type (see :ref:`node_type` -> DG), + - | a node_template implementing on of the supported Node Type (see :ref:`node_type` -> DG), either a Component or a DG | (see :ref:`workflow_single_action` or :ref:`workflow_multiple_actions`) @@ -284,39 +286,39 @@ Example: .. code-block:: json :caption: **workflow example** - { - "workflow": { - "resource-assignment": { <- workflow-name + { + "workflow": { + "resource-assignment": { <- workflow-name "inputs": { - "vnf-id": { <- static inputs - "required": true, - "type": "string" - }, - "resource-assignment-properties": { <- dynamic inputs - "required": true, - "type": "dt-resource-assignment-properties" - } + "vnf-id": { <- static inputs + "required": true, + "type": "string" + }, + "resource-assignment-properties": { <- dynamic inputs + "required": true, + "type": "dt-resource-assignment-properties" + } }, "steps": { - "call-resource-assignment": { <- step-name - "description": "Resource Assignment Workflow", - "target": "resource-assignment-process" <- node_template targeted by the step - } + "call-resource-assignment": { <- step-name + "description": "Resource Assignment Workflow", + "target": "resource-assignment-process" <- node_template targeted by the step + } }, "outputs": { - "template-properties": { <- output - "type": "json", <- complex type - "value": { + "template-properties": { <- output + "type": "json", <- complex type + "value": { "get_attribute": [ <- uses expression to retrieve attribute from context - "resource-assignment", - "assignment-params" + "resource-assignment", + "assignment-params" ] - } - } + } + } } - } + } + } } - } `TOSCA definition <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454203>`_ |