server Package

server Package

api_handler Module

Api handler interface

class vmware.vapi.protocol.server.api_handler.ApiHandler[source]

Bases: object

Generic api handler interface

Generic api handler interface init

handle_request(request)[source]

handle request

Type :str
Param :request string
Return type:str
Returns:response string
class vmware.vapi.protocol.server.api_handler.AsyncApiHandler[source]

Bases: vmware.vapi.protocol.server.api_handler.ApiHandler

Callback based AsyncApiHandler

Callback based AsyncApiHandler init

CANCELLED = 8
END_STATES = (1, 2, 8)
ERROR = 2
PENDING = 4
SUCCESS = 1
VALID_STATES = (1, 2, 4, 8)
async_handle_request(request, state_change_cb=None)[source]

async handle request

Parameters:
  • request (str) – request string
  • state_change_cb (function) –

    state change callback def state_change_cb(state, # One of the valid state

    response) # Response value associated with state

    # SUCCESS: response is the request response msg # ERROR: response is the exception thrown (or error response msg?) # PENDING: response is the progress (0 - 100) # CANCELLED: None

async_api_handler_adapter Module

Async api handler adapter

class vmware.vapi.protocol.server.async_api_handler_adapter.PooledAsyncApiHandlerAdapter(api_handler, workers_pool)[source]

Bases: vmware.vapi.protocol.server.api_handler.AsyncApiHandler

Pooled async api handler adapter

Pooled async api handler adapter init

Parameters:
async_handle_request(request, state_change_cb=None)[source]
handle_request(request)[source]

Table Of Contents

Previous topic

transport Package

Next topic

msg Package

This Page