Skip to content

Inconsistent response behavior with a 'values' array #204

@pkolbeck

Description

@pkolbeck

Services and endpoints send responses differently depending on the request.

def do_get_request(self, a_request_message):

Calling get with a specifier, e.g. dl-agent get <service> -s <specifier> returns the value in a dictionary with the "values" key pointing to the value.
Calling get without a specifier, e.g. dl-agent get <endpoint> returns just the value (this could be a dictionary, string, float, etc).
Calling set with a specifier returns a value based on the return value of the implemented on_set.
Calling set without a specifier returns a None value.
Callng cmd (always requires a specifier) returns the value based on the return value of the function called in the implementation.

Out of all of these, only calling get with a specifier puts the return value into a 'values' array. This inconsistency in behavior does not serve a discernible purpose at the moment, and consistent behavior should be established by no longer putting values in a 'values' array.

Applying a calibration function and getting a dictionary of the form {"value_raw": <value_raw>, "value_cal": <value_cal>} would be unaffected.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions