次の方法で共有


MetricAlertCollection.CreateOrUpdateAsync メソッド

定義

メトリック アラート定義を作成または更新します。

  • 要求パス/サブスクリプション/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}
  • 操作IdMetricAlerts_CreateOrUpdate
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.MetricAlertResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string ruleName, Azure.ResourceManager.Monitor.MetricAlertData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.MetricAlertData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.MetricAlertResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Monitor.MetricAlertData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Monitor.MetricAlertResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, ruleName As String, data As MetricAlertData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of MetricAlertResource))

パラメーター

waitUntil
WaitUntil

Completed メソッドがサービスで実行時間の長い操作が完了するまで戻るのを待機する必要がある場合。 Started 操作を開始した後に が返される場合は 。 実行時間の長い操作の詳細については、「 Azure.Core Long-Running 操作のサンプル」を参照してください。

ruleName
String

ルールの名前です。

data
MetricAlertData

作成または更新するルールのパラメーター。

cancellationToken
CancellationToken

使用する取り消しトークン。

戻り値

例外

ruleName は空の文字列であり、空でないと想定されていました。

ruleName または data が null です。

適用対象