using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using InfluxDB.Client.Api.Domain; using InfluxDB.Client.Api.Service; using InfluxDB.Client.Core; using InfluxDB.Client.Domain; namespace InfluxDB.Client { public interface INotificationEndpointsApi { /// /// Add new Slack notification endpoint. The 'url' should be defined. /// /// Endpoint name /// Slack WebHook URL /// Owner of an endpoint /// Cancellation token /// created Slack notification endpoint Task CreateSlackEndpointAsync(string name, string url, string orgId, CancellationToken cancellationToken = default); /// /// Add new Slack notification endpoint. The 'url' should be defined. /// /// Endpoint name /// Slack WebHook URL /// Slack WebHook Token /// Owner of an endpoint /// Cancellation token /// created Slack notification endpoint Task CreateSlackEndpointAsync(string name, string url, string token, string orgId, CancellationToken cancellationToken = default); /// /// Add new PagerDuty notification endpoint. /// /// Endpoint name /// Client URL /// Routing Key /// Owner of an endpoint /// Cancellation token /// created PagerDuty notification endpoint Task CreatePagerDutyEndpointAsync(string name, string clientUrl, string routingKey, string orgId, CancellationToken cancellationToken = default); /// /// Add new HTTP notification endpoint without authentication. /// /// Endpoint name /// URL /// HTTP Method /// Owner of an endpoint /// Cancellation token /// created HTTP notification endpoint Task CreateHttpEndpointAsync(string name, string url, HTTPNotificationEndpoint.MethodEnum method, string orgId, CancellationToken cancellationToken = default); /// /// /// /// Endpoint name /// URL /// HTTP Method /// HTTP Basic Username /// HTTP Basic Password /// Owner of an endpoint /// Cancellation token /// created HTTP notification endpoint Task CreateHttpEndpointBasicAuthAsync(string name, string url, HTTPNotificationEndpoint.MethodEnum method, string username, string password, string orgId, CancellationToken cancellationToken = default); /// /// /// /// Endpoint name /// URL /// HTTP Method /// Bearer token /// Owner of an endpoint /// Cancellation token /// created HTTP notification endpoint Task CreateHttpEndpointBearerAsync(string name, string url, HTTPNotificationEndpoint.MethodEnum method, string token, string orgId, CancellationToken cancellationToken = default); /// /// Add new notification endpoint. /// /// notificationEndpoint to create /// Cancellation token /// Notification endpoint created Task CreateEndpointAsync(NotificationEndpoint notificationEndpoint, CancellationToken cancellationToken = default); /// /// Update a notification endpoint. The updates is used for fields from . /// /// update to apply /// Cancellation token /// An updated notification endpoint Task UpdateEndpointAsync(NotificationEndpoint notificationEndpoint, CancellationToken cancellationToken = default); /// /// Update a notification endpoint. /// /// ID of notification endpoint /// update to apply /// Cancellation token /// An updated notification endpoint Task UpdateEndpointAsync(string endpointId, NotificationEndpointUpdate notificationEndpointUpdate, CancellationToken cancellationToken = default); /// /// Delete a notification endpoint. /// /// notification endpoint /// Cancellation token /// delete has been accepted> Task DeleteNotificationEndpointAsync(NotificationEndpoint notificationEndpoint, CancellationToken cancellationToken = default); /// /// Delete a notification endpoint. /// /// ID of notification endpoint /// Cancellation token /// delete has been accepted Task DeleteNotificationEndpointAsync(string endpointId, CancellationToken cancellationToken = default); /// /// Get notification endpoints. /// /// only show notification endpoints belonging to specified organization /// Cancellation token /// A list of notification endpoint Task> FindNotificationEndpointsAsync(string orgId, CancellationToken cancellationToken = default); /// /// Get all notification endpoints. /// /// only show notification endpoints belonging to specified organization /// the find options /// Cancellation token /// Task FindNotificationEndpointsAsync(string orgId, FindOptions findOptions, CancellationToken cancellationToken = default); /// /// Get a notification endpoint. /// /// ID of notification endpoint /// Cancellation token /// the notification endpoint requested Task FindNotificationEndpointByIdAsync(string endpointId, CancellationToken cancellationToken = default); /// /// Clone a Slack Notification endpoint. /// /// name of cloned endpoint /// Slack WebHook Token /// ID of endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneSlackEndpointAsync(string name, string token, string endpointId, CancellationToken cancellationToken = default); /// /// Clone a Slack Notification endpoint. /// /// name of cloned endpoint /// /// endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneSlackEndpointAsync(string name, string token, SlackNotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// Clone a PagerDuty Notification endpoint. /// /// name of cloned endpoint /// Routing Key /// ID of endpoint to clone /// Cancellation token /// Notification endpoint cloned Task ClonePagerDutyEndpointAsync(string name, string routingKey, string endpointId, CancellationToken cancellationToken = default); /// /// Clone a PagerDuty Notification endpoint. /// /// name of cloned endpoint /// Routing Key /// endpoint to clone /// Cancellation token /// Notification endpoint cloned Task ClonePagerDutyEndpointAsync(string name, string routingKey, PagerDutyNotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint without authentication. /// /// name of cloned endpoint /// ID of endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpointAsync(string name, string endpointId, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint without authentication. /// /// name of cloned endpoint /// endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpoint(string name, HTTPNotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint with Http Basic authentication. /// /// name of cloned endpoint /// HTTP Basic Username /// HTTP Basic Password /// ID of endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpointBasicAuthAsync(string name, string username, string password, string endpointId, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint with Http Basic authentication. /// /// name of cloned endpoint /// HTTP Basic Username /// HTTP Basic Password /// endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpointBasicAuthAsync(string name, string username, string password, HTTPNotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint with Bearer authentication. /// /// name of cloned endpoint /// Bearer token /// ID of endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpointBearerAsync(string name, string token, string endpointId, CancellationToken cancellationToken = default); /// /// Clone a Http Notification endpoint with Bearer authentication. /// /// name of cloned endpoint /// Bearer token /// endpoint to clone /// Cancellation token /// Notification endpoint cloned Task CloneHttpEndpointBearerAsync(string name, string token, HTTPNotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// List all labels for a notification endpoint. /// /// the notification endpoint /// Cancellation token /// a list of all labels for a notification endpoint Task> GetLabelsAsync(NotificationEndpoint endpoint, CancellationToken cancellationToken = default); /// /// List all labels for a notification endpoint. /// /// ID of the notification endpoint /// Cancellation token /// a list of all labels for a notification endpoint Task> GetLabelsAsync(string endpointId, CancellationToken cancellationToken = default); /// /// Add a label to a notification endpoint. /// /// label to add /// the notification endpoint /// Cancellation token /// Task