Content Library SubscribedItem sync

Content Library SubscribedItem 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 SubscriptionInfo of the library which owns the library item.

  • If Content Library SubscriptionInfo.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 forceSyncContent parameter.
  • If Content Library SubscriptionInfo.on_demand is false, then this call will always synchronize the file content. The forceSyncContent parameter is ignored when the subscription is not on-demand. When the file content has been synchronized, the Content Library ItemModel.cached property will be true.

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

Returns an authorization error if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.library.Item referenced by the parameter libraryItemId requires ContentLibrary.SyncLibraryItem.
Request
URI
POST
https://{api_host}/api/content/library/subscribed-item/{libraryItemId}?action=sync
COPY
Path Parameters
string
libraryItemId
Required

Identifier of the library item to synchronize.

The parameter must be an identifier for the resource type: com.vmware.content.library.Item.


Request Body

Request body for invoking operation: sync

Show optional properties

{
    "force_sync_content": false
}
{
    "force_sync_content": false,
    "sync_optional_files": false
}
boolean
force_sync_content
Required

Whether to synchronize file content as well as metadata. This parameter applies only if the subscription is on-demand.

boolean
sync_optional_files
Optional

Whether to synchronize optional files. This parameter applies to both types of subscriptions on-demand as well as sync-immediately.

This parameter was added in vSphere API 7.0.3.0.

This parameter is optional because it was added in a newer version than its parent node.

Authentication
This operation uses the following authentication methods.
Responses
204

Success!

Operation doesn't return any data structure

400

Vapi Std Errors InvalidElementType if the library item specified by libraryItemId is not a member of a subscribed library.

Vapi Std Errors NotAllowedInCurrentState if the content of the library item specified by libraryItemId 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.

Returns Vapi Std Errors Error of type(s) application/json
{
    "messages": [
        {
            "id": "string",
            "default_message": "string",
            "args": [
                "string"
            ],
            "params": {
                "params": {
                    "s": "string",
                    "dt": "string",
                    "i": 0,
                    "d": "number",
                    "l": "Vapi Std NestedLocalizableMessage Object",
                    "format": "string",
                    "precision": 0
                }
            },
            "localized": "string"
        }
    ],
    "data": {},
    "error_type": "string"
}
array of object
messages
Required

Stack of one or more localizable messages for human error consumers.

The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.

Each subsequent message in the stack describes the "cause" of the prior message.

object
data
Optional

Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.

Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.

The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.

Some operations will not set this property when reporting errors.

string
error_type
Required

Discriminator field to help API consumers identify the structure type.

For more information see: Vapi Std Errors Error Type.

This property was added in vSphere API 6.7.2.

Can be missing or null for compatibility with preceding implementations.


404

if the library item specified by libraryItemId could not be found.

Returns Vapi Std Errors NotFound of type(s) application/json
This response body class contains all of the following: InlineVapi Std Errors NotFound0
"Vapi Std Errors NotFound Object"

Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"force_sync_content:"boolean"}' https://{api_host}/api/content/library/subscribed-item/{libraryItemId}?action=sync