Shared parameters in local Template Designer

You can add shared parameters that are defined in Managed services as default values for variables or create new shared parameters.

Procedure

Add shared parameters defined in Managed services

  1. In the service composer canvas, select an object.
  2. From the menu icons, select Edit variables.
  3. In the Variables page, select and right-click a variable.
  4. Click Edit from the context menu.
  5. In the Edit variable page, select Link to shared parameter to link the Default value to a shared parameter. The Data type field is displayed. It connects with Managed services Server and displays all the available data types in a drop-down list.
  6. Select a Data type.
  7. Select the Attribute and click OK. The Attribute is the data object that is associated with the Data type. The Default is populated with the selected shared data object value automatically.
  8. In the Variables page, click OK.
  9. Go to the camvariables.json tab to verify. The input_datatypes and the corresponding default value of the variable. Example:

    {
      "input_datatypes": [ {
      "name": "aws_cloud",
      "label": "aws_cloud"
      }],
    

    In addition, you can view the value for the default with the selected shared Data Object value for "Aws Instance Ami" variable.

     "template_input_params": [
     {
       "name": "aws_access_id
       ...
       ...
       "default": "${aws_cloud.centos-ami}",
       ...
       ...
     },
    

Create new shared parameters in the local Template Designer user interface

  1. Right-click your Project, then select New > Folder in the context menu.
  2. In the Add Folder to "Project name", enter the Name and Description. The Name must be "datatypes"
  3. Click Save.
  4. Right-click your Project and in the context menu of the newly created folder, select New > Other.
  5. In the Add Other to project/Datatype folder name/, enter Name and Description.
  6. Enter "Json" for the Subtype and click Save.
  7. In the JSON file, enter the details to create a new datatype.

    Example of a JSON object is as follows:

     {
     "name": "SPB_Local_Data_Type_1",
     "label": "SPB Local Data Type 1",
     "description": "local",
     "attributes": [{
         "name": "AvailabilityZone",
         "type": "string",
         "description": "Cloud availability zone",
         "label": "Cloud Availability Zone"
       },
       {
         "name": "CloudZone",
         "type": "string",
         "description": "Cloud Zone",
         "label": "Cloud Zone"
       }
     ]
    }
    

    In this example, a "SPB_Local_Data_type1" Data Type is created. It has two objects, namely AvailabilityZone and CloudZone. If you want to create multiple data types, then you need multiple JSON files, that is, one JSON file per each data type.

  8. In the Edit Variable page, select Link to shared parameter and select the newly created Data Type. For the data type that got created locally, "(local)" is appended to the data type.
  9. Select the Data Objects in the Attribute drop-down list.
  10. After you publish the template that makes use of local data types in Go to Managed services console and click Automate infrastructure>Managed services, you can see the data types and data objects in the Shared Parameters page of Managed services.