Create Library Item
Creates a library item in content library from a virtual machine or virtual appliance. This operation creates a library item in content library whose content is an OVF package derived from a source virtual machine or virtual appliance, using the supplied create specification. The OVF package may be stored as in a newly created library item or in an in an existing library item. For an existing library item whose content is updated by this operation, the original content is overwritten. Meta data such as name and description is not updated for the exisitng library item.
if you do not have all of the privileges described as follows: - Operation execution requires System.Read. - The resource null or null referenced by the attribute LibraryItem.DeployableIdentity.id requires VApp.Export. - The resource com.vmware.content.Library referenced by the attribute LibraryItem.CreateTarget.library-id requires ContentLibrary.AddLibraryItem. - The resource com.vmware.content.library.Item referenced by the attribute LibraryItem.CreateTarget.library-item-id requires System.Read.
Request
URLURL
Header Parameters
Header Parameters
Client-generated token used to retry a request if the client fails to get a response from the server. If the original request succeeded, the result of that request will be returned, otherwise the operation will be retried. If unset, the server will create a token.
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.
{
"create_spec": {},
"source": {
"id": "string",
"type": "string"
},
"target": {
"library_id": "string"
}
}
Information used to create the OVF package from the source virtual machine or virtual appliance.
Identifier of the virtual machine or virtual appliance to use as the source.
Specification of the target content library and library item.
Authentication
Response
Response BodyResponse Body
Information about the success or failure of the operation, along with the details of the result or failure.
{
"error": {
"errors": [
{
"category": "VALIDATION",
"error": {},
"issues": [
{
"category": "VALUE_ILLEGAL",
"column_number": 0,
"file": "string",
"line_number": 0,
"message": {
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
}
}
],
"message": {
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
},
"name": "string",
"value": "string"
}
],
"information": [
{
"messages": [
{
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
}
]
}
],
"warnings": [
{
"category": "VALIDATION",
"error": {},
"issues": [
{
"category": "VALUE_ILLEGAL",
"column_number": 0,
"file": "string",
"line_number": 0,
"message": {
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
}
}
],
"message": {
"args": [
"string"
],
"default_message": "string",
"id": "string",
"localized": "string",
"params": {
"key": {
"d": 0,
"dt": "string",
"format": "SHORT_DATE",
"i": 0,
"l": {
"id": "string",
"params": "StdLocalizationParam Object"
},
"precision": 0,
"s": "string"
}
}
},
"name": "string",
"value": "string"
}
]
},
"ovf_library_item_id": "string",
"succeeded": false
}
Whether the LibraryItem.create operation completed successfully.
Errors, warnings, and informational messages produced by the LibraryItem.create operation. If unset, no errors, warnings, or informational messages were reported by the LibraryItem.create operation.
Identifier of the created or updated library item. If unset, the LibraryItem.create operation failed and LibraryItem.CreateResult.error will describe the error(s) that caused the failure. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.content.library.Item. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.content.library.Item.
Errors
com.vmware.vapi.std.errors.invalid_argument : if createSpec contains invalid arguments. if source describes an unexpected resource type. | com.vmware.vapi.std.errors.not_allowed_in_current_state : if the operation cannot be performed because of the specified virtual machine or virtual appliance’s current state. For example, if the virtual machine configuration information is not available, or if the virtual appliance is running.
com.vmware.vapi.std.errors.not_found : if the virtual machine or virtual appliance specified by source does not exist. if the library or library item specified by target does not exist.
com.vmware.vapi.std.errors.resource_inaccessible : if there was an error accessing a file from the source virtual machine or virtual appliance. | com.vmware.vapi.std.errors.resource_busy : if the specified virtual machine or virtual appliance is busy.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/com/vmware/vcenter/ovf/library-item
x-vmw-doc-operation: create