ironic_python_agent.api.app module

class ironic_python_agent.api.app.Application(agent, conf)[source]

Bases: object

api_get_command(request, *args, **kwargs)[source]
api_list_commands(request, *args, **kwargs)[source]
api_root(request)[source]
api_run_command(request)[source]
api_status(request)[source]
api_v1(request)[source]
handle_exception(environ, exc)[source]

Handle an exception during request processing.

require_agent_token_for_command()[source]
start(tls_cert_file=None, tls_key_file=None)[source]

Start the API service in the background.

stop()[source]

Stop the API service.

class ironic_python_agent.api.app.Request(environ: WSGIEnvironment, populate_request: bool = True, shallow: bool = False)[source]

Bases: werkzeug.wrappers.request.Request

Custom request class with JSON support.

environ

The WSGI environment containing HTTP headers and information from the WSGI server.

shallow

Set when creating the request object. If True, reading from the request body will cause a RuntimeException. Useful to prevent modifying the stream from middleware.

ironic_python_agent.api.app.format_exception(value)[source]
ironic_python_agent.api.app.jsonify(value, status=200)[source]

Convert value to a JSON response using the custom encoder.

ironic_python_agent.api.app.version(url)[source]