Table of Contents

Interface IAzureDeviceRegistryClientWrapper

Namespace
Azure.Iot.Operations.Connector
Assembly
Azure.Iot.Operations.Connector.dll
public interface IAzureDeviceRegistryClientWrapper : 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

deviceName string

The name of the device.

inboundEndpointName string

The name of the inbound endpoint.

request CreateOrUpdateDiscoveredAssetRequest

The request containing discovered asset creation parameters.

commandTimeout TimeSpan?

Optional timeout for the command.

cancellationToken CancellationToken

Optional 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

request CreateOrUpdateDiscoveredDeviceRequestSchema

The request containing discovered device endpoint profile creation parameters.

inboundEndpointType string
commandTimeout TimeSpan?

Optional timeout for the command.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<CreateOrUpdateDiscoveredDeviceResponsePayload>

A task that represents the asynchronous operation, containing the response for the created discovered device endpoint profile.

GetAssetNames(string, string)

List the names of all available assets within the provided endpoint within the provided device.

IEnumerable<string> GetAssetNames(string deviceName, string inboundEndpointName)

Parameters

deviceName string

The name of the device to get asset names from.

inboundEndpointName string

The name of the endpoint within the provided device to get asset names from.

Returns

IEnumerable<string>

The collection of asset names associated with the provided endpoint in the provided device. This collection is empty if the device does not exist (or is unavailable) or if the device has no inbound endpoint with the provided name or if both the device and inbound endpoint are available, but they have no assets.

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

deviceName string

The name of the device.

inboundEndpointName string

The name of the inbound endpoint.

assetName string

The name of the asset.

commandTimeout TimeSpan?

Optional timeout for the command.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<AssetStatus>

The status returned by the Azure Device Registry service.

GetDeviceNames()

List the names of all available devices.

IEnumerable<string> GetDeviceNames()

Returns

IEnumerable<string>

The names of all available devices

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

deviceName string

The name of the device.

inboundEndpointName string

The name of the inbound endpoint.

commandTimeout TimeSpan?

Optional timeout for the command.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<DeviceStatus>

The status returned by the Azure Device Registry service.

GetEndpointCredentials(string, string, InboundEndpointSchemaMapValue)

Get the credentials to use when connecting to the provided endpoint.

EndpointCredentials GetEndpointCredentials(string deviceName, string inboundEndpointName, InboundEndpointSchemaMapValue inboundEndpoint)

Parameters

deviceName string

The name of the device whose inbound endpoint credentials should be retrieved.

inboundEndpointName string

The name of the inbound endpoint whose credentials should be retrieved.

inboundEndpoint InboundEndpointSchemaMapValue

The endpoint whose credentials should be returned.

Returns

EndpointCredentials

The credentials for the endpoint

GetInboundEndpointNames(string)

List the names of all available inbound endpoints associated with the provided device name.

IEnumerable<string> GetInboundEndpointNames(string deviceName)

Parameters

deviceName string

The device whose inbound endpoint names will be listed.

Returns

IEnumerable<string>

The collection of inbound endpoint names associated with this device. This collection is empty if the device doesn't exist or isn't available.

ObserveAssets(string, string)

Start receiving notifications on AssetChanged when any asset associated with the provided endpoint in the provided device is created, updated, or deleted.

void ObserveAssets(string deviceName, string inboundEndpointName)

Parameters

deviceName string

The name of the device whose assets will be observed.

inboundEndpointName string

The name of the endpoint within the device whose assets will be observed.

ObserveDevices()

Start receiving notifications on DeviceChanged when any device is created, updated, or deleted.

void ObserveDevices()

UnobserveAllAsync(CancellationToken)

Stop receiving all asset and device notifications on AssetChanged and DeviceChanged.

Task UnobserveAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

UnobserveAssetsAsync(string, string, CancellationToken)

Stop receiving notifications on AssetChanged when any asset associated with the provided endpoint in the provided device is created, updated, or deleted.

Task UnobserveAssetsAsync(string deviceName, string inboundEndpointName, CancellationToken cancellationToken = default)

Parameters

deviceName string

The name of the device whose assets will no longer be observed.

inboundEndpointName string

The name of the endpoint within the device whose assets will no longer be observed.

cancellationToken CancellationToken

Returns

Task

UnobserveDevicesAsync(CancellationToken)

Stop receiving notifications on DeviceChanged when any device is creatd, updated, or deleted.

Task UnobserveDevicesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

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

deviceName string

The name of the device the asset belongs to.

inboundEndpointName string

The name of the inbound endpoint the asset belongs to.

request UpdateAssetStatusRequest

The new status of this asset and its datasets/event groups/streams/management groups.

commandTimeout TimeSpan?

The timeout for this RPC command invocation.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<AssetStatus>

The status returned by the Azure Device Registry service.

Remarks

This update behaves like a 'put' in that it will replace all current state for this asset in the Azure Device Registry service with what is provided. It is generally recommended to use GetAssetStatusAsync(string, string, string, TimeSpan?, CancellationToken) to fetch the current status, patch that status, and then provide it in request to ensure that no current asset status is lost.

UpdateDeviceStatusAsync(string, string, DeviceStatus, TimeSpan?, CancellationToken)

Update the status of a specific device in the Azure Device Registry service.

Task<DeviceStatus> UpdateDeviceStatusAsync(string deviceName, string inboundEndpointName, DeviceStatus status, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)

Parameters

deviceName string

The name of the device.

inboundEndpointName string

The name of the inbound endpoint.

status DeviceStatus

The new status of the device.

commandTimeout TimeSpan?

Optional timeout for the command.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<DeviceStatus>

The status returned by the Azure Device Registry service

Remarks

This update call will act as a patch for all endpoint level statuses, but will act as a put for the device-level status. That means that, for devices with multiple endpoints, you can safely call this method when each endpoint has a status to report without needing to include the existing status of previously reported endpoints.

Events

AssetChanged

Executes whenever a asset is created, updated, or deleted.

event EventHandler<AssetChangedEventArgs>? AssetChanged

Event Type

EventHandler<AssetChangedEventArgs>

Remarks

To start receiving these events, use ObserveAssets(string, string).

DeviceChanged

Executes whenever a device is created, updated, or deleted.

event EventHandler<DeviceChangedEventArgs>? DeviceChanged

Event Type

EventHandler<DeviceChangedEventArgs>

Remarks

To start receiving these events, use ObserveDevices().