client Package

client Package

factories Module

StubConfiguration factory

class vmware.vapi.stdlib.client.factories.StubConfigurationFactory[source]

Bases: object

Factory class for creating stub configuration objects

static new_configuration(connector, *errorTypes)[source]

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

Parameters:
static new_runtime_configuration(connector, *errorTypes)[source]

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

Parameters:
static new_std_configuration(connector, *errorTypes)[source]

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

Parameters:

introspection Module

Introspection services

class vmware.vapi.stdlib.client.introspection.IntrospectableApiProvider(connector)[source]

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)[source]

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)[source]

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'>)[source]

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:
localize(msg)[source]

Localize a given LocalizableMessage.

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

Table Of Contents

Previous topic

stdlib Package

This Page