REST API - sync

content library subscribed item: sync

Forces the synchronization of an individual library item in a subscribed library.

Synchronizing an individual item will update that item's metadata from the remote source. If the source library item on the remote library has been deleted, this operation will delete the library item from the subscribed library as well.

The default behavior of the synchronization is determined by the content.library.subscription_info of the library which owns the library item.

  • If content.library.subscription_info.on_demand is true, then the file content is not synchronized by default. In this case, only the library item metadata is synchronized. The file content may still be forcefully synchronized by passing true for the force_sync_content parameter.
  • If content.library.subscription_info.on_demand is false, then this call will always synchronize the file content. The force_sync_content parameter is ignored when the subscription is not on-demand.
When the file content has been synchronized, the content.library.item_model.cached field will be true.

This operation will return immediately and create an asynchronous task to perform the synchronization.

Request:

HTTP request

POST https://{server}/rest/com/vmware/content/library/subscribed-item/id:{library_item_id}?~action=sync

Path Parameters

Name Type Description
Required
library_item_id string Identifier of the library item to synchronize.

Request Body Structure:

{
    "force_sync_content"true
}

Request Body Parameters:

Name Type Description
bold = required
force_sync_content boolean Whether to synchronize file content as well as metadata. This parameter applies only if the subscription is on-demand.

Response:

HTTP Status Code: 200

None

Errors:

HTTP Status Code Type Description
404 not_found if the library item specified by library_item_id could not be found.
400 invalid_element_type if the library item specified by library_item_id is not a member of a subscribed library.
400 not_allowed_in_current_state if the content of the library item specified by library_item_id has been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.

For instance, this {@term error) is reported on synchronizing a library item in a subscribed library that was restored from backup, and the library item was deleted after backup, thus resulting in its content being deleted from the associated storage backings. In this scenario, the metadata of the library item is present on a restore, while its content has been deleted.