Measurements - Access object to measurements¶
Provides access API for measurement resources. A measurement is a set of time series data generated and transmitted from an edge.
Request Methods¶
Warning
Be sure to create the access object using measurements on client.
client = intdash.Client(...)
client.measurements.get(uuid='a9cdd3c2-6aa2-4347-b259-253bdc542d9a')
- class Measurements(...)[source]¶
Access object to the measurement resources.
- create(edge_uuid, basetime, basetime_type='manual', name='', description='', protect=False)[source]¶
Create a measurement on the server.
- Parameters
edge_uuid (str) – UUID of the edge
basetime (pandas.Timestamp) – Basetime
basetime_type (BasetimeType) – Basetime type
name (str) – Measurement name
description (str) – Description
protect (bool) – Protection
- Returns
Created measurement object
- Return type
Note
Users who do not have the permission to unprotect a measurement can create protected measurements, but they cannot delete protected measurements. Also, if you are a user who does not have the right to protect a measurement, you cannot put an unprotected measurement into the protected state at a later time.
- delete(uuid)[source]¶
Delete the measurement from the server.
- Parameters
uuid (str) – UUID of the measurement to be deleted
- get(uuid=None, marker_uuid=None)[source]¶
Retrieve the measurement.
- Parameters
uuid (str) – UUID of the measurement to be retrieved
marker_uuid (str) – UUID of the measurement marker (the measurement associated with the specified measurement marker will be retrieved)
- Returns
Measurement object
- Return type
Note
If neither
uuid
normarker_uuid
is specified,Value Error
will occur. If both are specified, only the measurement UUID will be used.
- list(start=None, end=None, edge_uuid=None, name=None, partial_match=False, ended=None, sort='name', order='asc', limit=100, page=1, iterator=False)[source]¶
Retrieve a list of measurements.
- Parameters
start (pandas.Timestamp) – Start point of retrieval range
end (pandas.Timestamp) – End point of retrieval range
edge_uuid (str) – UUID of the edge that the measurement is associated with
name (str) – Measurement name
partial_match (bool) – Partial match flag
ended (boolean) – End flag
sort (str) – Field name used for sorting
order (str) – Sort order (
asc
ordesc
)limit (int) – Maximum number of items retrieved
page (int) – Page number
iterator (bool) – If True, generate an iterator.
- Returns
List of measurement objects
- Return type
list[Measurement]
Note
In
partial_match
, you can specify the retrieval condition. If you specifyFalse
, the measurement will be the retrieved when the basetime of the measurement is within the retrieval target range. If set toTrue
, the measurement will be retrieved if part of the measurement is in the retrieval target range.| measurement1 | +--------------+ | measurement2 | +--------------+ | measurement3 | +--------------+ time -----------+----------------------------+------------> | | start end
In the above example, if
partial_match
isTrue
, you can get measurement1, measurement2, and measurement3. Ifpartial_match
isFalse
, you can get measurement2 and measurement3.
- protect(uuid)[source]¶
Protects the measurement.
- Parameters
uuid (str) – UUID of the measurement to be protected
- unprotect(uuid)[source]¶
Unprotects the measurement.
- Parameters
uuid (str) – UUID of the measurement to be unprotected
- update(uuid, name=None, description=None, basetime_type=None, ended=None)[source]¶
Updates the measurement.
- Parameters
uuid (str) – UUID of the measurement to be updated
name (str) – Measurement name
description (str) – Description
basetime_type (BasetimeType) – Basetime type
ended (bool) – End flag
Response¶
- class Measurement(...)[source]¶
An object that represents a measurement resource.
- uuid¶
UUID
- Type
str
- name¶
Measurement name
- Type
str
- description¶
Description
- Type
str
- edge_uuid¶
UUID of the edge that the measurement is associated with
- Type
str
- duration¶
Duration
- Type
pandas.Timedelta
- basetime¶
Basetime
- Type
pandas.Timestamp
- basetime_type¶
Basetime type
- Type
- ended¶
End flag
- Type
bool
- processed_ratio¶
Processed ratio
- Type
float
- protected¶
Protection status
- Type
bool
- markers¶
Measurement markers
- Type
- created_at¶
Created time
- Type
pandas.Timestamp
- updated_at¶
Updated time
- Type
pandas.Timestamp