알림 알림 채널 API - Amazon Managed Grafana

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

알림 알림 채널 API

알림 알림 채널 API를 사용하여 알림 채널을 생성, 업데이트, 삭제 및 검색할 수 있습니다.

알림 채널의 식별자 (id) 는 자동으로 증가하는 숫자 값이며 작업 공간별로만 고유합니다. 알림 채널의 고유 식별자 (uid) 는 여러 작업 영역 사이에 있는 폴더를 고유하게 식별하는 데 사용할 수 있습니다. 알림 채널을 만들 때 알림 채널을 제공하지 않으면 자동으로 생성됩니다. uid를 사용하면 알림 채널에 액세스하고 여러 Amazon Managed Grafana 작업 영역 간에 알림 채널을 동기화할 때 일관된 URL을 사용할 수 있습니다.

참고

아마존 관리형 그라파나 워크스페이스에서 Grafana API를 사용하려면 유효한 Grafana API 토큰이 있어야 합니다. API 요청의 필드에 이를 포함시키세요. Authorization API 호출을 인증하기 위한 토큰을 생성하는 방법에 대한 자세한 내용은 을 참조하십시오토큰으로 인증.

모든 알림 채널 가져오기

인증된 사용자가 볼 수 있는 권한을 가진 모든 알림 채널을 반환합니다.

GET /api/alert-notifications

요청 예제

GET /api/alert-notifications HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json [ { "id": 1, "uid": "sns-uid", "name": "test", "type": "sns", "isDefault": false, "sendReminder": false, "disableResolveMessage": false, "frequency": "", "created": "2023-09-08T19:57:56Z", "updated": "2023-09-08T19:57:56Z", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "secureFields": {} } ]

모든 알림 채널 가져오기 (조회)

모든 알림 채널을 반환하지만 세부 정보는 더 적게 표시합니다. 인증된 모든 사용자가 액세스할 수 있으며 주로 경고 규칙을 구성할 때 Grafana 작업 공간 콘솔 UI에서 경고 알림 채널을 제공하는 데 사용됩니다.

GET /api/alert-notifications/lookup

요청 예제

GET /api/alert-notifications/lookup HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json [ { "id": 1, "uid": "sns-uid", "name": "test", "type": "sns", "isDefault": false }, { "id": 2, "uid": "slack-uid", "name": "Slack", "type": "slack", "isDefault": false } ]

UID로 모든 알림 채널을 가져옵니다.

GET /api/alert-notifications/uid/:uid

요청 예제

GET /api/alert-notifications/uid/sns-uid HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json { "id": 1, "uid": "sns-uid", "name": "test", "type": "sns", "isDefault": false, "sendReminder": false, "disableResolveMessage": false, "frequency": "", "created": "2023-09-08T19:57:56Z", "updated": "2023-09-08T19:57:56Z", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "secureFields": {} }

ID로 모든 알림 채널 가져오기

GET /api/alert-notifications/:id

요청 예제

GET /api/alert-notifications/1 HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json { "id": 1, "uid": "sns-uid", "name": "test", "type": "sns", "isDefault": false, "sendReminder": false, "disableResolveMessage": false, "frequency": "", "created": "2023-09-08T19:57:56Z", "updated": "2023-09-08T19:57:56Z", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "secureFields": {} }

알림 채널 만들기

Amazon Managed Grafana에서 지원하는 알림 채널을 확인하려면 에서 지원되는 알리미 목록을 참조하십시오. 연락처 관련 작업

POST /api/alert-notifications

요청 예제

POST /api/alert-notifications HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890 { "uid": "new-sns-uid", // optional "name": "sns alert notification", //Required "type": "sns", //Required "isDefault": false, "sendReminder": false, "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false } }

응답의 예

HTTP/1.1 200 Content-Type: application/json { "id": 1, "uid": "new-sns-uid", "name": "sns alert notification", "type": "sns", "isDefault": false, "sendReminder": false, "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "created": "2018-04-23T14:44:09+02:00", "updated": "2018-08-20T15:47:49+02:00" }

UID별로 알림 채널을 업데이트하세요.

PUT /api/alert-notifications/uid/:uid

요청 예제

PUT /api/alert-notifications/uid/sns-uid HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890 { "uid": "sns-uid", // optional "name": "sns alert notification", //Required "type": "sns", //Required "isDefault": false, "sendReminder": true, "frequency": "15m", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false } }

응답의 예

HTTP/1.1 200 Content-Type: application/json { "id": 1, "uid": "sns-uid", "name": "sns alert notification", "type": "sns", "isDefault": false, "sendReminder": true, "frequency": "15m", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "created": "2017-01-01 12:34", "updated": "2017-01-01 12:34" }

ID별 알림 채널 업데이트

PUT /api/alert-notifications/:id

요청 예제

PUT /api/alert-notifications/1 HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890 { "id": 1, "uid": "sns-uid", // optional "name": "sns alert notification", //Required "type": "sns", //Required "isDefault": false, "sendReminder": true, "frequency": "15m", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false } }

응답의 예

HTTP/1.1 200 Content-Type: application/json { "id": 1, "uid": "sns-uid", "name": "sns alert notification", "type": "sns", "isDefault": false, "sendReminder": true, "frequency": "15m", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false }, "created": "2017-01-01 12:34", "updated": "2017-01-01 12:34" }

UID로 알림 채널 삭제

DELETE /api/alert-notifications/uid/:uid

요청 예제

DELETE /api/alert-notifications/uid/sns-uid HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json { "message": "Notification deleted" }

ID별 알림 채널 삭제

DELETE /api/alert-notifications/:id

요청 예제

DELETE /api/alert-notifications/1 HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890

응답의 예

HTTP/1.1 200 Content-Type: application/json { "message": "Notification deleted" }

테스트 알림 채널

지정된 알림 채널 유형 및 설정에 대한 테스트 알림 메시지를 보냅니다.

POST /api/alert-notifications/test

요청 예제

POST /api/alert-notifications/test HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer 1234abcd567exampleToken890 { "type": "sns", "settings": { "authProvider": "default", "autoResolve": true, "httpMethod": "POST", "messageFormat": "json", "severity": "critical", "topic": "<SNS-TOPIC-ARN>", "uploadImage": false } }

응답의 예

HTTP/1.1 200 Content-Type: application/json { "message": "Test notification sent" }