metadata Package

metadata Package

authentication_client Module

The com.vmware.vapi.metadata.authentication_client module provides classes that expose authentication information for operation elements across all the service elements.

To calculate the effective authentication information for an operation element, you should first see if there is an authentication scheme specified for the operation element. If it is not specified, then authentication scheme for the service element that contains this operation element is used. If it is not specified for the service element as well, then the authentication scheme for the package element that contains this service element is used.

class com.vmware.vapi.metadata.authentication_client.AuthenticationInfo(scheme_type=None, session_manager=None, scheme=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The AuthenticationInfo class describes the authentication information. Authentication information could be specified for a package element, service elenent or an operation element.

Using the authentication scheme information, a client invoking an API call from any class can figure out what kind of credentials are needed for that API call.

Tip

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

Parameters:
  • scheme_type (AuthenticationInfo.SchemeType) – The type of the authentication scheme.
  • session_manager (str) – In a session aware authentication scheme, a session manager is required that supports create, delete and keepAlive methods. The fully qualified class name of the session manager is provided in AuthenticationInfo.session_manager attribute. This class is responsible for handling sessions. This attribute is optional and it is only relevant when the value of schemeType is AuthenticationInfo.SchemeType.SESSION_AWARE.
  • scheme (str) –

    String identifier of the authentication scheme.

    Following are the supported authentication schemes by the infrastructure:

    • The identifier com.vmware.vapi.std.security.saml_hok_token for SAML holder of key token based authentication mechanism.
    • The identifier com.vmware.vapi.std.security.bearer_token for SAML bearer token based authentication mechanism.
    • The identifier com.vmware.vapi.std.security.session_id for session based authentication mechanism.
    • The identifier com.vmware.vapi.std.security.user_pass for username and password based authentication mechanism.
class SchemeType(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The AuthenticationInfo.SchemeType class provides class attributes for the set of valid authentication scheme types.

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 SchemeType instance.
SESSIONLESS = SchemeType(string=u'SESSIONLESS')

Indicates that the scheme is a session less authentication scheme, the user is authenticated on every method. There is no explicit session establishment.

SESSION_AWARE = SchemeType(string=u'SESSION_AWARE')

Indicates that the scheme is a session aware authentication scheme. It requires an explicit login before executing a method and logout when a session terminates. A class might choose to have a session aware scheme if it wants to associate some state corresponding to the user until the user logs out or if it wants to mitigate the cost of authenticating the user on every method.

class com.vmware.vapi.metadata.authentication_client.Component(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Component class provides methods to retrieve authentication information of a component element.

A component element is said to contain authentication information if any one of package elements contained in it has authentication information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.component'

Resource type for component.

fingerprint(component_id)[source]

Retrieves the fingerprint computed from the authentication metadata of the component element corresponding to component_id.

The fingerprint provides clients an efficient way to check if the metadata for a particular component has been modified on the server. The client can do this by comparing the result of this operation with the fingerprint returned in the result of Component.get().

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:str
Returns:The fingerprint computed from the authentication metadata of the component.
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id does not have any authentication information.
get(component_id)[source]

Retrieves authentication information about the component element corresponding to component_id.

The ComponentData contains the authentication information about the component element and it’s fingerprint. It contains information about all the package elements that belong to this component element.

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:ComponentData
Returns:The ComponentData instance that corresponds to component_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id does not have any authentication information.
list()[source]

Returns the identifiers for the component elements that have authentication information.

Return type:list of str
Returns:The list of identifiers for the component elements that have authentication information. The return value will contain identifiers for the resource type: com.vmware.vapi.component.
class com.vmware.vapi.metadata.authentication_client.ComponentData(info=None, fingerprint=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentData class contains the authentication information of the component along with its fingerprint.

Tip

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

Parameters:
  • info (ComponentInfo) – Authentication information of the component. This includes information about all the modules in the component.
  • fingerprint (str) –

    Fingerprint of the metadata of the component.

    Authentication information could change when there is an infrastructure update. Since the data present in ComponentData.info could be quite large, fingerprint provides a convenient way to check if the data for a particular component is updated.

    You should store the fingerprint associated with a component. After an update, by invoking the Component.fingerprint() method, you can retrieve the new fingerprint for the component. If the new fingerprint and the previously stored fingerprint do not match, clients can then use the Component.get() to retrieve the new authentication information for the component.

class com.vmware.vapi.metadata.authentication_client.ComponentInfo(packages=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentInfo class contains authentication information of a component element.

For an explanation of authentication information contained within component elements, see Component.

Tip

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

Parameters:packages (dict of str and PackageInfo) –

Authentication information of all the package elements. The key in the dict is the identifier of the package element and the value in the dict is the authentication information for the package element.

For an explanation of authentication information containment within package elements, see Package. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.package. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.package.

class com.vmware.vapi.metadata.authentication_client.OperationInfo(schemes=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The OperationInfo class contains authentication information of an operation element.

Tip

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

Parameters:schemes (list of AuthenticationInfo) – List of authentication schemes used by an operation element. The authentication scheme specified on the service element corresponding to this operation element is ignored.
class com.vmware.vapi.metadata.authentication_client.Package(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Package class provides methods to retrieve authentication information of a package element.

A package element is said to contain authentication information if there is a default authentication assigned to all service elements contained in the package element or if one of the service element contained in this package element has authentication information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.package'

Resource type for package.

get(package_id)[source]

Retrieves authentication information about the package element corresponding to package_id.

Parameters:package_id (str) – Identifier of the package element. The parameter must be an identifier for the resource type: com.vmware.vapi.package.
Return type:PackageInfo
Returns:The PackageInfo instance that corresponds to package_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the package element associated with package_id does not have any authentication information.
list()[source]

Returns the identifiers for the package elements that have authentication information.

Return type:list of str
Returns:The list of identifiers for the package elements that have authentication information. The return value will contain identifiers for the resource type: com.vmware.vapi.package.
class com.vmware.vapi.metadata.authentication_client.PackageInfo(schemes=None, services=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The PackageInfo class contains authentication information of a package element.

For an explanation of authentication information contained within package elements, see Package.

Tip

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

Parameters:
  • schemes (list of AuthenticationInfo) – List of authentication schemes to be used for all the operation elements contained in this package element. If a particular service or operation element has no explicit authentications defined in the authentication defintion file, these authentication schemes are used for authenticating the user.
  • services (dict of str and ServiceInfo) –

    Information about all service elements contained in this package element that contain authentication information. The key in the dict is the identifier of the service element and the value in the dict is the authentication information for the service element.

    For an explanation of authentication information containment within service elements, see Service. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.service. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.service.

class com.vmware.vapi.metadata.authentication_client.Service(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Service class provides methods to retrieve authentication information of a service element.

A service element is said to contain authentication information if there is a default authentication assigned to all operation elements contained in a service element or if one of the operation elements contained in this service element has authentication information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.service'

Resource type for service.

get(service_id)[source]

Retrieves authentication information about the service element corresponding to service_id.

Parameters:service_id (str) – Identifier of the service element. The parameter must be an identifier for the resource type: com.vmware.vapi.service.
Return type:ServiceInfo
Returns:The ServiceInfo instance that corresponds to service_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the service element associated with service_id does not have any authentication information.
list()[source]

Returns the identifiers for the service elements that have authentication information.

Return type:list of str
Returns:The list of identifiers for the service elements that have authentication information. The return value will contain identifiers for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.authentication_client.ServiceInfo(schemes=None, operations=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ServiceInfo class contains authentication information of a service element.

For an explanation of authentication information contained within service elements, see Service.

Tip

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

Parameters:
  • schemes (list of AuthenticationInfo) – List of authentication schemes to be used for all the operation elements contained in this service element. The authentication scheme specified on the package element corresponding to this service element is ignored.
  • operations (dict of str and OperationInfo) –

    Information about all operation elements contained in this service element that contain authentication information. The key in the dict is the identifier of the operation element and the value in the dict is the authentication information for the operation element.

    For an explanation of containment of authentication information within operation elements, see com.vmware.vapi.metadata.authentication.service_client.Operation. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.operation. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.operation.

class com.vmware.vapi.metadata.authentication_client.Source(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Source class provides methods to manage the sources of authentication metadata information.

The interface definition language infrastructure provides tools to generate various kinds of metadata in JSON format from the interface definition files and additional properties files. One of the generated files contains authentication information. The generated file can be registered as a source of metadata.

The authentication file contains all the data present in the interface definition files. Each authentication file contains data about one component element. When a authentication file is added as a source, each source contributes only one component element’s metadata.

Authentication metadata can also be discovered from a remote server that supports the authentication metadata classes (see com.vmware.vapi.metadata.authentication_client). Since multiple components can be registered with a single metadata server, when a remote server is registered as a source, that source can contribute more than one component.

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

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.CreateSpec class contains the registration information of a authentication source.

Tip

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

Parameters:
class Source.Info(description=None, type=None, filepath=None, address=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.Info class contains the metadata source information.

Tip

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

Parameters:
  • description (str) – English language human readable description of the source.
  • type (com.vmware.vapi.metadata_client.SourceType) – Type of the metadata source.
  • filepath (str) – Absolute file path of the authentication metadata file that has the authentication information about one component element. The filePath is the path to the file in the server’s filesystem. This attribute is optional and it is only relevant when the value of type is null.
  • address (str) –

    Connection information for the remote server. This must be in the format http(s)://IP:port/namespace.

    The remote server must support the classes in the com.vmware.vapi.metadata.authentication_client module. It must expose authentication information of one or more components. This attribute is optional and it is only relevant when the value of type is null.

Source.RESOURCE_TYPE = 'com.vmware.vapi.metadata.authentication.source'

Resource type for metadata source.

Source.create(source_id, spec)[source]

Creates a new metadata source. Once the server validates the registration information of the metadata source, the authentication metadata is retrieved from the source. This populates elements in all the classes defined in com.vmware.vapi.metadata.authentication_client module.

Parameters:
  • source_id (str) – metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.authentication.source.
  • spec (Source.CreateSpec) – create specification.
Raise :

com.vmware.vapi.std.errors_client.AlreadyExists if the metadata source identifier is already registered with the infrastructure.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the type of the source specified in null is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the file specified in null is not a valid JSON file or if the format of the authentication metadata in the JSON file is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the URI specified in null is unreachable or if there is a transport protocol or message protocol mismatch between the client and the server or if the remote server do not have classes present in com.vmware.vapi.metadata.authentication_client module.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the file specified in null does not exist.

Source.delete(source_id)[source]

Deletes an existing authentication metadata source from the infrastructure.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.authentication.source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source identifier is not found.
Source.fingerprint(source_id=None)[source]

Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.authentication.source. If unspecified, the fingerprint of all the metadata sources is returned.
Return type:str
Returns:Aggregate fingerprint of all the metadata sources or of a particular metadata source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.get(source_id)[source]

Retrieves information about the metadata source corresponding to source_id.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.authentication.source.
Return type:Source.Info
Returns:The Source.Info instance that corresponds to source_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.list()[source]

Returns the identifiers of the metadata sources currently registered with the infrastructure.

Return type:list of str
Returns:The list of identifiers for metadata sources currently registered. The return value will contain identifiers for the resource type: com.vmware.vapi.metadata.authentication.source.
Source.reload(source_id=None)[source]

Reloads the authentication metadata from all the metadata sources or of a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.authentication.source. If unspecified, all the metadata sources are reloaded.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.

cli_client Module

The com.vmware.vapi.metadata.cli_client module provides classes that expose all the information required to display namespace or command help, execute a command and display it’s result.

class com.vmware.vapi.metadata.cli_client.Command(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Command class provides methods to get information about command line interface (CLI) commands.

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

Bases: vmware.vapi.bindings.enum.Enum

The Command.FormatterType class defines supported CLI output formatter types. See Command.Info.formatter.

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 FormatterType instance.
CSV = FormatterType(string=u'CSV')

Displays command output in CSV format.

HTML = FormatterType(string=u'HTML')

Displays command output in HTML format.

JSON = FormatterType(string=u'JSON')

Displays command output in JSON format.

SIMPLE = FormatterType(string=u'SIMPLE')

Displays command output as it is.

TABLE = FormatterType(string=u'TABLE')

Displays command output in table format.

XML = FormatterType(string=u'XML')

Displays command output in XML format.

class Command.GenericType(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The Command.GenericType class defines generic types supported by Command class. See Command.OptionInfo.generic.

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 GenericType instance.
LIST = GenericType(string=u'LIST')

Input parameter is a list.

LIST_OPTIONAL = GenericType(string=u'LIST_OPTIONAL')

Input parameter is a list of optionals.

New in vSphere 6.5.
NONE = GenericType(string=u'NONE')

Default case.

OPTIONAL = GenericType(string=u'OPTIONAL')

Input parameter is an optional.

OPTIONAL_LIST = GenericType(string=u'OPTIONAL_LIST')

Input parameter is an optional of type list.

New in vSphere 6.5.
class Command.Identity(path=None, name=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Command.Identity class uniquely identifies a command in the CLI commands tree.

Tip

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

Parameters:
  • path (str) – The dot-separated path of the namespace containing the command in the CLI command tree.
  • name (str) – Name of the command.
class Command.Info(identity=None, description=None, service_id=None, operation_id=None, options=None, formatter=None, output_field_list=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Command.Info class contains information about a command. It includes the identity of the command, a description, information about the class and method that implement the command, and CLI-specific information for the command.

Tip

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

Parameters:
  • identity (Command.Identity) – Basic command identity.
  • description (str) – The text description displayed to the user in help output.
  • service_id (str) – The service identifier that contains the operations for this CLI command. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vapi.service. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vapi.service.
  • operation_id (str) – The operation identifier corresponding to this CLI command. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vapi.operation. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vapi.operation.
  • options (list of Command.OptionInfo) – The input for this command.
  • formatter (Command.FormatterType or None) – The formatter to use when displaying the output of this command. If not present, client can choose a default output formatter.
  • output_field_list (list of Command.OutputInfo) – List of output structure name and output field info.
class Command.OptionInfo(long_option=None, short_option=None, field_name=None, description=None, type=None, generic=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Command.OptionInfo class describes information about a specific input option of a command.

Tip

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

Parameters:
  • long_option (str) – The long option name of the parameter as used by the user.
  • short_option (str or None) – The single character value option name. If not present, there’s no single character option for the parameter.
  • field_name (str) – The fully qualified name of the option referred to by the operation element in Command.Info.operation_id.
  • description (str) – The description of the option to be displayed to the user when they request usage information for a CLI command.
  • type (str) – The type of option. This is used to display information about what kind of data is expected (string, number, boolean, etc.) for the option when they request usage information for a CLI command. For class this stores the fully qualified class id.
  • generic (Command.GenericType) – This is used to tell the user whether the option is required or optional, or whether they can specify the option multiple times.
class Command.OutputFieldInfo(field_name=None, display_name=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Command.OutputFieldInfo class describes the name used by the CLI to display a single attribute of a class element in the interface definition language.

Tip

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

Parameters:
  • field_name (str) – Name of the attribute.
  • display_name (str) – Name used by the CLI to display the attribute.
class Command.OutputInfo(structure_id=None, output_fields=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Command.OutputInfo class describes the names used by the CLI to display the attributes of a class element in the interface definition language as well as the order in which the attributes will be displayed.

Tip

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

Parameters:
  • structure_id (str) – Name of the class. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vapi.structure.
  • output_fields (list of Command.OutputFieldInfo) – The order in which the attributes of the class will be displayed by the CLI as well as the names used to display the attributes.
Command.fingerprint()[source]

Returns the aggregate fingerprint of all the command metadata from all the metadata sources.

The fingerprint provides clients an efficient way to check if the metadata for commands has been modified on the server.

Return type:str
Returns:Fingerprint of all the command metadata present on the server.
Command.get(identity)[source]

Retrieves information about a command including information about how to execute that command.

Parameters:identity (Command.Identity) – Identifier of the command for which to retreive information.
Return type:Command.Info
Returns:Information about the command including information about how to execute that command.
Raise :com.vmware.vapi.std.errors_client.NotFound if a command corresponding to identity doesn’t exist.
Command.list(path=None)[source]

Returns the identifiers of all commands, or commands in a specific namespace.

Parameters:path (str or None) – The dot-separated path of the namespace for which command identifiers should be returned. If None identifiers of all commands registered with the infrastructure will be returned.
Return type:list of Command.Identity
Returns:Identifiers of the requested commands.
Raise :com.vmware.vapi.std.errors_client.NotFound if a namespace corresponding to path doesn’t exist.
class com.vmware.vapi.metadata.cli_client.Namespace(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Namespace class provides methods to get information about command line interface (CLI) namespaces.

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

Bases: vmware.vapi.bindings.struct.VapiStruct

The Namespace.Identity class uniquely identifies a namespace in the CLI namespace tree.

Tip

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

Parameters:
  • path (str) – The dot-separated path of the namespace containing the namespace in the CLI node tree. For top-level namespace this will be empty.
  • name (str) – The name displayed to the user for this namespace.
class Namespace.Info(identity=None, description=None, children=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Namespace.Info class contains information about a namespace. It includes the identity of the namespace, a description, information children namespaces.

Tip

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

Parameters:
  • identity (Namespace.Identity) – Basic namespace identity.
  • description (str) – The text description displayed to the user in help output.
  • children (list of Namespace.Identity) – The children of this namespace in the tree of CLI namespaces.
Namespace.fingerprint()[source]

Returns the aggregate fingerprint of all the namespace metadata from all the metadata sources.

The fingerprint provides clients an efficient way to check if the metadata for namespaces has been modified on the server.

Return type:str
Returns:Fingerprint of all the namespace metadata present on the server.
Namespace.get(identity)[source]

Retreives information about a namespace including information about children of that namespace.

Parameters:identity (Namespace.Identity) – Identifier of the namespace for which to retreive information.
Return type:Namespace.Info
Returns:Information about the namespace including information about child of that namespace.
Raise :com.vmware.vapi.std.errors_client.NotFound if a namespace corresponding to identity doesn’t exist.
Namespace.list()[source]

Returns the identifiers of all namespaces registered with the infrastructure.

Return type:list of Namespace.Identity
Returns:Identifiers of all the namespaces.
class com.vmware.vapi.metadata.cli_client.Source(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Source class provides methods to manage the sources of command line interface (CLI) metadata information.

The interface definition language infrastructure provides tools to generate various kinds of metadata in JSON format from the interface definition files and additional properties files. One of the generated files contains CLI information.

A CLI metadata file contains information about one component element. When a CLI metadata file is added as a source, each source contributes only one component element’s metadata.

CLI metadata can also be discovered from a remote server that supports the CLI metadata services (see com.vmware.vapi.metadata.cli_client) module. Since multiple components can be registered with a single metadata server, when a remote server is registered as a source, that source can contribute more than one component.

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

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.CreateSpec class contains the registration information of a CLI source.

Tip

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

Parameters:
class Source.Info(description=None, type=None, filepath=None, address=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.Info class contains the metadata source information.

Tip

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

Parameters:
  • description (str) – English language human readable description of the source.
  • type (com.vmware.vapi.metadata_client.SourceType) – The type (FILE, REMOTE) of the metadata source.
  • filepath (str) – Absolute file path of the CLI metadata file that has the CLI information about one component. The filepath is the path to the file in the server’s filesystem. This attribute is optional and it is only relevant when the value of type is null.
  • address (str) –

    Connection information for the remote server. This should be in the format http(s)://IP:port/namespace.

    The remote server must contain the classes in the com.vmware.vapi.metadata.cli_client module. It must expose CLI information of one or more components. This attribute is optional and it is only relevant when the value of type is null.

Source.create(source_id, spec)[source]

Creates a new metadata source. Once the server validates the registration information of the metadata source, the CLI metadata is retrieved from the source. This populates elements in all the classes defined in com.vmware.vapi.metadata.cli_client module.

Parameters:
  • source_id (str) – metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
  • spec (Source.CreateSpec) – create specification.
Raise :

com.vmware.vapi.std.errors_client.AlreadyExists If the metadata source identifier is already registered with the infrastructure.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If type of the source specified in null is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If the file specified in null is not a valid JSON file or if the format of the CLI metadata in the JSON file is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If the URI specified in null is unreachable or if there is a transport protocol or message protocol mismatch between the client and the server or if the remote server do not have classes present in com.vmware.vapi.metadata.cli_client module.

Raise :

com.vmware.vapi.std.errors_client.NotFound If the file specified in null does not exist.

Source.delete(source_id)[source]

Deletes an existing CLI metadata source from the infrastructure.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.fingerprint(source_id=None)[source]

Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source. If unspecified, the fingerprint of all the metadata sources is returned.
Return type:str
Returns:Aggregate fingerprint of all the metadata sources or of a particular metadata source.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.get(source_id)[source]

Retrieves information about the metadata source corresponding to source_id.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
Return type:Source.Info
Returns:The Source.Info instance that corresponds to source_id
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.list()[source]

Returns the identifiers of the metadata sources currently registered with the infrastructure.

Return type:list of str
Returns:The list of identifiers for metadata sources currently registered. The return value will contain identifiers for the resource type: com.vmware.vapi.metadata.source.
Source.reload(source_id=None)[source]

Reloads the CLI metadata from all the metadata sources or of a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source. If unspecified, all the metadata sources are reloaded.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.

metamodel_client Module

The com.vmware.vapi.metadata.metamodel_client module provides classes that expose all the information present in the interface definition language (IDL) specification.

Metamodel metadata is organized into an hierarchy of elements. The main elements are:

  • Enumeration: An enumeration element that has a list of enumeration value elements.
  • Constant: A constant element has a name and a value.
  • Structure: A structure element can have field elements, constant elements and enumeration elements.
  • Operation: An operation has a list of parameter elements, result element and error elements.
  • Service: A service is a collection of operation elements, structure elements, enumerated elements and constant elements.
  • Package: A package is a collection of service elements, structure elements and enumeration elements.
  • Component: A component is a collection of package elements.

The com.vmware.vapi.metadata.metamodel_client module has classes that enables two styles of client applications:

  • A client can retrieve the exact pieces of information it requires using the various granularities the API supports (that is Component, Package, Service, Structure, Enumeration and com.vmware.vapi.metadata.metamodel.service_client.Operation). In this case, it doesn’t cache any information locally and always invokes methods to get the metamodel information it requires.
  • A client can retrieve all the metamodel information in fewer method invocations using the Component class and cache the output locally. It can then poll on the fingerprint information exposed by the Component class to monitor changes in API definition.
class com.vmware.vapi.metadata.metamodel_client.Component(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Component class providers methods to retrieve metamodel information of a component element.

A component defines a set of functionality that is deployed together and versioned together. For example, all the classes that belong to VMware Content Library are part of a single component. A component element describes a component. A component element contains one or more package elements.

The methods for package elements are provided by class Package.
Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.component'

Resource type for component.

fingerprint(component_id)[source]

Retrieves the fingerprint computed from the metamodel metadata of the component element corresponding to component_id.

The fingerprint provides clients an efficient way to check if the metadata for a particular component element has been modified on the server. The client can do this by comparing the result of this operation with the fingerprint returned in the result of Component.get().

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:str
Returns:The fingerprint computed from the metamodel metadata of the component element.
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id is not registered with the infrastructure.
get(component_id)[source]

Retrieves metamodel information about the component element corresponding to component_id.

The ComponentData contains the metamodel information about the component and it’s fingerprint. It contains information about all the package elements that are contained in this component element.

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:ComponentData
Returns:The ComponentData instance that corresponds to component_id.
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id is not registered with the infrastructure.
list()[source]

Returns the identifiers for the component elements that are registered with the infrastructure.

Return type:list of str
Returns:The list of identifiers for the component elements that are registered with the infrastructure. The return value will contain identifiers for the resource type: com.vmware.vapi.component.
class com.vmware.vapi.metadata.metamodel_client.ComponentData(info=None, fingerprint=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentData class contains the metamodel metadata information of a component element along with its fingerprint.

Tip

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

Parameters:
  • info (ComponentInfo) –

    Metamodel information of the component element. This includes information about all the package elements contained in this component element.

    The metamodel information about a component could be quite large if there are a lot of package elements contained in this component.

  • fingerprint (str) –

    Fingerprint of the metamodel metadata of the component component.

    Metamodel information could change when there is an infrastructure update and new functionality is added to an existing component.

    Since the data present in ComponentData.info could be quite large, fingerprint provides a convenient way to check if the data for a particular component is updated.

    You should store the fingerprint associated with a component. After an update, by invoking the Component.fingerprint() method, you can retrieve the new fingerprint for the component. If the new fingerprint and the previously stored fingerprint do not match, clients can use the Component.get() to retrieve the new metamodel information for the component.

class com.vmware.vapi.metadata.metamodel_client.ComponentInfo(name=None, packages=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentInfo class contains metamodel metadata information about a component element.

Tip

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

Parameters:
  • name (str) – Dot separated name of the component element. The segments in the name reflect the organization of the APIs. The format of each segment is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • packages (dict of str and PackageInfo) – Metamodel metadata information of all the package elements contained in the component element. The key in the dict is the identifier of the package element and the value in the dict is the metamodel information of the package element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.package. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.package.
  • metadata (dict of str and ElementMap) –

    Generic metadata for the component element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for a component. It can contain HTML markup and documentation tags (similar to Javadoc tags). The first sentence of the package documentation is a complete sentence that identifies the component by name and summarizes the purpose of the component.
class com.vmware.vapi.metadata.metamodel_client.ConstantInfo(type=None, value=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ConstantInfo class contains metamodel information of the constant elements.

Tip

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

Parameters:
  • type (Type) – Type of the constant element.
  • value (ConstantValue) – Value of the constant element.
  • documentation (str) – English language documentation for the constant element. It can contain HTML markup and documentation tags (similar to Javadoc tags).
class com.vmware.vapi.metadata.metamodel_client.ConstantValue(category=None, primitive_value=None, list_value=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ConstantValue class contains the metamodel information of the constant element.

Tip

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

Parameters:
class Category(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The ConstantValue.Category class defines class attributes for the valid kinds of values.

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 Category instance.
LIST = Category(string=u'LIST')

Indicates the type of constant value is a list.

PRIMITIVE = Category(string=u'PRIMITIVE')

Indicates the type of constant value is primitive.

class com.vmware.vapi.metadata.metamodel_client.ElementMap(elements=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ElementMap class contains the metadata elements.

One of the sources for metadata is the annotations present in the interface definition language. When an annotation is represented in the ElementMap, ElementMap describes the data specified in the arguments for the annotation.

For example, in \\@UnionCase(tag="tag", value="SELECT"), ElementMap describes the keyword arguments tag and value.

Tip

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

Parameters:elements (dict of str and ElementValue) – Metamodel information of the metadata elements. The key parameter of the dict is the identifier for the element and the value corresponds to the element value.
class com.vmware.vapi.metadata.metamodel_client.ElementValue(type=None, long_value=None, string_value=None, list_value=None, structure_id=None, structure_ids=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ElementValue class describes the value of the metadata element.

Tip

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

Parameters:
  • type (ElementValue.Type) – Type of the value.
  • long_value (long) – Long value of the metadata element. This attribute is optional and it is only relevant when the value of type is ElementValue.Type.LONG.
  • string_value (str) – String value of the metadata element. This attribute is optional and it is only relevant when the value of type is ElementValue.Type.STRING.
  • list_value (list of str) – List of strings value of the metadata element. This attribute is optional and it is only relevant when the value of type is ElementValue.Type.STRING_LIST.
  • structure_id (str) – Identifier of the structure element. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vapi.structure. This attribute is optional and it is only relevant when the value of type is ElementValue.Type.STRUCTURE_REFERENCE.
  • structure_ids (list of str) – List of identifiers of the structure elements. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type: com.vmware.vapi.structure. This attribute is optional and it is only relevant when the value of type is ElementValue.Type.STRUCTURE_REFERENCE_LIST.
class Type(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The ElementValue.Type class defines the valid types for values in metadata elements.

Note

This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.

Parameters:string (str) – String value for the Type instance.
LONG = Type(string=u'LONG')

Indicates the type of the value is a long (64 bit signed integer).

STRING = Type(string=u'STRING')

Indicates the type of the value is a string (a variable length sequence of characters). The encoding is UTF-8.

STRING_LIST = Type(string=u'STRING_LIST')

Indicates the type of the value is a list of strings.

STRUCTURE_REFERENCE = Type(string=u'STRUCTURE_REFERENCE')

Indicates the type of the value is an identifier for a structure element.

STRUCTURE_REFERENCE_LIST = Type(string=u'STRUCTURE_REFERENCE_LIST')

Indicates the type of the value is a list of identifiers for a structure element.

class com.vmware.vapi.metadata.metamodel_client.Enumeration(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Enumeration class provides methods to retrieve metamodel information about an enumeration element in the interface definition language.

The Enumeration has a list of enumeration value elements.
Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.enumeration'

Resource type for enumeration.

get(enumeration_id)[source]

Retrieves information about the enumeration element corresponding to enumeration_id.

The EnumerationInfo contains the metamodel information about the enumeration value element contained in the enumeration element.

Parameters:enumeration_id (str) – Identifier of the enumeration element. The parameter must be an identifier for the resource type: com.vmware.vapi.enumeration.
Return type:EnumerationInfo
Returns:The EnumerationInfo instance that corresponds to enumeration_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the enumeration element associated with enumeration_id is not contained in any of the package elements, service elements and structure elements.
list()[source]

Returns the identifiers for the enumeration elements that are contained in all the package elements, service elements and structure elements.

Return type:list of str
Returns:The list of identifiers for the enumeration elements. The return value will contain identifiers for the resource type: com.vmware.vapi.enumeration.
class com.vmware.vapi.metadata.metamodel_client.EnumerationInfo(name=None, values=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The EnumerationInfo class contains the metamodel information of an enumeration element.

Tip

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

Parameters:
  • name (str) – Dot separated name of the enumeration element. The segments in the name reflect the organization of the APIs. The format of each segment is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • values (list of EnumerationValueInfo) – Metamodel information of all the enumeration value elements contained in this enumeration element. The order of the enumeration value elements in the list is same as the order in which they are defined in the interface definition file.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for an enumeration element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) –

    English language documentation for an enumeration element. It can contain HTML markup and Javadoc tags. The first sentence of the enumeration documentation is a complete sentence that identifies the enumeration by name and summarizes the purpose of the enumeration. The documentation describes the context in which the enumeration is used.

    The documentation also contains references to the context in which the enumeration is used. But if the enumeration is used in many contexts, the references may not be present.

class com.vmware.vapi.metadata.metamodel_client.EnumerationValueInfo(value=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The EnumerationValueInfo class describes the class attribute in the class.

Tip

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

Parameters:
  • value (str) – Value in the enumerated type. All the characters in the string are capitalized.
  • metadata (dict of str and ElementMap) –

    Additional metadata for enumeration value in the enumerated type. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for an enumeration value. It can contain HTML markup and documentation tags (similar to Javadoc tags). The first statement will be a noun or verb phrase that describes the purpose of the enumeration value.
class com.vmware.vapi.metadata.metamodel_client.ErrorInfo(structure_id=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ErrorInfo class contains the metadata information about the error elements contained in an operation element.

Tip

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

Parameters:
  • structure_id (str) – Identifier for the structure element corresponding to the error that is being reported by the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type: com.vmware.vapi.structure.
  • documentation (str) – The English language documentation for the service element. It can contain HTML markup and Javadoc tags.
class com.vmware.vapi.metadata.metamodel_client.FieldInfo(name=None, type=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The FieldInfo class contains metamodel information of a field element contained in a structure element.

Tip

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

Parameters:
  • name (str) – Name of the field element in a canonical format. The format is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • type (Type) – Type information.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the field element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for the service element. It can contain HTML markup and Javadoc tags.
class com.vmware.vapi.metadata.metamodel_client.GenericInstantiation(generic_type=None, element_type=None, map_key_type=None, map_value_type=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The GenericInstantiation class describes the type information of a typed element when the type is an instantiation of one of the generic types provided by the infrastructure.

Tip

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

Parameters:
class GenericType(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The GenericInstantiation.GenericType class provides class attributes for each of the generic types provided by the infrastructure.

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 GenericType instance.
LIST = GenericType(string=u'LIST')

Indicates the generic type is a list.

MAP = GenericType(string=u'MAP')

Indicates the generic type is a map.

OPTIONAL = GenericType(string=u'OPTIONAL')

Indicates the generic type is an optional.

SET = GenericType(string=u'SET')

Indicates the generic type is a set.

class com.vmware.vapi.metadata.metamodel_client.MetadataIdentifier(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The MetadataIdentifier class provides string constants that can be used as identifiers for the metadata elements.

Most of the types in com.vmware.vapi.metadata.metamodel_client package has a metadata field whose type is Map<String, ElementMap>. MetadataIdentifier contains the identifiers used in the keys of the above Map type.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
CANONICAL_NAME = 'CanonicalName'

Identifier representing the CanonicalName metadata.

COMPONENT = 'Component'

Identifier representing the Component metadata.

CREATE = 'Create'

Identifier representing the Create metadata.

CRUD = 'Crud'

Identifier representing the Crud metadata.

HAS_FIELDS_OF = 'HasFieldsOf'

Identifier representing the HasFieldsOf metadata.

INCLUDABLE = 'Includable'

Identifier representing the Includable metadata.

INCLUDE = 'Include'

Identifier representing the Include metadata.

IS_ONE_OF = 'IsOneOf'

Identifier representing the IsOneOf metadata.

MODEL = 'Model'

Identifier representing the Model metadata.

READ = 'Read'

Identifier representing the Read metadata.

RESOURCE = 'Resource'

Identifier representing the Resource metadata.

UNION_CASE = 'UnionCase'

Identifier representing the UnionCase metadata.

UNION_TAG = 'UnionTag'

Identifier representing the UnionTag metadata.

UPDATE = 'Update'

Identifier representing the Update metadata.

class com.vmware.vapi.metadata.metamodel_client.OperationInfo(name=None, params=None, output=None, errors=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The OperationInfo class contains metamodel information of an operation element.

Tip

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

Parameters:
  • name (str) – Name of the operation element in a canonical format. The format is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • params (list of FieldInfo) – Metamodel information for the parameter elements. The order of the parameters elements in the list is same as the order of the parameters declared in the interface definition file.
  • output (OperationResultInfo) – Metamodel type for the output element.
  • errors (list of ErrorInfo) – List of error elements that might be reported by the operation element. If the operation reports the same error for more than one reason, the list contains the error element associated with the error more than once with different documentation elements.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the operation element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for key in the dict.

  • documentation (str) – English language documentation for the service element. It can contain HTML markup and Javadoc tags.
class com.vmware.vapi.metadata.metamodel_client.OperationResultInfo(type=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The OperationResultInfo class contains the metamodel information of an operation result element.

An operation accepts a list of parameters and returns a result or an error. The OperationResultInfo describes the result element of an operation.

Tip

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

Parameters:
  • type (Type) – Type information of the operation result element.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the service element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for the operation result element. It can contain HTML markup and Javadoc tags.
class com.vmware.vapi.metadata.metamodel_client.Package(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Package class provides methods to retrieve metamodel information about a package element in the interface definition language.

A package is a logical grouping of services, structures and enumerations. A package element describes the package. It contains the service elements, structure elements and enumeration elements that are grouped together.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.package'

Resource type for package.

get(package_id)[source]

Retrieves information about the package element corresponding to package_id.

Parameters:package_id (str) – Identifier of the package element. The parameter must be an identifier for the resource type: com.vmware.vapi.package.
Return type:PackageInfo
Returns:The PackageInfo instance that corresponds to package_id.
Raise :com.vmware.vapi.std.errors_client.NotFound if the package element associated with package_id does not exist.
list()[source]

Returns the identifiers for the packages elements that are contained in all the registered component elements.

Return type:list of str
Returns:The list of identifiers for the package elements that are contained in all the registered component elements. The return value will contain identifiers for the resource type: com.vmware.vapi.package.
class com.vmware.vapi.metadata.metamodel_client.PackageInfo(name=None, structures=None, enumerations=None, services=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The PackageInfo class contains the metamodel information of all the service elements, structure elements and enumeration elements contained in the package element.

Tip

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

Parameters:
  • name (str) – Dot separated name of the package element. The segments in the name reflect the organization of the APIs. The format of each segment is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • structures (dict of str and StructureInfo) –

    Metamodel information of all the structure elements contained in the package element. The key in the dict is the identifier of the structure element and the value in the dict is the metamodel information for the structure element.

    This does not include the structure elements contained in the service elements that are contained in this package element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.structure.

  • enumerations (dict of str and EnumerationInfo) –

    Metamodel information of all the enumeration elements contained in the package element. The key in the dict is the identifier of the enumeration element and the value in the dict is the metamodel information for the enumeration element.

    This does not include the enumeration elements that are contained in the service elements of this package element or structure elements of this package element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.enumeration. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.enumeration.

  • services (dict of str and ServiceInfo) – Metamodel information of all the service elements contained in the package element. The key in the dict is the identifier of the service element and the value in the dict is the metamodel information for the service element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.service. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.service.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the package element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) –

    English language documentation for a package. It can contain HTML markup and Javadoc tags. The first sentence of the package documentation is a complete sentence that identifies the package by name and summarizes the purpose of the package.

    The primary purpose of a package documentation is to provide high-level context that will provide a framework in which the users can put the detail about the package contents.

class com.vmware.vapi.metadata.metamodel_client.PrimitiveValue(type=None, boolean_value=None, double_value=None, long_value=None, string_value=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The PrimitiveValue class contains value of the constant element.

Tip

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

Parameters:
  • type (PrimitiveValue.Type) – Type of the constant value.
  • boolean_value (bool) – Boolean value of the constant. This attribute is optional and it is only relevant when the value of type is PrimitiveValue.Type.BOOLEAN.
  • double_value (float) – Double value of the constant. This attribute is optional and it is only relevant when the value of type is PrimitiveValue.Type.DOUBLE.
  • long_value (long) – Long value of the constant. This attribute is optional and it is only relevant when the value of type is PrimitiveValue.Type.LONG.
  • string_value (str) – String value of the constant. This attribute is optional and it is only relevant when the value of type is PrimitiveValue.Type.STRING.
class Type(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The PrimitiveValue.Type class defines the valid types for values in constant elements.

Note

This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.

Parameters:string (str) – String value for the Type instance.
BOOLEAN = Type(string=u'BOOLEAN')

Indicates the value is a boolean (true or false).

DOUBLE = Type(string=u'DOUBLE')

Indicates the value is a double (64 bit floating number).

LONG = Type(string=u'LONG')

Indicates the value is a long (64 bit signed integer).

STRING = Type(string=u'STRING')

Indicates the value is a string (a variable length sequence of characters). The encoding is UTF8.

class com.vmware.vapi.metadata.metamodel_client.Resource(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Resource class provides methods to retrieve information about resource types.

A service is a logical grouping of operations that operate on an entity. Each entity is identifier by a namespace (or resource type) and an unique identifier.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.resource'

Resource type for resource.

list()[source]

Returns the set of resource types present across all the service elements contained in all the package elements.

Return type:set of str
Returns:Set of resource types The return value will contain identifiers for the resource type: com.vmware.vapi.resource.
class com.vmware.vapi.metadata.metamodel_client.Service(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Service class provides methods to retrieve metamodel information about a service element in the interface definition language.

A service is a logical grouping of operations that operate on some entity. A service element describes a service. It contains operation elements that describe the operations grouped in the service. It also contains structure elements and enumeration elements corresponding to the structures and enumerations defined in the service.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.service'

Resource type for service.

get(service_id)[source]

Retrieves information about the service element corresponding to service_id.

The ServiceInfo contains the metamodel information for the operation elements, structure elements and enumeration elements contained in the service element.

Parameters:service_id (str) – Identifier of the service element. The parameter must be an identifier for the resource type: com.vmware.vapi.service.
Return type:ServiceInfo
Returns:The ServiceInfo instance that corresponds to service_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the service element associated with service_id is not registered with the infrastructure.
list()[source]

Returns the identifiers for the service elements that are currently registered with the infrastructure.

The list of service elements is an aggregate list of all the service elements contained in all the package elements.

Return type:list of str
Returns:The list of identifiers for the service elements that are currently registered with the infrastructure. The return value will contain identifiers for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.metamodel_client.ServiceInfo(name=None, operations=None, structures=None, enumerations=None, constants=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ServiceInfo class contains the metamodel information of all the operation elements, structure elements and enumeration elements containted in a service element.

Tip

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

Parameters:
  • name (str) – Dot separated name of the service element. The segments in the name reflect the organization of the APIs. The format of each segment is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • operations (dict of str and OperationInfo) – Metamodel information of all the operation elements contained in the service element. The key in the dict is the identifier of the operation element and the value in the dict is the metamodel information for the operation element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.operation. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.operation.
  • structures (dict of str and StructureInfo) – Metamodel information of all the structure elements contained in the service element. The key in the dict is the identifier of the structure element and the value in the dict is the metamodel information for the structure element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.structure. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.structure.
  • enumerations (dict of str and EnumerationInfo) – Metamodel information of all the enumeration elements contained in the service element. The key in the dict is the identifier of the enumeration element and the value in the dict is the metamodel information for the enumeration element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.enumeration. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.enumeration.
  • constants (dict of str and ConstantInfo) – Metamodel information of all the constant elements contained in the service element. The key in the dict is the name of the constant element and the value in the dict is the metamodel information for the contant element.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the service element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for the service element. It can contain HTML markup and Javadoc tags. The first sentence of the service documentation is a complete sentence that identifies the service by name and summarizes the purpose of the service. The remaining part of the documentation provides a summary of how to use the operations defined in the service.
class com.vmware.vapi.metadata.metamodel_client.Source(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Source class provides methods to manage the sources of metamodel metadata information.

The interface definition language infrastructure provides tools to generate various kinds of metadata in JSON format from the interface definition files and additional properties files. One of the generated files contains metamodel information. The generated file can be registered as a source of metadata.

The metamodel file contains all the data present in the interface definition files. Each metamodel file contains data about one component element. When a metamodel file is added as a source, each source contributes only one component element’s metadata.

Metamodel metadata can also be discovered from a remote server that supports the metamodel metadata classes (see com.vmware.vapi.metadata.metamodel_client). Since multiple components can be registered with a single metadata server, when a remote server is registered as a source, that source can contribute more than one component.

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

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.CreateSpec class contains the registration information of a metamodel source.

Tip

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

Parameters:
class Source.Info(description=None, type=None, filepath=None, address=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.Info class contains the metadata source information.

Tip

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

Parameters:
  • description (str) – English language human readable description of the source.
  • type (com.vmware.vapi.metadata_client.SourceType) – Type of the metadata source.
  • filepath (str) – Absolute file path of the metamodel metadata file that has the metamodel information about one component element. The filePath is the path to the file in the server’s filesystem. This attribute is optional and it is only relevant when the value of type is null.
  • address (str) –

    Connection information for the remote server. This must be in the format http(s)://IP:port/namespace.

    The remote server must support the classes in the com.vmware.vapi.metadata.metamodel_client module. It must expose metamodel information of one or more components. This attribute is optional and it is only relevant when the value of type is null.

Source.RESOURCE_TYPE = 'com.vmware.vapi.metadata.metamodel.source'

Resource type for metadata source.

Source.create(source_id, spec)[source]

Creates a new metadata source. Once the server validates the registration information of the metadata source, the metamodel metadata is retrieved from the source. This populates elements in all the classes defined in com.vmware.vapi.metadata.metamodel_client module.

Parameters:
  • source_id (str) – metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.metamodel.source.
  • spec (Source.CreateSpec) – create specification.
Raise :

com.vmware.vapi.std.errors_client.AlreadyExists if the metadata source identifier is already registered with the infrastructure.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the type of the source specified in null is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the file specified in null is not a valid JSON file or if the format of the metamodel metadata in the JSON file is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the URI specified in null is unreachable or if there is a transport protocol or message protocol mismatch between the client and the server or if the remote server do not have classes present in com.vmware.vapi.metadata.metamodel_client module.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the file specified in null does not exist.

Source.delete(source_id)[source]

Deletes an existing metamodel metadata source from the infrastructure.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.metamodel.source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.fingerprint(source_id=None)[source]

Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.metamodel.source. If unspecified, the fingerprint of all the metadata sources is returned.
Return type:str
Returns:Aggregate fingerprint of all the metadata sources or of a particular metadata source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.get(source_id)[source]

Retrieves information about the metadata source corresponding to source_id.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.metamodel.source.
Return type:Source.Info
Returns:The Source.Info instance that corresponds to source_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.list()[source]

Returns the identifiers of the metadata sources currently registered with the infrastructure.

Return type:list of str
Returns:The list of identifiers for metadata sources currently registered. The return value will contain identifiers for the resource type: com.vmware.vapi.metadata.metamodel.source.
Source.reload(source_id=None)[source]

Reloads the metamodel metadata from all the metadata sources or of a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.metamodel.source. If unspecified, all the metadata sources are reloaded.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
class com.vmware.vapi.metadata.metamodel_client.Structure(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Structure class providers methods to retrieve metamodel information about a structure element in the interface definition language.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.structure'

Resource type for structure.

get(structure_id)[source]

Retrieves information about the structure element corresponding to structure_id.

The StructureInfo contains the metamodel information about the structure element. It contains information about all the field elements and enumeration elements contained in this structure element.

Parameters:structure_id (str) – Identifier of the structure element. The parameter must be an identifier for the resource type: com.vmware.vapi.structure.
Return type:StructureInfo
Returns:The StructureInfo instance that corresponds to structure_id.
Raise :com.vmware.vapi.std.errors_client.NotFound if the structure element associated with structure_id is not contained in any of the package elements or service elements.
list()[source]

Returns the identifiers for the structure elements that are contained in all the package elements and service elements.

Return type:list of str
Returns:The list of identifiers for the structure elements. The return value will contain identifiers for the resource type: com.vmware.vapi.structure.
class com.vmware.vapi.metadata.metamodel_client.StructureInfo(name=None, type=None, enumerations=None, constants=None, fields=None, metadata=None, documentation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The StructureInfo class contains the metamodel information of all the field elements, constant elements and enumeration elements contained in the structure element.

In the interface definition language, API designers have the ability to include all the fields from one structure to another structure. This is done by using an annotation \\@Include on the structure in which we want to add the fields. If this annotation is present, the list of fields in the StructureInfo will also contain the fields that are being included. The annotation information is also retained in the StructureInfo.metadata element as well.

Tip

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

Parameters:
  • name (str) – Dot separated name of the structure element. The segments in the name reflect the organization of the APIs. The format of each segment is lower case with underscores. Each underscore represents a word boundary. If there are acronyms in the word, the capitalization is preserved. This format makes it easy to translate the segment into a different naming convention.
  • type (StructureInfo.Type) – Type of the structure.
  • enumerations (dict of str and EnumerationInfo) – Metamodel information of all the enumeration elements contained in the structure element. The key in the dict is the identifier of the enumeration element and the value is the metamodel information of the enumeration element. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.enumeration. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.enumeration.
  • constants (dict of str and ConstantInfo) – Metamodel information of all the constant elements contained in the structure element. The key in the dict is the name of the constant element and the value in the dict is the metamodel information for the constant element.
  • fields (list of FieldInfo) – Metamodel information of all the field elements. The order of the field elements in the list matches the order in which the fields are defined in the service.
  • metadata (dict of str and ElementMap) –

    Generic metadata elements for the structure element. The key in the dict is the name of the metadata element and the value is the data associated with that metadata element.

    The MetadataIdentifier contains possible string values for keys in the dict.

  • documentation (str) – English language documentation for a structure element. It can contain HTML markup and Javadoc tags. The first sentence of the structure documentation is a complete sentence that identifies the structure by name and summarizes the purpose of the structure.
class Type(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The StructureInfo.Type class defines the kind of this structure element. In the interface definition language, structure element and error element have similar characteristics. The difference is that only error elements can be used to describe the exceptions of an operation element.

Note

This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.

Parameters:string (str) – String value for the Type instance.
ERROR = Type(string=u'ERROR')

If the type is an error element.

STRUCTURE = Type(string=u'STRUCTURE')

If the type is a structure element.

class com.vmware.vapi.metadata.metamodel_client.Type(category=None, builtin_type=None, user_defined_type=None, generic_instantiation=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Type class describes the type information of a typed element in the interface definiton language. The following elements in the metamodel are typed:

  • Field element in a structure element. See StructureInfo.fields
  • Parameter element in an operation element. See OperationInfo.params
  • Result element in an operation element. See OperationInfo.output
The type could be one of the three following categories:
  • Built-in types: These are types present in the interface definition language type system. They are provided by the infrastructure.
  • User defined named type: API designers can create custom types and use them for the typed elements. These types have a unique identifier.
  • Generic type instantiation: The language infrastructure also provides generic types such as list, map, set and so on. An instantiation of one of these generic types could also be used for the typed elements.

Tip

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

Parameters:
  • category (Type.Category) – Category of this type.
  • builtin_type (Type.BuiltinType) – Category of the built-in type. This attribute is optional and it is only relevant when the value of category is Type.Category.BUILTIN.
  • user_defined_type (UserDefinedType) – Identifier and type of the user defined type. This attribute is optional and it is only relevant when the value of category is Type.Category.USER_DEFINED.
  • generic_instantiation (GenericInstantiation) – Instantiation of one of the generic types available in the interface definition language. This attribute is optional and it is only relevant when the value of category is Type.Category.GENERIC.
class BuiltinType(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The Type.BuiltinType class provides class attribute for each of the built-in types present in the interface definition language type system.

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 BuiltinType instance.
ANY_ERROR = BuiltinType(string=u'ANY_ERROR')

The built-in type is an arbitrary exception type. This is used if the value of a typed element can be one of any user defined named type which is an exception.

BINARY = BuiltinType(string=u'BINARY')

The built-in type is a binary. The value is a variable-length sequence of zero or more bytes.

BOOLEAN = BuiltinType(string=u'BOOLEAN')

The built-in type is a boolean. The value is true or false.

DATE_TIME = BuiltinType(string=u'DATE_TIME')

The built-in type is a datetime. The value should be in the UTC timezone and the precision is milliseconds.

DOUBLE = BuiltinType(string=u'DOUBLE')

The built-in type is a double. The value is a 64 bit floating point number.

DYNAMIC_STRUCTURE = BuiltinType(string=u'DYNAMIC_STRUCTURE')

The built-in type is a dynamic structure. This is used if the value of a typed element can be one of any user defined named type.

ID = BuiltinType(string=u'ID')

The built-in type is an ID. The value represents an identifier for a resource.

LONG = BuiltinType(string=u'LONG')

The built-in type is a long. The value is a 64 bit signed integer.

OPAQUE = BuiltinType(string=u'OPAQUE')

The built-in type is an opaque. This is used if the value of a typed element could be of any type and the actual type will be known only during the execution of the API. This is mostly used in infrastructure classes.

SECRET = BuiltinType(string=u'SECRET')

The built-in type is a secret. The value is a variable-length sequence of zero or more unicode characters. The value contains sensitive data that should not be printed or displayed anywhere.

STRING = BuiltinType(string=u'STRING')

The built-in type is a string. The value is a variable-length sequence of zero or more unicode characters.

URI = BuiltinType(string=u'URI')

The built-in type is an URI. The value follows the IRI specification in RFC 3987.

VOID = BuiltinType(string=u'VOID')

The built-in type is a void. The value is None.

class Type.Category(string)[source]

Bases: vmware.vapi.bindings.enum.Enum

The Type.Category class provides class attribute for each category of the type.

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 Category instance.
BUILTIN = Category(string=u'BUILTIN')

The type is one of the built-in types specified in Type.BuiltinType

GENERIC = Category(string=u'GENERIC')

The type is an instantiation of one of the generic types.

USER_DEFINED = Category(string=u'USER_DEFINED')

The type is one of the user defined named types.

class com.vmware.vapi.metadata.metamodel_client.UserDefinedType(resource_type=None, resource_id=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The UserDefinedType class contains the metamodel type information of a typed element whose type is a user defined named type.

Tip

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

Parameters:
  • resource_type (str) – Category of the user defined named type. The named type could be a structure element or an enumeration element. When clients pass a value of this class as a parameter, the attribute must be one of com.vmware.vapi.structure or com.vmware.vapi.enumeration. When methods return a value of this class as a return value, the attribute will be one of com.vmware.vapi.structure or com.vmware.vapi.enumeration.
  • resource_id (str) – Identifier of the user defined named type. When clients pass a value of this class as a parameter, the attribute must be an identifier for one of these resource types: com.vmware.vapi.structure or com.vmware.vapi.enumeration. When methods return a value of this class as a return value, the attribute will be an identifier for one of these resource types: com.vmware.vapi.structure or com.vmware.vapi.enumeration.

privilege_client Module

The com.vmware.vapi.metadata.privilege_client module provides classes that expose privilege information for operation elements across all the service elements.

An entity has a unique identifier and a resource type. An entity can either be present in one of the parameter elements or if a parameter is a structure element, it could also be present in one of the field elements.

Privileges can be assigned to either operation elements or entities used in the operation element. A list of privileges can also be applied on a package element. This list of privileges would be used as a default for all the operation elements and the entities that do not have any defined privileges.

class com.vmware.vapi.metadata.privilege_client.Component(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Component class provides methods to retrieve privilege information of a component element.

A component element is said to contain privilege information if any one of package elements in it contains privilege information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.component'

Resource type for vAPI component.

fingerprint(component_id)[source]

Retrieves the fingerprint computed from the privilege metadata of the component element corresponding to component_id.

The fingerprint provides clients an efficient way to check if the metadata for a particular component has been modified on the server. The client can do this by comparing the result of this operation with the fingerprint returned in the result of Component.get().

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:str
Returns:The fingerprint computed from the privilege metadata of the component.
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id does not have any privilege information.
get(component_id)[source]

Retrieves privilege information about the component element corresponding to component_id.

The ComponentData contains the privilege information about the component element and its fingerprint. It contains information about all the package elements that belong to this component element.

Parameters:component_id (str) – Identifier of the component element. The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:ComponentData
Returns:The ComponentData instance that corresponds to component_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the component element associated with component_id does not have any privilege information.
list()[source]

Returns the identifiers for the component elements that have privilege information.

Return type:list of str
Returns:The list of identifiers for the component elements that have privilege information. The return value will contain identifiers for the resource type: com.vmware.vapi.component.
class com.vmware.vapi.metadata.privilege_client.ComponentData(info=None, fingerprint=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentData class contains the privilege information of the component along with its fingerprint.

Tip

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

Parameters:
  • info (ComponentInfo) – Privilege information of the component. This includes information about all the modules in the component.
  • fingerprint (str) –

    Fingerprint of the metadata of the component.

    Privilege information could change when there is an infrastructure update. Since the data present in ComponentData.info could be quite large, fingerprint provides a convenient way to check if the data for a particular component is updated.

    You should store the fingerprint associated with a component. After an update, by invoking the Component.fingerprint() method, you can retrieve the new fingerprint for the component. If the new fingerprint and the previously stored fingerprint do not match, clients can then use the Component.get() to retrieve the new privilege information for the component.

class com.vmware.vapi.metadata.privilege_client.ComponentInfo(packages=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ComponentInfo class contains the privilege information of a component element.

For an explanation of privilege information contained within component elements, see Component.

Tip

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

Parameters:packages (dict of str and PackageInfo) –

Privilege information of all the package elements. The key in the dict is the identifier of the package element and the value in the dict is the privilege information for the package element.

For an explanation of privilege information containment within package elements, see Package. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.package. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.package.

class com.vmware.vapi.metadata.privilege_client.OperationInfo(privileges=None, privilege_info=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The OperationInfo class contains privilege information of an operation element.

For an explanation of containment within operation elements, see com.vmware.vapi.metadata.privilege.service_client.Operation.

Tip

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

Parameters:
  • privileges (list of str) – List of all privileges assigned to the operation element.
  • privilege_info (list of PrivilegeInfo) – Privilege information of all the parameter elements of the operation element. For an explanation of containment of privilege information within parameter elements, see PrivilegeInfo.
class com.vmware.vapi.metadata.privilege_client.Package(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Package class provides methods to retrieve privilege information of a package element.

A package element is said to contain privilege information if there is a default privilege assigned to all service elements contained in the package element or if one of the operation elements contained in one of the service elements in this package element has privilege information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.package'

Resource type for package.

get(package_id)[source]

Retrieves privilege information about the package element corresponding to package_id.

Parameters:package_id (str) – Identifier of the package element. The parameter must be an identifier for the resource type: com.vmware.vapi.package.
Return type:PackageInfo
Returns:The PackageInfo instance that corresponds to package_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the package element associated with package_id does not have any privilege information.
list()[source]

Returns the identifiers for the package elements that have privilege information.

Return type:list of str
Returns:The list of identifiers for the package elements that have privilege information. The return value will contain identifiers for the resource type: com.vmware.vapi.package.
class com.vmware.vapi.metadata.privilege_client.PackageInfo(privileges=None, services=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The PackageInfo class contains the privilege information of a package element.

For an explanation of privilege information contained within package elements, see Package.

Tip

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

Parameters:
  • privileges (list of str) – List of default privileges to be used for all the operations present in this package. If a particular operation element has no explicit privileges defined in the privilege definition file, these privileges are used for enforcing authorization.
  • services (dict of str and ServiceInfo) – Information about all service elements contained in this package element that contain privilege information. The key in the dict is the identifier of the service element and the value in the dict is the privilege information for the service element. For an explanation of privilege information containment within service elements, see Service. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.service. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.privilege_client.PrivilegeInfo(property_path=None, privileges=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The PrivilegeInfo class contains the privilege information for a parameter element in an operation element.

Tip

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

Parameters:
  • property_path (str) –

    The propertyPath points to an entity that is used in the operation element. An entity can either be present in one of the parameter elements or if a parameter is a structure element, it could also be present in one of the field elements.

    If the privilege is assigned to an entity used in the parameter, propertyPath will just contain the name of the parameter field. If the privilege is assigned to an entity in one of the field elements of a parameter element that is a structure element, then propertyPath will contain a path to the field element starting from the parameter name.

  • privileges (list of str) – List of privileges assigned to the entity that is being referred by PrivilegeInfo.property_path.
class com.vmware.vapi.metadata.privilege_client.Service(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Service class provides methods to retrieve privilege information of a service element.

A service element is said to contain privilege information if one of the operation elements contained in this service element has privilege information.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.service'

Resource type for service.

get(service_id)[source]

Retrieves privilege information about the service element corresponding to service_id.

Parameters:service_id (str) – Identifier of the service element. The parameter must be an identifier for the resource type: com.vmware.vapi.service.
Return type:ServiceInfo
Returns:The ServiceInfo instance that corresponds to service_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the service element associated with service_id does not have any privilege information.
list()[source]

Returns the identifiers for the service elements that have privilege information.

Return type:list of str
Returns:The list of identifiers for the service elements that have privilege information. The return value will contain identifiers for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.privilege_client.ServiceInfo(operations=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The ServiceInfo class contains privilege information of a service element.

For an explanation of privilege information contained within service elements, see Service.

Tip

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

Parameters:operations (dict of str and OperationInfo) –

Information about all operation elements contained in this service element that contain privilege information. The key in the dict is the identifier of the operation element and the value in the dict is the privilege information for the operation element.

For an explanation of containment of privilege information within operation elements, see com.vmware.vapi.metadata.privilege.service_client.Operation. When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.operation. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.operation.

class com.vmware.vapi.metadata.privilege_client.Source(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

The Source class provides methods to manage the sources of privilege metadata information.

The interface definition language infrastructure provides tools to generate various kinds of metadata in JSON format from the interface definition files and additional properties files. One of the generated files contains privilege information. The generated file can be registered as a source of metadata.

The privilege file contains all the data present in the interface definition files. Each privilege file contains data about one component element. When a privilege file is added as a source, each source contributes only one component element’s metadata.

Privilege metadata can also be discovered from a remote server that supports the privilege metadata classes (see com.vmware.vapi.metadata.privilege_client). Since multiple components can be registered with a single metadata server, when a remote server is registered as a source, that source can contribute more than one component.

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

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.CreateSpec class contains the registration information of a privilege source.

Tip

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

Parameters:
class Source.Info(description=None, type=None, filepath=None, address=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

The Source.Info class contains the metadata source information.

Tip

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

Parameters:
  • description (str) – English language human readable description of the source.
  • type (com.vmware.vapi.metadata_client.SourceType) – Type of the metadata source.
  • filepath (str) – Absolute file path of the privilege metadata file that has the privilege information about one component element. The filePath is the path to the file in the server’s filesystem. This attribute is optional and it is only relevant when the value of type is null.
  • address (str) –

    Connection information for the remote server. This must be in the format http(s)://IP:port/namespace.

    The remote server must support the classes in the com.vmware.vapi.metadata.privilege_client module. It must expose privilege information of one or more components. This attribute is optional and it is only relevant when the value of type is null.

Source.RESOURCE_TYPE = 'com.vmware.vapi.metadata.privilege.source'

Resource type for metadata source.

Source.create(source_id, spec)[source]

Creates a new metadata source. Once the server validates the registration information of the metadata source, the privilege metadata is retrieved from the source. This populates elements in all the classes defined in com.vmware.vapi.metadata.privilege_client module.

Parameters:
  • source_id (str) – metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.privilege.source.
  • spec (Source.CreateSpec) – create specification.
Raise :

com.vmware.vapi.std.errors_client.AlreadyExists if the metadata source identifier is already registered with the infrastructure.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the type of the source specified in null is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the file specified in null is not a valid JSON file or if the format of the privilege metadata in the JSON file is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument if the URI specified in null is unreachable or if there is a transport protocol or message protocol mismatch between the client and the server or if the remote server do not have classes present in com.vmware.vapi.metadata.privilege_client module.

Raise :

com.vmware.vapi.std.errors_client.NotFound if the file specified in null does not exist.

Source.delete(source_id)[source]

Deletes an existing privilege metadata source from the infrastructure.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.privilege.source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.fingerprint(source_id=None)[source]

Returns the aggregate fingerprint of metadata from all the metadata sources or from a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.privilege.source. If unspecified, the fingerprint of all the metadata sources is returned.
Return type:str
Returns:Aggregate fingerprint of all the metadata sources or of a particular metadata source.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.get(source_id)[source]

Retrieves information about the metadata source corresponding to source_id.

Parameters:source_id (str) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.privilege.source.
Return type:Source.Info
Returns:The Source.Info instance that corresponds to source_id
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.
Source.list()[source]

Returns the identifiers of the metadata sources currently registered with the infrastructure.

Return type:list of str
Returns:The list of identifiers for metadata sources currently registered. The return value will contain identifiers for the resource type: com.vmware.vapi.metadata.privilege.source.
Source.reload(source_id=None)[source]

Reloads the privilege metadata from all the metadata sources or of a particular metadata source if source_id is specified.

Parameters:source_id (str or None) – Identifier of the metadata source. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.privilege.source. If unspecified, all the metadata sources are reloaded.
Raise :com.vmware.vapi.std.errors_client.NotFound if the metadata source associated with source_id is not found.

routing_client Module

class com.vmware.vapi.metadata.routing_client.Component(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

Operations to retrieve information about the routing information in a vAPI component. A Component is said to contain routing information if any of its packages, services or methods contain routing information

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.component'

Resource type for vAPI Component.

fingerprint(component_id)[source]

Checksum of all routing metadata for a vAPI component on the server

Parameters:component_id (str) – fully qualified component name The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:str
Returns:checksum of routing metadata for a vAPI component
Raise :com.vmware.vapi.std.errors_client.NotFound If the component name does not exist
get(component_id)[source]

Get the routing information for a vAPI component

Parameters:component_id (str) – fully qualified component name The parameter must be an identifier for the resource type: com.vmware.vapi.component.
Return type:ComponentData
Returns:routing information for the vAPI component
Raise :com.vmware.vapi.std.errors_client.NotFound If the component name does not exist
list()[source]

List all the vAPI components that contain operations which have routing information.

Return type:list of str
Returns:list of fully qualified component names The return value will contain identifiers for the resource type: com.vmware.vapi.component.
class com.vmware.vapi.metadata.routing_client.ComponentData(info=None, fingerprint=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Routing information of the vAPI component along with its checksum

Tip

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

Parameters:
  • info (ComponentInfo) – Routing information of the vAPI component
  • fingerprint (str) – Fingerprint of metadata of a vAPI component
class com.vmware.vapi.metadata.routing_client.ComponentInfo(packages=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Information about a vAPI component that contains routing information For an explanation of routing information within components, see Component

Tip

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

Parameters:packages (dict of str and PackageInfo) – Routing information of all the vAPI packages. The key in the map is the ID of the package and the value in the map is the routing information for the package For an explanation of routing information within packages, see Package When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.package. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.package.
class com.vmware.vapi.metadata.routing_client.OperationInfo(routing_info=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Information about a vAPI operation that contains routing information. For an explanation of containment within operations, see null

Tip

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

Parameters:routing_info (RoutingInfo) – The routing information assigned for this operation. For an explanation of routing information, see RoutingInfo
class com.vmware.vapi.metadata.routing_client.Package(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

Operations to retrieve information about routing information in a vAPI package A Package is said to contain routing information if there is a default RoutingInfo assigned to all operations within a package or if one of the operations within this package has explicit routing information

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.package'

Resource type for vAPI package.

get(package_id)[source]

Get the routing information for a vAPI package

Parameters:package_id (str) – fully qualified package name The parameter must be an identifier for the resource type: com.vmware.vapi.package.
Return type:PackageInfo
Returns:routing information for the vAPI package
Raise :com.vmware.vapi.std.errors_client.NotFound If the package name does not exist
list()[source]

List of all vAPI packages that have routing information

Return type:list of str
Returns:list of fully qualified package names The return value will contain identifiers for the resource type: com.vmware.vapi.package.
class com.vmware.vapi.metadata.routing_client.PackageInfo(routing_info=None, services=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Information about a vAPI package containing routing information.

For an explanation of routing information within packages, see Package

Tip

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

Parameters:
  • routing_info (RoutingInfo) – The routing information to be used for all the operations present in this package. If a particular operation has no explicit routing information defined in the routing definition file, this routing info will be used for enforcing routing.
  • services (dict of str and ServiceInfo) – Information about all services in this package that contain routing information. The key in the map is the ID of the service and the value in the map is the routing information for the service For an explanation of routing information within service, see Service When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.service. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.routing_client.RoutingInfo(routing_path=None, routing_strategy=None, operation_hints=None, id_types=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Routing information

Tip

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

Parameters:
  • routing_path (str) – The initial version of the routing info allowed routing by single parameter. Clients requested allowing them to place more than one parameters so that the routing is performed by the first non-null argument in the list. To achieve that we have added method com.vmware.vapi.metadata.RoutingInfo#getRoutingPaths() which should be preferred over com.vmware.vapi.metadata.RoutingInfo#getRoutingPath() which is deprecated. The deprecated method will return string representation of the comma-separated list of ids, while the com.vmware.vapi.metadata.RoutingInfo#getRoutingPaths() will return instance of java.util.List<String> containing the ids.
  • routing_strategy (str) – The routingStrategy is the actual strategy, based on which will be performed the routing. If the routingStrategy is IDROUTE, in RoutingInfo.routing_path must be assigned the id for the routing. There are also default strategies like IDFIRSTROUTE, LOCAL for which there is no need to specify routingPath. The name of these strategies is clear about where we should look for an ID to route, or if we need ID at all.
  • operation_hints (list of str) – This is comma-separated list of hints from the input ini file. Here the user must mention the type of the invoked method, e.g. HINTS(create) or HINTS(delete). In the future we expect this field to contain other hints also e.g. HINTS(create,lazy).
  • id_types (dict of str and str) – This is map of specifically predefined resource types in the routing metadata. For example id types that do not require storage in the Inventory Service. Those type of objects are called ‘positioned’ - it is well known in advance where those objects will be routed, because their ids contain VC server guid. Example: Content Library Sessions are considered transient objects that do not need to be persisted in the IS. Routing ini file must contain section: [types] com.vmware.content.DownloadSession=positioned The map therefore will contain: {{“com.vmware.content.DownloadSession”, “positioned”}} Note: This should not be final solution. To avoid duplication, currently this map will be stored only in one RoutingInfo object across the whole ProductModel. In the future, it might be moved to a common place as ComponentInfo, for example.
class com.vmware.vapi.metadata.routing_client.Service(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

Operations to retrieve information about routing information of a vAPI service

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
RESOURCE_TYPE = 'com.vmware.vapi.service'

Resource type for vAPI Service.

get(service_id)[source]

Get the routing information for a vAPI service

Parameters:service_id (str) – fully qualified service name The parameter must be an identifier for the resource type: com.vmware.vapi.service.
Return type:ServiceInfo
Returns:identifier information for the vAPI service
Raise :com.vmware.vapi.std.errors_client.NotFound If the service name does not exist
list()[source]

Get list of all vAPI services that have operations with routing information

Return type:list of str
Returns:list of fully qualified service names The return value will contain identifiers for the resource type: com.vmware.vapi.service.
class com.vmware.vapi.metadata.routing_client.ServiceInfo(routing_info=None, operations=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Information about a vAPI service that has routing information A service is said to contain routing information if any of its operations have routing information

Tip

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

Parameters:
  • routing_info (RoutingInfo) – The routing information to be used for all the operations present in this service. If a particular operation has no explicit routing information defined in the routing definition file, this routing info will be used for enforcing routing.
  • operations (dict of str and OperationInfo) –

    Information about all operations in this service that contain routing Information. The key in the map is the ID of the operation and the value in the map is the routing information for this operation.

    For an explanation of routing information within operations, see null When clients pass a value of this class as a parameter, the key in the attribute dict must be an identifier for the resource type: com.vmware.vapi.operation. When methods return a value of this class as a return value, the key in the attribute dict will be an identifier for the resource type: com.vmware.vapi.operation.

class com.vmware.vapi.metadata.routing_client.Source(config)[source]

Bases: vmware.vapi.bindings.stub.VapiInterface

Operations to manage the metadata sources for routing information

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

Bases: vmware.vapi.bindings.struct.VapiStruct

Metadata source create spec.

Tip

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

Parameters:
class Source.Info(description=None, type=None, filepath=None, address=None)[source]

Bases: vmware.vapi.bindings.struct.VapiStruct

Metadata source info.

Tip

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

Parameters:
  • description (str) – Description of the source.
  • type (com.vmware.vapi.metadata_client.SourceType) – Type of the metadata source.
  • filepath (str) – Absolute file path of the file that has the metadata information. This attribute is optional and it is only relevant when the value of type is null.
  • address (str) – URI of the remote vAPI endpoint. This should be of the format http(s):IP:port/namespace. This attribute is optional and it is only relevant when the value of type is null.
Source.RESOURCE_TYPE = 'com.vmware.vapi.metadata.source'

Resource type for vAPI metadata source.

Source.create(source_id, spec)[source]

Create a new metadata source.

Parameters:
  • source_id (str) – metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
  • spec (Source.CreateSpec) – create specification.
Raise :

com.vmware.vapi.std.errors_client.AlreadyExists If the metadata source identifier is already present.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If type of the source specified in \@{link CreateSpec#type} is invalid.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If the file specified in \@{link CreateSpec#filepath} is not a valid json file.

Raise :

com.vmware.vapi.std.errors_client.InvalidArgument If the URI specified in \@{link CreateSpec#address} is unreachable or not a vAPI compatible server.

Raise :

com.vmware.vapi.std.errors_client.NotFound If the file specified in \@{link CreateSpec#filepath} does not exist.

Source.delete(source_id)[source]

Delete a metadata source.

Parameters:source_id (str) – Metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.fingerprint(source_id=None)[source]

Returns the fingerprint of all the sources or of a particular source.

Parameters:source_id (str or None) –

Metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.

If unspecified, fingerprint of all the sources is returned
Return type:str
Returns:fingerprint of all the sources or of a particular source.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.get(source_id)[source]

Get the details about a metadata source.

Parameters:source_id (str) – Metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.
Return type:Source.Info
Returns:Metadata source info.
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.
Source.list()[source]

List all the metadata sources.

Return type:list of str
Returns:List of all metadata sources. The return value will contain identifiers for the resource type: com.vmware.vapi.metadata.source.
Source.reload(source_id=None)[source]

Reload metadata from all the sources or of a particular source.

Parameters:source_id (str or None) –

Metadata source identifier. The parameter must be an identifier for the resource type: com.vmware.vapi.metadata.source.

If unspecified, all the sources are reloaded
Raise :com.vmware.vapi.std.errors_client.NotFound If the metadata source identifier is not found.