You use the
catalog service to perform a power off action. For simple actions that require
no user input, the process is straightforward.
This command leverages the
links for the power off action from the command used in the
Syntax for Navigating to the Children of a Deployed Resource
example.
{
"@type": "link",
"rel": "GET Template: {[email protected]}",
"href": "https://$vRA/api/consumer/resources/dd3...a4a/actions/02ba...e38/requests/template"
},
{
"@type": "link",
"rel": "POST: {com.vmware..iaas.proxy.provider@resource.action.name.machine.PowerOff}",
"href": "https://$vRA/api/consumer/resources/dd3...a4a/actions/02b...e38/requests"
}
Procedure
-
Get the template
for the resource action request.
$curl --insecure -s -H "Content-Type: multipart/form-data" -H "Authorization: Bearer $token" https://$vRA/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests/template
-
Examine the response.
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Cache-Control: no-cache, no-store
Pragma: no-cache
Expires: Sat, 01 August 2015 23:04:50 GMT
Content-Type: application/json;charset=UTF-8
Date: Sat, 01 August 2015 13:04:50 GMT
{
"type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
"resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a",
"actionId": "02bad06d-f92b-4cf8-b964-37bb5d57be38",
"description": null,
"data": {
"description": null,
"reasons": null
}
}
-
Edit the template as
desired. The template is populated with default values. For example, you may
want to provide custom values for the description and reasons.
-
Use a POST command to
send the template without modification to the corresponding URI.
$curl --verbose --insecure -s -H" Content-Type: multipart/form-data" -H "Authorization: Bearer $token"https://$vRA/catalog-service/api/consumer/resources/dd37b7a1-829c-4773-b5be-b229453eca4a/actions/02bad06d-f92b-4cf8-b964-37bb5d57be38/requests
{
"type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
"resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a",
"actionId": "02bad06d-f92b-4cf8-b964-37bb5d57be38",
"description": null,
"data": {
"description": null,
"reasons": null
}
}
Results
This POST command returns a
response indicating success or failure.
HTTP/1.1 201 CREATED
indicates that the request was
submitted successfully.