API Reference

Request

request defines how to fetch data from time-series database.

Attributes

NameTypeDescription
datapointslistlist of str pointing to hardware ids of datapoint or template properties name.
aggregationstraggregation method ("mean", "stddev", "mode", "median", "count", "sum", "first", "last", "max", "min").
intervalintinterval passed in seconds at init (stored as milliseconds).
template_iduuid.UUIDuse technical id of wizata_dsapi.Template to fetch data based on a template.
twin_iduuid.UUIDtechnical id of wizata_dsapi.Twin registered on template_id.
filtersdictfilters to apply to the query pre-aggregation. nested dictionary using as first key=datapoint then value=another dictionary with key=operator (gt,lt,gte,lte,eq,neq) and value is the float value to compare too).
optionsdictdict representing query options.

Methods

api_id()

return current object id on Web API format.

end_time()

convert a relative end time to a datetime based on a now parameter.

NameTypeDefaultDescription
nowNoneoverride now value for relative datetime
return: end datetime

endpoint()

return endpoint name used to contact backend.

from_json()

load the object from a dict originating of a JSON format.

NameTypeDefaultDescription
json_data

get_params()

get a list of all parameters.

return: list of parameters

get_template_id()

extract template id from request if present.

return: template id as uuid.UUID

get_template_key()

extract template key from request if present.

return: template key as str

get_twin_hardware_id()

extract twin hardware id from request if present.

return: template key as str

get_twin_id()

extract twin id from request if present.

return: template key as uuid

list_agg_methods()

get a list of all authorized methods.

return: list with "mean", "stddev", "mode", "median", "count", "sum", "first", "last", "max" or "min"

select_template()

select a template and its registration.

NameTypeDefaultDescription
template_idNonetemplate UUID
template_keyNonetemplate key ( ignored if template_id specified )
twin_idNoneDigital Twin UUID
twin_hardware_idNonehardware ID of Digital Twin ( ignored if twin_id specified )

set_aggregation()

specifies aggregation properties

NameTypeDefaultDescription
method"mean", "stddev", "mode", "median", "count", "sum", "first", "last", "max" or "min"
intervalNoneinterval in ms (will be stored in seconds) can be null

set_id()

specify the id_value neutrally

NameTypeDefaultDescription
id_value
return:

set_param()

set value of parameter based on his name.

NameTypeDefaultDescription
namestr
value

set_template()

set a template properly (str key or uuid.UUID)

NameTypeDefaultDescription
template
return:

set_twin()

set a twin properly (str hardware Id or uuid.UUID)

NameTypeDefaultDescription
twin
return:

start_time()

convert a relative start time to a datetime based on a now parameter.

NameTypeDefaultDescription
nowNoneoverride now value for relative datetime
return: start datetime

to_json()

transform current object into a dict that could be JSONIFY.

NameTypeDefaultDescription
targetstrNone
return: dumpable dict.