Check In Library Items Check Outs
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
Checks in a virtual machine into the library item. This operation updates the library item to contain the virtual machine being checked in as a template. This template becomes the latest version of the library item. The previous virtual machine template contained in the library item is available as a backup and its information can be queried using the Versions service. At most one previous version of a virtual machine template is retained in the library item.
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 VirtualMachine referenced by the parameter vm requires System.Read.
Request
URL
POST
https://{api_host}/rest/vcenter/vm-template/library-items/{template_library_item}/check-outs/{vm}?action=check-in
Parameters
string
template_library_item
Required
Identifier of the content library item in which the virtual machine is checked in.
The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
string
vm
Required
Identifier of the virtual machine to check into the library item.
The parameter must be an identifier for the resource type: VirtualMachine.
Header Parameters
string
vmware-api-session-id
Required
Example: b00db39f948d13ea1e59b4d6fce56389
Request Body
VmTemplateLibraryItemsCheckOutsCheckInRequestBody of type
application/json (required)
{
"spec": {
"message": "string"
}
}
spec
Required
Specification used to check in the virtual machine into 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
VmTemplateLibraryItemsCheckOutsCheckInResponseBody
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
400
com.vmware.vapi.std.errors.invalid_argument : if any of the specified parameters are invalid.
if the virtual machine identified by vm was not checked out of the item specified by templateLibraryItem.
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.
404
com.vmware.vapi.std.errors.not_found : if the item specified by templateLibraryItem does not exist.
if the virtual machine specified by vm does not exist. | com.vmware.vapi.std.errors.resource_inaccessible : if there is an error accessing a file from the virtual machine. | 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 the operation cannot be performed because of the virtual machine's current state. For example, if the virtual machine is not powered off.