Script ganeti_rapi :: Class RemoteApiHttpServer
[hide private]
[frames] | no frames]

Class RemoteApiHttpServer


REST Request Handler Class.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Initializes the HTTP server
 
_GetRequestContext(self, req)
Returns the context for a request.
 
AuthenticationRequired(self, req)
Determine whether authentication is required.
 
Authenticate(self, req, username, password)
Checks whether a user can access a resource.
 
HandleRequest(self, req)
Handles a request.

Inherited from ganeti.http.auth.HttpServerRequestAuthentication: GetAuthRealm, PreHandleRequest, VerifyBasicAuthPassword

Inherited from ganeti.http.server.HttpServer: OnSignal, Start, Stop, handle_accept

Inherited from ganeti.http.HttpBase: GetSslCiphers

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from asyncore.dispatcher: __getattr__, accept, add_channel, bind, close, connect, create_socket, del_channel, handle_close, handle_connect, handle_connect_event, handle_error, handle_expt, handle_expt_event, handle_read, handle_read_event, handle_write, handle_write_event, listen, log, log_info, readable, recv, send, set_reuse_addr, set_socket, writable

Class Variables [hide private]
  AUTH_REALM = "Ganeti Remote API"

Inherited from ganeti.http.server.HttpServer: MAX_CHILDREN

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, debug, ignore_log_types

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

 

Initializes the HTTP server

Parameters:
  • mainloop - Mainloop used to poll for I/O events
  • local_address - Local IP address to bind to
  • port - TCP port to listen on
  • ssl_params - SSL key and certificate
  • ssl_verify_peer - Whether to require client certificate and compare it with our certificate
  • request_executor_class - an class derived from the HttpServerRequestExecutor class
Overrides: asyncore.dispatcher.__init__

_GetRequestContext(self, req)

 

Returns the context for a request.

The context is cached in the req.private variable.

AuthenticationRequired(self, req)

 

Determine whether authentication is required.

Parameters:
  • req - HTTP request context
Overrides: ganeti.http.auth.HttpServerRequestAuthentication.AuthenticationRequired

Authenticate(self, req, username, password)

 

Checks whether a user can access a resource.

Overrides: ganeti.http.auth.HttpServerRequestAuthentication.Authenticate

HandleRequest(self, req)

 

Handles a request.

Overrides: ganeti.http.server.HttpServer.HandleRequest