### Navigation

- index
- modules |
- previous |
- vSphere Automation SDK for Python 6.5.0 documentation »
- vmware Package »
- vapi Package »
- stdlib Package »

# client Package

## `client` Package

## `factories` Module

StubConfiguration factory

class `vmware.vapi.stdlib.client.factories.``StubConfigurationFactory`

  Bases: `object`

  Factory class for creating stub configuration objects

  static `new_configuration`(connector, *errorTypes)

    Return a stub configuration using the specified connection, with no registered errors.

    Parameters: | connector (`vmware.vapi.protocol.client.connector.Connector`) – Connection to be used to talk to the remote ApiProvider error_types (`list` of `vmware.vapi.bindings.type.ErrorType`) – error types to be registered in the configuration

  static `new_runtime_configuration`(connector, *errorTypes)

    Return a stub configuration using the specified connection, with the errors reported by the vAPI runtime registered.

    Parameters: | connector (`vmware.vapi.protocol.client.connector.Connector`) – Connection to be used to talk to the remote ApiProvider error_types (`list` of `vmware.vapi.bindings.type.ErrorType`) – additional error types to be registered in the configuration

  static `new_std_configuration`(connector, *errorTypes)

    Return a stub configuration using the specified connection, with all the standard errors registered.

    Parameters: | connector (`vmware.vapi.protocol.client.connector.Connector`) – Connection to be used to talk to the remote ApiProvider error_types (`list` of `vmware.vapi.bindings.type.ErrorType`) – additional error types to be registered in the configuration

## `introspection` Module

Introspection services

class `vmware.vapi.stdlib.client.introspection.``IntrospectableApiProvider`(connector)

  Bases: `object`

  Helper class for invoking the ‘get’ operation in the service ‘com.vmware.vapi.std.introspection.Operation’

  Initialize IntrospectableApiProvider

  Parameters: | Connector – Protocol connector to use for operation invocations

  `get_method`(service_id, operation_id)

    Get method definition for the specified operation

    Parameters: | service_id (`str`) – Service identifier operation_id (`str`) – Operation identifier
    Return type: | `vmware.vapi.core.MethodDefinition`
    Returns: | Method definition of the specified operation

`vmware.vapi.stdlib.client.introspection.``make_introspection_error_def`(error_name)

  Create an instance of `com.vmware.vapi.std.introspection_client.Operation.DataDefinition` that represents the standard error specified

  Parameters: | error_name (`str`) – Fully qualified error name of one of the vAPI standard errors
  Return type: | `com.vmware.vapi.std.introspection_client.Operation.DataDefinition`
  Returns: | Error definition instance for the given error name

## `l10n` Module

Helper classes for client side localization.

class `vmware.vapi.stdlib.client.l10n.``MessageLocalizer`(bundle, formatter=<class 'vmware.vapi.l10n.formatter.StringFormatter'>)

  Bases: `object`

  Helper class to localize vAPI LocalizableMessages.

  Before initializating the MessageLocalizer, locale has to be explicitly set if the user wants a locale other than English (U.S.).

  Typically, at the start of the application, the following two lines are required to set the locale.

  import locale locale.setlocale(locale.LC_ALL,<locale_type>)

  If the locale_type is empty string, locale is set to user’s default setting (typically specified in the LANG environment variable). Otherwise, the specified locale type has to be installed in the system.

  Initialize MessageLocalizer

  Parameters: | bundle (`vmware.vapi.message.MessageBundle`) – Message bundle to retrieve the templates for the messages formatter (`vmware.vapi.message.MessageFormatter`) – Message formatter to format the messages

  `localize`(msg)

    Localize a given LocalizableMessage.

    Parameters: | msg (`com.vmware.vapi.std_client.LocalizableMessage`) – LocalizableMessage
    Return type: | `str`
    Returns: | Localized string

### Navigation

- index
- modules |
- previous |
- vSphere Automation SDK for Python 6.5.0 documentation »
- vmware Package »
- vapi Package »
- stdlib Package »