vmware Package

vmware Package

cis_client Module

class com.vmware.cis_client.Session(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Session class allows API clients to manage session tokens including creating, deleting and obtaining information about sessions.

The call to the Session.create() method is part of the overall authentication process for API clients. For example, the sequence of steps for establishing a session with SAML token is:

  • Connect to lookup service.
  • Discover the secure token service (STS) endpoint URL.
  • Connect to the secure token service to obtain a SAML token.
  • Authenticate to the lookup service using the obtained SAML token.
  • Discover the API endpoint URL from lookup service.
  • Call the Session.create() method. The Session.create() call must include the SAML token.

See the programming guide and samples for additional information about establishing API sessions.

Execution Context and Security Context

To use session based authentication a client should supply the session token obtained through the Session.create() method. The client should add the session token in the security context when using SDK classes. Clients using the REST API should supply the session token as a HTTP header.

Session Lifetime

A session begins with call to the Session.create() method to exchange a SAML token for a API session token. A session ends under the following circumstances:

  • Call to the Session.delete() method.
  • The session expires. Session expiration may be caused by one of the following situations:
  • Client inactivity - For a particular session identified by client requests that specify the associated session ID, the lapsed time since the last request exceeds the maximum interval between requests.
  • Unconditional or absolute session expiration time: At the beginning of the session, the session logic uses the SAML token and the system configuration to calculate absolute expiration time.

When a session ends, the authentication logic will reject any subsequent client requests that specify that session. Any operations in progress will continue to completion.

Error Handling

The Session returns the following exceptions:

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
class Info(user=None, created_time=None, last_accessed_time=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Represents data associated with an API session.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • user (str) – Fully qualified name of the end user that created the session, for example Administrator\@vsphere.local. A typical use case for this information is in Graphical User Interfaces (GUI) or logging systems to visualize the identity of the current user.
  • created_time (datetime.datetime) – Time when the session was created.
  • last_accessed_time (datetime.datetime) – Last time this session was used by passing the session key for invoking an API.
Session.create()[source]

Creates a session with the API. This is the equivalent of login. This method exchanges user credentials supplied in the security context for a session identifier that is to be used for authenticating subsequent calls. To authenticate subsequent calls clients are expected to include the session key.

Return type:

str

Returns:

Newly created session identifier to be used for authenticating further requests.

Raise :

com.vmware.vapi.std.errors_client.Unauthenticated if the session creation fails due to request specific issues. Due to the security nature of the API the details of the error are not disclosed.

Please check the following preconditions if using a SAML token to authenticate:

  • the supplied token is delegate-able.
  • the time of client and server system are synchronized.
  • the token supplied is valid.
  • if bearer tokens are used check that system configuration allows the API endpoint to accept such tokens.
Raise :

com.vmware.vapi.std.errors_client.ServiceUnavailable if session creation fails due to server specific issues, for example connection to a back end component is failing. Due to the security nature of this API further details will not be disclosed in the exception. Please refer to component health information, administrative logs and product specific documentation for possible causes.

Session.delete()[source]

Terminates the validity of a session token. This is the equivalent of log out.

A session identifier is expected as part of the request.
Raise :com.vmware.vapi.std.errors_client.Unauthenticated if the session id is missing from the request or the corresponding session object cannot be found.
Raise :com.vmware.vapi.std.errors_client.ServiceUnavailable if session deletion fails due to server specific issues, for example connection to a back end component is failing. Due to the security nature of this API further details will not be disclosed in the exception. Please refer to component health information, administrative logs and product specific documentation for possible causes.
Session.get()[source]

Returns information about the current session. This method expects a valid session identifier to be supplied.

A side effect of invoking this method may be a change to the session’s last accessed time to the current time if this is supported by the session implementation. Invoking any other method in the API will also update the session’s last accessed time.

This API is meant to serve the needs of various front end projects that may want to display the name of the user. Examples of this include various web based user interfaces and logging facilities.

Return type:Session.Info
Returns:Information about the session.
Raise :com.vmware.vapi.std.errors_client.Unauthenticated if the session id is missing from the request or the corresponding session object cannot be found.
Raise :com.vmware.vapi.std.errors_client.ServiceUnavailable if session retrieval fails due to server specific issues e.g. connection to back end component is failing. Due to the security nature of this API further details will not be disclosed in the error. Please refer to component health information, administrative logs and product specific documentation for possible causes.

content_client Module

The Content module provides classes and classes for configuring global settings and permissions, and for managing libraries in the Content Library Service.

class com.vmware.content_client.Configuration(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Configuration class provides methods to configure the global settings of the Content Library Service.

The configuration settings are used by the Content Library Service to control the behavior of various operations.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
get()[source]

Retrieves the current configuration values.

Return type:

ConfigurationModel

Returns:

The ConfigurationModel instance representing the configuration of the Content Library Service.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.GetConfiguration.
update(model)[source]

Updates the configuration. The update is incremental. Any attribute in the ConfigurationModel class that is None will not be modified. Note that this update method doesn’t guarantee an atomic change of all the properties. In the case of a system crash or failure, some of the properties could be left unchanged while others may be updated.

Parameters:

model (ConfigurationModel) – The ConfigurationModel specifying the settings to update.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if one of the configuration properties is not within the proper range.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.UpdateConfiguration.
class com.vmware.content_client.ConfigurationModel(automatic_sync_enabled=None, automatic_sync_start_hour=None, automatic_sync_stop_hour=None, maximum_concurrent_item_syncs=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ConfigurationModel class defines the global settings of the Content Library Service.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • automatic_sync_enabled (bool) –

    Whether automatic synchronization is enabled.

    When automatic synchronization is enabled, the Content Library Service will automatically synchronize all subscribed libraries on a daily basis. Subscribed libraries with the com.vmware.content.library_client.SubscriptionInfo.automatic_sync_enabled flag turned on will be synchronized every hour between ConfigurationModel.automatic_sync_start_hour and ConfigurationModel.automatic_sync_stop_hour. This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is optional for the update method.

  • automatic_sync_start_hour (long) – The hour at which the automatic synchronization will start. This value is between 0 (midnight) and 23 inclusive. This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is optional for the update method.
  • automatic_sync_stop_hour (long) – The hour at which the automatic synchronization will stop. Any active synchronization operation will continue to run, however no new synchronization operations will be triggered after the stop hour. This value is between 0 (midnight) and 23 inclusive. This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is optional for the update method.
  • maximum_concurrent_item_syncs (long) –

    The maximum allowed number of library items to synchronize concurrently from remote libraries. This must be a positive number. The service may not be able to guarantee the requested concurrency if there is no available capacity.

    This setting is global across all subscribed libraries.

    This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is optional for the update method.

class com.vmware.content_client.Library(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Library class provides methods to manage and find LibraryModel entities.

The Library class provides support for generic functionality which can be applied equally to all types of libraries. The functionality provided by this class will not affect the properties specific to the type of library. See also LocalLibrary and SubscribedLibrary.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
class FindSpec(name=None, type=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Specifies the properties that can be used as a filter to find libraries. When multiple attributes are specified, all properties of the library must match the specification.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • name (str or None) – Name of the library to search. The name is case-insensitive. See LibraryModel.name. If not specified any name will be searched.
  • type (LibraryModel.LibraryType or None) – Library type to search. See LibraryModel.type. If not specified any library type will be searched.
Library.RESOURCE_TYPE = 'com.vmware.content.Library'

Resource type for library.

Library.find(spec)[source]

Returns a list of all the visible (as determined by authorization policy) libraries matching the requested Library.FindSpec.

Parameters:

spec (Library.FindSpec) – Specification describing what properties to filter on.

Return type:

list of str

Returns:

The list of identifiers of all the visible libraries matching the given spec. The return value will contain identifiers for the resource type: com.vmware.content.Library.

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:

  • Method execution requires System.Read.
Library.get(library_id)[source]

Returns a given LibraryModel.

Parameters:

library_id (str) – Identifier of the library to return. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Return type:

LibraryModel

Returns:

The LibraryModel instance with the specified library_id.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the specified library does not exist.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires System.Read.
Library.list()[source]

Returns the identifiers of all libraries of any type in the Content Library.

Return type:

list of str

Returns:

The list of all identifiers of all libraries in the Content Library. The return value will contain identifiers for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.
Library.update(library_id, update_spec)[source]

Updates the properties of a library.

This is an incremental update to the library. Any attribute in the LibraryModel class that is None will not be modified.

This method will only update the common properties for all library types. This will not, for example, update the LibraryModel.publish_info of a local library, nor the LibraryModel.subscription_info of a subscribed library. Specific properties are updated in LocalLibrary.update() and SubscribedLibrary.update().

Parameters:
  • library_id (str) – Identifier of the library to update. The parameter must be an identifier for the resource type: com.vmware.content.Library.
  • update_spec (LibraryModel) – Specification of the new property values to set on the library.
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.InvalidArgument if the update_spec is not valid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the LibraryModel.version of update_spec is not equal to the current version of the library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.UpdateLibrary.
class com.vmware.content_client.LibraryModel(id=None, creation_time=None, description=None, last_modified_time=None, last_sync_time=None, name=None, storage_backings=None, type=None, version=None, publish_info=None, subscription_info=None, server_guid=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The LibraryModel class represents a Content Library resource model.

A LibraryModel is a container for a set of items which represent a usable set of files. The Content Library Service allows for multiple libraries to be created with separate authorization and sharing policies.

Each LibraryModel is a container for a set of com.vmware.content.library_client.ItemModel instances. Each item is a logical object in a library, which may have multiple files.

A LibraryModel may be local or subscribed. A local library has its source of truth about items within this Content Library Service. Items may be added to or removed from the library. A local library may also be private or published. When published, the library is exposed by a network endpoint and can be used by another Content Library Service for synchronization. A private local library cannot be used for synchronization.

A subscribed library is a library which gets its source of truth from another library that may be across a network in another Content Library Service. A subscribed library may have a different name and metadata from the library to which it subscribes, but the set of library items is always the same as those in the source library. Library items cannot be manually added to a subscribed library – they can only be added by adding new items to the source library.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • id (str) – An identifier which uniquely identifies this LibraryModel. 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 not used for the create method. It will not be present in the return value of the get or list methods. It is not used for the update method.
  • creation_time (datetime.datetime) – The date and time when this library was created. This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is not used for the update method.
  • description (str) – A human-readable description for this library. This attribute is optional for the create method. Leaving it None during creation will result in an empty string value. It will always be present in the result of a get or list method. It is optional for the update method. Leaving it None during update indicates that the description should be left unchanged.
  • last_modified_time (datetime.datetime) –

    The date and time when this library was last updated.

    This attribute is updated automatically when the library properties are changed. This attribute is not affected by adding, removing, or modifying a library item or its content within the library. Tagging the library or syncing the subscribed library does not alter this attribute. This attribute is not used for the create method. It will always be present in the return value of the get or list methods. It is not used for the update method.

  • last_sync_time (datetime.datetime) –

    The date and time when this library was last synchronized.

    This attribute applies only to subscribed libraries. It is updated every time a synchronization is triggered on the library. The value is None for a local library. This attribute is not used for the create method. It is optional in the return value of the get or list methods. It is not used for the update method.

  • name (str) –

    The name of the library.

    A Library is identified by a human-readable name. Library names cannot be undefined or an empty string. Names do not have to be unique. This attribute must be provided for the create method. It will always be present in the return value of the get or list methods. It is optional for the update method.

  • storage_backings (list of com.vmware.content.library_client.StorageBacking) –

    The list of storage backings which are available for this library.

    A com.vmware.content.library_client.StorageBacking defines a storage location which can be used to store files for the library items in this library. Multiple storage locations are not currently supported but may become supported in future releases. This attribute must be provided for the create method. It will always be present in the return value of the get or list methods. It is not used for the update method.

  • type (LibraryModel.LibraryType) –

    The type (LOCAL, SUBSCRIBED) of this library.

    This value can be used to determine what additional services and information can be available for this library. This attribute must be provided for the create method. It will always be present in the return value of the get or list methods. It is not used for the update method.

  • version (str) –

    A version number which is updated on metadata changes. This value allows clients to detect concurrent updates and prevent accidental clobbering of data.

    This value represents a number which is incremented every time library properties, such as name or description, are changed. It is not incremented by changes to a library item within the library, including adding or removing items. It is also not affected by tagging the library. This attribute is not used for the create method. It will always be present in the result of a get or list method. It is optional for the update method. Leaving it None during update indicates that you do not need to detect concurrent updates.

  • publish_info (com.vmware.content.library_client.PublishInfo) –

    Defines how this library is published so that it can be subscribed to by a remote subscribed library.

    The com.vmware.content.library_client.PublishInfo defines where and how the metadata for this local library is accessible. A local library is only published publically if com.vmware.content.library_client.PublishInfo.published is true. This attribute is optional for the create and update methods. If not specified during creation, the default is for the library to not be published. If not specified during update, the attribute is left unchanged.

  • subscription_info (com.vmware.content.library_client.SubscriptionInfo) –

    Defines the subscription behavior for this Library.

    The com.vmware.content.library_client.SubscriptionInfo defines how this subscribed library synchronizes to a remote source. Setting the value will determine the remote source to which the library synchronizes, and how. Changing the subscription will result in synchronizing to a new source. If the new source differs from the old one, the old library items and data will be lost. Setting com.vmware.content.library_client.SubscriptionInfo.automatic_sync_enabled to false will halt subscription but will not remove existing cached data. This attribute is optional for the create and update methods. If not specified during creation, a default will be created without an active subscription. If not specified during update, the attribute is left unchanged.

  • server_guid (str) – The unique identifier of the vCenter server where the library exists. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vcenter.VCenter. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vcenter.VCenter. This attribute is optional for the create method. It will always be present in the return value of the get or list methods. It is not used for the update method.
class LibraryType(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The LibraryModel.LibraryType class defines the type of a LibraryModel.

The type of a library can be used to determine which additional services can be performed with a library.

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 LibraryType instance.
LOCAL = LibraryType(string='LOCAL')

The library contents are defined and stored by the local Content Library Service installation.

A local library can be retrieved and managed via the LocalLibrary.

SUBSCRIBED = LibraryType(string='SUBSCRIBED')

The library synchronizes its items and content from another published library.

A subscribed library can be retrieved and managed via the SubscribedLibrary.

class com.vmware.content_client.LocalLibrary(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The LocalLibaray class manages local libraries.

The LocalLibrary class provides support for creating and maintaining local library instances. A local library may also use the Library class to manage general library functionality.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
create(create_spec, client_token=None)[source]

Creates a new local library.

Parameters:
  • client_token (str or None) – 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 (LibraryModel) – Specification for the new local library.
Return type:

str

Returns:

Identifier of the newly created LibraryModel. The return value will be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the create_spec is not valid.

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.Unsupported if using multiple storage backings.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.CreateLocalLibrary.
delete(library_id)[source]

Deletes the specified local library.

Deleting a local library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.

Parameters:

library_id (str) – Identifier of the local library to delete. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a local library.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by 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:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.DeleteLocalLibrary.
get(library_id)[source]

Returns a given local library.

Parameters:

library_id (str) – Identifier of the local library to return. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Return type:

LibraryModel

Returns:

The LibraryModel instance associated with library_id.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by library_id does not exist.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a local library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires System.Read.
list()[source]

Returns the identifiers of all local libraries in the Content Library.

Return type:

list of str

Returns:

The list of identifiers of all local libraries in the Content Library. The return value will contain identifiers for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.
update(library_id, update_spec)[source]

Updates the properties of a local library.

This is an incremental update to the local library. Attributes that are None in the update specification will be left unchanged.

Parameters:
  • library_id (str) – Identifier of the local library to update. The parameter must be an identifier for the resource type: com.vmware.content.Library.
  • update_spec (LibraryModel) – Specification of the new property values to set on the local library.
Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by library_id does not exist.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a local library.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the update_spec is not valid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the LibraryModel.version of update_spec is not equal to the current version of the library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.UpdateLocalLibrary.
class com.vmware.content_client.SubscribedLibrary(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
class ProbeResult(status=None, ssl_thumbprint=None, error_messages=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The SubscribedLibrary.ProbeResult class defines the subscription information probe result. This describes whether using a given subscription URL is successful or if there are access problems, such as SSL errors.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • status (SubscribedLibrary.ProbeResult.Status) – The status of probe result. This will be one of SUCCESS, INVALID_URL, TIMED_OUT, HOST_NOT_FOUND, RESOURCE_NOT_FOUND, INVALID_CREDENTIALS, CERTIFICATE_ERROR, UNKNOWN_ERROR.
  • ssl_thumbprint (str or None) – The SSL thumbprint for the remote endpoint. An SSL thumbprint is only returned if the host is secured with SSL/TLS.
  • error_messages (list of com.vmware.vapi.std_client.LocalizableMessage) – If the probe result is in an error status, this attribute will contain the detailed error messages.
class Status(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The SubscribedLibrary.ProbeResult.Status class defines the error status constants for the probe result.

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 Status instance.
CERTIFICATE_ERROR = Status(string='CERTIFICATE_ERROR')

Indicates that the provided server certificate thumbprint in com.vmware.content.library_client.SubscriptionInfo.ssl_thumbprint is invalid. In this case, the returned null should be set in com.vmware.content.library_client.SubscriptionInfo.ssl_thumbprint.

HOST_NOT_FOUND = Status(string='HOST_NOT_FOUND')

Indicates that the host in the URL could not be found.

INVALID_CREDENTIALS = Status(string='INVALID_CREDENTIALS')

Indicates that the connection was rejected due to invalid credentials.

INVALID_URL = Status(string='INVALID_URL')

Indicates that the supplied URL was not valid.

RESOURCE_NOT_FOUND = Status(string='RESOURCE_NOT_FOUND')

Indicates that the given resource at the URL was not found.

SUCCESS = Status(string='SUCCESS')

Indicates that the probe was successful.

TIMED_OUT = Status(string='TIMED_OUT')

Indicates that the probe timed out while attempting to connect to the URL.

UNKNOWN_ERROR = Status(string='UNKNOWN_ERROR')

Indicates an unspecified error different from the other error cases defined in SubscribedLibrary.ProbeResult.Status.

SubscribedLibrary.create(create_spec, client_token=None)[source]

Creates a new subscribed library.

Once created, the subscribed library will be empty. If the LibraryModel.subscription_info property is set, the Content Library Service will attempt to synchronize to the remote source. This is an asynchronous operation so the content of the published library may not immediately appear.

Parameters:
  • client_token (str or None) – 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 (LibraryModel) – Specification for the new subscribed library.
Return type:

str

Returns:

Identifier of the newly created subscribed library. The return value will be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the create_spec is not valid.

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.Unsupported if using multiple storage backings.

Raise :

com.vmware.vapi.std.errors_client.ResourceInaccessible if subscribing to a published library which cannot be accessed.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.CreateSubscribedLibrary.
SubscribedLibrary.delete(library_id)[source]

Deletes the specified subscribed library.

Deleting a subscribed library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.

Parameters:

library_id (str) – Identifier of the subscribed library to delete. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library referenced by library_id is not a subscribed library.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the library referenced by 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:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.DeleteSubscribedLibrary.
SubscribedLibrary.evict(library_id)[source]

Evicts the cached content of an on-demand subscribed library.

This method allows the cached content of a subscribed library to be removed to free up storage capacity. This method will only work when a subscribed library is synchronized on-demand.

Parameters:

library_id (str) – Identifier of the subscribed library whose content should be evicted. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by library_id does not exist.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a subscribed library.

Raise :

com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if the library specified by library_id 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:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.EvictSubscribedLibrary.
SubscribedLibrary.get(library_id)[source]

Returns a given subscribed library.

Parameters:

library_id (str) – Identifier of the subscribed library to return. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Return type:

LibraryModel

Returns:

The LibraryModel instance that corresponds to library_id.

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.InvalidElementType if the library associated with library_id is not a subscribed library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires System.Read.
SubscribedLibrary.list()[source]

Returns the identifiers of all subscribed libraries in the Content Library.

Return type:

list of str

Returns:

The list of identifiers of all subscribed libraries in the Content Library. The return value will contain identifiers for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.
SubscribedLibrary.probe(subscription_info)[source]

Probes remote library subscription information, including URL, SSL certificate and password. The resulting SubscribedLibrary.ProbeResult class describes whether or not the subscription configuration is successful.

Parameters:

subscription_info (com.vmware.content.library_client.SubscriptionInfo) – The subscription info to be probed.

Return type:

SubscribedLibrary.ProbeResult

Returns:

The subscription info probe result.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.ProbeSubscription.
SubscribedLibrary.sync(library_id)[source]

Forces the synchronization of the subscribed library.

Synchronizing a subscribed library forcefully with this method will perform the same synchronization behavior as would run periodically for the library. The com.vmware.content.library_client.SubscriptionInfo.on_demand setting is respected. Calling this method on a library that is already in the process of synchronizing will have no effect.

Parameters:

library_id (str) – Identifier of the subscribed library to synchronize. The parameter must be an identifier for the resource type: com.vmware.content.Library.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by library_id does not exist.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a subscribed library.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if some parameter in the subscribed library subscription info is invalid.

Raise :

com.vmware.vapi.std.errors_client.ResourceInaccessible if the published library cannot be contacted or found.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.SyncLibrary.
SubscribedLibrary.update(library_id, update_spec)[source]

Updates the properties of a subscribed library.

This is an incremental update to the subscribed library. Attributes that are None in the update specification will be left unchanged.

Parameters:
  • library_id (str) – Identifier of the subscribed library to update. The parameter must be an identifier for the resource type: com.vmware.content.Library.
  • update_spec (LibraryModel) – Specification of the new property values to set on the subscribed library.
Raise :

com.vmware.vapi.std.errors_client.NotFound if the library specified by library_id does not exist.

Raise :

com.vmware.vapi.std.errors_client.InvalidElementType if the library specified by library_id is not a subscribed library.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the update_spec is not valid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the LibraryModel.version of update_spec is not equal to the current version of the library.

Raise :

com.vmware.vapi.std.errors_client.ResourceInaccessible if the subscription info is being updated but the published library cannot be contacted or found.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • The resource com.vmware.content.Library referenced by the parameter library_id requires ContentLibrary.UpdateSubscribedLibrary.
class com.vmware.content_client.Type(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Type class exposes the com.vmware.content.library_client.ItemModel types that this Content Library Service supports.

A library item has an optional type which can be specified with the com.vmware.content.library_client.ItemModel.type attribute. For items with a type that is supported by a plugin, the Content Library Service may understand the files which are part of the library item and can produce metadata for the item.

In other cases, uploads may require a process in which one upload implies subsequent uploads. For example, an Open Virtualization Format (OVF) package is composed of an OVF descriptor file and the associated virtual disk files. Uploading an OVF descriptor can enable the Content Library Service to understand that the complete OVF package requires additional disk files, and it can set up the transfers for the disks automatically by adding the file entries for the disks when the OVF descriptor is uploaded.

When a type is not supported by a plugin, or the type is not specified, the Content Library Service can handle a library item in a default way, without adding metadata to the item or guiding the upload process.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
class Info(description=None, name=None, type=None, vendor=None, version=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Type.Info class describes support for a specific type of data in an com.vmware.content.library_client.ItemModel. The Type.Info can be queried through the Type class. Type support describes plugins in the Content Library which can provide metadata on library items and help manage the transfer process by adding dependent files when a current file is added.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • description (str) – A description of the type support offered by the plugin.
  • name (str) – The name of the plugin which provides the type support.
  • type (str) –

    The type which the plugin supports.

    To upload a library item of the type supported by the plugin, the com.vmware.content.library_client.ItemModel.type attribute of the item should be set to this value.

  • vendor (str) – The name of the vendor who created the type support plugin.
  • version (str) – The version number of the type support plugin.
Type.list()[source]

Returns a list of Type.Info instances which describe the type support plugins in this Content Library.

Return type:

list of Type.Info

Returns:

The list of Type.Info instances which describe the type support plugins in this Content Library.

Raise :

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires ContentLibrary.TypeIntrospection.

vapi_client Module

The com.vmware.vapi_client component provides API infrastructure classes and standard types that can be used in the interface specification of any class.

Table Of Contents

Previous topic

com Package

Next topic

cis Package

This Page