You use the
catalog service to change a lease. For actions that require user input, you may
need to edit the template prior to submitting the request.
This command leverages the
links for the change lease 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/b5739e30-.../requests/template"
},
{
"@type": "link",
"rel": "POST: {com.vmware...iaas.proxy.provider@resource.action.name.machine.ChangeLease}",
"href": "https://$vRA/api/consumer/resources/dd3...a4a/actions/b5739e30-.../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/b5739e30-871d-48c7-9012-f2a7cf431dc1/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": "b5739e30-871d-48c7-9012-f2a7cf431dc1",
"description": null,
"data": {"provider-ExpirationDate": "2015-07-29T16:44:13.846Z"}
}
-
Edit the template as
desired. The template is populated with default values. In this example, the
value of
provider-ExpirationDate
is set to the time at which the template was requested in UTC. Edit this value
(for example, to change the expiration to a month from now). You may also want
to provide a custom value for the description.
-
Use a POST command to
send the template 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/b5739e30-871d-48c7-9012-f2a7cf431dc1/requests
Accept: application/json
Content-Type: application/json
Authorization: Bearer $token
{
"type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
"resourceId": "dd37b7a1-829c-4773-b5be-b229453eca4a",
"actionId": "b5739e30-871d-48c7-9012-f2a7cf431dc1",
"description": null,
"data": {"provider-ExpirationDate": "2015-08-29T16:44:13.846Z"}
}
Results
This POST command returns a
response indicating success or failure.
HTTP/1.1 201 CREATED
indicates that the request was
submitted successfully.