sgr_commhandler.driver.rest.restapi_interface_async

Provides the HTTP/REST interface implementation.

Attributes

logger

Classes

RestDataPoint

Implements a data point of a REST API interface.

RestFunctionalProfile

Implements a functional profile of a REST API interface.

SGrRestInterface

Implements a REST API device interface.

Functions

build_rest_data_point(data_point, functional_profile, ...)

Module Contents

sgr_commhandler.driver.rest.restapi_interface_async.logger
sgr_commhandler.driver.rest.restapi_interface_async.build_rest_data_point(data_point, functional_profile, interface)
Parameters:
  • data_point (sgr_specification.v0.product.RestApiDataPoint)

  • functional_profile (sgr_specification.v0.product.RestApiFunctionalProfile)

  • interface (SGrRestInterface)

Return type:

sgr_commhandler.api.data_point_api.DataPoint

class sgr_commhandler.driver.rest.restapi_interface_async.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.restapi_interface_async.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.restapi_interface_async.SGrRestInterface(frame)

Bases: sgr_commhandler.api.device_api.SGrBaseInterface

Implements 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:
Return type:

sgr_commhandler.driver.rest.request.RestResponse