das.iot_client package
Subpackages
- das.iot_client.interfaces package
- Submodules
- das.iot_client.interfaces.assets_client module
- das.iot_client.interfaces.commands_client module
- das.iot_client.interfaces.credentials_client module
- das.iot_client.interfaces.data_client module
- das.iot_client.interfaces.devices_client module
- das.iot_client.interfaces.events_client module
- das.iot_client.interfaces.models_client module
- das.iot_client.interfaces.organizations_client module
- Module contents
Submodules
das.iot_client.client module
- class das.iot_client.client.IoTClient(base_url=None, subscription=None, organization_id=None, client_id=None, client_secret=None, username=None, password=None, identity_provider=None, environment_type=None, auth_flow='legacy', keep_alive=False, config_name='config.ini')
Bases:
AssetsClient,CommandsClient,CredentialsClient,DataClient,DevicesClient,EventsClient,ModelsClient,OnnxClient,OrganizationsClient,ServicesClientREST API client for IoT-TICKET 4.X
If parameters are not given in the client initialization method, those are read from config.ini or environment variables. First four ones are mandatory, the rest are required only with the ‘legacy’ auth_flow.
- Parameters
- base_urlstr
Base url for IoT-TICKET Public API.
- subscriptionstr
The name of the subscription used.
- organization_idstr
Organization id for IoT-TICKET Public API.
- client_idstr
Client id for IoT-TICKET Public API.
- client_secretstr
Client secret for IoT-TICKET Public API.
- usernamestr
IoT-TICKET username.
- passwordstr
IoT-TICKET password.
- identity_providerstr
Identity provider for IoT-TICKET. Usually the name after “Or sign in with…” sentence in UI login.
- environment_typestr
The type of the environment. Defaults to ‘default’, implying for multi-subscription environment. Other options are ‘single-subscription’, or ‘on-premise’.
- auth_flowstr, default=’legacy’
Authentication flow to use. One of ‘legacy’, ‘webapp-auto’ or ‘webapp-manual’.
- keep_alivebool, default=False
Flag if the connection is being kept alive by automatically refreshing the token. If True, client must be logged out at the end of the session.
- config_namestr, default = ‘config.ini’
Optional parameter to tell the file name of the config file that can be used to define the other parameters. Should always be an .ini file. Defaults to ‘config.ini.’ This is located in the .das folder in the user folder.
- Raises
- ValueError
For wrong auth_flow, environment_type or config_name parameters.
- Exception
For undefined required parameters.
- InvalidGrantError
For invalid user credentials.
- ResourceNotFoundError
For invalid base_url.
- Attributes
analytics_items_countGet the count of how many analytics items (MLModels, MLServices and OnnxModels) are currently registered to IoT-TICKET.
asset_event_active_countGet the number of events that are currently active.
Methods
acknowledge_active_asset_event([names_path, ...])Acknowledge an active asset event in IoT-TICKET.
acknowledge_history_asset_event([...])Acknowledge a history asset event in IoT-TICKET.
delete_model([model_name, model_id])Delete a registered model in IoT-TICKET.
delete_onnx_model([model_name, model_id])Delete an ONNX model that is registered into IoT-TICKET
delete_service([service_name, service_id])Delete a registered service in IoT-TICKET.
get_all_analytics_items()List all data-analytics items that are registered to IoT-TICKET, including models, services and ONNX-models.
get_all_assets([templates, event_types])Get all assets for the organization.
get_asset_event_history([asset_ids, ...])Get event history from IoT-TICKET for an organization.
get_asset_events_active([asset_ids, ...])Get active asset events from IoT-TICKET for an organization.
get_asset_template([template_id, template_name])Get details of an asset template in IoT-TICKET.
get_asset_templates()Get a list of asset templates in IoT-TICKET.
get_assets([asset_id, asset_name, ...])Get information of assets in a certain position of the asset tree.
get_attributes([asset_id, asset_name, ...])Read asset attributes information.
get_command_details([names_path, ...])Read asset's latest command log entry details.
get_credential_query([organization_id, ...])Query credentials by given information.
get_credentials([organization_id])Read credentials information.
get_device(device_id)Get information from a specific device.
get_devices([asset_id, asset_name, names_path])Get device ids.
get_id_name_mapping([names_path, ...])Get mapping of ids and names in the system.
get_model_details([model_name, model_id])Get details of a model registered into IoT-TICKET.
get_model_list()List all models that are registered into IoT-TICKET.
get_multiple_timeseries([names_path, ...])Get data from multiple Telemetry Data or Calculated attributes with the same call.
get_onnx_model_details([model_name, model_id])Get details of a registered ONNX Model.
get_onnx_model_list()Get all registered ONNX Models.
get_organization_details([organization_id])Get details for current organization (default), or for the organization of which id was given.
get_organizations()Read organizations information.
get_service_details([service_name, service_id])Get details of a service registered into IoT-TICKET.
get_service_list()List all services that are registered into IoT-TICKET.
get_statistics(period, dimension[, ...])Read asset attribute statistics values.
get_timeseries([names_path, attribute_id, ...])Read asset attribute values from a single Telemetry Data or Calculated attribute.
get_timesignal([timesignal_id, latest, ...])Read asset timesignal attribute values.
print_asset_tree([asset_id, asset_name, ...])Get all available assets printed in a tree form.
register_model(model)Create a registered ML model to IoT-TICKET.
register_onnx_model(name[, onnx_model, ...])Register a model to IoT-TICKET in ONNX (Open Neural Network Exchange) form.
register_service(service)Create a registered ML service to IoT-TICKET.
send_command([payload, template_variables, ...])Trigger a command for a command attribute.
send_control_command(desired_value[, ...])Trigger a control command for a command attribute.
update_model(model)Update a model in IoT-TICKET.
update_onnx_model(payload[, model_id])Update ONNX model basic information.
update_service(service[, service_name, ...])Update a service in IoT-TICKET.
write_calculated(data[, names_path, ...])Write to IoT-TICKET's Calculated attributes.
write_device_event(device_id, ...[, ...])Write a device event to IoT-TICKET.
write_device_events(device_id, ...[, tz])Write multiple device events to IoT-TICKET based on the complete json payload that is delivered by the user.
write_static(data[, attribute_ids, ...])Write to IoT-TICKET's static String or Number attributes.
write_telemetry(data, device_id, ...[, ...])Write data to a device in IoT-TICKET.
write_timesignal(device_id, device_username, ...)Write a time signal to a device in IoT-TICKET.
write_timesignals(device_id, ...[, tz])Write one or multiple time signals to a device in IoT-TICKET based on the complete payload given by the user.
logout
- allowed_flows = ['legacy', 'webapp-manual', 'webapp-auto']
- logout(delete_token_cache=True)