コンテンツにスキップ

変更



POST /api/v1/incidents/schedule/{schedule_uuid}/modify

概要

オンコールを変更します。

ルートパラメータ

パラメータ名 必須 説明
schedule_uuid string Y スケジュールUUID
空を許可: False

Body リクエストパラメータ

パラメータ名 必須 説明
name string Y 名前
空を許可: False
最大長: 256
空文字列を許可: False
timezone string タイムゾーン、デフォルトは Asia/Shanghai
例: Asia/Shanghai
空を許可: False
最大長: 48
start string Y 時間帯 開始時間
例: 00:00
空を許可: False
最大長: 48
end string Y 時間帯 終了時間
例: 23:59
空を許可: False
最大長: 48
tagFilter array フィルタータグに対応するUUIDリスト
空を許可: False
例: ['tag1', 'tag2']
dimensionFilter string フィルター次元
空を許可: False
例: host:127.0.0.1
notifyTargets array Y 通知先。アカウントUUID、通知先UUID、メールアドレスを含む
例: ['acnt_xxx', 'notify_', 'xxx@guance.com']
空を許可: False
extend json 拡張情報。ローテーション通知先設定を含む
空を許可: False
extend.enableRotateNotification boolean ローテーションを有効にするかどうか。デフォルトは無効
例: False
空を許可: False
extend.rotationCycle string ローテーション周期。日: day、週: week、月: month、平日: workDay、週末: weekend
例: day
空を許可: False
選択可能な値: ['day', 'week', 'month', 'workDay', 'weekend']
extend.effectiveTime json スケジュールの有効期限。デフォルトは永久有効。開始/終了時間は11桁のタイムスタンプ
例: {'start': 1719990196, 'end': 1729990196}
空を許可: False
scheduleStrategy array エスカレーションポリシールール

パラメータ補足説明

1. リクエストパラメータ説明

パラメータ名 type 必須 説明
name String 必須 スケジュール名
start String 必須 時間帯 開始時間
end String 必須 時間帯 終了時間
timezone String タイムゾーン
tagFilter array フィルタータグに対応するUUIDリスト
dimensionFilter array 次元フィルター。現在は等価とワイルドカードロジックをサポート
notifyTargets array 必須 通知先。アカウントUUID、通知先UUID、メールアドレスを含む
extend Json 拡張情報
scheduleStrategy Json エスカレーションポリシールール

2. dimensionFilter パラメータ説明 次元フィルターです。現在は等価とワイルドカードロジックをサポートし、形式は key:value です。例えば host:127.0.0.1 は、host が 127.0.0.1 の次元のみを含むことを意味します。 ワイルドカードロジックは * ワイルドカードをサポートします。例えば host:127.0.0.* は、host が 127.0.0. で始まる次元のみを含むことを意味します。 複数条件の or/and もサポートします。例えば host:127.0.0.1 AND service:mysql 現在サポートされている次元フィールドは以下の通りです: host、service、resource、pod_name、app_name、env、url


3. extend のパラメータ説明

パラメータ名 type 必須 説明
enableRotateNotification Boolean 通知先のローテーションを有効にするかどうか。デフォルトは無効
rotationCycle string 通知先ローテーション有効時のローテーション周期
effectiveTime json スケジュールの有効時間設定。デフォルトは永久有効。開始/終了時間は11桁のタイムスタンプ

4. scheduleStrategy のパラメータ説明

パラメータ名 type 必須 説明
scheduleStrategy[].uuid string Y 一意のUUID
scheduleStrategy[].name string Y ポリシー名
scheduleStrategy[].strategy array N エスカレーションポリシーリスト
scheduleStrategy[].strategy[].level integer Y レベル
scheduleStrategy[].strategy[].notifyConfig array Y 通知設定リスト
scheduleStrategy[].strategy[].notifyConfig[].notifyType array Y 通知先タイプ member - メンバー object - 通知先
scheduleStrategy[].strategy[].notifyConfig[].notifyObject array Y 通知先リスト。watchkeeper は現在のオンコール担当者を表す
scheduleStrategy[].strategy[].notifyConfig[].notifyMethod array N 通知方法。通知先の場合は不要。mobile - 電話 message - ショートメール email - メール
scheduleStrategy[].strategy[].ifRepeatNotify boolean Y 通知を繰り返し送信するかどうか
scheduleStrategy[].strategy[].repeatNotifyInterval integer N 通知の繰り返し間隔。単位: 秒
scheduleStrategy[].strategy[].levelUpTime integer N エスカレーションの継続時間
scheduleStrategy[].strategy[].incidentsLevel array N 対応するインシデントレベルのリスト
scheduleStrategy[].strategy[].incidentsStatus array N 対応するインシデントステータス open - 未割り当て working - 処理中

