Rollback Library Items Versions
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Released in v6.9.1
Description
Rollbacks a library item containing a virtual machine template to a previous version. The virtual machine template at the specified version becomes the latest virtual machine template with a new version identifier.
if you do not have all of the privileges described as follows:
- Operation execution requires System.Read.
- The resource com.vmware.content.library.Item referenced by the parameter templateLibraryItem requires ContentLibrary.CheckInTemplate.
- The resource com.vmware.content.library.item.Version referenced by the parameter version requires System.Read.
Request
URL
POST
https://{api_host}/rest/vcenter/vm-template/library-items/{template_library_item}/versions/{version}?action=rollback
Parameters
string
template_library_item
Required
Identifier of the VM template library item.
The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
string
version
Required
Version of the library item to rollback.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.Version.
Header Parameters
string
vmware-api-session-id
Required
Example: b00db39f948d13ea1e59b4d6fce56389
Request Body
VmTemplateLibraryItemsVersionsRollbackRequestBody of type
application/json (required)
{
"spec": {
"message": "string"
}
}
spec
Required
Specification to rollback the library item.
This parameter is currently required. In the future, if this parameter is unset, the system will apply suitable defaults.
Response
Response Body
200 OK returns
VmTemplateLibraryItemsVersionsRollbackResponseBody
of type application/json
The new version of the library item.
The result will be an identifier for the resource type: com.vmware.content.library.item.Version.
{
"value": "string"
}
string
value
Optional
The new version of the library item.
The result will be an identifier for the resource type: com.vmware.content.library.item.Version.
cURL Command
Errors
404
com.vmware.vapi.std.errors.not_found : if the library item or version is not found. | com.vmware.vapi.std.errors.error : if the system reports an error while responding to the request.
409
com.vmware.vapi.std.errors.not_allowed_in_current_state : if a virtual machine is checked out of the library item.
400
com.vmware.vapi.std.errors.invalid_argument : if the specified version is the latest version of the library item.
if the library item does not contain a virtual machine template.
401
com.vmware.vapi.std.errors.unauthenticated : if the user that requested the operation cannot be authenticated. | com.vmware.vapi.std.errors.unauthorized : if the user that requested the operation is not authorized to perform the operation.