7.2

Table Of Contents
n
Syntax for Updating Cost Information on page 67
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 specic request. For
example, if the blueprint allows for a range of CPU, memory, or storage values, the cost depends on
the value requested.
Procedure
1 List all available work item IDs.
curl --insecure -H "Content-Type: application/json"
-H "Authorization: Bearer $token
https://$host/workitem-service/api/workitems
2 Get details for a specic work item ID.
For example, get the details for work item 5e3e9519-78ea-4409-a52c-e4aa3bc56511.
curl --insecure -H "Content-Type: application/json"
-H "Authorization: Bearer $token
https://$host/workitem-service/api/workitems/5e3e9519-78ea-4409-a52c-e4aa3bc56511
3 Construct a JSON le that contains the work item ID information that you need to approve a machine
request.
a Copy the appropriate JSON input le template to a new le in an XML editor that maintains
formaing.
b Substitute the input variables in the template with the values you obtained for your specic work
item ID, for example 5e3e9519-78ea-4409-a52c-e4aa3bc56511.
c Save the le with a new name, for example, approve.json.
4 Approve the submied machine request by specifying the work item ID and including the JSON le as
part of the command line.
curl --insecure -H "Content-Type: application/json"
-H "Authorization: Bearer $token"
https://$host/workitem-service/api/workitems/5e3e9519-78ea-4409-
a52c-e4aa3bc56511/actions/com.mycompany.csp.core.approval.action.approve
--d @approve.json
If the command is successful, the HTTP status is 201 Created. If the command is not successful, the HTTP
status is 204 No Content.
Syntax for Listing Work Items
You can use the vRealize Automation REST API workitem service to list the unique IDs of all available work
items.
Inputs
Use the supported input parameters to control the command output.
Parameter Description
URL hps://$host/workitem-service/api/workitems
$host Species the host name and fully qualied domain name or IP address of
the vRealize Automation identity server.
$token Species a valid HTTP bearer token with necessary credentials.
Chapter 3 REST API Use Cases
VMware, Inc. 51