Outputs

The outputs that are used to provide useful information such as resource properties. You can use API to obtain this information.

Syntax

Each output item consists of a UUID and a description.
  • All output descriptions are enclosed in braces {}.
  • Multiple output items are separated with commas ,.
The key fields of Outputs are as follows.
Key Field Description Required Example
Description The string that describes the output. No
  • "Description" : "print l3 network"
  • For more information, see Description
Value The content of the output. Yes
  • "Value" : {"Ref": "WebServer1"}
  • For more information, see Value

Example

The following example shows the Outputs syntax.
"Outputs" : {
    "UUID-1" : {
        "Description" : "The output description",
        "Value" : "The output content"
    },
    "UUID-2" : {
        "Description" : "The output description",
        "Value" : "The output content"
    }
}
In this example, two outputs are declared in Outputs. The description of key fields are as follows:
  • Output UUID
    • The output UUID is unique in a template.
  • Description
    • The description of the output item. The description must be a string.
  • Value
    • The content of the output.
    • The following example shows the Value syntax.
      {
      	"ZStackTemplateFormatVersion": "2018-06-18",
      	"Description": "This template creates a VM instance with a volume attached (based on the local storage). Prerequisites: The instance offering, image, disk offering, private network, and available host are created.",
      	"Parameters": {
      	    "InstanceOfferingUuid": {
      	        "Type": "String",
                     "Label": "Instance Offering",
      		 "Description": "The instance offering uuid"
      	    },
      	    "ImageUuid": {
      		 "Type": "String",
                     "Label": "Image",
      		 "Description": "The Image uuid for creating VmInstance. Please choose an image not iso"
      	    },
      	    "PrivateNetworkUuid": {
      		 "Type": "String",
                     "Label": "Private Network",
      		 "Description" : "The private network uuid for creating VmInstance"
                 },
      	    "DiskOfferingUuid": {
      		 "Type": "String",
                     "Label": "Disk Offering",
      		 "Description": "Volume size offering uuid"
      	    },
      	    "HostUuid": {
      		 "Type": "String",
                     "Label": "Host",
      		 "Description": "Host uuid, that vm will start on"
      	    }
      	},
      	"Resources": {
      	    "VmInstance": {
      		 "Type": "ZStack::Resource::VmInstance",
      		 "Properties": {
      		     "name": {"Fn::Join":["-",[{"Ref":"ZStack::StackName"},"VM"]]},
      		     "instanceOfferingUuid": {"Ref":"InstanceOfferingUuid"},
      		     "imageUuid":{"Ref":"ImageUuid"},
      		     "l3NetworkUuids":[{"Ref":"PrivateNetworkUuid"}],
      		     "dataDiskOfferingUuids":[{"Ref":"DiskOfferingUuid"}],
      		     "hostUuid":{"Ref":"HostUuid"}
      		 }
      	    }
      	},
      	"Outputs": {
      	    "VmInstance": {
      	        "Value": {
      		     "Ref": "VmInstance"
      		 }
      	    }
      	}
      }

      In this example, there is one output item, which contains the property value of VmInstance.