HTTP stack
This module provides an attribute request and response.
- class HttpPollRequest
A poll request representing payload of a request to an MCCS web server.
Some MCCS devices monitor and control hardware by issuing HTTP GETs to a HTTP server running on the hardware management board. This object represents the payload of such a GET.
An attribute request specifies
attributes whose values are to be read (“queries”)
commands to be invoked. These commands allow for multiple arguments. Writing an attribute value is covered by the single- argument case.
- __init__()
Initialise a new instance.
- add_command(name, *args)
Add a command to be executed as part of this request.
- add_getattributes(*attributes)
Add attributes to be queried as part of this request.
- add_setattribute(name, value)
Add an attribute to be updated as part of this request.
- property commands: list[tuple[str, tuple]]
Return the commands to be executed in this request.
- Returns:
a list of name-args tuples for commands to be invoked in this request.
- class HttpPollResponse
Representation of an attribute response.
An attribute response specifies values of attributes that have been queried in an attribute request.
- __init__()
Initialise a new instance.
- add_command_response(command, value)
Add a response to an command.
- add_query_response(attribute, value)
Add a response to an attribute value query.