REST API - create
com.vmware.vcenter.ovf.library_item
create
POST /com/vmware/vcenter/ovf/library-item |
POST /com/vmware/vcenter/ovf/library-item?~action=create |
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.
- Request:
-
- Representations:
{
"client_token": "string",
"create_spec": {
"description": "string",
"flags": [
"string",
"string"
],
"name": "string"
},
"source": {
"id": "obj-103",
"type": "string"
},
"target": {
"library_id": "obj-103",
"library_item_id": "obj-103"
}
}<?xml version="1.0" ?>
<ns0:Create-Input xmlns:ns0="http://vmware.com/vcenter/ovf/library_item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<create_spec>
<flags-array>
<array-item>string</array-item>
<array-item>string</array-item>
</flags-array>
<description>string</description>
<name>string</name>
</create_spec>
<source>
<id>obj-103</id>
<type>string</type>
</source>
<client_token>string</client_token>
<target>
<library_id>obj-103</library_id>
<library_item_id>obj-103</library_item_id>
</target>
</ns0:Create-Input>POST /com/vmware/vcenter/ovf/library-item
?create_spec.flags.1=string
&create_spec.flags.2=string
&create_spec.description=string
&create_spec.name=string
&source.id=obj-103
&source.type=string
&client_token=string
&target.library_id=obj-103
&target.library_item_id=obj-103- Parameters:
Name Type Required Description client_token string No 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. source *
deployable_identity Yes Identifier of the virtual machine or virtual appliance to use as the source. target *
create_target Yes Specification of the target content library and library item. create_spec *
create_spec Yes Information used to create the OVF package from the source virtual machine or virtual appliance. - Response:
-
- Representations:
{
"value": {
"error": {
"errors": [
{},
{}
],
"information": [
{
"messages": [
{
"args": [
"string",
"string"
],
"default_message": "string",
"id": "string"
},
{
"args": [
"string",
"string"
],
"default_message": "string",
"id": "string"
}
]
},
{
"messages": [
{
"args": [
"string",
"string"
],
"default_message": "string",
"id": "string"
},
{
"args": [
"string",
"string"
],
"default_message": "string",
"id": "string"
}
]
}
],
"warnings": [
{},
{}
]
},
"ovf_library_item_id": "obj-103",
"succeeded": true
}
}<?xml version="1.0" ?>
<ns0:Create-Result xmlns:ns0="http://vmware.com/vcenter/ovf/library_item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<value>
<succeeded>true</succeeded>
<error>
<information-array>
<array-item>
<messages-array>
<array-item>
<default_message>string</default_message>
<id>string</id>
<args-array>
<array-item>string</array-item>
<array-item>string</array-item>
</args-array>
</array-item>
<array-item>
<default_message>string</default_message>
<id>string</id>
<args-array>
<array-item>string</array-item>
<array-item>string</array-item>
</args-array>
</array-item>
</messages-array>
</array-item>
<array-item>
<messages-array>
<array-item>
<default_message>string</default_message>
<id>string</id>
<args-array>
<array-item>string</array-item>
<array-item>string</array-item>
</args-array>
</array-item>
<array-item>
<default_message>string</default_message>
<id>string</id>
<args-array>
<array-item>string</array-item>
<array-item>string</array-item>
</args-array>
</array-item>
</messages-array>
</array-item>
</information-array>
<errors-array>
<array-item>
</array-item>
<array-item>
</array-item>
</errors-array>
<warnings-array>
<array-item>
</array-item>
<array-item>
</array-item>
</warnings-array>
</error>
<ovf_library_item_id>obj-103</ovf_library_item_id>
</value>
</ns0:Create-Result>- Parameters:
Name Type Required Description result create_result Yes Information about the success or failure of the operation, along with the details of the result or failure. - Errors:
-
Type Description HTTP Status Code invalid_argument if create_spec
contains invalid arguments.400 not_found if the virtual machine or virtual appliance specified by source
does not exist.404 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. 400 resource_inaccessible if there was an error accessing a file from the source virtual machine or virtual appliance. 400 resource_busy if the specified virtual machine or virtual appliance is busy. 400
Copyright © 2014. All Rights Reserved.