The Content Library module provides classes and classes for defining and managing the library’s items, subscription, publication, and storage.
Bases: vmware.vapi.bindings.stub.VapiInterface
The Item class provides methods for managing library items.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The Item.FindSpec class specifies the properties that can be used as a filter to find library items. When multiple attributes are specified, all properties of the item must match the specification.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Resource type for item.
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.
Parameters: |
|
---|---|
Return type: | str |
Returns: | The identifier of the new library item into which the content is being copied. The return value will be an identifier for the resource type: com.vmware.content.library.Item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item with source_library_item_id does not exist, or if the library referenced by the ItemModel.library_id property of destination_create_spec does not exist. |
Raise: |
|
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if the client_token does not conform to the UUID format. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the ItemModel.library_id property of destination_create_spec refers to a subscribed library. |
Raise: | com.vmware.vapi.std.errors_client.ResourceInaccessible if the copy operation failed because the source or destination library item is not accessible. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
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_client.UpdateSession and com.vmware.content.library.item.updatesession_client.File classes.
A library item cannot be created in a subscribed library.
Parameters: |
|
---|---|
Return type: | str |
Returns: | Identifier of the new library item. The return value will be an identifier for the resource type: com.vmware.content.library.Item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the ItemModel.library_id property of create_spec refers to a library that does not exist. |
Raise: |
|
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if the client_token does not conform to the UUID format. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the ItemModel.library_id property of destinationCreateSpec refers to a subscribed library. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Deletes a library item.
This method will immediately remove the item from the library that owns it. The content of the item will be asynchronously removed from the storage backings. The content deletion can be tracked with a task. In the event that the task fails, an administrator may need to manually remove the files from the storage backing.
This method cannot be used to delete a library item that is a member of a subscribed library. Removing an item from a subscribed library requires deleting the item from the original published local library and syncing the subscribed library.
Parameters: | library_item_id (str) – Identifier of the library item to delete. The parameter must be an identifier for the resource type: com.vmware.content.library.Item. |
---|---|
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the library item with the given library_item_id is a member of a subscribed library. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item with the specified library_item_id does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Returns identifiers of all the visible (as determined by authorization policy) library items matching the requested Item.FindSpec.
Parameters: | spec (Item.FindSpec) – Specification describing what properties to filter on. |
---|---|
Return type: | list of str |
Returns: | The list of identifiers of all the visible library items matching the given spec. The return value will contain identifiers for the resource type: com.vmware.content.library.Item. |
Raise: | com.vmware.vapi.std.errors_client.InvalidArgument if no properties are specified in the spec. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Returns the ItemModel with the given identifier.
Parameters: | library_item_id (str) – Identifier of the library item to return. The parameter must be an identifier for the resource type: com.vmware.content.library.Item. |
---|---|
Return type: | |
Returns: | The ItemModel instance with the given library_item_id. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if no item with the given library_item_id exists. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Returns the identifiers of all items in the given library.
Parameters: | library_id (str) – Identifier of the library whose items should be returned. The parameter must be an identifier for the resource type: com.vmware.content.Library. |
---|---|
Return type: | list of str |
Returns: | The list of identifiers of the items in the library specified by library_id. The return value will contain identifiers for the resource type: com.vmware.content.library.Item. |
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library associated with library_id does not exist. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Updates the specified properties of a library item.
This is an incremental update to the library item. Attributes that are None in the update specification are left unchanged.
This method cannot update a library item that is a member of a subscribed library. Those items must be updated in the source published library and synchronized to the subscribed library.
Parameters: |
|
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item specified by library_item_id does not exist. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the library item corresponding to library_item_id is a member of a subscribed library. |
Raise: |
|
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.struct.VapiStruct
The ItemModel class represents a library item that has been stored in a library.
A ItemModel represents a single logical unit to be managed within a com.vmware.content_client.LibraryModel. Items contain the actual content of a library, and their placement within a library determines policies that affect that content such as publishing.
A library item can have a specified type, indicated with the ItemModel.type attribute. This property is associated with a Content Library Service plugin that supports specific types and provides additional services. The types available in a specific Content Library Service can be queried using the com.vmware.content_client.Type class. Items of an unknown or unspecified type are treated generically. Because subscribed library catalogs are synchronized as is, subscribing to a remote Content Library Service effectively gives you a library with the functionality of the remote service’s type adapter plugins, even if they are not installed locally.
Items can be managed using the Item class and, for items in subscribed libraries, the SubscribedItem class.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The OptimizationInfo class defines different optimizations and optimization parameters applied to particular library.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: | optimize_remote_publishing (bool) – If set to true then library would be optimized for remote publishing. Turn it on if remote publishing is dominant use case for this library. Remote publishing means here that publisher and subscribers are not the part of the same Vcenter SSO domain. Any optimizations could be done as result of turning on this optimization during library creation. For example, library content could be stored in different format but optimizations are not limited to just storage format. Note, that value of this toggle could be set only during creation of the library and you would need to migrate your library in case you need to change this value (optimize the library for different use case). This attribute is optional for the create method. If not specified for the create, the default is for the library to not be optmized for specific use case. It is not used for the update method. |
---|
Bases: vmware.vapi.bindings.struct.VapiStruct
The PublishInfo class defines how a local library is published publicly for synchronization to other libraries.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The PublishInfo.AuthenticationMethod class indicates how a subscribed library should authenticate to the published library endpoint.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the AuthenticationMethod instance. |
---|
Require HTTP Basic authentication matching a specified username and password.
Require no authentication.
Bases: vmware.vapi.bindings.struct.VapiStruct
The StorageBacking class defines a storage location where content in a library will be stored. The storage location can either be a Datastore or Other type.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
The StorageBacking.Type class specifies the type of the StorageBacking.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the Type instance. |
---|
The content of the library will be stored on a datastore.
These are vCenter Server managed datastores, and are logical containers that hide specifics of each storage device. Depending on the type of storage you use, datastores can be backed by the following file system formats:
The content of the library will be stored on a remote file system.
Supports the following remote file systems:
Bases: vmware.vapi.bindings.stub.VapiInterface
The SubscribedItem class manages the unique features of library items that are members of a subscribed library.
Parameters: | config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub. |
---|
Evicts the cached content of a library item in a subscribed library.
This method allows the cached content of a library item to be removed to free up storage capacity. This method will only work when a library item is synchronized on-demand. When a library is not synchronized on-demand, it always attempts to keep its cache up-to-date with the published source. Evicting the library item will set ItemModel.cached to false.
Parameters: | library_item_id (str) – Identifier of the library item whose content should be evicted. The parameter must be an identifier for the resource type: com.vmware.content.library.Item. |
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item specified by library_item_id does not exist. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the library item specified by library_item_id is not a member of a subscribed library. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementConfiguration if the library item specified by library_item_id is a member of a subscribed library that does not synchronize on-demand. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
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 method will delete the library item from the subscribed library as well.
The default behavior of the synchronization is determined by the SubscriptionInfo of the library which owns the library item.
When the file content has been synchronized, the ItemModel.cached attribute will be true.
This method will return immediately and create an asynchronous task to perform the synchronization.
Parameters: |
|
---|---|
Raise: | com.vmware.vapi.std.errors_client.NotFound if the library item specified by library_item_id could not be found. |
Raise: | com.vmware.vapi.std.errors_client.InvalidElementType if the library item specified by library_item_id is not a member of a subscribed library. |
Raise: | com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:
|
Bases: vmware.vapi.bindings.struct.VapiStruct
The SubscriptionInfo class defines the subscription behavior for a subscribed library.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: |
|
---|
Bases: vmware.vapi.bindings.enum.Enum
Indicate how the subscribed library should authenticate with the published library endpoint.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: | string (str) – String value for the AuthenticationMethod instance. |
---|
Require HTTP Basic authentication matching a specified username and password.
Require no authentication.