Interface with all methods available both to the pipeline runners and the Data Science API.
Methods
create()
create and save an object on the server
| Name | Type | Default | Description |
|---|---|---|---|
| obj | object from a supported entity |
return: object created
create_component()
create a component based on its ID.
| Name | Type | Default | Description |
|---|---|---|---|
| component | SolutionComponent |
delete()
delete an object on the server
| Name | Type | Default | Description |
|---|---|---|---|
| obj | object from a supported entity |
delete_component()
delete component
| Name | Type | Default | Description |
|---|---|---|---|
| component_id | UUID |
get()
get record content from DS API.
- get will look first for obj then for id then for key (e.g. if id and key specified, key is ignored )
| Name | Type | Default | Description |
|---|---|---|---|
| obj | None | a wizata_dsapi.() with UUID set - fetch using technical UUID | |
| id | UUID | None | a UUID of a specific object (use in combination of entity) |
| key | str | None | a logical key of a specific object (e.g. hardware id for DataPoint and Twin (use in combination of entity) |
| entity | None | plural name of the entity or class (use in combination of entity)(e.g. scripts, plots, mlmodels, dataframes...) |
return: object with all properties or None if not found.
get_business_labels()
get a name / uuid dictionary with all business labels in platform.
get_components()
get components
| Name | Type | Default | Description |
|---|---|---|---|
| label_id | UUID | None | filter on a specific label |
| twin_id | UUID | None | filter on a specific twin |
| template_id | UUID | None | filter on a specific template |
| owner_id | UUID | None | filter on a specific owner_id |
| organization_only | bool | False | work only with organization components (by default - False) |
| name | str | None | filter on a specific name (contains) |
get_datapoint_mappings()
get datapoint mapping from a registration.
| Name | Type | Default | Description |
|---|---|---|---|
| registration |
get_registrations()
retrieve all registrations for
| Name | Type | Default | Description |
|---|---|---|---|
| template | template object, UUID or str key. |
return: list of twin registration.
lists()
lists all elements of a specific entity.
| Name | Type | Default | Description |
|---|---|---|---|
| entity | plural name of the entity or class (e.g. scripts, plots, mlmodels, dataframes...) |
return: list of all elements with at least the id property.
query()
Query a dataframe from timeseries DB.
| Name | Type | Default | Description |
|---|---|---|---|
| datapoints | list | None | list of datapoints to fetch. |
| start | datetime | None | start datetime of range to fetch |
| end | datetime | None | end datetime of range to fetch |
| interval | int | None | interval in milliseconds. |
| agg_method | str | mean | |
| template | str | None | template to fetch. |
| twin | str | None | hardware ID of twin to fetch based on template. |
| null | str | None | default 'drop' will drop NaN values. If not intended behavior please set it to 'ignore' or 'all'. |
| filters | dict | None | dict of filters. |
| options | dict | None | dict of options. |
| group | dict | None | can be used to set group system and event retrieving instructions. |
| field | str | None | by default 'value' if none, can be used to retrieve 'eventId' |
return: dataframe
search_datapoints()
get datapoints with a paged query.
| Name | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | numero of the page - default 1. |
| size | int | 20 | quantity per page - default 20 max 100. |
| sort | str | id | column to sort results - default id. |
| direction | str | asc | sorting direction by default asc, accept also desc. |
| hardware_id | str | None | filter on a specific hardware ID name or partial name. |
| categories | list | None | list of UUID or Category. |
| business_types | list | None | list of BusinessType or str. |
| twin | None | uuid or Twin element to search datapoints. | |
| recursive | bool | False | set to True in combination of a twin to look inside all sub-twins recursively. |
return: PagedQueryResults, check total for number of potential results and results for the list of entity.
search_insights()
get insights with a paged query.
| Name | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | numero of the page - default 1. |
| size | int | 20 | quantity per page - default 20 max 100. |
| sort | str | id | column to sort results - default id. |
| direction | str | asc | sorting direction by default asc, accept also desc. |
| datapoint_id | str | None | id of the datapoint on which filtering the insights. |
| twin_id | str | None | id of the twin on which filtering the insights. |
| component_id | list | None | id of the component on which filtering the insights. |
return: PagedQueryResults, check total for number of potential results and results for the list of entity.
search_twins()
get twins with a paged query.
| Name | Type | Default | Description |
|---|---|---|---|
| page | int | 1 | numero of the page - default 1. |
| size | int | 20 | quantity per page - default 20 max 100. |
| sort | str | id | column to sort results - default id. |
| direction | str | asc | sorting direction by default asc, accept also desc. |
| hardware_id | str | None | filter on a specific hardware ID name or partial name. |
| name | str | None | name or part of twin name. |
| parents | list | None | list of all possible parents (Twin, UUID, or str UUID). |
return: PagedQueryResults, check total for number of potential results and results for the list of entity.
send_alerts()
send alerts through backend
| Name | Type | Default | Description |
|---|---|---|---|
| message | str | ||
| recipients | list | ||
| alert_type | AlertType | AlertType.SMS | |
| subject | str | ||
| cc | list | None |
update()
update and save an object on the server
| Name | Type | Default | Description |
|---|---|---|---|
| obj | object from a supported entity |
update_component()
update a component based on its ID.
| Name | Type | Default | Description |
|---|---|---|---|
| component | SolutionComponent |