alertRule を更新する

名前空間: microsoft.graph.deviceManagement

重要

Microsoft Graph のバージョンの /beta API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 API が v1.0 で使用できるかどうかを判断するには、 バージョン セレクターを使用します。

alertRule オブジェクトのプロパティを更新します。

アクセス許可

この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。

アクセス許可の種類 アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント) CloudPC.ReadWrite.All
委任 (個人用 Microsoft アカウント) サポートされていません。
アプリケーション CloudPC.ReadWrite.All

HTTP 要求

PATCH /deviceManagement/monitoring/alertRules/{alertRuleId}

要求ヘッダー

名前 説明
Authorization ベアラー {token}。 必須です。
Content-Type application/json. 必須です。

要求本文

要求本文で、更新すべきプロパティの値のみを指定します。 要求本文に含まれない既存のプロパティは、以前の値のままになるか、他のプロパティ値の変化に基づいて再計算されます。

次の表に、更新できるプロパティを示します。

プロパティ 説明
enabled ブール型 ルールが有効か無効かを示すルールの状態。 の場合 true、ルールが有効になっています。それ以外の場合、ルールは無効になります。 オプション。
notificationChannels microsoft.graph.deviceManagement.notificationChannel コレクション ユーザーが選択したルールの通知チャネル。 オプション。
severity ruleSeverityType ルールの重大度。 使用可能な値: unknowninformationalwarningcriticalunknownFutureValue。 オプション。
しきい値 microsoft.graph.deviceManagement.ruleThreshold ルールのしきい値。 省略可能。

応答

成功した場合、このメソッドは応答コードと、応答本文で更新された microsoft.graph.deviceManagement.alertRule オブジェクトを返200 OKします。

要求

要求の例を次に示します。

PATCH https://graph.microsoft.com/beta/deviceManagement/monitoring/alertRules/215c55cc-b1c9-4d36-a870-be5778101714
Content-Type: application/json

{
  "severity": "informational",
  "enabled": true,
  "threshold": {
      "aggregation": "count",
      "operator": "greaterOrEqual",
      "target": 90
  },
  "notificationChannels": [
      {
        "notificationChannelType": "portal",
        "receivers": [
            ""
        ],
        "notificationReceivers": []
      },
      {
        "notificationChannelType": "email",
        "receivers": [
            "serena.davis@contoso.com"
        ],
        "notificationReceivers": [
            {
                "locale": "en-us",
                "contactInformation": "serena.davis@contoso.com"
            }
        ]
      }
  ]
}

応答

応答の例を次に示します。

HTTP/1.1 200 OK
Content-Type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/monitoring/alertRules/$entity",
  "id": "215c55cc-b1c9-4d36-a870-be5778101714",
  "displayName": "Azure network connection failure impacting Cloud PCs",
  "severity": "informational",
  "isSystemRule": true,
  "description": "Azure network connection checks have failed and is potentially impacting existing Cloud PCs and blocking the provisioning of new Cloud PCs",
  "enabled": true,
  "alertRuleTemplate": "cloudPcOnPremiseNetworkConnectionCheckScenario",
  "threshold": {
      "aggregation": "count",
      "operator": "greaterOrEqual",
      "target": 90
  },
  "notificationChannels": [
      {
        "notificationChannelType": "portal",
        "receivers": [
            ""
        ],
        "notificationReceivers": []
      },
      {
        "notificationChannelType": "email",
        "receivers": [
            "serena.davis@contoso.com"
        ],
        "notificationReceivers": [
            {
                "locale": "en-us",
                "contactInformation": "serena.davis@contoso.com"
            }
        ]
      }
  ]
}