콘텐츠로 이동

생성



POST /api/v1/incidents/schedule/add

개요

새 온콜 일정 생성

본문 요청 파라미터

파라미터명 유형 필수 설명
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. 요청 파라미터 설명

파라미터명 유형 필수 설명
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 파라미터 설명

파라미터명 유형 필수 설명
enableRotateNotification Boolean 알림 대상 교대 활성화 여부, 기본값 비활성화
rotationCycle string 알림 대상 교대 활성화 후 교대 주기
effectiveTime json 일정 유효 시간 설정, 기본값은 영구 유효, 시작/종료 시간은 11자리 타임스탬프

4. scheduleStrategy 파라미터 설명

파라미터명 유형 필수 설명
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/add' \
-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"
} 

문서 평가

이 페이지가 도움이 되었나요?