sgr_commhandler.driver.rest
Provides the HTTP / REST interface driver.
Submodules
Classes
Implements a data point of a REST API interface. |
|
Implements a functional profile of a REST API interface. |
|
Implements a REST API device interface. |
Package Contents
- class sgr_commhandler.driver.rest.RestDataPoint(dp_spec, fp_spec, interface)
Bases:
sgr_commhandler.api.data_point_api.DataPointProtocol[sgr_specification.v0.product.RestApiFunctionalProfile,sgr_specification.v0.product.RestApiDataPoint]Implements a data point of a REST API interface.
- Parameters:
dp_spec (sgr_specification.v0.product.RestApiDataPoint)
fp_spec (sgr_specification.v0.product.RestApiFunctionalProfile)
interface (SGrRestInterface)
- _read_call: sgr_specification.v0.product.rest_api_types.RestApiServiceCall
- _write_call: sgr_specification.v0.product.rest_api_types.RestApiServiceCall
- _interface
- async get_val(parameters=None, skip_cache=False)
- Parameters:
parameters (Optional[dict[str, str]])
skip_cache (bool)
- Return type:
Any
- async set_val(value)
- Parameters:
value (Any)
- class sgr_commhandler.driver.rest.RestFunctionalProfile(fp_spec, interface)
Bases:
sgr_commhandler.api.functional_profile_api.FunctionalProfile[sgr_specification.v0.product.RestApiFunctionalProfile]Implements a functional profile of a REST API interface.
- Parameters:
fp_spec (sgr_specification.v0.product.RestApiFunctionalProfile)
interface (SGrRestInterface)
- _interface
- _data_points
- get_data_points()
- Return type:
dict[tuple[str, str], sgr_commhandler.api.data_point_api.DataPoint]
- class sgr_commhandler.driver.rest.SGrRestInterface(frame)
Bases:
sgr_commhandler.api.device_api.SGrBaseInterfaceImplements a REST API device interface.
- Parameters:
frame (sgr_specification.v0.product.DeviceFrame)
- _session = None
- _cache
- base_url
- functional_profiles
- is_connected()
- async disconnect_async()
- async connect_async()
- async authenticate()
- async execute_request(request, skip_cache)
- Parameters:
skip_cache (bool)
- Return type: