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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.
sampleIntervalTimeSpanInterval between samples. Assign zero to receive at the lowest interval possible.
pathsIEnumerable<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.
actionAction<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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.
sampleIntervalTimeSpanInterval between samples. Assign zero to receive at the lowest interval possible.
pathsIEnumerable<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.
suppressRedundantboolWhen true, only values that changed during the interval will be sent.
heartbeatIntervalTimeSpanAlters 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.
actionAction<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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.
sampleIntervalTimeSpanInterval between samples. Assign zero to receive at the lowest interval possible.
pathsIEnumerable<Path>The model paths to subscribe to. This uses the actual gNMI Path class.
actionAction<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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel, or the request will be ignored if already active.
sampleIntervalTimeSpanInterval between samples. Assign zero to receive at the lowest interval possible.
pathsIEnumerable<Path>The model paths to subscribe to. This uses the actual gNMI Path class.
suppressRedundantboolWhen true, only values that changed during the interval will be sent.
heartbeatIntervalTimeSpanAlters 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.
actionAction<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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.
pathsIEnumerable<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.
actionAction<IEnumerable<GnmiResponseValue>>The callback action to execute when an update is received.
useTargetDefinedboolThe 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
subscriptionNamestringAn identifying name for this subscription. The name must be unique for the channel or the request will be ignored if already active.
pathsIEnumerable<Path>The model paths to subscribe to. This uses the actual gNMI Path class.
actionAction<IEnumerable<GnmiResponseValue>>The callback action to execute when an update is received.
useTargetDefinedboolThe 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.