com.vmware.content package¶
Submodules¶
com.vmware.content.library_client module¶
The Content Library module provides classes and classes for defining and managing the library’s items, subscription, publication, and storage.
-
class
com.vmware.content.library_client.Item(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
Itemclass provides methods for managing library items.- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
-
class
DestinationSpec(subscription=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Item.DestinationSpecclass contains information required to publish the library item to a specific subscription. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
subscription (
str) – Identifier of the subscription associated with the subscribed library. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Subscriptions. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Subscriptions.
-
class
FindSpec(name=None, library_id=None, source_id=None, type=None, cached=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Item.FindSpecclass 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
name (
strorNone) – The name of the library item. The name is case-insensitive. SeeItemModel.name. If not specified all library item names are searched.library_id (
strorNone) – The identifier of the library containing the item. SeeItemModel.library_id. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library. If not specified all libraries are searched.source_id (
strorNone) – The identifier of the library item as reported by the publisher. SeeItemModel.source_id. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Item. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Item. If not specified all library items are searched.type (
strorNone) – The type of the library item. The type is case-insensitive. SeeItemModel.type. If not specified all types are searched.cached (
boolorNone) – Whether the item is cached. Possible values are ‘true’ or ‘false’. SeeItemModel.cached. If not specified all library items are searched.
-
RESOURCE_TYPE= 'com.vmware.content.library.Item'¶ Resource type for item.
-
copy(source_library_item_id, destination_create_spec, client_token=None)¶ 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
client_token (
strorNone) – 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. If not specified copy is not idempotent.source_library_item_id (
str) – Identifier of the existing library item from which the content will be copied. The parameter must be an identifier for the resource type:com.vmware.content.library.Item.destination_create_spec (
ItemModel) – Specification for the new library item to be created.
- 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.NotFoundif the library item withsource_library_item_iddoes not exist, or if the library referenced by theItemModel.library_idproperty ofdestination_create_specdoes not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif one of the following is true for the new library item:
name is empty
name exceeds 80 characters
description exceeds 2000 characters
- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif theclient_tokendoes not conform to the UUID format.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeif theItemModel.library_idproperty ofdestination_create_specrefers to a subscribed library.- Raise
com.vmware.vapi.std.errors_client.ResourceInaccessibleif the copy operation failed because the source or destination library item is not accessible.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the content of the source library item specified bysource_library_item_id, or the content of the target library specified by the library ID (seeItemModel.library_id) property ofdestination_create_spechas been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parametersource_library_item_idrequiresSystem.Read.The resource
com.vmware.content.Libraryreferenced by the attributeItemModel.library_idrequiresContentLibrary.AddLibraryItem.
-
create(create_spec, client_token=None)¶ 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.UpdateSessionandcom.vmware.content.library.item.updatesession_client.Fileclasses.A library item cannot be created in a subscribed library.
- Parameters
client_token (
strorNone) – 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. If not specified creation is not idempotent.create_spec (
ItemModel) – Specification that defines the properties of the new library item.
- 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.NotFoundif theItemModel.library_idproperty ofcreate_specrefers to a library that does not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif one of the following is true for the new library item:
name is empty
name exceeds 80 characters
description exceeds 2000 characters
- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif theclient_tokendoes not conform to the UUID format.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeif theItemModel.library_idproperty ofcreate_specrefers to a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the content of the library specified by the library ID (seeItemModel.library_id) property ofcreate_spechas been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.- Raise
com.vmware.vapi.std.errors_client.AlreadyExistsif there is already a library item with same name in the library.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the attributeItemModel.library_idrequiresContentLibrary.AddLibraryItem.
-
delete(library_item_id)¶ 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.InvalidElementTypeif the library item with the givenlibrary_item_idis a member of a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotFoundif the library item with the specifiedlibrary_item_iddoes not exist.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the library item contains a virtual machine template and a virtual machine is checked out of the library item.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.DeleteLibraryItem.
-
find(spec)¶ 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
listofstr- Returns
The
listof identifiers of all the visible library items matching the givenspec. The return value will contain identifiers for the resource type:com.vmware.content.library.Item.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif no properties are specified in thespec.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:Method execution requires
System.Read.The resource
com.vmware.content.Libraryreferenced by the attributeItem.FindSpec.library_idrequiresSystem.Read.
-
get(library_item_id)¶ Returns the
ItemModelwith 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
ItemModelinstance with the givenlibrary_item_id.- Raise
com.vmware.vapi.std.errors_client.NotFoundif no item with the givenlibrary_item_idexists.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresSystem.Read.
-
list(library_id)¶ 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
listofstr- Returns
The
listof identifiers of the items in the library specified bylibrary_id. The return value will contain identifiers for the resource type:com.vmware.content.library.Item.- Raise
com.vmware.vapi.std.errors_client.NotFoundif the library associated withlibrary_iddoes not exist.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibrary_idrequiresSystem.Read.
-
publish(library_item_id, force_sync_content, subscriptions=None)¶ Publishes the library item to specified subscriptions of the library. If no subscriptions are specified, then publishes the library item to all subscriptions of the library. This method was added in vSphere API 6.7.2.
- Parameters
library_item_id (
str) – Library item identifier. The parameter must be an identifier for the resource type:com.vmware.content.library.Item.force_sync_content (
bool) – Whether to synchronize file content as well as metadata. This parameter applies only if the subscription is on-demand.subscriptions (
listofItem.DestinationSpecorNone) – The list of subscriptions to publish this library item to.
- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library item specified bylibrary_item_iddoes not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentIf one or more arguments insubscriptionsis not valid.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library item specified bylibrary_item_idis a member of a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library item specified bylibrary_item_iddoes not belong to a published library.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.PublishLibraryItem.
-
update(library_item_id, update_spec)¶ 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
library_item_id (
str) – Identifier of the library item to update. The parameter must be an identifier for the resource type:com.vmware.content.library.Item.update_spec (
ItemModel) – Specification of the properties to set.
- Raise
com.vmware.vapi.std.errors_client.NotFoundif the library item specified bylibrary_item_iddoes not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeif the library item corresponding tolibrary_item_idis a member of a subscribed library.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentif one of the following is true for the
update_spec:
name is empty
name exceeds 80 characters
description exceeds 2000 characters
version is not equal to the current version of the library item
- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the library item belongs to a published library with JSON persistence enabled (seePublishInfo.persist_json_enabled) and the content of the library item specified bylibrary_item_idhas been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.- Raise
com.vmware.vapi.std.errors_client.AlreadyExistsif there is already a library item with same name in the library.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.UpdateLibraryItem.
-
class
com.vmware.content.library_client.ItemModel(id=None, library_id=None, content_version=None, creation_time=None, description=None, last_modified_time=None, last_sync_time=None, metadata_version=None, name=None, cached=None, size=None, type=None, version=None, source_id=None, security_compliance=None, certificate_verification_info=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
ItemModelclass represents a library item that has been stored in a library.A
ItemModelrepresents a single logical unit to be managed within acom.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.typeattribute. 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 thecom.vmware.content_client.Typeclass. 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
Itemclass and, for items in subscribed libraries, theSubscribedItemclass.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
id (
str) – A unique identifier for this library item. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Item. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Item. This attribute is not used for thecreatemethod. It will not be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.library_id (
str) – The identifier of thecom.vmware.content_client.LibraryModelto which this item belongs. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.content_version (
str) – The latest version of the file content list of this library item. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.item.Version. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.item.Version. This attribute is not used for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.creation_time (
datetime.datetime) – The date and time when this library item was created. This attribute is not used for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.description (
str) – A human-readable description for this library item. This attribute is optional for thecreatemethod. Leaving it None during creation will result in an empty string value. It will always be present in the result of agetorlistmethod. It is optional for theupdatemethod. Leaving it None during update indicates that the description remains unchanged.last_modified_time (
datetime.datetime) –The date and time when the metadata for this library item was last changed.
This attribute is affected by changes to the properties or file content of this item. It is not modified by changes to the tags of the item, or by changes to the library which owns this item. This attribute is not used for the
createmethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.last_sync_time (
datetime.datetime) –The date and time when this library item was last synchronized.
This attribute is updated every time a synchronization is triggered on the library item, including when a synchronization is triggered on the library to which this item belongs. The value is None for a library item that belongs to a local library. This attribute is not used for the
createmethod. It is optional in the return value of thegetorlistmethods. It is not used for theupdatemethod.metadata_version (
str) –A version number for the metadata of this library item.
This value is incremented with each change to the metadata of this item. Changes to name, description, and so on will increment this value. The value is not incremented by changes to the content or tags of the item or the library which owns it. This attribute is not used for the
createmethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.name (
str) –A human-readable name for this library item.
The name may not be None or an empty string. The name does not have to be unique, even within the same library. This attribute must be provided for the
createmethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.cached (
bool) – The status that indicates whether the library item is on disk or not. The library item is cached when all its files are on disk. This attribute is not used for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.size (
long) – The library item size, in bytes. The size is the sum of the size used on the storage backing for all the files in the item. When the library item is not cached, the size is 0. This attribute is not used for thecreatemethod. It is optional in the return value of thegetorlistmethods. It is not used for theupdatemethod.type (
str) –An optional type identifier which indicates the type adapter plugin to use.
This attribute may be set to a non-empty string value that corresponds to an identifier supported by a type adapter plugin present in the Content Library Service. A type adapter plugin, if present for the specified type, can provide additional information and services around the item content. A type adapter can guide the upload process by creating file entries that are in need of being uploaded to complete an item.
The types and plugins supported by the Content Library Service can be queried using the
com.vmware.content_client.Typeclass. This attribute is optional for thecreateandupdatemethods. During creation, if the type is left unspecified, or if the type is specified but does not have a corresponding type support plugin, then the type of the library item is considered to be generic and all data is treated as generic files. During update, if the type is not specified, then it is not updated.version (
str) –A version number that is updated on metadata changes. This value is used to validate update requests to provide optimistic concurrency of changes.
This value represents a number that is incremented every time library item properties, such as name or description, are changed. It is not incremented by changes to the file content of the library item, including adding or removing files. It is also not affected by tagging the library item. This attribute is not used for the
createmethod. It will always be present in the result of agetorlistmethod. It is optional for theupdatemethod. Leaving it None during update indicates that you do not need to detect concurrent updates.source_id (
str) – The identifier of theItemModelto which this item is synchronized to if the item belongs to a subscribed library. The value is None for a library item that belongs to a local library. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Item. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Item. This attribute is not used for thecreatemethod. It is optional in the return value of thegetorlistmethods. It is not used for theupdatemethod.security_compliance (
bool) – Shows the security compliance ofItemModel. This attribute was added in vSphere API 7.0.3.0. This attribute is not used for thecreateandupdatemethods. It will be present in the result of agetorlistmethod.certificate_verification_info (
com.vmware.content.library.item_client.CertificateVerificationInfoorNone) – Certificate verification status andItemModel’s signing certificate . Currently, this field is available only in following cases 1. This item belongs to a secure content library 2. The item is of type ovf. This attribute was added in vSphere API 7.0.3.0. This attribute is not used for thecreateandupdatemethods. It may be present in the result of agetorlistmethod.
-
class
com.vmware.content.library_client.OptimizationInfo(optimize_remote_publishing=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
OptimizationInfoclass 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
truethen 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
VcenterSSO 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
createmethod. If not specified for thecreate, the default is for the library to not be optmized for specific use case. It is not used for theupdatemethod.
-
class
com.vmware.content.library_client.PublishInfo(authentication_method=None, published=None, publish_url=None, user_name=None, password=None, current_password=None, persist_json_enabled=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
PublishInfoclass 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
authentication_method (
PublishInfo.AuthenticationMethod) – Indicates how a subscribed library should authenticate (BASIC, NONE) to the published library endpoint. This attribute is required for thecom.vmware.content_client.LocalLibrary.create()method. It is optional for thecom.vmware.content_client.LocalLibrary.update()operation, and if None the value will not be changed. When the existing authentication method isPublishInfo.AuthenticationMethod.BASICand authentication is being turned off by updating this attribute toPublishInfo.AuthenticationMethod.NONE, then thePublishInfo.current_passwordattribute is required. This attribute will always be present in the results of thecom.vmware.content_client.LocalLibrary.get()method.published (
bool) – Whether the local library is published. This attribute is required for thecom.vmware.content_client.LocalLibrary.create()method. It is optional for thecom.vmware.content_client.LocalLibrary.update()operation, and if None the value will not be changed. When the existing authentication method isPublishInfo.AuthenticationMethod.BASICand the local library is published, thePublishInfo.current_passwordattribute is required before turning off publishing. This attribute will always be present in the results of thecom.vmware.content_client.LocalLibrary.get()method.publish_url (
str) –The URL to which the library metadata is published by the Content Library Service.
This value can be used to set the
SubscriptionInfo.subscription_urlproperty when creating a subscribed library. This attribute is not used for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.user_name (
str) – The username to require for authentication. This attribute is optional for thecom.vmware.content_client.LocalLibrary.create()andcom.vmware.content_client.LocalLibrary.update()methods. When the authentication method isPublishInfo.AuthenticationMethod.NONE, the username can be left None. When the authentication method isPublishInfo.AuthenticationMethod.BASIC, the username is ignored in the current release. It defaults to “vcsp”. It is preferable to leave this None. If specified, it must be set to “vcsp”.password (
str) – The new password to require for authentication. This attribute is optional for thecom.vmware.content_client.LocalLibrary.create()method. When the authentication method isPublishInfo.AuthenticationMethod.NONE, the password can be left None. When the authentication method isPublishInfo.AuthenticationMethod.BASIC, the password should be a non-empty string. This attribute is optional for thecom.vmware.content_client.LocalLibrary.update()method. Leaving it None during update indicates that the password is not changed. When the password is changed, thePublishInfo.current_passwordattribute is required. This attribute is not used for thecom.vmware.content_client.LocalLibrary.get()method.current_password (
str) – The current password to verify. This attribute is available starting in vSphere 6.7. This attribute is unused for thecom.vmware.content_client.LocalLibrary.create()method. This attribute is optional for thecom.vmware.content_client.LocalLibrary.update()method. When the existing authentication method isPublishInfo.AuthenticationMethod.NONE, the current password can be left None. When the existing authentication method isPublishInfo.AuthenticationMethod.BASIC, the current password is verified before applying the newPublishInfo.password, turning off authentication, or unpublishing the library. This attribute is not used for thecom.vmware.content_client.LocalLibrary.get()method.persist_json_enabled (
bool) –Whether library and library item metadata are persisted in the storage backing as JSON files. This flag only applies if the local library is published.
Enabling JSON persistence allows you to synchronize a subscribed library manually instead of over HTTP. You copy the local library content and metadata to another storage backing manually and then create a subscribed library referencing the location of the library JSON file in the
SubscriptionInfo.subscription_url. When the subscribed library’s storage backing matches the subscription URL, files do not need to be copied to the subscribed library.For a library backed by a datastore, the library JSON file will be stored at the path contentlib-{library_id}/lib.json on the datastore.
For a library backed by a remote file system, the library JSON file will be stored at {library_id}/lib.json in the remote file system path. This attribute is optional for the
createmethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.
-
class
AuthenticationMethod(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
PublishInfo.AuthenticationMethodclass 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 theAuthenticationMethodinstance.
-
BASIC= AuthenticationMethod(string='BASIC')¶ Require HTTP Basic authentication matching a specified username and password.
-
NONE= AuthenticationMethod(string='NONE')¶ Require no authentication.
-
class
com.vmware.content.library_client.SourceInfo(source_library=None, subscription=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
SourceInfoclass contains information about the source published library of a subscribed library. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
source_library (
str) – Identifier of the published library. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.subscription (
str) – Identifier of the subscription associated with the subscribed library. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Subscriptions. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Subscriptions. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.
-
class
com.vmware.content.library_client.StorageBacking(type=None, datastore_id=None, storage_uri=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
StorageBackingclass 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
type (
StorageBacking.Type) – Type (DATASTORE, OTHER) ofStorageBacking. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is not used for theupdatemethod.datastore_id (
str) – Identifier of the datastore used to store the content in the library. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Datastore. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Datastore. This attribute is optional and it is only relevant when the value oftypeisStorageBacking.Type.DATASTORE.storage_uri (
str) –URI identifying the location used to store the content in the library.
The following URI formats are supported:
vSphere 6.5
nfs://server/path?version=4 (for vCenter Server Appliance only) - Specifies an NFS Version 4 server.
nfs://server/path (for vCenter Server Appliance only) - Specifies an NFS Version 3 server. The nfs://server:/path format is also supported.
smb://server/path - Specifies an SMB server or Windows share.
vSphere 6.0 Update 1
nfs://server:/path (for vCenter Server Appliance only)
file://unc-server/path (for vCenter Server for Windows only)
file:///mount/point (for vCenter Server Appliance only) - Local file URIs are supported only when the path is a local mount point for an NFS file system. Use of file URIs is strongly discouraged. Instead, use an NFS URI to specify the remote file system.
vSphere 6.0
nfs://server:/path (for vCenter Server Appliance only)
file://unc-server/path (for vCenter Server for Windows only)
file:///path - Local file URIs are supported but strongly discouraged because it may interfere with the performance of vCenter Server.
This attribute is optional and it is only relevant when the value of
typeisStorageBacking.Type.OTHER.
-
class
Type(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
StorageBacking.Typeclass specifies the type of theStorageBacking.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 theTypeinstance.
-
DATASTORE= Type(string='DATASTORE')¶ 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:
Virtual Machine File System (VMFS)
Network File System (NFS)
-
OTHER= Type(string='OTHER')¶ The content of the library will be stored on a remote file system.
Supports the following remote file systems:
NFS (on vCenter Server Appliance)
SMB (on vCenter Server Appliance and vCenter Server for Windows)
-
class
com.vmware.content.library_client.StubFactory(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBaseInitialize StubFactoryBase
- Parameters
stub_config (
vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance
-
class
com.vmware.content.library_client.SubscribedItem(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
SubscribedItemclass 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.
-
evict(library_item_id)¶ 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.cachedto 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.NotFoundif the library item specified bylibrary_item_iddoes not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeif the library item specified bylibrary_item_idis not a member of a subscribed library.- Raise
com.vmware.vapi.std.errors_client.InvalidElementConfigurationif the library item specified bylibrary_item_idis a member of a subscribed library that does not synchronize on-demand.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the content of the library item specified bylibrary_item_idhas been deleted from the storage backings (see LibraryModel#storageBackings) associated with it.For instance, this {\@term error) is reported on evicting a library item in an on-demand 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.
- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.EvictLibraryItem.
-
sync(library_item_id, force_sync_content, sync_optional_files=None)¶ 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
SubscriptionInfoof the library which owns the library item.If
SubscriptionInfo.on_demandis 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 theforce_sync_contentparameter.If
SubscriptionInfo.on_demandis false, then this call will always synchronize the file content. Theforce_sync_contentparameter is ignored when the subscription is not on-demand.
When the file content has been synchronized, the
ItemModel.cachedattribute will be true.This method will return immediately and create an asynchronous task to perform the synchronization.
- Parameters
library_item_id (
str) – Identifier of the library item to synchronize. The parameter must be an identifier for the resource type:com.vmware.content.library.Item.force_sync_content (
bool) – Whether to synchronize file content as well as metadata. This parameter applies only if the subscription is on-demand.sync_optional_files (
boolorNone) – 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.
- Raise
com.vmware.vapi.std.errors_client.NotFoundif the library item specified bylibrary_item_idcould not be found.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeif the library item specified bylibrary_item_idis not a member of a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the content of the library item specified bylibrary_item_idhas 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.
- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.library.Itemreferenced by the parameterlibrary_item_idrequiresContentLibrary.SyncLibraryItem.
-
class
com.vmware.content.library_client.SubscriptionInfo(authentication_method=None, automatic_sync_enabled=None, on_demand=None, password=None, ssl_thumbprint=None, subscription_url=None, user_name=None, source_info=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
SubscriptionInfoclass defines the subscription behavior for a subscribed library.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
authentication_method (
SubscriptionInfo.AuthenticationMethod) – Indicate how the subscribed library should authenticate (BASIC, NONE) with the published library endpoint. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.automatic_sync_enabled (
bool) – Whether the library should participate in automatic library synchronization. In order for automatic synchronization to happen, the globalcom.vmware.content_client.ConfigurationModel.automatic_sync_enabledoption must also be true. The subscription is still active even when automatic synchronization is turned off, but synchronization is only activated with an explicit call tocom.vmware.content_client.SubscribedLibrary.sync()orSubscribedItem.sync(). In other words, manual synchronization is still available even when automatic synchronization is disabled. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.on_demand (
bool) –Indicates whether a library item’s content will be synchronized only on demand.
If this is set to
true, then the library item’s metadata will be synchronized but the item’s content (its files) will not be synchronized. The Content Library Service will synchronize the content upon request only. This can cause the first use of the content to have a noticeable delay.Items without synchronized content can be forcefully synchronized in advance using the
SubscribedItem.sync()call withforceSyncContentset to true. Once content has been synchronized, the content can removed with theSubscribedItem.evict()call.If this value is set to
false, all content will be synchronized in advance. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.password (
str) –The password to use when authenticating.
The password must be set when using a password-based authentication method; empty strings are not allowed. This attribute is optional for the
createmethod. It will not be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.ssl_thumbprint (
str) –An optional SHA-1 hash of the SSL certificate for the remote endpoint.
If this value is defined the SSL certificate will be verified by comparing it to the SSL thumbprint. The SSL certificate must verify against the thumbprint. When specified, the standard certificate chain validation behavior is not used. The certificate chain is validated normally if this value is None. This attribute is optional for the
createmethod. It will not be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.subscription_url (
str) –The URL of the endpoint where the metadata for the remotely published library is being served.
This URL can be the
PublishInfo.publish_urlof the published library (for example, https://server/path/lib.json).If the source content comes from a published library with
PublishInfo.persist_json_enabled, the subscription URL can be a URL pointing to the library JSON file on a datastore or remote file system. The supported formats are:vSphere 6.5
ds:///vmfs/volumes/{uuid}/mylibrary/lib.json (for datastore)
nfs://server/path/mylibrary/lib.json (for NFSv3 server on vCenter Server Appliance)
nfs://server/path/mylibrary/lib.json?version=4 (for NFSv4 server on vCenter Server Appliance)
smb://server/path/mylibrary/lib.json (for SMB server)
vSphere 6.0
file://server/mylibrary/lib.json (for UNC server on vCenter Server for Windows)
file:///path/mylibrary/lib.json (for local file system)
When you specify a DS subscription URL, the datastore must be on the same vCenter Server as the subscribed library. When you specify an NFS or SMB subscription URL, the
StorageBacking.storage_uriof the subscribed library must be on the same remote file server and should share a common parent path with the subscription URL. This attribute must be provided for thecreatemethod. It will always be present in the return value of thegetorlistmethods. It is optional for theupdatemethod.user_name (
str) –The username to use when authenticating.
The username must be set when using a password-based authentication method. Empty strings are allowed for usernames. This attribute is optional for the
createmethod. It is optional in the return value of thegetorlistmethods. It is optional for theupdatemethod.source_info (
SourceInfo) – Information about the source published library. This attribute will be set for a subscribed library which is associated with a subscription of the published library. This attribute was added in vSphere API 6.7.2. This attribute is optional for thecreatemethod. It is optional in the return value of thegetorlistmethods. It is optional for theupdatemethod.
-
class
AuthenticationMethod(string)¶ Bases:
vmware.vapi.bindings.enum.EnumIndicate 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 theAuthenticationMethodinstance.
-
BASIC= AuthenticationMethod(string='BASIC')¶ Require HTTP Basic authentication matching a specified username and password.
-
NONE= AuthenticationMethod(string='NONE')¶ Require no authentication.
-
class
com.vmware.content.library_client.Subscriptions(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterfaceThe
Subscriptionsclass provides methods for managing the subscription information of the subscribers of a published library. This class was added in vSphere API 6.7.2.- Parameters
config (
vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
-
class
CreateSpec(subscribed_library=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.CreateSpecclass defines the information required to create a new subscription of the published library. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
subscribed_library (
Subscriptions.CreateSpecSubscribedLibrary) – Specification for the subscribed library to be associated with the subscription. This attribute was added in vSphere API 6.7.2.
-
class
CreateSpecNewSubscribedLibrary(name=None, description=None, storage_backings=None, automatic_sync_enabled=None, on_demand=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.CreateSpecNewSubscribedLibraryclass defines the information required to create a new subscribed library. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
name (
str) – Name of the subscribed library. This attribute was added in vSphere API 6.7.2.description (
strorNone) – Description of the subscribed library. This attribute was added in vSphere API 6.7.2. If None, the description will be an empty string.storage_backings (
listofStorageBacking) –The list of default storage backings for this library.
The list must contain exactly one storage backing. Multiple default storage locations are not currently supported but may become supported in future releases.. This attribute was added in vSphere API 6.7.2.
automatic_sync_enabled (
bool) – Specifies whether the library should participate in automatic library synchronization. This attribute was added in vSphere API 6.7.2.on_demand (
bool) – Specifies whether a library item’s content will be synchronized only on demand. This attribute was added in vSphere API 6.7.2.
-
class
CreateSpecPlacement(folder=None, cluster=None, resource_pool=None, host=None, network=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.CreateSpecPlacementclass defines the placement information for the subscribed library’s virtual machine template library items. Storage location of the virtual machine template items is defined by the subscribed library’s storage backing. This placement information needs to be compatible with the subscribed library’s storage backing. TheSubscriptions.CreateSpecPlacementclass is only applicable for the virtual machine template library items of the subscribed library. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
folder (
strorNone) – Virtual machine folder into which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder:VCenter. This attribute is currently required. In future, if this is None, the system will attempt to choose a suitable folder for the virtual machine template; if a folder cannot be chosen, publishing a virtual machine template item will fail.cluster (
strorNone) – Cluster onto which the virtual machine template should be placed. IfclusterandresourcePoolare both specified,resourcePoolmust belong tocluster. Ifclusterandhostare both specified,hostmust be a member ofcluster. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ClusterComputeResource:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource:VCenter. IfresourcePoolorhostis specified, it is recommended that this attribute be None.resource_pool (
strorNone) – Resource pool into which the virtual machine template should be placed. IfhostandresourcePoolare both specified,resourcePoolmust belong tohost. IfclusterandresourcePoolare both specified,resourcePoolmust belong tocluster. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool:VCenter. This attribute is currently required. In future, if this is None, the system will attempt to choose a suitable resource pool for the virtual machine template; if a resource pool cannot be chosen, publish of virtual machine template item will fail.host (
strorNone) – Host onto which the virtual machine template should be placed. IfhostandresourcePoolare both specified,resourcePoolmust belong tohost. Ifhostandclusterare both specified,hostmust be a member ofcluster. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem:VCenter. If this is None, the system will attempt to choose a suitable host for the virtual machine template; if a host cannot be chosen, publishing the virtual machine template item will fail.network (
strorNone) – Network that backs the virtual Ethernet adapters in the virtual machine template. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Network:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Network:VCenter. If None, the virtual Ethernet adapters will not be backed by a network.
-
class
CreateSpecSubscribedLibrary(target=None, new_subscribed_library=None, subscribed_library=None, location=None, vcenter=None, placement=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.CreateSpecSubscribedLibraryclass defines the subscribed library information used to create the subscription. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
target (
Subscriptions.CreateSpecSubscribedLibrary.Target) – Specifies whether the target subscribed library should be newly created or an existing subscribed library should be used. This attribute was added in vSphere API 6.7.2.new_subscribed_library (
Subscriptions.CreateSpecNewSubscribedLibrary) – Specification for creating a new subscribed library associated with the subscription. This attribute was added in vSphere API 6.7.2. This attribute is optional and it is only relevant when the value oftargetisSubscriptions.CreateSpecSubscribedLibrary.Target.CREATE_NEW.subscribed_library (
str) – Identifier of the existing subscribed library to associate with the subscription. Only the subscribed libraries for whichSubscriptionInfo.subscription_urlproperty is set to thePublishInfo.publish_urlof the published library can be associated with the subscription. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library. This attribute is optional and it is only relevant when the value oftargetisSubscriptions.CreateSpecSubscribedLibrary.Target.USE_EXISTING.location (
Subscriptions.Location) – Location of the subscribed library relative to the published library. This attribute was added in vSphere API 6.7.2.vcenter (
Subscriptions.CreateSpecVcenter) – Specification for the subscribed library’s vCenter Server instance. This attribute was added in vSphere API 6.7.2. This attribute is optional and it is only relevant when the value oflocationisSubscriptions.Location.REMOTE.placement (
Subscriptions.CreateSpecPlacementorNone) – Placement specification for the virtual machine template library items on the subscribed library. This attribute was added in vSphere API 6.7.2. This attribute is currently required. In future, if this is None, the system will attempt to choose a suitable placement specification for the virtual machine template items; if a placement specification cannot be chosen, publish of virtual machine template items will fail.
-
class
Target(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
Subscriptions.CreateSpecSubscribedLibrary.Targetclass defines the options related to the target subscribed library which will be associated with the subscription. This enumeration was added in vSphere API 6.7.2.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 theTargetinstance.
-
CREATE_NEW= Target(string='CREATE_NEW')¶ Create a new subscribed library. This class attribute was added in vSphere API 6.7.2.
-
USE_EXISTING= Target(string='USE_EXISTING')¶ Use the specified existing subscribed library. This class attribute was added in vSphere API 6.7.2.
-
class
CreateSpecVcenter(hostname=None, https_port=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.CreateSpecVcenterclass defines information about the vCenter Server instance where the subscribed library associated with the subscription exists or will be created. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
hostname (
str) – The hostname of the subscribed library’s vCenter Server. This attribute was added in vSphere API 6.7.2.https_port (
longorNone) – The HTTPS port of the vCenter Server instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2. If None, port 443 will be used.
-
class
Info(subscribed_library=None, subscribed_library_name=None, subscribed_library_location=None, subscribed_library_vcenter=None, subscribed_library_placement=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.Infoclass contains information about the subscription. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
subscribed_library (
str) – Identifier of the subscribed library associated with the subscription. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library.subscribed_library_name (
str) – Name of the subscribed library associated with the subscription. This attribute was added in vSphere API 6.7.2.subscribed_library_location (
Subscriptions.Location) – Location of the subscribed library relative to the published library. This attribute was added in vSphere API 6.7.2.subscribed_library_vcenter (
Subscriptions.VcenterInfo) – Information about the vCenter Server instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2. This attribute is optional and it is only relevant when the value ofsubscribedLibraryLocationisSubscriptions.Location.REMOTE.subscribed_library_placement (
Subscriptions.PlacementInfo) – Placement information about the subscribed library’s virtual machine template items. This attribute was added in vSphere API 6.7.2.
-
class
Location(string)¶ Bases:
vmware.vapi.bindings.enum.EnumThe
Subscriptions.Locationclass defines the location of subscribed library relative to the published library. This enumeration was added in vSphere API 6.7.2.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 theLocationinstance.
-
LOCAL= Location(string='LOCAL')¶ The subscribed library belongs to the same vCenter instance as the published library. This class attribute was added in vSphere API 6.7.2.
-
REMOTE= Location(string='REMOTE')¶ The subscribed library belongs to a different vCenter instance than the published library. This class attribute was added in vSphere API 6.7.2.
-
class
PlacementInfo(folder=None, cluster=None, resource_pool=None, host=None, network=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.PlacementInfoclass contains the placement information for the subscribed library’s virtual machine template library items. TheSubscriptions.PlacementInfoclass is only applicable for the virtual machine template library items of the subscribed library. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
folder (
strorNone) – Virtual machine folder into which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder:VCenter. The attribute will be None if the subscribed library associated with the subscription does not have a virtual machine folder.cluster (
strorNone) – Cluster onto which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ClusterComputeResource:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource:VCenter. The attribute will be None if the subscribed library associated with the subscription does not have a cluster.resource_pool (
strorNone) – Resource pool into which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool:VCenter. The attribute will be None if the subscribed library associated with the subscription does not have a resource pool.host (
strorNone) – Host onto which the virtual machine template should be placed. IfhostandresourcePoolare both specified,resourcePoolmust belong tohost. Ifhostandclusterare both specified,hostmust be a member ofcluster. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem:VCenter. The attribute will be None if the subscribed library associated with the subscription does not have a host.network (
strorNone) – Network that backs the virtual Ethernet adapters in the virtual machine template. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Network:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Network:VCenter. The attribute will be None if the subscribed library associated with the subscription does not have a network.
-
RESOURCE_TYPE= 'com.vmware.content.library.Subscriptions'¶ Resource type for Subscription resource. This class attribute was added in vSphere API 6.7.2.
-
class
Summary(subscription=None, subscribed_library=None, subscribed_library_name=None, subscribed_library_vcenter_hostname=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.Summaryclass contains commonly used information about the subscription. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
subscription (
str) – Identifier of the subscription. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.library.Subscriptions. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.library.Subscriptions.subscribed_library (
str) – Identifier of the subscribed library. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library.subscribed_library_name (
str) – Name of the subscribed library. This attribute was added in vSphere API 6.7.2.subscribed_library_vcenter_hostname (
strorNone) – Hostname of the vCenter instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2. This attribute is unset if the subscribed library is on the same vCenter Server instance as the published library.
-
class
UpdateSpec(subscribed_library_vcenter=None, subscribed_library_placement=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.UpdateSpecclass defines information required to update the subscription. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
subscribed_library_vcenter (
Subscriptions.UpdateSpecVcenterorNone) – Specification for the subscribed library’s vCenter Server instance. This attribute was added in vSphere API 6.7.2. If None, the value is unchanged.subscribed_library_placement (
Subscriptions.UpdateSpecPlacementorNone) – Placement specification for the virtual machine template items of the subscribed library. Updating this information will only affect new or updated items, existing items will not be moved. The entire placement configuration of the subscribed library will replaced by the new specification. This attribute was added in vSphere API 6.7.2. If None, the placement configuration of the subscribed library will be unchanged.
-
class
UpdateSpecPlacement(folder=None, cluster=None, resource_pool=None, host=None, network=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.UpdateSpecPlacementclass defines the placement information for the subscribed library’s virtual machine template library items. Storage location of the virtual machine template items is defined by the subscribed library’s storage backing. This placement information needs to be compatible with the subscribed library’s storage backing. TheSubscriptions.UpdateSpecPlacementclass is only applicable for the newly published virtual machine template library items of the subscribed library. Existing items will not be moved. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
folder (
strorNone) – Virtual machine folder into which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder:VCenter. This attribute is currently required. In future, if this is None, the system will attempt to choose a suitable folder for the virtual machine template; if a folder cannot be chosen, publishing a virtual machine template item will fail.cluster (
strorNone) – Cluster onto which the virtual machine template should be placed. IfclusterandresourcePoolare both specified,resourcePoolmust belong tocluster. Ifclusterandhostare both specified,hostmust be a member ofcluster. IfresourcePoolorhostis specified, it is recommended that this attribute be None. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ClusterComputeResource:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource:VCenter. IfresourcePoolorhostis specified, it is recommended that this attribute be None.resource_pool (
strorNone) – Resource pool into which the virtual machine template should be placed. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool:VCenter. This attribute is currently required. In future, if this is None, the system will attempt to choose a suitable resource pool for the virtual machine template; if a resource pool cannot be chosen, publish of virtual machine template item will fail.host (
strorNone) – Host onto which the virtual machine template should be placed. IfhostandresourcePoolare both specified,resourcePoolmust belong tohost. Ifhostandclusterare both specified,hostmust be a member ofcluster. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem:VCenter. If this is None, the system will attempt to choose a suitable host for the virtual machine template; if a host cannot be chosen, publishing the virtual machine template item will fail.network (
strorNone) – Network that backs the virtual Ethernet adapters in the virtual machine template. This attribute was added in vSphere API 6.7.2. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Network:VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Network:VCenter. If None, newly published virtual machine template library items will not be backed by a network.
-
class
UpdateSpecVcenter(hostname=None, https_port=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.UpdateSpecVcenterclass defines information about the vCenter Server instance where the subscribed library associated with the subscription exists. TheSubscriptions.UpdateSpecVcenterclass is only applicable to subscribed library which exists on remote vCenter Server instance. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
hostname (
strorNone) – The hostname of the subscribed library’s vCenter Server. This attribute was added in vSphere API 6.7.2. If None, the value is unchanged.https_port (
longorNone) – The HTTPS port of the vCenter Server instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2. If None, the value is unchanged.
-
class
VcenterInfo(hostname=None, https_port=None, server_guid=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStructThe
Subscriptions.VcenterInfoclass contains information about the vCenter Server instance where the subscribed library associated with the subscription exists. This class was added in vSphere API 6.7.2.Tip
The arguments are used to initialize data attributes with the same names.
- Parameters
hostname (
str) – Hostname of the vCenter Server instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2.https_port (
longorNone) – The HTTPS port of the vCenter Server instance where the subscribed library exists. This attribute was added in vSphere API 6.7.2. If None, port 443 will be used.server_guid (
str) – The unique identifier of the vCenter Server where the subscribed library exists. This attribute was added in vSphere API 6.7.2.
-
create(library, spec, client_token=None)¶ Creates a subscription of the published library. This method was added in vSphere API 6.7.2.
- Parameters
client_token (
strorNone) – 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. If not specified, creation is not idempotent.library (
str) – Identifier of the published library. The parameter must be an identifier for the resource type:com.vmware.content.Library.spec (
Subscriptions.CreateSpec) – Specification for the subscription.
- Return type
str- Returns
Subscription identifier. The return value will be an identifier for the resource type:
com.vmware.content.library.Subscriptions.- Raise
com.vmware.vapi.std.errors_client.AlreadyExistsIf a subscription of the published library to the specified subscribed library already exists. This is only applicable whensubscribedLibrary#subscribedLibraryis specified.- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library specified bylibrarydoes not exist.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the subscribed library specified bysubscribedLibrary#subscribedLibrarydoes not exist at the vCenter instance specified bysubscribedLibrary#vcenter.- Raise
com.vmware.vapi.std.errors_client.ResourceInaccessibleIf the vCenter instance specified bysubscribedLibrary#vcentercannot be contacted or found.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentIfSubscriptions.CreateSpeccontains invalid arguments.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library specified bylibraryis a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library specified bylibraryis not a published library.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibraryrequiresContentLibrary.AddSubscription.
-
delete(library, subscription)¶ Deletes the specified subscription of the published library. The subscribed library associated with the subscription will not be deleted. This method was added in vSphere API 6.7.2.
- Parameters
library (
str) – Identifier of the published library. The parameter must be an identifier for the resource type:com.vmware.content.Library.subscription (
str) – Subscription identifier. The parameter must be an identifier for the resource type:com.vmware.content.library.Subscriptions.
- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library specified bylibraryis a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library specified bylibraryis not a published library.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library specified bylibrarydoes not exist.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the subscription specified bysubscriptiondoes not exist for the library specified bylibrary.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibraryrequiresContentLibrary.DeleteSubscription.
-
get(library, subscription)¶ Returns information about the specified subscription of the published library. This method was added in vSphere API 6.7.2.
- Parameters
library (
str) – Identifier of the published library. The parameter must be an identifier for the resource type:com.vmware.content.Library.subscription (
str) – Identifier of the subscription. The parameter must be an identifier for the resource type:com.vmware.content.library.Subscriptions.
- Return type
- Returns
Information about the subscription.
- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library specified bylibrarydoes not exist.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentIf thesubscriptionis not valid.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library specified bylibraryis a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library specified bylibraryis not a published library.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibraryrequiresSystem.Read.
-
list(library)¶ Lists the subscriptions of the published library. This method was added in vSphere API 6.7.2.
- Parameters
library (
str) – Identifier of the published library. The parameter must be an identifier for the resource type:com.vmware.content.Library.- Return type
- Returns
List of commonly used information about subscriptions of the published library.
- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library specified bylibraryis a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library specified bylibrarydoes not exist.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library specified bylibraryis not a published library.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibraryrequiresSystem.Read.
-
update(library, subscription, spec)¶ Updates the specified subscription of the published library.
This is an incremental update to the subscription. Except for the
Subscriptions.UpdateSpecPlacementclass, attributes that are None in the update specification will be left unchanged. Ifspec#subscribedLibraryPlacementis specified, all attributes of the current subscribed library placement will be replaced by this placement.. This method was added in vSphere API 6.7.2.- Parameters
library (
str) – Identifier of the published library. The parameter must be an identifier for the resource type:com.vmware.content.Library.subscription (
str) – subscription identifier. The parameter must be an identifier for the resource type:com.vmware.content.library.Subscriptions.spec (
Subscriptions.UpdateSpec) – Specification of the new property values to set on the subscription.
- Raise
com.vmware.vapi.std.errors_client.ErrorIf the system reports an error while responding to the request.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the library specified bylibrarydoes not exist.- Raise
com.vmware.vapi.std.errors_client.NotFoundIf the subscription specified bysubscriptiondoes not exist for the library specified bylibrary.- Raise
com.vmware.vapi.std.errors_client.ResourceInaccessibleIf the subscribed library cannot be contacted or found.- Raise
com.vmware.vapi.std.errors_client.InvalidArgumentIfSubscriptions.UpdateSpeccontains invalid arguments.- Raise
com.vmware.vapi.std.errors_client.InvalidElementTypeIf the library specified bylibraryis a subscribed library.- Raise
com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateIf the library specified bylibraryis not a published library.- Raise
com.vmware.vapi.std.errors_client.UnauthenticatedIf the user that requested the method cannot be authenticated.- Raise
com.vmware.vapi.std.errors_client.UnauthorizedIf the user that requested the method is not authorized to perform the method.- Raise
com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:The resource
com.vmware.content.Libraryreferenced by the parameterlibraryrequiresContentLibrary.UpdateSubscription.