Service List Create¶
POST /api/v1/service_manage/add
Overview¶
Add a new Service List configuration
Body Request Parameters¶
Parameter | Type | Required | Description |
---|---|---|---|
serviceCatelog | string | Y | Service List configuration, toml configuration string $maxCustomLength: 65535 Allow empty: False |
Parameter Additional Information¶
Request Body Structure Description
Parameter | type | Required | Description |
---|---|---|---|
serviceCatelog | string | Y | Original toml format string of Service List configuration |
serviceCatelog Field Description
Parameter | type | Required | Description |
---|---|---|---|
Team | dict | Y | Service, team information |
Repos | array | N | Repository configuration |
Docs | array | N | Help configuration |
Related | array | N | Related configuration |
Team Field Description
Parameter | type | Required | Description |
---|---|---|---|
service | string | Y | Service name |
type | string | N | Service type, this field is an enumeration type (app, framework, cache, message_queue, custom, db, web) |
team | string | N | Team name |
colour | string | N | Service color |
oncall | array | N | Contact information |
colour Field Enumeration Types '#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 Field Description
Parameter | type | Required | Description |
---|---|---|---|
name | string | N | Contact name |
type | string | N | Contact type, enumeration value email,mobile,slack |
emails | array | N | Emails |
mobiles | array | N | Phones |
slack | string | N | Slack channel address |
Repos, Docs Field Description
Parameter | type | Required | Description |
---|---|---|---|
link | string | N | Repository code URL/related document URL |
name | string | N | Display name |
provider | string | N | Provider name |
Related Field Description
Parameter | type | Required | Description |
---|---|---|---|
AppId | string | N | RUM application ID |
DashboardUUIDs | array | N | Bound built-in view UUIDs |
Tags | array | N | Related tags |
serviceCatelog Field Example:
[Team] #Team
service = "jinlei_1" # Required
type = "db" # Required, current service type
team = "Test Group" # Current service team name
colour = "#40C9C9" # Current service color information
[[Team.oncall]] # Contact method configuration
name = "example_yun"
type = "email"
emails = ["xxx@guance.com", "xxx@guance.com"]
[[Team.oncall]] # Contact method configuration
name = "zhuyun"
type = "mobile"
mobiles = ["xxxxxxx5786", "xxxxxxx4231"]
[[Team.oncall]] # Contact method configuration
name = "test"
type = "slack"
slack = "#test"
[[Repos]] # Repository configuration, # Fill in the provider and expected display text for the repository link
link = "https://www.guance.com"
name = "guance"
provider = "example_yun"
[[Repos]] # Repository configuration
link = "https://func.guance.com"
name = "func"
provider = "example_yun"
[[Docs]] # Help, fill in the content provider and expected display text for the help link
link = "https://docs.guance.com/en"
name = "guance"
provider = "example_yun"
[[Docs]] # Help
link = "https://func.guance.com/doc"
name = "func"
provider = "example_yun"
[Related] # Related configuration
AppId = "a138bcb0_47ef_11ee_9d75_31ea50b9d85a"
Tags = ["test", "mysql"]
DashboardUUIDs = ["dsbd_xxxx32", "dsbd_xxxx32"]
Request Example¶
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/en\"\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