volttron.platform.web package¶
-
volttron.platform.web.
build_vip_address_string
(vip_root, serverkey, publickey, secretkey)[source]¶ Build a full vip address string based upon the passed arguments
All arguments are required to be non-None in order for the string to be created successfully.
:raises ValueError if one of the parameters is None.
Submodules¶
volttron.platform.web.admin_endpoints module¶
volttron.platform.web.authenticate_endpoint module¶
-
class
volttron.platform.web.authenticate_endpoint.
AuthenticateEndpoints
(ssl_private_key)[source]¶ Bases:
object
-
get_auth_token
(env, data)[source]¶ Creates an authentication token to be returned to the caller. The response will be a text/plain encoded user
Parameters: - env –
- data –
Returns:
-
get_routes
()[source]¶ Returns a list of tuples with the routes for authentication.
Tuple should have the following:
- regular expression for calling the endpoint
- ‘callable’ keyword specifying that a method is being specified
- the method that should be used to call when the regular expression matches
code:
- return [
- (re.compile(‘^/csr/request_new$’), ‘callable’, self._csr_request_new)
]
Returns:
-
volttron.platform.web.csr_endpoints module¶
-
class
volttron.platform.web.csr_endpoints.
CSREndpoints
(core)[source]¶ Bases:
object
-
auto_allow_csr
¶
-
get_routes
()[source]¶ Returns a list of tuples with the routes for authentication.
Tuple should have the following:
- regular expression for calling the endpoint
- ‘callable’ keyword specifying that a method is being specified
- the method that should be used to call when the regular expression matches
code:
- return [
- (re.compile(‘^/csr/request_new$’), ‘callable’, self._csr_request_new)
]
Returns:
-
volttron.platform.web.discovery module¶
-
exception
volttron.platform.web.discovery.
DiscoveryError
[source]¶ Bases:
Exception
Raised when a different volttron central tries to register.
volttron.platform.web.master_web_service module¶
-
class
volttron.platform.web.master_web_service.
MasterWebService
(serverkey, identity, address, bind_web_address, aip, volttron_central_address=None, volttron_central_rmq_address=None, web_ssl_key=None, web_ssl_cert=None, **kwargs)[source]¶ Bases:
volttron.platform.vip.agent.Agent
The service that is responsible for managing and serving registered pages
Agents can register either a directory of files to serve or an rpc method that will be called during the request process.
-
app_routing
(env, start_response)[source]¶ The main routing function that maps the incoming request to a response.
Depending on the registered routes map the request data onto an rpc function or a specific named file.
-
get_volttron_central_address
()[source]¶ Return address of external Volttron Central
Note: this only applies to Volltron Central agents that are running on a different platform.
-
register_agent_route
(regex, fn)[source]¶ Register an agent route to an exported function.
When a http request is executed and matches the passed regular expression then the function on peer is executed.
-
volttron.platform.web.webapp module¶
-
class
volttron.platform.web.webapp.
WebApplicationWrapper
(masterweb, host, port)[source]¶ Bases:
object
A container class that will hold all of the applications registered with it. The class provides a contianer for managing the routing of websocket, static content, and rpc function calls.
volttron.platform.web.websocket module¶
-
class
volttron.platform.web.websocket.
VolttronWebSocket
(*args, **kwargs)[source]¶ Bases:
ws4py.websocket.WebSocket
-
closed
(code, reason='A client left the room without a proper explanation.')[source]¶ Called when the websocket stream and connection are finally closed. The provided
code
is status set by the other point andreason
is a human readable message.See also
Defined Status Codes http://tools.ietf.org/html/rfc6455#section-7.4.1
-