Class ChecksApi
The client of the InfluxDB 2.x that implement Check Api.
Inheritance
Implements
Namespace: InfluxDB.Client
Assembly: InfluxDB.Client.dll
Syntax
public class ChecksApi : object, IChecksApi
Constructors
ChecksApi(ChecksService)
Declaration
protected ChecksApi(ChecksService service)
Parameters
| Type | Name | Description |
|---|---|---|
| ChecksService | service |
Methods
AddLabelAsync(Label, Check, CancellationToken)
Add a label to a check.
Declaration
public Task<Label> AddLabelAsync(Label label, Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Label | label | label to add |
| Check | check | the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Label> | the label was added to the check |
AddLabelAsync(String, String, CancellationToken)
Add a label to a check.
Declaration
public async Task<Label> AddLabelAsync(string labelId, string checkId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | labelId | ID of label to add |
| System.String | checkId | ID of the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Label> | the label was added to the check |
CreateCheckAsync(Check, CancellationToken)
Add new check.
Declaration
public Task<Check> CreateCheckAsync(Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Check | check | check to create |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Check> | Check created |
CreateDeadmanCheckAsync(String, String, String, String, String, String, CheckStatusLevel, String, CancellationToken)
Add new Deadman check.
Declaration
public async Task<DeadmanCheck> CreateDeadmanCheckAsync(string name, string query, string every, string timeSince, string staleTime, string messageTemplate, CheckStatusLevel level, string orgId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | the check name |
| System.String | query | The text of the flux query |
| System.String | every | Check repetition interval |
| System.String | timeSince | string duration before deadman triggers |
| System.String | staleTime | string duration for time that a series is considered stale and should not trigger deadman |
| System.String | messageTemplate | template that is used to generate and write a status message |
| CheckStatusLevel | level | the state to record if check matches a criteria |
| System.String | orgId | the organization that owns this check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<DeadmanCheck> | DeadmanCheck created |
CreateThresholdCheckAsync(String, String, String, String, Threshold, String, CancellationToken)
Add new Threshold check.
Declaration
public Task<ThresholdCheck> CreateThresholdCheckAsync(string name, string query, string every, string messageTemplate, Threshold threshold, string orgId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | the check name |
| System.String | query | The text of the flux query |
| System.String | every | Check repetition interval |
| System.String | messageTemplate | template that is used to generate and write a status message |
| Threshold | threshold | condition for that specific status |
| System.String | orgId | the organization that owns this check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<ThresholdCheck> | ThresholdCheck created |
CreateThresholdCheckAsync(String, String, String, String, List<Threshold>, String, CancellationToken)
Add new Threshold check.
Declaration
public async Task<ThresholdCheck> CreateThresholdCheckAsync(string name, string query, string every, string messageTemplate, List<Threshold> thresholds, string orgId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | the check name |
| System.String | query | The text of the flux query |
| System.String | every | Check repetition interval |
| System.String | messageTemplate | template that is used to generate and write a status message |
| List<Threshold> | thresholds | conditions for that specific status |
| System.String | orgId | the organization that owns this check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<ThresholdCheck> | ThresholdCheck created |
DeleteCheckAsync(Check, CancellationToken)
Delete a check.
Declaration
public Task DeleteCheckAsync(Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Check | check | the check to delete |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
DeleteCheckAsync(String, CancellationToken)
Delete a check.
Declaration
public Task DeleteCheckAsync(string checkId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | checkId | checkID the ID of check to delete |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
DeleteLabelAsync(Label, Check, CancellationToken)
Delete label from a check.
Declaration
public Task DeleteLabelAsync(Label label, Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Label | label | the label to delete |
| Check | check | the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
DeleteLabelAsync(String, String, CancellationToken)
Delete label from a check.
Declaration
public Task DeleteLabelAsync(string labelId, string checkId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | labelId | labelID the label id to delete |
| System.String | checkId | checkID ID of the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
FindCheckByIdAsync(String, CancellationToken)
Get a check.
Declaration
public Task<Check> FindCheckByIdAsync(string checkId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | checkId | ID of check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Check> | the check requested |
FindChecksAsync(String, CancellationToken)
Get checks.
Declaration
public async Task<List<Check>> FindChecksAsync(string orgId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | orgId | only show checks belonging to specified organization |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<List<Check>> | A list of checks |
FindChecksAsync(String, FindOptions, CancellationToken)
Get all checks.
Declaration
public Task<Checks> FindChecksAsync(string orgId, FindOptions findOptions, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | orgId | only show checks belonging to specified organization |
| FindOptions | findOptions | find options |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Checks> | A list of checks |
GetLabelsAsync(Check, CancellationToken)
List all labels for a check.
Declaration
public Task<List<Label>> GetLabelsAsync(Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Check | check | the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<List<Label>> | a list of all labels for a check |
GetLabelsAsync(String, CancellationToken)
List all labels for a check.
Declaration
public async Task<List<Label>> GetLabelsAsync(string checkId, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | checkId | ID of the check |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<List<Label>> | a list of all labels for a check |
UpdateCheckAsync(Check, CancellationToken)
Update a check.
Declaration
public Task<Check> UpdateCheckAsync(Check check, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Check | check | check update to apply |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Check> | An updated check |
UpdateCheckAsync(String, CheckPatch, CancellationToken)
Update a check.
Declaration
public Task<Check> UpdateCheckAsync(string checkId, CheckPatch patch, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | checkId | ID of check |
| CheckPatch | patch | update to apply |
| CancellationToken | cancellationToken | Cancellation token |
Returns
| Type | Description |
|---|---|
| Task<Check> | An updated check |