Share via


Smart Detector Alert Rules - Create Or Update

Smart Detector 경고 규칙을 만들거나 업데이트합니다.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}?api-version=2019-06-01

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
alertRuleName
path True

string

경고 규칙의 이름입니다.

resourceGroupName
path True

string

리소스 그룹의 이름.

subscriptionId
path True

string

대상 구독의 ID입니다.

api-version
query True

string

클라이언트 API 버전.

요청 본문

Name 필수 형식 Description
properties.actionGroups True

ActionGroupsInformation

경고 규칙 작업입니다.

properties.detector True

Detector

경고 규칙의 탐지기입니다.

properties.frequency True

string

ISO8601 형식의 경고 규칙 빈도입니다. 시간 세분성은 분 단위여야 하고 최소값은 5분이어야 합니다.

properties.scope True

string[]

경고 규칙 리소스는 scope.

properties.severity True

Severity

경고 규칙 심각도입니다.

properties.state True

AlertRuleState

경고 규칙 상태입니다.

location

string

리소스 위치입니다.

properties.description

string

경고 규칙 설명입니다.

properties.throttling

ThrottlingInformation

경고 규칙 제한 정보입니다.

tags

object

리소스 태그입니다.

응답

Name 형식 Description
200 OK

AlertRule

Smart Detector 경고 규칙을 업데이트하는 데 성공했습니다.

201 Created

AlertRule

Smart Detector 경고 규칙을 만들기 위한 요청이 성공했습니다.

Other Status Codes

SmartDetectorErrorResponse

작업이 실패한 이유를 설명하는 오류 응답입니다.

보안

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation 사용자 계정 가장

예제

Create or update a Smart Detector alert rule

Sample Request

PUT https://management.azure.com/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule?api-version=2019-06-01

{
  "properties": {
    "description": "Sample smart detector alert rule description",
    "state": "Enabled",
    "severity": "Sev3",
    "frequency": "PT5M",
    "detector": {
      "id": "VMMemoryLeak"
    },
    "scope": [
      "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "actionGroups": {
      "customEmailSubject": "My custom email subject",
      "customWebhookPayload": "{\"AlertRuleName\":\"#alertrulename\"}",
      "groupIds": [
        "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup"
      ]
    },
    "throttling": {
      "duration": "PT20M"
    }
  }
}

Sample Response

{
  "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
  "type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
  "name": "MyAlertRule",
  "location": "global",
  "tags": {},
  "properties": {
    "description": "Sample smart detector alert rule description",
    "state": "Enabled",
    "severity": "Sev3",
    "frequency": "PT5M",
    "detector": {
      "id": "VMMemoryLeak"
    },
    "scope": [
      "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "actionGroups": [
      {
        "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup"
      }
    ],
    "throttling": {
      "duration": "PT20M"
    }
  }
}
{
  "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyAlertRules/providers/microsoft.alertsManagement/smartDetectorAlertRules/MyAlertRule",
  "type": "Microsoft.AlertsManagement/smartDetectorAlertRules",
  "name": "MyAlertRule",
  "location": "global",
  "tags": {},
  "properties": {
    "description": "Sample smart detector alert rule description",
    "state": "Enabled",
    "severity": "Sev3",
    "frequency": "PT5M",
    "detector": {
      "id": "VMMemoryLeak"
    },
    "scope": [
      "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/MyVms/providers/Microsoft.Compute/virtualMachines/vm1"
    ],
    "actionGroups": [
      {
        "actionGroupId": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourcegroups/actionGroups/providers/microsoft.insights/actiongroups/MyActionGroup"
      }
    ],
    "throttling": {
      "duration": "PT20M"
    }
  }
}

정의

Name Description
ActionGroupsInformation

경고 규칙에서 사용하는 작업 그룹 정보입니다.

AlertRule

경고 규칙 정보

AlertRuleState

경고 규칙 상태입니다.

Detector

탐지기 정보입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

Severity

경고 규칙 심각도입니다.

SmartDetectorErrorResponse

오류 응답의 형식을 설명합니다.

ThrottlingInformation

경고 규칙에 대한 선택적 제한 정보입니다.

ActionGroupsInformation

경고 규칙에서 사용하는 작업 그룹 정보입니다.

Name 형식 Description
customEmailSubject

string

메일 알림 사용할 선택적 사용자 지정 전자 메일입니다.

customWebhookPayload

string

웹 후크 알림에 사용할 선택적 사용자 지정 웹 후크 페이로드입니다.

groupIds

string[]

작업 그룹 리소스 ID입니다.

AlertRule

경고 규칙 정보

Name 형식 기본값 Description
id

string

리소스 ID입니다.

location

string

global

리소스 위치입니다.

name

string

리소스 이름입니다.

properties.actionGroups

ActionGroupsInformation

경고 규칙 작업입니다.

properties.description

string

경고 규칙 설명입니다.

properties.detector

Detector

경고 규칙의 탐지기입니다.

properties.frequency

string

ISO8601 형식의 경고 규칙 빈도입니다. 시간 세분성은 분 단위여야 하고 최소값은 5분이어야 합니다.

properties.scope

string[]

경고 규칙 리소스는 scope.

properties.severity

Severity

경고 규칙 심각도입니다.

properties.state

AlertRuleState

경고 규칙 상태입니다.

properties.throttling

ThrottlingInformation

경고 규칙 제한 정보입니다.

tags

object

리소스 태그입니다.

type

string

리소스 종류입니다.

AlertRuleState

경고 규칙 상태입니다.

Name 형식 Description
Disabled

string

Enabled

string

Detector

탐지기 정보입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

Name 형식 Description
description

string

Smart Detector 설명입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

id

string

감지기 ID입니다.

imagePaths

string[]

Smart Detector 이미지 경로입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

name

string

Smart Detector 이름입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

parameters

object

탐지기의 매개 변수입니다.'

supportedResourceTypes

string[]

Smart Detector 지원 리소스 종류입니다. expandDetector에 지정되지 않는 한 기본적으로 채워지지 않습니다.

Severity

경고 규칙 심각도입니다.

Name 형식 Description
Sev0

string

Sev1

string

Sev2

string

Sev3

string

Sev4

string

SmartDetectorErrorResponse

오류 응답의 형식을 설명합니다.

Name 형식 Description
code

string

오류 코드

message

string

작업이 실패한 이유를 나타내는 오류 메시지입니다.

ThrottlingInformation

경고 규칙에 대한 선택적 제한 정보입니다.

Name 형식 Description
duration

string

경고 규칙에 다시 알리기 전에 대기하는 데 필요한 기간(ISO8601 형식)입니다. 시간 세분성은 분 단위여야 하고 최소값은 0분이어야 합니다.