Add operation steps to a resource block

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 3 minutes to read
  • After 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.

    Before you begin

    Role required: sn_cmp.cloud_service_designer

    Procedure

    1. On the resource block, click the Steps sub-tab under Operations.
    2. Click Add Step.
    3. Fill in the form fields.
      Field Description
      Operation Type
      Select the type of operation:
      • Invoke Cloud API: Select this option to select a provider, interface, and method from CAPI.
      • 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.
      • Invoke Script: Select this option to invoke a method from an existing MID Server script include.
      • Invoke Workflow: Select this option to invoke a pre-existing workflow triggering operations on this resource block.
      • Invoke Flow: Select this option to invoke subflows from a list of active subflows.
      API Provider

      [Operation Type = Invoke Cloud API]

      Select the API that provides the interfaces you need. The providers are part of the Cloud API (CAPI).

      For example, CAPI supplies the AWS provider, which has products, some of which have provider names.

      This value appears if you select the Invoke Cloud API operation type.

      API Interface

      [Operation Type = Invoke Cloud API]

      Select 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.
      API Method

      [Operation Type = Invoke Cloud API]

      Select the method to perform the operation. In this example, CreateContainer is required to provision storage.
      CAPI Version

      [Operation Type = Invoke Cloud API]

      Enter the version of the CAPI API.
      Host Interface

      [Operation Type = Invoke Host Resource Operation]

      Select 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.

      Interface Operation

      [Operation Type = Invoke Host Resource Operation]

      Select 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.
      Scripts

      [Operation Type = Invoke Script]

      Enter the script you want to invoke, along with a method in the script. Use this syntax: script-name.method.
      Workflow

      [Operation Type = Invoke Script]

      Do not use Workflow.
      Flow

      [Operation Type = Invoke Flow > Subflow]

      Select 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&Outputs
      Condition Enter an optional condition that must be met before the system uses this step.

      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.

    4. Click Submit.

      The Input and Response Processor tabs appear for the step.

    5. On the Input tab, configure the CAPI operation inputs.

      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.

      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 > Input tab.

      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}.

    6. If any subsequent steps in this operation or subsequent operations require parameters values from this step to be passed to them, configure output attributes.

      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.

      1. Click the Output Attributes tab.
      2. Enter code in the following notation:
        
        {
          "Attribute": "${Value}"
        }
        

        Where the value comes from a mapping to the interface and the operation.

        For example, in the following output attribute:
        
        {
          "NodeId": "${Compute Interface.CreateNode.Output.resp.nodeId}"
        }
        
        • NodeId is the attribute.
        • Compute Interface specifies the interface.
        • CreateNode is the name of the method that creates the node.
        • Output.resp is a mandatory part of the syntax.
        • nodeId