通知チャネルの作成
以下の API を使用して通知チャネルを作成できます。
リクエストURL
POST https://http-collector-observability.sixthsense.rakuten.com/api-externalization/api/v1/channels
ヘッダー
ヘッダーキー:Authorization
ヘッダー値:Bearer {{access_token}} (SixthSenceポータルで [設定] > [アクセストークン] > [アクセストークンを表示] に移動)
リクエスト
{
"channelName": "string",
"template": "string",
"type": "EMAIL",
"values": [
"string"
]
}
例:
{
"channelName": "test",
"type": "WEBHOOK",
"values": [
"https://webhook.site/a0aac6c4-fb99-4dc8-b415-e31a393faa14"
],
"template": "{"ALERT_NAME":"{{alert_name}}","CAPABILITY":"{{capability}}","SEVERITY":"{{severity}}","ENTITY_NAME":"{{service_name}}","DESC":"
{{event_type}}","COMP":"{{metric_name}}","NOTES":"{{tool_name}} has detected a problem with {{service_name}} application where {{metric_name}} was
{{aggregator_operator}} {{threshold_value}} and the current value is around {{current_value}} for the last {{period}} min(s).","TIME":"
{{timestamp}}","TOOL_NAME":"{{tool_name}}","URL":"{{url}}"}"
}
パラメータ | 内容 |
---|---|
channelName | チャネル名(100文字以内) |
type | メール、Slack、Webhook |
values | メールアドレス、SlackのURL、WebhookのURLのタイプ別一覧 |
template | Webhook 通知用にカスタマイズされた有効な JSON テンプレートのみ許可 |
レスポンス
{
"data": {},
"message": "string",
"success": true
}
例
{
"message": "Notification channel successfully created.",
"success": true,
"data": {
"channelId": "4KuExIUBVVmCg9TvYqE3",
"channelName": "test",
"type": "WEBHOOK",
"values": [
"https://webhook.site/a0aac6c4-fb99-4dc8-b415-e31a393faa14"
],
"template": "{"ALERT_NAME":"{{alert_name}}","CAPABILITY":"{{capability}}","SEVERITY":"{{severity}}","ENTITY_NAME":"{{service_name}}","DESC":"{{event_type}}","COMP":"{{metric_name}}","NOTES": "{{tool_name}} has detected a problem with {{service_name}} application where {{metric_name}} was {{aggregator_operator}} {{threshold_value}} and the current value is around {{current_value}} for the last {{period}} min(s).","TIME":"{{timestamp}}","TOOL_NAME":"{{tool_name}}","URL":"{{url}}"}" ,
"lastUpdatedAt": 1674216304426,
"lastUpdatedBy": "API user",
"createdAt": 1674216304426,
"createdBy": "API user"
}
}