REST API - create
com.vmware.content.library.item
create
POST /com/vmware/content/library/item |
POST /com/vmware/content/library/item?~action=create |
Creates a new library item.
A new library item is created without any content. After creation, content can be added through the com.vmware.content.library.item.update_session and com.vmware.content.library.item.updatesession.file services.
A library item cannot be created in a subscribed library.
- Request:
-
- Representations:
{
"client_token": "string",
"create_spec": {
"cached": true,
"content_version": "string",
"creation_time": "2013-06-06T22:13:05",
"description": "string",
"id": "obj-103",
"last_modified_time": "2013-06-06T22:13:05",
"last_sync_time": "2013-06-06T22:13:05",
"library_id": "obj-103",
"metadata_version": "string",
"name": "string",
"size": 10,
"source_id": "obj-103",
"type": "string",
"version": "string"
}
}<?xml version="1.0" ?>
<ns0:Create-Input xmlns:ns0="http://vmware.com/content/library/item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<create_spec>
<cached>true</cached>
<library_id>obj-103</library_id>
<source_id>obj-103</source_id>
<metadata_version>string</metadata_version>
<type>string</type>
<last_sync_time>2013-06-06T22:13:05</last_sync_time>
<version>string</version>
<size>10</size>
<id>obj-103</id>
<content_version>string</content_version>
<description>string</description>
<last_modified_time>2013-06-06T22:13:05</last_modified_time>
<name>string</name>
<creation_time>2013-06-06T22:13:05</creation_time>
</create_spec>
<client_token>string</client_token>
</ns0:Create-Input>POST /com/vmware/content/library/item
?create_spec.cached=true
&create_spec.library_id=obj-103
&create_spec.source_id=obj-103
&create_spec.metadata_version=string
&create_spec.type=string
&create_spec.last_sync_time=2013-06-06T22%3A13%3A05
&create_spec.version=string
&create_spec.size=10
&create_spec.id=obj-103
&create_spec.content_version=string
&create_spec.description=string
&create_spec.last_modified_time=2013-06-06T22%3A13%3A05
&create_spec.name=string
&create_spec.creation_time=2013-06-06T22%3A13%3A05
&client_token=string- Parameters:
Name Type Required Description client_token string No A unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example: b8a2a2e3-2314-43cd-a871-6ede0f429751
. This token can be used to guarantee idempotent creation.create_spec *
item_model Yes Specification that defines the properties of the new library item. - Response:
-
- Representations:
- Parameters:
Name Type Required Description result ID Yes Identifier of the new library item. Id of type com.vmware.content.library.Item. - Errors:
-
Type Description HTTP Status Code not_found if the com.vmware.content.library.item_model.library_id property of create_spec
refers to a library that does not exist.404 invalid_argument if one of the following is true for the new library item: - name is empty
- name exceeds 80 characters
- description exceeds 1024 characters
400 invalid_element_type if the com.vmware.content.library.item_model.library_id property of destinationCreateSpec
refers to a subscribed library.400
Copyright © 2014. All Rights Reserved.