Class NotificationRulesApi
Inheritance
Implements
Namespace: InfluxDB.Client
Assembly: InfluxDB.Client.dll
Syntax
public class NotificationRulesApi : object, INotificationRulesApi
Constructors
NotificationRulesApi(NotificationRulesService)
Declaration
protected NotificationRulesApi(NotificationRulesService service)
Parameters
Type | Name | Description |
---|---|---|
NotificationRulesService | service |
Methods
AddLabelAsync(Label, NotificationRule, CancellationToken)
Add a label to a notification rule.
Declaration
public Task<Label> AddLabelAsync(Label label, NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Label | label | Label to add |
NotificationRule | rule | The notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<Label> | The label was added to the notification rule |
AddLabelAsync(String, String, CancellationToken)
Add a label to a notification rule.
Declaration
public async Task<Label> AddLabelAsync(string labelId, string ruleId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | labelId | Label to add |
System.String | ruleId | The notification rule ID. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<Label> | The label was added to the notification rule |
CreateHttpRuleAsync(String, String, RuleStatusLevel, List<TagRule>, HTTPNotificationEndpoint, String, CancellationToken)
Add a HTTP notification rule.
Declaration
public async Task<HTTPNotificationRule> CreateHttpRuleAsync(string name, string every, RuleStatusLevel status, List<TagRule> tagRules, HTTPNotificationEndpoint endpoint, string orgId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Human-readable name describing the notification rule. |
System.String | every | The notification repetition interval. |
RuleStatusLevel | status | Status rule the notification rule attempts to match. |
List<TagRule> | tagRules | List of tag rules the notification rule attempts to match. |
HTTPNotificationEndpoint | endpoint | The endpoint to use for notification. |
System.String | orgId | The ID of the organization that owns this notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<HTTPNotificationRule> | Notification rule created |
CreatePagerDutyRuleAsync(String, String, String, RuleStatusLevel, List<TagRule>, PagerDutyNotificationEndpoint, String, CancellationToken)
Add a PagerDuty notification rule.
Declaration
public async Task<PagerDutyNotificationRule> CreatePagerDutyRuleAsync(string name, string every, string messageTemplate, RuleStatusLevel status, List<TagRule> tagRules, PagerDutyNotificationEndpoint endpoint, string orgId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Human-readable name describing the notification rule. |
System.String | every | The notification repetition interval. |
System.String | messageTemplate | The template used to generate notification. |
RuleStatusLevel | status | Status rule the notification rule attempts to match. |
List<TagRule> | tagRules | List of tag rules the notification rule attempts to match. |
PagerDutyNotificationEndpoint | endpoint | The endpoint to use for notification. |
System.String | orgId | The ID of the organization that owns this notification rule |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<PagerDutyNotificationRule> | Notification rule created |
CreateRuleAsync(NotificationRule, CancellationToken)
Add a notification rule.
Declaration
public Task<NotificationRule> CreateRuleAsync(NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
NotificationRule | rule | Notification rule to create |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<NotificationRule> | Notification rule created |
CreateSlackRuleAsync(String, String, String, RuleStatusLevel, SlackNotificationEndpoint, String, CancellationToken)
Add a Slack notification rule.
Declaration
public Task<SlackNotificationRule> CreateSlackRuleAsync(string name, string every, string messageTemplate, RuleStatusLevel status, SlackNotificationEndpoint endpoint, string orgId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Human-readable name describing the notification rule. |
System.String | every | The notification repetition interval. |
System.String | messageTemplate | The template used to generate notification. |
RuleStatusLevel | status | Status rule the notification rule attempts to match. |
SlackNotificationEndpoint | endpoint | The endpoint to use for notification. |
System.String | orgId | The ID of the organization that owns this notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<SlackNotificationRule> | Notification rule created |
CreateSlackRuleAsync(String, String, String, RuleStatusLevel, List<TagRule>, SlackNotificationEndpoint, String, CancellationToken)
Add a Slack notification rule.
Declaration
public async Task<SlackNotificationRule> CreateSlackRuleAsync(string name, string every, string messageTemplate, RuleStatusLevel status, List<TagRule> tagRules, SlackNotificationEndpoint endpoint, string orgId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Human-readable name describing the notification rule. |
System.String | every | The notification repetition interval. |
System.String | messageTemplate | The template used to generate notification. |
RuleStatusLevel | status | Status rule the notification rule attempts to match. |
List<TagRule> | tagRules | List of tag rules the notification rule attempts to match. |
SlackNotificationEndpoint | endpoint | The endpoint to use for notification. |
System.String | orgId | The ID of the organization that owns this notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<SlackNotificationRule> | Notification rule created |
DeleteLabelAsync(Label, NotificationRule, CancellationToken)
Delete label from a notification rule.
Declaration
public Task DeleteLabelAsync(Label label, NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Label | label | The label to delete. |
NotificationRule | rule | The notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task |
DeleteLabelAsync(String, String, CancellationToken)
Delete label from a notification rule.
Declaration
public Task DeleteLabelAsync(string labelId, string ruleId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | labelId | The ID of the label to delete. |
System.String | ruleId | The notification rule ID. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task |
DeleteNotificationRuleAsync(NotificationRule, CancellationToken)
Delete a notification rule.
Declaration
public Task DeleteNotificationRuleAsync(NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
NotificationRule | rule | The notification rule |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task |
DeleteNotificationRuleAsync(String, CancellationToken)
Delete a notification rule.
Declaration
public Task DeleteNotificationRuleAsync(string ruleId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | ruleId | The notification rule ID |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task |
FindNotificationRuleByIdAsync(String, CancellationToken)
Get a notification rule.
Declaration
public Task<NotificationRule> FindNotificationRuleByIdAsync(string ruleId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | ruleId | The notification rule ID |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<NotificationRule> | The notification rule requested |
FindNotificationRulesAsync(String, CancellationToken)
Get notification rules.
Declaration
public async Task<List<NotificationRule>> FindNotificationRulesAsync(string orgId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | orgId | Only show notification rules that belong to a specific organization ID. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<List<NotificationRule>> | A list of notification rules |
FindNotificationRulesAsync(String, FindOptions, CancellationToken)
Get all notification rules.
Declaration
public Task<NotificationRules> FindNotificationRulesAsync(string orgId, FindOptions findOptions, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | orgId | Only show notification rules that belong to a specific organization ID. |
FindOptions | findOptions | find options |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<NotificationRules> |
GetLabelsAsync(NotificationRule, CancellationToken)
List all labels for a notification rule.
Declaration
public Task<List<Label>> GetLabelsAsync(NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
NotificationRule | rule | The notification rule. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<List<Label>> | A list of all labels for a notification rule |
GetLabelsAsync(String, CancellationToken)
List all labels for a notification rule
Declaration
public async Task<List<Label>> GetLabelsAsync(string ruleId, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | ruleId | The notification rule ID. |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<List<Label>> | A list of all labels for a notification rule |
UpdateNotificationRuleAsync(NotificationRule, CancellationToken)
Update a notification rule.
Declaration
public Task<NotificationRule> UpdateNotificationRuleAsync(NotificationRule rule, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
NotificationRule | rule | Notification rule update to apply |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<NotificationRule> | An updated notification rule |
UpdateNotificationRuleAsync(String, NotificationRuleUpdate, CancellationToken)
Update a notification rule.
Declaration
public Task<NotificationRule> UpdateNotificationRuleAsync(string ruleId, NotificationRuleUpdate update, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | ruleId | The notification rule ID. |
NotificationRuleUpdate | update | Notification rule update to apply |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<NotificationRule> | An updated notification rule |