IngestAgent
Class
- class ClientSDK.Ingest.IngestAgent
Methods
IncrementNextUpload
Increments the Next Upload time and sets the Next Upload according to the Configuration Upload Frequency
Required Role(s): Any
- ClientSDK.Ingest.IngestAgent.IncrementNextUpload(DateTime dateTime)
- Parameters
dateTime (DateTime) – The time of the current completed upload
- Return type
void
IngestDataAsync
Adds Data to be uploaded to a local cache until the UploadAsync method is called
Required Role(s): Any
- ClientSDK.Ingest.IngestAgent.IngestData(string telemetryTwinId, DateTime dateTime, double? value, string stringValue= "", object detail = null)
- Parameters
telemetryTwinId (string) – Digital Twin Reference Id of the Telemetry Dataset
dateTime (DateTime) – Time related to the value
value (double?) – Numerical data to be stored
stringValue (string) – (Optional) String equivalent of the Numerical data to be stored
detail (object) – (Optional) additional data stored as JSON
- Return type
void
- ClientSDK.Ingest.IngestAgent.IngestData(string telemetryTwinId, TimeSeriesData timeSeriesData)
- Parameters
telemetryTwinId (string) – Digital Twin Reference Id of the Telemetry Dataset
timeSeriesData (TimeSeriesData) – Protocol Buffer used to represent Data
- Return type
void
InitializeAsync
Initializes the Class when a new agent is created
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.InitializeAsync(AuthenticationApi authenticationApi, CoreApi coreApi, DigitalTwinApi digitalTwinApi, ConfigurationApi configurationApi, DataApi dataApi, string ingestClientId, string ingestAgentName, string agentSubTypeId)
- Parameters
authenticationApi (AuthenticationApi) – The Authentication Class from the Client SDK
coreApi (CoreApi) – The Core Class from the Client SDK
digitalTwinApi (DigitalTwinApi) – The Digital Twin Class from the Client SDK
configurationApi (ConfigurationApi) – The Configuration Class from the Client SDK
dataApi (DataApi) – The Data Class from the Client SDK
ingestClientId (string) – Digital Twin Reference Id of the Instrument Ingestion Client
ingestAgentName (string) – Name of this Agent
agentSubTypeId (string) – Instrument Agent Digital Twin SubType Id
- Returns
Whether the agent was successfully initialized
- Return type
Task<bool>
LoadAsync
Loads the Agent with the information it needs to run
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.LoadAsync(AuthenticationApi authenticationApi, CoreApi coreApi, DigitalTwinApi digitalTwinApi, ConfigurationApi configurationApi, DataApi dataApi, DigitalTwin digitalTwin)
- Parameters
authenticationApi (AuthenticationApi) – The Authentication Class from the Client SDK
coreApi (CoreApi) – The Core Class from the Client SDK
digitalTwinApi (DigitalTwinApi) – The Digital Twin Class from the Client SDK
configurationApi (ConfigurationApi) – The Configuration Class from the Client SDK
dataApi (DataApi) – The Data Class from the Client SDK
digitalTwin (DigitalTwin) – The digital Twin that represents the IngestAgent
- Returns
Whether the Agent was successfully loaded
- Return type
Task<bool>
LoadConfiguration
Loads the configuration object from the ConfigurationJSON
Required Role(s): Any
- ClientSDK.Ingest.IngestAgent.LoadConfiguration(string json)
- Parameters
json (string) – The configuration represented as a JSON string
- Returns
Whether the load was successful
- Return type
Task<bool>
RunAsync
Runs the agent to obtain data
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.RunAsync()
- Returns
Whether the run was successful
- Return type
Task<bool>
SaveAsync
Saves all of the Digital Twin and Configuration Data related to the agent.
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.SaveAsync()
- Returns
Whether the save was successful
- Return type
Task<bool>
UploadAsync
Uploads the data to a Telemetry Data Set configured by a digital Twin with the same Reference Id
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.UploadAsync()
- Returns
Whether the upload was successful
- Return type
Task<bool>
UpdateTelemetryTwinName
Updates one of the Telemetry Twins Names
Required Role(s): Any
Resource Authorization: Access to the digital twin associated to the operation that the report definition is associated.
- ClientSDK.Ingest.IngestAgent.UpdateTelemetryTwinName(DigitalTwin digitalTwin, string name)
- Parameters
digitalTwin (DigitalTwin) – The Telemetry Twin
name (string) – The new name of the Telemetry Twin
- Returns
Whether the Telemetry Twin was updated
- Return type
Task<bool>
Properties
Configuration
The Configuration Object related to the Agent
- ClientSDK.Ingest.IngestAgent.Configuration
- Return type
IngestAgentConfiguration
ConfigurationJson
The JSON representation of the configuration
- ClientSDK.Ingest.IngestAgent.ConfigurationJson
- Return type
string
DataSets
Data is a memory cache for the data to be stored by Telemetry GUID
- ClientSDK.Ingest.IngestAgent.DataSets
- Return type
Dictionary<string,TimeSeriesDatas>
Enabled
Whether the Agent is Enabled.
IsTimeToRun
Whether the Agent is Eligible to run. AKA it is time to run.
LastRun
Last time the agent was run
- ClientSDK.Ingest.IngestAgent.LastRun
- Return type
DateTime
LastUpload
Last time the data in the agent was uploaded
- ClientSDK.Ingest.IngestAgent.LastUpload
- Return type
DateTime
Logger
This is a class that manages the logging of information for the Agent
- ClientSDK.Ingest.IngestAgent.Logger
- Return type
IngestLogger
Name
This property returns the name of the Ingest Client agent. If this property is set, the Save() method will need to be called to persist the change.
- ClientSDK.Ingest.IngestAgent.Name
- Returns
The name of the IngestAgent
- Return type
DateTime
NextRun
Next time the agent should be run
- ClientSDK.Ingest.IngestAgent.NextRun
- Return type
DateTime
NextUpload
Next time the data in the agent should be uploaded
- ClientSDK.Ingest.IngestAgent.NextUpload
- Return type
DateTime
Telemetry
The Telemetry Datasets that are related to the Agent. This property is populated when the LoadAsync is called.
- ClientSDK.Ingest.IngestAgent.Telemetry
- Returns
The collection of digital twin reference ids that represent the data related to Ingest Client agent.
- Return type
List<string>
TwinSubTypeId
Identifies the unique type of the agent. This must be set by the implementing class for the agent to be properly registered
- ClientSDK.Ingest.IngestAgent.TwinSubTypeId
- Return type
string