You can use the composition service to update and display cost information for a deployment. The cost of a deployment is based on which blueprint you request plus details of the specific request. For example, if the blueprint allows for a range of CPU, memory, or storage values, the cost depends on the value requested.

Input

Use the supported input parameters to control the command output.

Parameter

Description

URL

//$host/composition-service/api/blueprints/$BlueprintId/costs/upfront

Method

Post

$host

Specifies the host name and fully qualified domain name or IP address of the vRealize Automation identity server.

$token

Specifies a valid HTTP bearer token with necessary credentials.

HTTP Body

Specifies the blueprint ID for the blueprint for which you are requesting cost information and other information.

  • Blueprint ID: Specifies the blueprint ID.

  • requestedFor: The user for whom this request is being made. Must be the fully qualified user ID.

  • subTenantId: Specifies the subtenant ID associated with the blueprint

  • requestData: Specifies data that identifies the blueprint further.

    • entries

      • Key: The name of the machine on which the blueprint resides.

      • value: Specifies key-value pairs that further identify the blueprint, such as the type of the value, the componentType ID for the item, the classID of the value, and where the blueprint resides. In turn, each entry contains an array of key-value pairs that identify the type of data used to compute the cost that is to be displayed.

        • Values: Specifies an array of type filters.

        • Entries: Specifies a list of key-value pairs that specify the values to be used in computing the cost. For example, the cluster, CPU, and allocated memory to use.

Output

The command output contains property names and values based on the command input parameters.

Property

Description

setupFee

Specifies the one time setup fee associated with the component.

totalLeasePriceInfo

Specifies the minimum cost and maximum cost for the lease period.

averageDailyPriceInfo

Specifies the average daily price, which depends on the reservation available for the component.

count

Specifies the instance count of the component.

memory

Specifies memory requested for this component.

additional

Specifies the additional cost, if any, associated with the component.

cpu

Specifies the cpu requested for the component.

storage

Specifies the storage requested for the component.

componentId

Specifies the component ID, or total cost of the deployment.

Example: curl Command

The following sample command updates and displays the cost of a sample blueprint with one node. The HTTP body is included as part of the command line input.

curl -- insecure -H “Content Type: application/json”
-H "Authorization: Bearer $token" 
https://$host/composition-service/api/blueprints/$BlueprintId/costs/upfront"

{
  "blueprintId": "myblueprintId",
  "requestedFor": "fritz@coke.sqa-horizon.local",
  "subTenantId": "7a961949-13c4-4f3d-9010-66db8da6c51e",
  "requestData": {
    "entries": [
      {
        "key": "vSphere_Machine_1",
        "value": {
          "type": "complex",
          "componentTypeId": "com.vmware.csp.iaas.blueprint.service",
          "classId": "Blueprint.Node",
          "typeFilter": "phanisimple*vSphere_Machine_1",
          "values": {
            "entries": [
              {
                "key": "_cluster",
                "value": {
                  "type": "integer",
                  "value": 3
                }
              },
              {
                "key": "cpu",
                "value": {
                  "type": "integer",
                  "value": 2
                }
              },
              {
                "key": "memory",
                "value": {
                  "type": "integer",
                  "value": 2048
                }
              }
            ]
          }
        }
      }
    ]
  }
}

Example: JSON Output for a Blueprint Cost Update

[{"componentId":"vSphere_Machine_1",
"setupFee":"$0.00",
"totalLeasePriceInfo":{"min":50.0543225806451601,"max":50.0543225806451601,"displayString":"$50.05"},
"averageDailyPriceInfo":{"min":16.6847741935483867,"max":16.6847741935483867,"displayString":"$16.68"},
"count":3
"fieldMap":{"setup_fee":{"min":0,"max":0,"displayString":"$0.00"},
"memory":{"min":8.00,"max":8.00,"displayString":"$8.00"},
"additional":{"min":8.6847741935483867,"max":8.6847741935483867,"displayString":"$8.68"},
"cpu":{"min":0.0,"max":0.0,"displayString":"$0.00"},
"storage":{"min":0,"max":0,"displayString":"$0.00"}}},
{"componentId":"Total","setupFee":"","totalLeasePriceInfo":
{"min":50.0543225806451601,"max":50.0543225806451601,"displayString":"$50.05"},
"averageDailyPriceInfo":{"min":16.6847741935483867,"max":16.6847741935483867,"displayString":"$16.68"},
"count":3,"fieldMap":{}}]