Table of Contents

Interface IAssetMonitor

Namespace
Azure.Iot.Operations.Services.Assets
Assembly
Azure.Iot.Operations.Services.dll
public interface IAssetMonitor

Methods

GetAssetAsync(string, CancellationToken)

Get the asset with the provided Id.

Task<Asset?> GetAssetAsync(string assetName, CancellationToken cancellationToken = default)

Parameters

assetName string

The Id of the asset to retrieve.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<Asset>

The requested asset.

GetAssetEndpointProfileAsync(CancellationToken)

Get the asset endpoint profile of the asset with the provided Id.

Task<AssetEndpointProfile?> GetAssetEndpointProfileAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<AssetEndpointProfile>

The requested asset endpoint profile. This value may be null if no asset endpoint profile is configured yet.

GetAssetNamesAsync(CancellationToken)

Returns the complete list of assets deployed by the operator to this pod.

Task<List<string>> GetAssetNamesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<List<string>>

The complete list of assets deployed by the operator to this pod.

ObserveAssetEndpointProfile(TimeSpan?, CancellationToken)

Start receiving notifications on AssetEndpointProfileChanged when the asset endpoint profile changes for the asset with the provided Id.

void ObserveAssetEndpointProfile(TimeSpan? pollingInterval = null, CancellationToken cancellationToken = default)

Parameters

pollingInterval TimeSpan?

How frequently to check for changes to the asset endpoint profile.

cancellationToken CancellationToken

Cancellation token.

ObserveAssets(TimeSpan?, CancellationToken)

Start receiving notifications on AssetChanged when any asset changes.

void ObserveAssets(TimeSpan? pollingInterval = null, CancellationToken cancellationToken = default)

Parameters

pollingInterval TimeSpan?

How frequently to check for changes to the asset.

cancellationToken CancellationToken

Cancellation token.

UnobserveAssetEndpointProfile(CancellationToken)

Stop receiving notifications on AssetEndpointProfileChanged when the asset endpoint profile changes for the asset with the provided Id.

void UnobserveAssetEndpointProfile(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

UnobserveAssets(CancellationToken)

Stop receiving notifications on AssetChanged when an asset changes.

void UnobserveAssets(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Events

AssetChanged

The callback that executes when an asset has changed once you start observing an asset with ObserveAssets(TimeSpan?, CancellationToken).

event EventHandler<AssetChangedEventArgs>? AssetChanged

Event Type

EventHandler<AssetChangedEventArgs>

AssetEndpointProfileChanged

The callback that executes when the asset endpoint profile has changed once you start observing it with ObserveAssetEndpointProfile(TimeSpan?, CancellationToken).

event EventHandler<AssetEndpointProfileChangedEventArgs>? AssetEndpointProfileChanged

Event Type

EventHandler<AssetEndpointProfileChangedEventArgs>