com.vmware.content.library.item

The item service provides operations for managing library items.

copy

POST /com/vmware/content/library/item/id:{source_library_item_id}?~action=copy
POST /com/vmware/content/library/item?~action=copy

Copies a library item.

Copying a library item allows a duplicate to be made within the same or different library. The copy occurs by first creating a new library item, whose identifier is returned. The content of the library item is then copied asynchronously. This copy can be tracked as a task.

If the copy fails, Content Library Service will roll back the copy by deleting any content that was already copied, and removing the new library item. A failure during rollback may require manual cleanup by an administrator.

A library item cannot be copied into a subscribed library.

Request:
Representations:
{
    "client_token""string",
    "destination_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"
    },
    "source_library_item_id""obj-103"
}
<?xml version="1.0" ?>
<ns0:Copy-Input xmlns:ns0="http://vmware.com/content/library/item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <destination_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>
  </destination_create_spec>
  <client_token>string</client_token>
  <source_library_item_id>obj-103</source_library_item_id>
</ns0:Copy-Input>
POST /com/vmware/content/library/item?~action=copy
&destination_create_spec.cached=true
&destination_create_spec.library_id=obj-103
&destination_create_spec.source_id=obj-103
&destination_create_spec.metadata_version=string
&destination_create_spec.type=string
&destination_create_spec.last_sync_time=2013-06-06T22%3A13%3A05
&destination_create_spec.version=string
&destination_create_spec.size=10
&destination_create_spec.id=obj-103
&destination_create_spec.content_version=string
&destination_create_spec.description=string
&destination_create_spec.last_modified_time=2013-06-06T22%3A13%3A05
&destination_create_spec.name=string
&destination_create_spec.creation_time=2013-06-06T22%3A13%3A05
&client_token=string
&source_library_item_id=obj-103

Parameters:
Name Type Required Description
client_token string No A unique token generated on the client for each copy 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 copy.
source_library_item_id
 *
ID Yes Identifier of the existing library item from which the content will be copied. Id of type com.vmware.content.library.Item.
destination_create_spec
 *
item_model Yes Specification for the new library item to be created.

Response:
Representations:
{
    "value""obj-103"
}
<?xml version="1.0" ?>
<ns0:Copy-Result xmlns:ns0="http://vmware.com/content/library/item" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <value>obj-103</value>
</ns0:Copy-Result>

Parameters:
Name Type Required Description
result ID Yes The identifier of the new library item into which the content is being copied. Id of type com.vmware.content.library.Item.

Errors:
Type Description HTTP Status Code
not_found if the library item with source_library_item_id does not exist, or if the library referenced by the com.vmware.content.library.item_model.library_id property of destination_create_spec 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 destination_create_spec refers to a subscribed library. 400
resource_inaccessible if the copy operation failed because the source or destination library item is not accessible. 400

Copyright © 2014. All Rights Reserved.