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
stringThe Id of the asset to retrieve.
cancellationToken
CancellationTokenCancellation token.
Returns
GetAssetEndpointProfileAsync(CancellationToken)
Get the asset endpoint profile of the asset with the provided Id.
Task<AssetEndpointProfile?> GetAssetEndpointProfileAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation 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
CancellationTokenCancellation token.
Returns
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
CancellationTokenCancellation 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
CancellationTokenCancellation 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
CancellationTokenCancellation token.
UnobserveAssets(CancellationToken)
Stop receiving notifications on AssetChanged when an asset changes.
void UnobserveAssets(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation 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
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