Interface IAzureDeviceRegistryClient
- Namespace
- Azure.Iot.Operations.Services.AssetAndDeviceRegistry
- Assembly
- Azure.Iot.Operations.Services.dll
Defines methods and events for interacting with the Asset and Device Registry (ADR) service.
public interface IAzureDeviceRegistryClient : IAsyncDisposable
- Inherited Members
Methods
CreateOrUpdateDiscoveredAssetAsync(string, string, CreateOrUpdateDiscoveredAssetRequest, TimeSpan?, CancellationToken)
Creates or updates a discovered asset.
Task<CreateOrUpdateDiscoveredAssetResponsePayload> CreateOrUpdateDiscoveredAssetAsync(string deviceName, string inboundEndpointName, CreateOrUpdateDiscoveredAssetRequest request, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
requestCreateOrUpdateDiscoveredAssetRequestThe request containing discovered asset creation parameters.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<CreateOrUpdateDiscoveredAssetResponsePayload>
A task that represents the asynchronous operation, containing the response for the created discovered asset.
CreateOrUpdateDiscoveredDeviceAsync(CreateOrUpdateDiscoveredDeviceRequestSchema, string, TimeSpan?, CancellationToken)
Creates or updates a discovered device.
Task<CreateOrUpdateDiscoveredDeviceResponsePayload> CreateOrUpdateDiscoveredDeviceAsync(CreateOrUpdateDiscoveredDeviceRequestSchema request, string inboundEndpointType, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestCreateOrUpdateDiscoveredDeviceRequestSchemaThe request containing discovered device endpoint profile creation parameters.
inboundEndpointTypestringcommandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<CreateOrUpdateDiscoveredDeviceResponsePayload>
A task that represents the asynchronous operation, containing the response for the created discovered device endpoint profile.
GetAssetAsync(string, string, string, TimeSpan?, CancellationToken)
Retrieves details of a specific asset.
Task<Asset> GetAssetAsync(string deviceName, string inboundEndpointName, string assetName, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
assetNamestringcommandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
GetAssetStatusAsync(string, string, string, TimeSpan?, CancellationToken)
Retrieves the status of a specific asset.
Task<AssetStatus> GetAssetStatusAsync(string deviceName, string inboundEndpointName, string assetName, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
assetNamestringThe name of the asset.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<AssetStatus>
A task that represents the asynchronous operation, containing the asset status.
GetDeviceAsync(string, string, TimeSpan?, CancellationToken)
Retrieves details of a specific device.
Task<Device> GetDeviceAsync(string deviceName, string inboundEndpointName, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
GetDeviceStatusAsync(string, string, TimeSpan?, CancellationToken)
Retrieves the status of a specific device.
Task<DeviceStatus> GetDeviceStatusAsync(string deviceName, string inboundEndpointName, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<DeviceStatus>
A task that represents the asynchronous operation, containing the device status.
ReportDatasetRuntimeHealthAsync(string, string, string, List<DatasetsRuntimeHealthEvent>, TimeSpan?, CancellationToken)
Report the health of a given asset dataset.
Task ReportDatasetRuntimeHealthAsync(string deviceName, string inboundEndpointName, string assetName, List<DatasetsRuntimeHealthEvent> datasetsRuntimeHealth, TimeSpan? telemetryTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the endpoint.
assetNamestringThe name of the asset this dataset belongs to.
datasetsRuntimeHealthList<DatasetsRuntimeHealthEvent>The health status to report.
telemetryTimeoutTimeSpan?Optional message expiry time for the telemetry.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
This package contains the AssetRuntimeHealthReporter class which can more smartly report this same information with de-duplication + background reporting. Connectors should generally use that class rather than directly call this method.
ReportDeviceEndpointRuntimeHealthAsync(string, string, RuntimeHealth, TimeSpan?, CancellationToken)
Report the health of a given device endpoint.
Task ReportDeviceEndpointRuntimeHealthAsync(string deviceName, string inboundEndpointName, RuntimeHealth deviceEndpointRuntimeHealth, TimeSpan? telemetryTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the endpoint.
deviceEndpointRuntimeHealthRuntimeHealthThe health status to report.
telemetryTimeoutTimeSpan?Optional message expiry time for the telemetry.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
This package contains the DeviceEndpointRuntimeHealthReporter class which can more smartly report this same information with de-duplication + background reporting. Connectors should generally use that class rather than directly call this method.
ReportEventRuntimeHealthAsync(string, string, string, List<EventsRuntimeHealthEvent>, TimeSpan?, CancellationToken)
Report the health of a given asset event.
Task ReportEventRuntimeHealthAsync(string deviceName, string inboundEndpointName, string assetName, List<EventsRuntimeHealthEvent> eventsRuntimeHealth, TimeSpan? telemetryTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the endpoint.
assetNamestringThe name of the asset this dataset belongs to.
eventsRuntimeHealthList<EventsRuntimeHealthEvent>The health status to report.
telemetryTimeoutTimeSpan?Optional message expiry time for the telemetry.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
This package contains the AssetRuntimeHealthReporter class which can more smartly report this same information with de-duplication + background reporting. Connectors should generally use that class rather than directly call this method.
ReportManagementActionRuntimeHealthAsync(string, string, string, List<ManagementActionsRuntimeHealthEvent>, TimeSpan?, CancellationToken)
Report the health of a given management action.
Task ReportManagementActionRuntimeHealthAsync(string deviceName, string inboundEndpointName, string assetName, List<ManagementActionsRuntimeHealthEvent> managementActionsRuntimeHealth, TimeSpan? telemetryTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the endpoint.
assetNamestringThe name of the asset this dataset belongs to.
managementActionsRuntimeHealthList<ManagementActionsRuntimeHealthEvent>The health status to report.
telemetryTimeoutTimeSpan?Optional message expiry time for the telemetry.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
This package contains the AssetRuntimeHealthReporter class which can more smartly report this same information with de-duplication + background reporting. Connectors should generally use that class rather than directly call this method.
ReportStreamRuntimeHealthAsync(string, string, string, List<StreamsRuntimeHealthEvent>, TimeSpan?, CancellationToken)
Report the health of a given asset stream.
Task ReportStreamRuntimeHealthAsync(string deviceName, string inboundEndpointName, string assetName, List<StreamsRuntimeHealthEvent> streamsRuntimeHealth, TimeSpan? telemetryTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the endpoint.
assetNamestringThe name of the asset this dataset belongs to.
streamsRuntimeHealthList<StreamsRuntimeHealthEvent>The health status to report.
telemetryTimeoutTimeSpan?Optional message expiry time for the telemetry.
cancellationTokenCancellationTokenCancellation token.
Returns
Remarks
This package contains the AssetRuntimeHealthReporter class which can more smartly report this same information with de-duplication + background reporting. Connectors should generally use that class rather than directly call this method.
SetNotificationPreferenceForAssetUpdatesAsync(string, string, string, NotificationPreference, TimeSpan?, CancellationToken)
Observe or unobserve updates for a specific asset.
Task<SetNotificationPreferenceForAssetUpdatesResponsePayload> SetNotificationPreferenceForAssetUpdatesAsync(string deviceName, string inboundEndpointName, string assetName, NotificationPreference notificationPreference, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
assetNamestringThe name of the asset.
notificationPreferenceNotificationPreferencecommandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<SetNotificationPreferenceForAssetUpdatesResponsePayload>
A task that represents the asynchronous operation, containing the notification response.
SetNotificationPreferenceForDeviceUpdatesAsync(string, string, NotificationPreference, TimeSpan?, CancellationToken)
Observe or unobserve updates for a specific device endpoint.
Task<SetNotificationPreferenceForDeviceUpdatesResponsePayload> SetNotificationPreferenceForDeviceUpdatesAsync(string deviceName, string inboundEndpointName, NotificationPreference notificationPreference, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
notificationPreferenceNotificationPreferencecommandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<SetNotificationPreferenceForDeviceUpdatesResponsePayload>
A task that represents the asynchronous operation, containing the notification response.
UpdateAssetStatusAsync(string, string, UpdateAssetStatusRequest, TimeSpan?, CancellationToken)
Updates the status of a specific asset.
Task<AssetStatus> UpdateAssetStatusAsync(string deviceName, string inboundEndpointName, UpdateAssetStatusRequest request, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
requestUpdateAssetStatusRequestThe request containing asset status update parameters.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<AssetStatus>
A task that represents the asynchronous operation, containing the updated asset details.
UpdateDeviceStatusAsync(string, string, DeviceStatus, TimeSpan?, CancellationToken)
Updates the status of a specific device.
Task<DeviceStatus> UpdateDeviceStatusAsync(string deviceName, string inboundEndpointName, DeviceStatus status, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
deviceNamestringThe name of the device.
inboundEndpointNamestringThe name of the inbound endpoint.
statusDeviceStatusThe new status of the device.
commandTimeoutTimeSpan?Optional timeout for the command.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<DeviceStatus>
A task that represents the asynchronous operation, containing the updated device details.
Events
OnReceiveAssetUpdateEventTelemetry
Event triggered when an asset update telemetry event is received. NOTE: This event starts triggering after the call to SetNotificationPreferenceForAssetUpdatesAsync(string, string, string, NotificationPreference, TimeSpan?, CancellationToken).
event Func<string, Asset, Task>? OnReceiveAssetUpdateEventTelemetry
Event Type
OnReceiveDeviceUpdateEventTelemetry
Event triggered when a device update telemetry event is received. NOTE: This event starts triggering after the call to SetNotificationPreferenceForDeviceUpdatesAsync(string, string, NotificationPreference, TimeSpan?, CancellationToken).
event Func<string, string, Device, Task>? OnReceiveDeviceUpdateEventTelemetry