Asyncore http connection
Bases: object
Async chat write adapter
Async chat write adapter init
| Parameters: | chat_obj (asynchat.async_chat) – async chat object |
|---|
Bases: asynchat.async_chat, BaseHTTPServer.BaseHTTPRequestHandler
Async Http connection with async chat
Async Http connection with async chat
| Parameters: |
|
|---|
http headers end callback
| Parameters: | headers (str) – http headers string |
|---|
Override the BaseHTTPServer.BaseHTTPRequestHandler method to send the log message to the log file instead of stderr.
:param format string :type args: tuple :param args: format argument(s)
Send request too large error
| Parameters: |
|
|---|
Send http error
| Parameters: |
|
|---|
Bases: vmware.vapi.server.asyncore_http.HttpBodyHandler
Async chat http chunked handler
Async chat http chunked handler init
| Parameters: | channel (HttpRequestHandler) – http request handler |
|---|
Bases: object
Chunked message writer
Chunked message writer init
| Parameters: |
|
|---|
Bases: object
Async chat data handler
Async chat data handler init
| Parameters: | channel (HttpRequestHandler) – http request handler |
|---|
Generic incoming data handler: Append data to self.data
| Parameters: | data (str) – incoming data |
|---|
Set asynchat handlers
| Parameters: |
|
|---|
Bases: object
Deflate (zlib) writer
Deflate (zlib) writer init
| Parameters: | wfile (file) – file object to write to |
|---|
Bases: object
Gzip writer
Gzip writer init
| Parameters: | wfile (file) – file object to write to |
|---|
Bases: object
Head of line writer
Head of line writer init
| Parameters: | wfile (file) – file object to write to |
|---|
Chile writer
Chile writer init
| Parameters: | parent (HeadOfLineWriter) – Parent writer |
|---|
Close a child writer
| Parameters: | writer (Writer) – child writer |
|---|
flush a child writer (only possible for head of line writer)
| Parameters: | writer (Writer) – child writer |
|---|
Flush pending reply
| Parameters: | writer (Writer) – child writer |
|---|
Bases: vmware.vapi.server.asyncore_http.DataHandler
Async chat http body handler
Async chat http body handler init
| Parameters: | channel (HttpRequestHandler) – http request handler |
|---|
Bases: object
Http factory
Http factory init
Get posix absolute path
| Parameters: | path (str) – url path |
|---|---|
| Return type: | str |
| Returns: | posix style abs path |
add handler associated with url path and transport message
| Parameters: |
|
|---|
get handler for a particular url path and content type
| Parameters: |
|
|---|---|
| Return type: | vmware.vapi.protocol.server.transport.async_protocol_handler.AsyncProtocolHandler |
| Returns: | protocol handler |
get handlers for a particular url path
| Parameters: | path (str) – url path |
|---|---|
| Return type: | dict of tuple of (str, vmware.vapi.protocol.server.transport.async_protocol_handler.AsyncProtocolHandler) |
| Returns: | a dict of content type to protocol handler mapping |
Bases: vmware.vapi.server.asyncore_http.DataHandler
Async chat http header handler
Async chat http headers handler init
| Parameters: | channel (HttpRequestHandler) – http request handler |
|---|
Bases: object
Http request handler
Http request handler init
| Parameters: |
|
|---|
response data continue
| Parameters: | response (str) – http response data |
|---|
Bases: vmware.vapi.server.asyncore_http.HttpBodyHandler
Async chat http message handler
Async chat http message handler init
| Parameters: |
|
|---|
Find token and token value from a comma separated tokens
| Parameters: |
|
|---|
:rtype tuple of str, str if token is found, None otherwise :return: tuple of (token_to_find, value)
Asyncore server
Bases: asyncore.dispatcher
Asyncore loop controller
Asyncore loop controller init
| Parameters: | sock_map (dict) – Global socket map |
|---|
Bases: asyncore.dispatcher
Asyncore ssl connection
Asyncore ssl connection init
| Parameters: |
|
|---|
Bases: asyncore.dispatcher
Asyncore tcp listener
Asyncore tcp listener init
| Parameters: |
|
|---|
Bases: vmware.vapi.server.server_interface.ServerInterface
Asyncore tcp server
Asyncore tcp server init
Register protocol handler
| Parameters: |
|
|---|
Bases: object
Sync write to async write adapter
Sync write to async write adapter init
| Parameters: | async_socket (socket.socket) – async socket |
|---|
tcp cork
Python failed to merge small send into big packet, which is very inefficient. Use TCP_CORK to queue partial packets to bigger packet before sending it. Alternatively we should use writev, but it is not available on standard python socket lib.
| Parameters: | enable (int) – 1 => turn TCP_CORK on, 0 => off |
|---|---|
| Raise : | socket.error if TCP_CORK is not supported on this socket |
Get asyncore server
| Parameters: | cfg (ConfigParser.SafeConfigParser) – Config parser |
|---|---|
| Return type: | vmware.vapi.server.server_interface.ServerInterface |
| Returns: | subclass of ServerInterface |
Server interface
Bases: object
Server interface
Server interface init
Register protocol handler
| Parameters: |
|
|---|
STDIO server : This handles all protocol requests over stdin/out
Bases: vmware.vapi.server.server_interface.ServerInterface
stdio server
Initialize the Stdio Server instance
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.
| Parameters: |
|
|---|
get stdio server
| Parameters: | cfg (ConfigParser.SafeConfigParser) – Config parser |
|---|---|
| Return type: | vmware.vapi.server.server_interface.ServerInterface |
| Returns: | subclass of ServerInterface |
Twisted server
Bases: twisted.internet.protocol.Protocol
Twisted async protocol handler adapter
Bases: object
Twisted connection adapter
Twisted connection adapter init
| Parameters: | transport (twisted.internet.interfaces.ITransport) – Twisted transport |
|---|
Bases: object
Twisted http connection adapter
Twisted http connection init
| Parameters: | request (twisted.web.http.Request) – Twisted http request object |
|---|
Bases: twisted.web.server.Site
Twisted http site
Http site site init
Add resource handler for a path
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if added. False otherwise |
Bases: vmware.vapi.server.server_interface.ServerInterface
Twisted server
Twisted server init
get ssl context
| Parameters: | ssl_args (dict) – ssl arguments |
|---|---|
| Return type: | twisted.internet.ssl.DefaultOpenSSLContextFactory |
| Returns: | twisted ssl context factory instance |
Register protocol handler
| Parameters: |
|
|---|
Bases: twisted.web.resource.Resource
Twisted vapi resource
Twisted vapi resource init
add content handler
| Parameters: |
|
|---|
Handle error
| Parameters: |
|
|---|
Handle read
| Parameters: | request (twisted.web.http.Request) – Twisted http request object |
|---|
Handle request
| Parameters: |
|
|---|
Bases: twisted.internet.protocol.Factory
Twisted vmacre protocol factory
Twisted vmacre protocol factory init
| Parameters: | protocol_handler (vmware.vapi.protocol.server.transport.async_protocol_handler.AsyncProtocolHandler) – protocol handler for this addr |
|---|
alias of TwistedAsyncProtocolHandlerAdapter
Get twisted server
| Parameters: | cfg (ConfigParser.SafeConfigParser) – Config parser |
|---|---|
| Return type: | vmware.vapi.server.server_interface.ServerInterface |
| Returns: | subclass of ServerInterface |
Vapi server
Check if name is a file and exists
:type str :param file name
Configure logging using properties file
| Parameters: | log_config (str) – File path of the properties file |
|---|
Create RPC servers
| Parameters: |
|
|---|---|
| Return type: | |
| Returns: | list of servers |
Extract the ssl arguments
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | SSL arguments for this protocol configuration |
If setproctitle library is available, set the process title :type cfg: configparser :param cfg: configparser object
Setup the API Provider chain
In the properties file, users would specify the order of ApiProviders For ex: InterposerProvider, ApiAggregator. In this case all incoming requests would first go to InterposerProvider and then forwarded to ApiAggregator after processing.
This function initializes all these providers in the reverse order and passes the reference of n+1th provider to nth provider.
| Parameters: |
|
|---|---|
| Return type: | list of vmware.vapi.core.ApiProvider |
| Returns: | List of API Providers |
Wsgi Server
Bases: object
Python WSGI application. For more details about WSGI specification, see PEP 333.
Initialize WsgiApplication
| Parameters: | msg_handler_map (dict of str and vmware.vapi.protocol.server.api_handler.ApiHandler) – Map of content type to the message handler for that content type |
|---|
Bases: vmware.vapi.server.server_interface.ServerInterface
Server wrapper class for Wsgi application.
Initialize WsgiServer
Returns the WSGI application.
| Return type: | vmware.vapi.server.wsgi_server.WsgiApplication |
|---|---|
| Returns: | WSGI application. |
Register protocol handler
| Parameters: |
|
|---|
Get wsgi server
| Parameters: | cfg (ConfigParser.SafeConfigParser) – Config parser |
|---|---|
| Return type: | vmware.vapi.server.server_interface.ServerInterface |
| Returns: | subclass of ServerInterface |