Service instance level parameters

The conventions to be followed for service instance level input and output parameters.

The svc_instance represents a JSON request object that is used to initiate a "provision" or a "bind" action instance.

  • ${svc_instance.name} - Name of the "provision" or a "bind" action instance that is entered in the deployment page.

  • ${svc_instance.instance_parameters} - The action parameter JSON object with key/values as entered in the deployment page. The Keys depend on the service definition. For example:

    {
      "host" : "some-name",
      "region" : "us-west"
    }
    
  • ${svc_instance.instance_parameters.host} - The particular action parameter key value. Using a subquery to drill down to a particular value.

  • ${svc_instance.service} - The service definition JSON object as available in the service composer source tab.

    Note: The ${svc_instance.service} interpolation interpolates the whole source of the service. The service source might contain other interpolations, the Service composer tries to resolve these nested interpolations, which might sometimes cause undesired errors. So it is not recommended to use ${svc_instance.service}, if used, should be used with caution.

  • ${svc_instance.service.actions[name=provision].input_parameters[name=HybridCloud].options[label=AWS].value} - Using a subquery to drill down to a particular value in the service definition. It gets the value of one of the input parameter options. In this example, it is "HybridCloud", "AWS".

  • ${svc_instance.service.catalog_metadata.category} - Using subquery to drill down to a particular value in the service definition. In this example, it gets the category of the service, "CloudServices".

  • ${svc_instance.owner} - Owner of the service. For example, "admin".

  • ${svc_instance.instance_plan} - Plan name in use for the current instance. For example, "Standard".

  • ${svc_instance.tags} - Tags JSON object with key/value pairs of tag name and values as entered in the Deployment page. Tag key names depend on the service definition. For example:

    {
     "dept" : "FIN"
     "org" : "AAA"
    }
    
  • ${svc_instance.service_action_name} - Current action has been performed. Name maps to action.name in the service definition. For example, "Provision".

  • ${svc_instance.output_parameters.<parameterName>} - Key/value pairs of output parameters received from 'Provision' action. Keys are defined in service definition. These output parameters are available in 'Bind' action. For example:

    {
      "host" : "test01.ibm.com",
      "ipaddress: "9.9.9.9"
    }
    

    You can drill down to a particular key in the output parameters as in the following example:

    `${svc_instance.output_parameters.ipaddress}`
    

    This returns the IP address "9.9.9.9"

    For more information on how to define output parameters, see Creating a service.

  • ${svc_instance.namespace} - The namespace value for a deployed instance.

Service instance level parameters in Error flow

  • In addition to the listed service instance level parameters, the error flow section of the Composition tab supports these interpolations:

    • ${svc_instance.error.message} - Error message for failure
    • ${svc_instance.error.activity_id} - Activity id of the failed activity
    • ${svc_instance.error.activity_type} - Type of failed activity
    • ${svc_instance.error.created_at} - Creation time of the failed activity
    • ${svc_instance.primaryflow.decisions.<decision_id>.selection} - Retrieve data about the decision that got selected at the time of deployment. For example, ${svc_instance.primaryflow.decisions.decision6d43ee5f.selection}.
  • Interpolation of primary flow activity parameters in Error flow:

    The interpolation expression for primary flow activity parameters in Error flow is as follows:

    ${svc_instance.primaryflow.<activity>.<activity_id>.<attribute name>}
    

    Where, activity can be REST Hook, templates, or notifications.

    The 'svc_instance.primaryflow.' prefix can be used with any parameter of REST Hook/template/notification activity from the primary flow. If an ${svc_instance.primaryflow.xxx.xxx.xxx} expression does not exist, then an empty string value is used.

    Note: The ${svc_instance.primaryflow.xxx.xxx.xxx} expression works only from within an error flow section.

  • Example interpolation expressions for the different activities:

    • REST Hook:

      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.payload} - REST Hook payload
      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.status} - REST Hook status
      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.headers.Content-Type} - REST Hook Headers
      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.authentication.type} - REST Hook authentication mechanism
      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.authentication.username} - The username for REST Hook authentication management system.
      • ${svc_instance.primaryflow.resthooks.resthook8a5f70ec.title} - The title of the REST Hook.

      For REST Hook related input and output interpolation expressions, see Input and output parameter mapping for REST Hook.

    • Templates:

      • ${svc_instance.primaryflow.templates.testtemp53db922a.status} - Template status
      • ${svc_instance.primaryflow.templates.testtemp53db922a.output.selected-region} - Template Output: Selected Region
      • ${svc_instance.primaryflow.templates.testtemp53db922a.template_name} - Template Name
      • ${svc_instance.primaryflow.templates.testtemp53db922a.input.sleep} - Template: Input Param Sleep

      For template-related input and output interpolation expressions, see Input output mapping for templates and Helm charts.

    • Notification Status:

      • ${svc_instance.primaryflow.notifications.emailnotbf32ca47.status}
      • ${svc_instance.primaryflow.notifications.emailnotbf32ca47.sender_name}
      • ${svc_instance.primaryflow.notifications.emailnotbf32ca47.title}

      For notification-related input and output interpolation expressions, see Input and output parameter mapping for email notification.