{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":29072,"path":"it-operations-management/cloud-configuration-governance/add-operation-steps.md","title":"Add operation steps to a resource block","bundle":null,"doc_type":null,"release":"australia","body":"\n# Add operation steps to a resource block\n\nAfter you configure operations and input parameters for your resource block, add steps for each operation to tell the system which Cloud API \\(CAPI\\) to call. Each step is a separate call to CAPI.\n\n## Before you begin\n\nRole required: sn\\_cmp.cloud\\_service\\_designer\n\n## Procedure\n\n1.  On the resource block, click the **Steps** sub-tab under **Operations**.\n\n2.  Click **Add Step**.\n\n3.  Fill in the form fields.\n\n<table id=\"table_q1n_4qw_52b\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nOperation Type\n\n</td><td>\n\nSelect the type of operation:\n\n-   **Invoke Cloud API**: Select this option to select a provider, interface, and method from CAPI.\n-   **Invoke Host Resource Operation**: Select this option to use an operation \\(also called an operation signature\\) from the host interface that you already specified for this resource block.\n-   **Invoke Script**: Select this option to invoke a method from an existing MID Server script include.\n-   **Invoke Flow**: Select this option to invoke subflows from a list of active subflows.\n\n\n</td></tr><tr><td>\n\nAPI Provider\\[Operation Type = Invoke Cloud API\\]\n\n</td><td>\n\nSelect the API that provides the interfaces you need. The providers are part of the Cloud API \\(CAPI\\).\n\n For example, CAPI supplies the AWS provider, which has products, some of which have provider names.\n\n This value appears if you select the Invoke Cloud API operation type.\n\n</td></tr><tr><td>\n\nAPI Interface\\[Operation Type = Invoke Cloud API\\]\n\n</td><td>\n\nSelect the interface that has the methods you want to use. For example, the **Blob Storage Interface** provides the **CreateContainer** interface, which the system uses during provisioning.\n\n</td></tr><tr><td>\n\nAPI Method\\[Operation Type = Invoke Cloud API\\]\n\n</td><td>\n\nSelect the method to perform the operation. In this example, **CreateContainer** is required to provision storage.\n\n</td></tr><tr><td>\n\nCAPI Version\\[Operation Type = Invoke Cloud API\\]\n\n</td><td>\n\nEnter the version of the CAPI API.\n\n</td></tr><tr><td>\n\nHost Interface\\[Operation Type = Invoke Host Resource Operation\\]\n\n</td><td>\n\nSelect the interface from which to call an operation. You can only select the same interface that you configured on the **General Information** tab of the resource block. To change the interface, navigate back to the **General Information** tab and select another value in the **Host Interface** field.\n\n</td></tr><tr><td>\n\nInterface Operation\\[Operation Type = Invoke Host Resource Operation\\]\n\n</td><td>\n\nSelect the operation from the host interface. For example, if you select **Storage Server** Interface, you can call all the operations in that interface, such as CreateStorageVolume.\n\n</td></tr><tr><td>\n\nScripts\\[Operation Type = Invoke Script\\]\n\n</td><td>\n\nEnter the script you want to invoke, along with a method in the script. Use this syntax: `script-name.method`.\n\n</td></tr><tr><td>\n\nFlow\\[Operation Type = Invoke Flow &gt; Subflow\\]\n\n</td><td>\n\nSelect the subflow from the Subflows list. For example, if you select a Terraform Enterprise Provision subflow, you can simply reuse the existing subflow to populate the Inputs&amp;Outputs\n\n</td></tr><tr><td>\n\nCondition\n\n</td><td>\n\nEnter an optional condition that must be met before the system uses this step.\n\n</td></tr></tbody>\n</table>    If you look at the Azure API and the CreateNode method mapper, you can see that the endpoint operation is a script. It calls the MID Server script include, which shows you the createNode\\(\\) function. This function uses AzureComputeVirtualMachine script include. Take time to review and understand this script include.\n\n4.  Click **Submit**.\n\n    The **Input** and **Response Processor** tabs appear for the step.\n\n5.  On the **Input** tab, configure the CAPI operation inputs.\n\n    On the CAPI interface, which in this case is **Blob Storage** Interface, open CreateContainer method. The inputs from CAPI are shown on the Input tab, where you create parameters.\n\n    Remember that the parameters on the **Input Parameters** tab is where users enter values. You can map those input parameters to the parameters on the **Input** tab. To do this, copy the **Mapping** value from the **Input Parameters** tab into the **Value** field on the **Steps** &gt; **Input** tab.\n\n    If this step is invoking a script, and that script requires arguments to return values, you can add a new input parameter for each argument. Use this syntax in the **Value** field: `${parameter.arg1}`.\n\n6.  If any subsequent steps in this operation or subsequent operations require parameters values from this step to be passed to them, configure output attributes.\n\n    For example, the Provision operation for a virtual server can provide an output attribute for the network interface ID and another for the node ID. When the cloud provider sends the response, the actual ID of the network and node are parsed out of the response and saved in the output attributes. Subsequent steps use the IDs to perform actions.\n\n    1.  Click the **Output Attributes** tab.\n\n    2.  Enter code in the following notation:\n\n        ```\n        \n        {\n          \"Attribute\": \"${Value}\"\n        }\n        \n        ```\n\n        Where the value comes from a mapping to the interface and the operation.\n\n        For example, in the following output attribute:\n\n        ```\n        \n        {\n          \"NodeId\": \"${Compute Interface.CreateNode.Output.resp.nodeId}\"\n        }\n        \n        ```\n\n        -   `NodeId` is the attribute.\n        -   `Compute Interface` specifies the interface.\n        -   `CreateNode` is the name of the method that creates the node.\n        -   `Output.resp` is a mandatory part of the syntax.\n        -   `nodeId`\n\n-   **[Add a resource operation step to invoke a subflow](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/cloud-configuration-governance/add-resource-op-step-subflow.md)**  \nInvoke a subflow by adding an operation step to a resource and linking it to a new or existing subflow.\n\n**Parent Topic:**[Resource blocks in Cloud Provisioning and Governance](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/cloud-configuration-governance/resource-blocks.md)\n\n"}}