Core Protocol Definition classes
Bases: object
The ApiInterface interface provides introspection APIs for a vAPI interface; it is implemented by API providers.
Initialize the Api Interface instance
Returns interface definition
Return type: | InterfaceDefinition |
---|---|
Returns: | Interface definition |
Returns interface identifier
Return type: | InterfaceIdentifier |
---|---|
Returns: | Interface identifier |
Returns the method definition
Return type: | MethodDefinition |
---|---|
Returns: | Method definition |
Invokes the specified method using the execution context and the input provided
Parameters: |
|
---|---|
Return type: | |
Returns: | Result of the method invocation |
Bases: object
The ApiProvider interface is used for invocation of operations
Invokes the specified method using the input value and the the execution context provided
Parameters: |
|
---|---|
Return type: | |
Returns: | Result of the method invocation |
Bases: vmware.vapi.core.CustomDict
Interface representing additional data associated with the request for method execution represented by this ExecutionContext. The additional data format is key-value pairs of String.
This additional data is provided by the client initiating the execution, it is then transported as is over the wire and is available for the provider-side service implementations on the server. This extra data is completely opaque for the infrastructure, in other words it is a contract between the client and the service implementation only.
Bases: dict
Interface for implementing Custom dict classes with additional constraints.
Overriding __setitem__ as not enough for adding additional constraints on key/value pairs of dictionaries. We also have to override update and setdefault, so that even they use __setitem__.
Bases: object
This class provides out-of-band context information that is passed along with a method invocation
Initialize Execution Context
Bases: object
The InterfaceDefinition class contains detailed information about a vAPI interface. This should contain all the information required to address an interface in the vAPI runtime.
Initialize the InterfaceDefinition
Parameters: |
|
---|
Returns the interface identifier
Return type: | InterfaceIdentifier |
---|---|
Returns: | Returns the interface identifer of this interface |
Returns the list of method identifiers of the methods exposed by this interface. Each method identifier is unique within an interface. The method identifiers returned are unordered
Return type: | list of MethodIdentifier |
---|---|
Returns: | List of method identifiers of the methods exposed by this interface |
Bases: object
InterfaceIdentifier has the information required to uniquely address a vAPI interface
Initialize an InterfaceIdentifier
Parameters: | iface (str) – String identifier of the interface |
---|
Bases: object
This class contains detailed information about a vAPI method. This should contain all the information required to address a method in the vAPI runtime.
Initialize MethodDefinition
Parameters: |
|
---|
Returns the error definition with the specified name reported by this method or None if this method doesn’t report an error with the specified name.
Parameters: | error_name (str) – Name of the error definition to return |
---|---|
Return type: | vmware.vapi.data.definition.ErrorDefinition |
Returns: | Error definition with the specified name reported by this method or None if this method doesn’t report an error with the specified name. |
Returns a set of error definitions describing the errors that this method can report
Return type: | set of vmware.vapi.data.definition.ErrorDefinition |
---|---|
Returns: | Set of error definitions describing the errors that this method can report |
Returns the method identifier
Return type: | MethodIdentifier |
---|---|
Returns: | MethodIdentifier of this method |
Returns the struct definition corresponding to the method’s input parameters. The field names in the struct definition are the parameter names and the field values correspond to the data definition of the respective fields.
Return type: | vmware.vapi.data.definition.StructDefinition |
---|---|
Returns: | StructDefinition correspoding to the method’s input |
Returns the data definition of the method’s output
Return type: | vmware.vapi.data.definition.DataDefinition |
---|---|
Returns: | Data definition of the method’s output |
Bases: object
This class identifies a ApiMethod instance
Initialize the MethodIdentifier
Parameters: |
|
---|
Returns the interface identifier of the method
Return type: | InterfaceIdentifier |
---|---|
Returns: | InterfaceIdentifier of this method |
Bases: object
The MethodResult class contains the result of a method call. It contains either the output of the method invocation or an error reported by the method invocation. These are mutually exclusive.
Variables: |
|
---|
Initialize MethodResult
Parameters: |
|
---|
Return type: | vmware.vapi.data.value.ErrorValue |
---|---|
Returns: | Method error |
Return type: | vmware.vapi.data.value.DataValue |
---|---|
Returns: | Method output |
Bases: object
The ProviderDefinition class contains details information about a vAPI provider
Initialize the ProviderDefinition
Parameters: | name (str) – Name of the provider |
---|
Bases: vmware.vapi.core.CustomDict
Implementations of this interface will provide all needed data for authentication for the given invocation.
vAPI CoreException Class
Bases: exceptions.Exception
This exception is raised by various components of the vAPI runtime infrastructure to indicate failures in that infrastructure.
Server-side the exception is caught by specific components and an internal_server_error is reported to the client that invoked the request. Client-side the exception may be raised for certain failures before a request was sent to the server or after the response was received from the server. Similarly, server-side the exception may be raised for failures that occur when a provider implementation invokes the vAPI runtime.
This exception is not part of the vAPI message protocol, and it must never be raised by provider implementations.
Variables: | messages – Generator of error messages describing why the Exception was raised |
---|
Initialize CoreException
Parameters: | message (vmware.vapi.message.Message) – Description regarding why the Exception was raised |
---|
Return type: | generator of vmware.vapi.message.Message |
---|---|
Returns: | Generator of error messages describing why the Exception was raised |
vAPI Message class
Bases: object
This class encapsulates the concept of a localizable message.
Variables: |
|
---|
Initializes the message object
Parameters: |
|
---|
Bases: object
Base class for all message bundle classes.
Initialize MessageBundle.
Parameters: | messages (dict of str, str) – Dictionary with message identifiers as keys and message templates as values. |
---|
Bases: object
A factory class to generate localizable messages
Initializes the message object
Parameters: |
|
---|
Return a message object for the given id with the given args. If the message is not found, a default unknown message is returned.
Parameters: |
|
---|---|
Return type: | |
Returns: | The message object constructed using the given arguments |