Table of Contents

Method Subscribe

Namespace
Skyline.DataMiner.DataSources.OpenConfig.Gnmi.Api
Assembly
Skyline.DataMiner.DataSources.OpenConfig.Gnmi.dll

Subscribe(string, TimeSpan, IEnumerable<string>, Action<IEnumerable<GnmiResponseValue>>)

Adds a subscription with a sample interval on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, TimeSpan sampleInterval, IEnumerable<string> paths, Action<IEnumerable<GnmiResponseValue>> action = null)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.

sampleInterval TimeSpan

Interval between samples. Assign zero to receive at the lowest interval possible.

paths IEnumerable<string>

The model paths to subscribe to. A path should be formatted as a concatenation of node names separated by either a forward or backward slash.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentOutOfRangeException

The sampleInterval argument cannot be negative.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.

Subscribe(string, TimeSpan, IEnumerable<string>, bool, TimeSpan, Action<IEnumerable<GnmiResponseValue>>)

Adds a subscription with a sample interval on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, TimeSpan sampleInterval, IEnumerable<string> paths, bool suppressRedundant, TimeSpan heartbeatInterval, Action<IEnumerable<GnmiResponseValue>> action = null)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.

sampleInterval TimeSpan

Interval between samples. Assign zero to receive at the lowest interval possible.

paths IEnumerable<string>

The model paths to subscribe to. A path should be formatted as a concatenation of node names separated by either a forward or backward slash.

suppressRedundant bool

When true, only values that changed during the interval will be sent.

heartbeatInterval TimeSpan

Alters the suppress-redundant behavior and sets an interval at which values should be sent even if they did not change. Value cannot be negative and TimeSpan.Zero disables the feature.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentOutOfRangeException

The sampleInterval argument cannot be negative.

ArgumentOutOfRangeException

The heartbeatInterval argument cannot be negative.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.

Subscribe(string, TimeSpan, IEnumerable<Path>, Action<IEnumerable<GnmiResponseValue>>)

Adds a subscription with a sample interval on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, TimeSpan sampleInterval, IEnumerable<Path> paths, Action<IEnumerable<GnmiResponseValue>> action = null)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.

sampleInterval TimeSpan

Interval between samples. Assign zero to receive at the lowest interval possible.

paths IEnumerable<Path>

The model paths to subscribe to. This uses the actual gNMI Path class.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentOutOfRangeException

The sampleInterval argument cannot be negative.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.

Subscribe(string, TimeSpan, IEnumerable<Path>, bool, TimeSpan, Action<IEnumerable<GnmiResponseValue>>)

Adds a subscription with a sample interval on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, TimeSpan sampleInterval, IEnumerable<Path> paths, bool suppressRedundant, TimeSpan heartbeatInterval, Action<IEnumerable<GnmiResponseValue>> action = null)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel, or the request will be ignored if already active.

sampleInterval TimeSpan

Interval between samples. Assign zero to receive at the lowest interval possible.

paths IEnumerable<Path>

The model paths to subscribe to. This uses the actual gNMI Path class.

suppressRedundant bool

When true, only values that changed during the interval will be sent.

heartbeatInterval TimeSpan

Alters the suppress-redundant behavior and sets an interval at which values should be sent even if they did not change. Value cannot be negative and TimeSpan.Zero disables the feature.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentOutOfRangeException

The sampleInterval argument cannot be negative.

ArgumentOutOfRangeException

The heartbeatInterval argument cannot be negative.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.

Subscribe(string, IEnumerable<string>, Action<IEnumerable<GnmiResponseValue>>, bool)

Adds a subscription for changed values on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, IEnumerable<string> paths, Action<IEnumerable<GnmiResponseValue>> action = null, bool useTargetDefined = false)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.

paths IEnumerable<string>

The model paths to subscribe to. A path should be formatted as a concatenation of node names separated by either a forward or backward slash.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

useTargetDefined bool

The TARGET_DEFINED mode lets the server decide for each leaf of the subscribed nodes whether it should use an ON_CHANGE or SAMPLE subscription.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.

Subscribe(string, IEnumerable<Path>, Action<IEnumerable<GnmiResponseValue>>, bool)

Adds a subscription for changed values on the endpoint for the specified paths.

public void Subscribe(string subscriptionName, IEnumerable<Path> paths, Action<IEnumerable<GnmiResponseValue>> action = null, bool useTargetDefined = false)

Parameters

subscriptionName string

An identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.

paths IEnumerable<Path>

The model paths to subscribe to. This uses the actual gNMI Path class.

action Action<IEnumerable<GnmiResponseValue>>

The callback action to execute when an update is received.

useTargetDefined bool

The TARGET_DEFINED mode lets the server decide for each leaf of the subscribed nodes whether it should use an ON_CHANGE or SAMPLE subscription.

Exceptions

ArgumentNullException

The action argument cannot be null when there is no DataMapper present.

ArgumentException

Name of the subscription cannot be null, empty, or a whitespace.

ArgumentNullException

The paths argument cannot be null.

ArgumentException

There should be at least one path present in the paths argument.

RequestFailedException

An exception was thrown by the DxM.