MetricsAdvisorAdministrationClient.CreateHookAsync Method

Definition

Creates a NotificationHook and assigns it a unique ID.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Administration.NotificationHook>> CreateHookAsync (Azure.AI.MetricsAdvisor.Administration.NotificationHook hook, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateHookAsync : Azure.AI.MetricsAdvisor.Administration.NotificationHook * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Administration.NotificationHook>>
override this.CreateHookAsync : Azure.AI.MetricsAdvisor.Administration.NotificationHook * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.MetricsAdvisor.Administration.NotificationHook>>
Public Overridable Function CreateHookAsync (hook As NotificationHook, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of NotificationHook))

Parameters

hook
NotificationHook

Specifies how the created NotificationHook should be configured.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A Response<T> containing the result of the operation. The result is a NotificationHook instance containing information about the created hook.

Exceptions

hook is null; or hook is an EmailNotificationHook and hook.EmailsToAlert is null.

hook is an EmailNotificationHook and hook.EmailsToAlert is empty.

Applies to