콘텐츠로 이동

생성



POST /api/v1/service_manage/add

개요

새 서비스 목록 구성을 추가합니다

Body 요청 파라미터

파라미터명 타입 필수 설명
serviceCatelog string Y 서비스 목록 구성, toml 구성 문자열
$maxCustomLength: 65535
빈 값 허용: False

파라미터 추가 설명

요청 본문 구조 설명

파라미터명 type 필수 설명
serviceCatelog string Y 서비스 목록 구성의 원시 toml 형식 문자열

serviceCatelog 필드 설명

파라미터명 type 필수 설명
Team dict Y 서비스, 팀 등 정보
Repos array N 저장소 구성
Docs array N 도움말 구성
Related array N 연결 구성

Team 필드 설명

파라미터명 type 필수 설명
service string Y 서비스 이름
type string N 서비스 유형, 열거형 값(app, framework, cache, message_queue, custom, db, web)
team string N 팀 이름
colour string N 서비스 색상
oncall array N 연락처

colour 필드 열거형 값 '#C75BC9', '#DE5565', '#C43243', '#D77D3D', '#2EB2EE', '#A7D650', '#417C51', '#40C9C9', '#6454CB', '#E8C035', '#36AEAE', '#FDA82D', '#FFD33B', '#196AAB', '#993C7E', '#6C7AEB', '#49B566', '#9E7EDD', '#8EB743', '#D47FD6', '#289ED4', '#3F94DC', '#8934A4', '#1A9A82', '#AC8AF0', '#F19AF2'

oncall 필드 설명

파라미터명 type 필수 설명
name string N 연락처 이름
type string N 연락처 유형, 열거형 값 email,mobile,slack
emails array N 이메일
mobiles array N 전화번호
slack string N Slack 채널 주소

Repos, Docs 필드 설명

파라미터명 type 필수 설명
link string N 저장소 코드 URL/연결 문서 URL
name string N 표시 이름
provider string N 제공자 이름

Related 필드 설명

파라미터명 type 필수 설명
AppId string N RUM 애플리케이션 ID
DashboardUUIDs array N 내장 대시보드 UUID 바인딩
Tags array N 연결 태그

serviceCatelog 필드 예시:

[Team]    #팀
service = "jinlei_1"    # 필수
type = "db"  # 필수, 현재 서비스 유형
team = "测试组"   # 현재 서비스 팀 이름
colour = "#40C9C9"   # 현재 서비스 색상 정보

[[Team.oncall]]  # 연락처 구성
name = "example_yun"
type = "email"
emails = ["xxx@guance.com", "xxx@guance.com"]

[[Team.oncall]]  # 연락처 구성
name = "zhuyun"
type = "mobile"
mobiles = ["xxxxxxx5786", "xxxxxxx4231"]

[[Team.oncall]]  # 연락처 구성
name = "test"
type = "slack"
slack = "#test"

[[Repos]]  # 저장소 구성, # 저장소 링크의 제공자와 표시 텍스트 입력
link = "https://www.guance.com"
name = "guance"
provider = "example_yun"

[[Repos]]  # 저장소 구성
link = "https://func.guance.com"
name = "func"
provider = "example_yun"


[[Docs]]  # 도움말, 도움말 링크의 콘텐츠 제공자와 표시 텍스트 입력
link = "https://docs.guance.com/ko"
name = "guance"
provider = "example_yun"

[[Docs]]  # 도움말
link = "https://func.guance.com/doc"
name = "func"
provider = "example_yun"


[Related]  # 연결 구성
AppId = "a138bcb0_47ef_11ee_9d75_31ea50b9d85a"
Tags = ["test", "mysql"]
DashboardUUIDs = ["dsbd_xxxx32", "dsbd_xxxx32"]

요청 예시

curl 'https://openapi.guance.com/api/v1/service_manage/add' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  --data-binary '{"serviceCatelog": "\n[Team]    #Team\nservice = \"test\"    # Required\ntype = \"db\"  # Required,Current Service Type\nteam = \"Test Group\"   # Current Service TeamUUID\ncolour = \"#40C9C9\"   # Current Service Color Information\n\n[[Team.oncall]]  # Contact Method Configuration\nname = \"example_yun\"\ntype = \"email\"\nemails = [\"xxx@guance.com\", \"xxx@guance.com\"]\n\n[[Team.oncall]]  # Contact Method Configuration\nname = \"zhuyun\"\ntype = \"mobile\"\nmobiles = [\"xxxxxxx5786\", \"xxxxxxx4231\"]\n\n[[Team.oncall]]  # Contact Method Configuration\nname = \"test\"\ntype = \"slack\"\nslack = \"#test\"\n\n[[Repos]]  # Repository Configuration, # Fill in the provider and expected display text for the repository link\nlink = \"https://www.guance.com\"\nname = \"guance\"\nprovider = \"example_yun\"\n\n[[Repos]]  # Repository Configuration\nlink = \"https://func.guance.com\"\nname = \"func\"\nprovider = \"example_yun\"\n\n\n[[Docs]]  # Help, Fill in the content provider and expected display text for the help link\nlink = \"https://docs.guance.com/ko\"\nname = \"guance\"\nprovider = \"example_yun\"\n\n[[Docs]]  # Help\nlink = \"https://func.guance.com/doc\"\nname = \"func\"\nprovider = \"example_yun\"\n\n\n[Related]  # Associated Configuration\nAppId = \"a138bcb0_47ef_11ee_9d75_31ea50b9d85a\"\nTags = [\"test\", \"mysql\"]\nDashboardUUIDs = [\"dsbd_xxxx32\", \"dsbd_xxxx32\"]"}' \
  --compressed

응답

{
    "code": 200,
    "content": {
        "service": "test",
        "type": "db",
        "uuid": "sman_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-46F852D1-95CE-4783-B62A-9DDF66922A71"
}

문서 평가

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