scheduleStrategy フィールドの例:

  [
    {
        "uuid": "",
        "name": "AAA",
        "strategy": [
            {
                "level": 0,
                "notifyConfig": [
                    {
                        "notifyObjectType": "member",
                        "notifyObject": ["watchkeeper"]
                    }
                    {
                        "notifyObjectType": "member",
                        "notifyObject": ["uuid_xxx1"]
                    }
                ],
                "ifRepeatNotify": true,
                "repeatNotifyInterval": 300
            },
            {
                "level": 1,
                "notifyConfig": [
                    {
                        "notifyObjectType": "member",
                        "notifyObject": ["uuid_xxx1"],
                        "notifyMethod": ["mobile", "message", "email"]
                    },
                    {
                        "notifyObjectType": "group",
                        "notifyObject": ["uuid_xxx2"],
                        "notifyMethod": ["mobile", "message", "email"]
                    }
                ],
                "ifRepeatNotify": true,
                "repeatNotifyInterval": 300,
                "levelUpTime": 1800,
                "incidentsLevel": ["uuid_xxxx"],
                "incidentsStatus": ["open"]
            }
        ]
    },
    {
        "uuid": "",
        "name": "BBB",
        "strategy": [
            {
                "level": 0,
                "notifyConfig": [
                    {
                        "notifyObject": "uuid_xxx"
                    }
                ],
                "ifRepeatNotify": true,
                "repeatNotifyInterval": 300
            }
        ]
    }
]

リクエスト例

curl 'https://openapi.guance.com/api/v1/incidents/schedule/incsch_xxx/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"test","timezone":"Asia/Shanghai","start":"00:00","end":"23:59","tagFilter":[],"dimensionFilter":"host:172.16.242.113","scheduleStrategy":[{"name":"test","uuid":"4c5851c0-f692-11f0-9ba3-87705656b525","strategy":[{"level":0,"notifyConfig":[{"notifyMethod":["email","message"],"notifyObject":["watchkeeper"],"notifyObjectType":"member"},{"notifyMethod":[],"notifyObject":["notify_xxx"],"notifyObjectType":"notify"}],"ifRepeatNotify":false,"repeatNotifyInterval":null},{"level":1,"levelUpTime":1800,"notifyConfig":[{"notifyMethod":["email"],"notifyObject":["acnt_xxxx"],"notifyObjectType":"member"}],"ifRepeatNotify":true,"incidentsLevel":["system_level_0"],"incidentsStatus":["open"],"repeatNotifyInterval":300}]}],"notifyTargets":["acnt_xxx"],"extend":{"enableRotateNotification":false,"rotationCycle":"day"}}' \
--compressed

レスポンス

{
    "code": 200,
    "content": {
        "workspaceUUID": "wksp_xxx",
        "name": "test",
        "timezone": "Asia/Shanghai",
        "start": "00:00",
        "end": "23:59",
        "tagFilter": [],
        "dimensionFilter": "host:172.16.242.113",
        "notifyTargets": [
            "acnt_xxx"
        ],
        "strategyConfig": [
            {
                "name": "test",
                "uuid": "4c5851c0-f692-11f0-9ba3-87705656b525",
                "strategy": [
                    {
                        "level": 0,
                        "notifyConfig": [
                            {
                                "notifyMethod": [
                                    "email",
                                    "message"
                                ],
                                "notifyObject": [
                                    "watchkeeper"
                                ],
                                "notifyObjectType": "member"
                            },
                            {
                                "notifyMethod": [],
                                "notifyObject": [
                                    "notify_xxx"
                                ],
                                "notifyObjectType": "notify"
                            }
                        ],
                        "ifRepeatNotify": false,
                        "repeatNotifyInterval": null
                    },
                    {
                        "level": 1,
                        "levelUpTime": 1800,
                        "notifyConfig": [
                            {
                                "notifyMethod": [
                                    "email"
                                ],
                                "notifyObject": [
                                    "acnt_xxx"
                                ],
                                "notifyObjectType": "member"
                            }
                        ],
                        "ifRepeatNotify": true,
                        "incidentsLevel": [
                            "system_level_0"
                        ],
                        "incidentsStatus": [
                            "open"
                        ],
                        "repeatNotifyInterval": 300
                    }
                ]
            }
        ],
        "extend": {
            "enableRotateNotification": false,
            "rotationCycle": "day"
        },
        "isDefault": false,
        "rotationUpdateAt": 1768989775,
        "id": 9180,
        "uuid": "incsch_xxx",
        "status": 0,
        "creator": "acnt_xxx",
        "updator": "acnt_xxx",
        "createAt": 1768964659,
        "deleteAt": -1,
        "updateAt": 1768989775
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "xxx"
}

フィードバック

このページは役に立ちましたか?