Create Library Items Deprecated
Creates a library item in content library from a virtual machine. This operation creates a library item in content library whose content is a virtual machine template created from the source virtual machine, using the supplied create specification. The virtual machine template is stored in a newly created 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 referenced by the attribute LibraryItems.CreateSpec.library requires ContentLibrary.AddLibraryItem. - The resource VirtualMachine referenced by the attribute LibraryItems.CreateSpec.source-vm requires System.Read. - The resource Datastore referenced by the attribute LibraryItems.CreateSpecVmHomeStorage.datastore requires System.Read. - The resource com.vmware.spbm.StorageProfile referenced by the attribute LibraryItems.CreateSpecVmHomeStoragePolicy.policy requires System.Read. - The resource Datastore referenced by the attribute LibraryItems.CreateSpecDiskStorage.datastore requires System.Read. - The resource com.vmware.spbm.StorageProfile referenced by the attribute LibraryItems.CreateSpecDiskStoragePolicy.policy requires System.Read. - The resource com.vmware.vcenter.vm.hardware.Disk referenced by the map key of attribute LibraryItems.CreateSpec.disk-storage-overrides requires System.Read. - The resource Folder referenced by the attribute LibraryItems.CreatePlacementSpec.folder requires System.Read. - The resource ResourcePool referenced by the attribute LibraryItems.CreatePlacementSpec.resource-pool requires System.Read. - The resource HostSystem referenced by the attribute LibraryItems.CreatePlacementSpec.host requires System.Read. - The resource ClusterComputeResource referenced by the attribute LibraryItems.CreatePlacementSpec.cluster requires System.Read.
Request
URLURL
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
This is a request body class for an operation.
{
"spec": {
"library": "string",
"name": "string",
"placement": {},
"source_vm": "string"
}
}
information used to create the library item from the source virtual machine.
Authentication
Response
Response BodyResponse Body
Identifier of the newly created library item. The result will be an identifier for the resource type: com.vmware.content.library.Item.
{
"value": "string"
}
Identifier of the newly created library item. The result will be an identifier for the resource type: com.vmware.content.library.Item.
Errors
com.vmware.vapi.std.errors.already_exists : if an entity with the name specified by LibraryItems.CreateSpec.name already exists in the folder specified by LibraryItems.CreatePlacementSpec.folder. | com.vmware.vapi.std.errors.invalid_argument : if LibraryItems.CreateSpec contains invalid arguments. | com.vmware.vapi.std.errors.not_allowed_in_current_state : if the operation cannot be performed because of the source virtual machine’s current state. | com.vmware.vapi.std.errors.resource_in_use : if the source virtual machine is busy.
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.
com.vmware.vapi.std.errors.not_found : if the source virtual machine specified by LibraryItems.CreateSpec.source-vm does not exist. if the library specified by LibraryItems.CreateSpec.library does not exist.
com.vmware.vapi.std.errors.error : if the system reports an error while responding to the request. | com.vmware.vapi.std.errors.resource_inaccessible : if there was an error accessing a file from the source virtual machine. | com.vmware.vapi.std.errors.unable_to_allocate_resource : if any of the resources needed to create the virtual machine template could not be allocated.
com.vmware.vapi.std.errors.service_unavailable : if any of the services involved in the operation are unavailable.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
cURL Command
Vendor Extensions
x-vmw-doc-new-method: post
x-vmw-doc-new-path: /api/vcenter/vm-template/library-items
x-vmw-doc-operation: create