Skip to content

[Service List] Create



POST /api/v1/service_manage/add

Overview

Create a new service list configuration

Body Request Parameters

Parameter Name Type Required Description
serviceCatelog string Y Service list configuration, toml configuration string
$maxCustomLength: 65535
Allow empty: False

Additional Parameter Explanation

Request Body Structure Explanation

Parameter Name type Required Description
serviceCatelog string Y Original toml format string of the service list configuration

serviceCatelog Field Explanation

Parameter Name type Required Description
Team dict Y Service and team information
Repos array N Repository configuration
Docs array N Help configuration
Related array N Related configuration

Team Field Explanation

Parameter Name type Required Description
service string Y Service name
type string N Service type, the value of 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 as Follows '#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 Explanation

Parameter Name type Required Description
name string N Contact name
type string N Contact type, enumeration values email,mobile,slack
emails array N Email
mobiles array N Phone
slack string N Slack channel address

Repos, Docs Fields Explanation

Parameter Name type Required Description
link string N Repository code URL/Related document URL
name string N Display name
provider string N Provider name

Related Field Explanation

Parameter Name type Required Description
AppId string N Synthetic Tests application ID
DashboardUUIDs array N Bound built-in view UUID
Tags array N Related tags

serviceCatelog Field Example:

[Team]    # Team
service = "JaneDoe_1"    # Required
type = "db"  # Required, current service type
team = "QA"   # Current service team name
colour = "#40C9C9"   # Current service color information

[[Team.oncall]]  # Contact configuration
name = "truewatch"
type = "email"
emails = ["[email protected]", "[email protected]"]

[[Team.oncall]]  # Contact configuration
name = "test"
type = "slack"
slack = "#test"

[[Repos]]  # Repository configuration, # Fill in the provider corresponding to the repository link and the expected display text
link = "https://www.truewatch.com"
name = "truewatch"
provider = "truewatch"

[[Repos]]  # Repository configuration
link = "https://dataflux-func.com"
name = "func"
provider = "truewatch"


[[Docs]]  # Help, fill in the content provider and expected display text corresponding to the help link
link = "https://docs.truewatch.com"
name = "truewatch"
provider = "truewatch"

[[Docs]]  # Help
link = "https://dataflux-func.com/doc"
name = "func"
provider = "truewatch"

[Related]  # Related configuration
AppId = "a138bcb0_47ef_11ee_9d75_31ea50b9d85a"
Tags = ["test", "mysql"]
DashboardUUIDs = ["dsbd_xxxx32", "dsbd_xxxx32"]

Request Example

curl 'https://us1-openapi.truewatch.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\nteam = \"QA\"   # team_UUID\ncolour = \"#40C9C9\"   # team_color\n\n[[Team.oncall]]  # contact\nname = \"truewatch\"\ntype = \"email\"\nemails = [\"[email protected]\", \"[email protected]\"]\n\n[[Team.oncall]]  # contact\nname = \"truewatch\"\ntype = \"mobile\"\nmobiles = [\"xxxxxxx5786\", \"xxxxxxx4231\"]\n\n[[Team.oncall]]  # contact\nname = \"test\"\ntype = \"slack\"\nslack = \"#test\"\n\n[[Repos]]  # repo, # repo\nlink = \"https://www.truewatch.com\"\nname = \"truewatch\"\nprovider = \"truewatch\"\n\n[[Repos]]  # repo\nlink = \"https://dataflux-func.com\"\nname = \"func\"\nprovider = \"truewatch\"\n\n\n[[Docs]]  # help\nlink = \"https://docs.truewatch.com\"\nname = \"truewatch\"\nprovider = \"truewacth\"\n\n[[Docs]]  # help\nlink = \"https://dataflux-func.com/doc\"\nname = \"func\"\nprovider = \"truewatch\"\n\n\n[Related]  # linked\nAppId = \"a138bcb0_47ef_11ee_9d75_31ea50b9d85a\"\nTags = [\"test\", \"mysql\"]\nDashboardUUIDs = [\"dsbd_xxxx32\", \"dsbd_xxxx32\"]"}' \
  --compressed

Response

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