ApiInterface

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

NameTypeDefaultDescription
objobject from a supported entity

return: object created

create_component()

create a component based on its ID.

NameTypeDefaultDescription
componentSolutionComponent

delete()

delete an object on the server

NameTypeDefaultDescription
objobject from a supported entity

delete_component()

delete component

NameTypeDefaultDescription
component_idUUID

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 )
NameTypeDefaultDescription
objNonea wizata_dsapi.() with UUID set - fetch using technical UUID
idUUIDNonea UUID of a specific object (use in combination of entity)
keystrNonea logical key of a specific object (e.g. hardware id for DataPoint and Twin (use in combination of entity)
entityNoneplural 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

NameTypeDefaultDescription
label_idUUIDNonefilter on a specific label
twin_idUUIDNonefilter on a specific twin
template_idUUIDNonefilter on a specific template
owner_idUUIDNonefilter on a specific owner_id
organization_onlyboolFalsework only with organization components (by default - False)
namestrNonefilter on a specific name (contains)

get_datapoint_mappings()

get datapoint mapping from a registration.

NameTypeDefaultDescription
registration

get_registrations()

retrieve all registrations for

NameTypeDefaultDescription
templatetemplate object, UUID or str key.

return: list of twin registration.

lists()

lists all elements of a specific entity.

NameTypeDefaultDescription
entityplural 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.

NameTypeDefaultDescription
datapointslistNonelist of datapoints to fetch.
startdatetimeNonestart datetime of range to fetch
enddatetimeNoneend datetime of range to fetch
intervalintNoneinterval in milliseconds.
agg_methodstrmean
templatestrNonetemplate to fetch.
twinstrNonehardware ID of twin to fetch based on template.
nullstrNonedefault 'drop' will drop NaN values. If not intended behavior please set it to 'ignore' or 'all'.
filtersdictNonedict of filters.
optionsdictNonedict of options.

return: dataframe

search_datapoints()

get datapoints with a paged query.

NameTypeDefaultDescription
pageint1numero of the page - default 1.
sizeint20quantity per page - default 20 max 100.
sortstridcolumn to sort results - default id.
directionstrascsorting direction by default asc, accept also desc.
hardware_idstrNonefilter on a specific hardware ID name or partial name.
categorieslistNonelist of UUID or Category.
business_typeslistNonelist of BusinessType or str.
twinNoneuuid or Twin element to search datapoints.
recursiveboolFalseset 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_twins()

get twins with a paged query.

NameTypeDefaultDescription
pageint1numero of the page - default 1.
sizeint20quantity per page - default 20 max 100.
sortstridcolumn to sort results - default id.
directionstrascsorting direction by default asc, accept also desc.
hardware_idstrNonefilter on a specific hardware ID name or partial name.
namestrNonename or part of twin name.
parentslistNonelist 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 - supported only in context and by SMS.

NameTypeDefaultDescription
messagestr
recipientslist

update()

update and save an object on the server

NameTypeDefaultDescription
objobject from a supported entity

update_component()

update a component based on its ID.

NameTypeDefaultDescription
componentSolutionComponent