Modify¶
POST /api/v1/service_manage/{service_uuid}/modify
Overview¶
Modify the specified Service List configuration.
Before Calling and Usage Steps¶
The API Key must have Service Management permission (trace.serviceManage). First, use Service List Details to export the current TOML as the editing basis, and retain the repositories, documents, and related information that need to continue to be used. After submitting the complete configuration, retrieve it again by the same UUID and verify it. If the target UUID is invalid, an internal error may be returned; verify the target from the list first.
Route Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| service_uuid | string | Y | Service List UUID in the current Workspace, prefixed with sman_. Allowed null: False Example: sman_exampleHow to obtain or fill: Obtain it from content.data[].uuid in the Service List, or use content.uuid from the create response. |
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the Workspace. Example: <DF-API-KEY>How to obtain or fill: Obtain an OpenAPI Key with this operation permission from API Key Management in the target Workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| serviceCatelog | string | Y | Service List TOML configuration text. See the request example for a complete JSON-escaped example. Maximum weighted length: 65535; ASCII characters and half-width katakana count as 1, and other characters count as 2. $maxCustomLength: 65535 Allowed null: False Example: "[Team]\nservice = \"checkout\"\ntype = \"web\"\nteam = \"team-commerce\"\ncolour = \"#40C9C9\"\n\n[[Team.oncall]]\nname = \"值班邮箱\"\ntype = \"email\"\nemails = [\"xxx@guance.com\"]\n\n[[Repos]]\nname = \"业务仓库\"\nlink = \"https://example.invalid/repos/checkout\"\nprovider = \"Git\"\n\n[[Docs]]\nname = \"操作手册\"\nlink = \"https://example.invalid/help/checkout\"\nprovider = \"Wiki\"\n\n[Related]\nAppId = \"\"\nTags = [\"team:commerce\"]\nDashboardUUIDs = []\n"How to obtain or fill: Pass originStr=1 to Service List Details to obtain the original text, or construct the complete TOML according to the field table below and send it as a JSON string. |
Additional Parameter Notes¶
serviceCatelog is a JSON string containing TOML text. The following paths refer to the parsed TOML content. Submit the complete configuration when modifying; omitting existing Repos, Docs, or Related associations causes the corresponding configuration or tags to be replaced or removed.
| TOML Field | Type | How to Fill and Value Source |
|---|---|---|
| Team | TOML table |
Required when calling; contains basic service information. |
| Team.service | string |
Required and non-empty for the business. Copy the service field from Application Performance Monitoring (APM) trace records, or enter the service name for which a Service List needs to be pre-created. It is recommended not to exceed the database field length of 256 characters. |
| Team.type | string |
Optional. Use app, framework, cache, message_queue, custom, db, web, or aws_lambda. During creation, other values trigger inference based on existing trace data, and custom is used when there is no match; during modification, other values are directly converted to custom. |
| Team.colour | string |
Optional. Valid colors are #C43243, #DE5565, #D77D3D, #FDA82D, #FFD33B, #8934A4, #C75BC9, #F19AF2, #993C7E, #6454CB, #AC8AF0, #6C7AEB, #196AAB, #2EB2EE, #40C9C9, #1A9A82, #417C51, #49B566, #A7D650, #3F94DC. For empty values or other colors, a color within the allowed range is generated from the service name. |
| Team.team | string |
Team name. You can copy name from the Team List. A non-existent name creates a team; it is recommended to explicitly enter an existing team name. |
| Team.oncall | array<table> |
Array of contact methods; can be omitted as an empty array. TOML can use multiple [[Team.oncall]] tables. |
| Team.oncall[].name | string |
Display name of the contact method, for example, On-Call Email. |
| Team.oncall[].type | string |
Enter email, mobile, or slack for each item. |
| Team.oncall[].emails | array<string> |
When type=email, enter an array of email addresses, for example ["xxx@guance.com"]. |
| Team.oncall[].mobiles | array<string> |
When type=mobile, enter an array of phone number strings. |
| Team.oncall[].slack | string |
When type=slack, enter the Slack channel URL or an existing configuration value. |
| Repos | array<table> |
Array of code repositories; can be omitted as empty. Each item consists of name, link, and provider. |
| Repos[].name | string |
Repository display name. |
| Repos[].link | string |
Enter the actual repository URL. |
| Repos[].provider | string |
Repository provider display name. |
| Docs | array<table> |
Array of associated operation documents; can be omitted as empty. Each item consists of name, link, and provider. |
| Docs[].name | string |
Document display name. |
| Docs[].link | string |
Enter the operation guide URL accessible to customers. |
| Docs[].provider | string |
Content provider display name. |
| Related | TOML table |
Required when calling. Even when there are no associations, retain an empty [Related] table. |
| Related.AppId | string |
Real User Monitoring (RUM) application ID; keep AppId in the original case. Obtain it from app_id in the configuration or record of the RUM application; it can be omitted or left empty. |
| Related.DashboardUUIDs | array<string> |
Obtain content.data[].uuid from the Built-in View List, and use only active built-in views in the current Workspace. Enter [] when there is no binding. |
| Related.Tags | array<string> |
Array of scene tag names. You can copy Related.Tags returned by the details; an empty array clears tag associations. Each name can contain at most 128 characters. |
Complete Configuration Example
[Team]
service = "checkout"
type = "web"
team = "team-commerce"
colour = "#40C9C9"
[[Team.oncall]]
name = "值班邮箱"
type = "email"
emails = ["xxx@guance.com"]
[[Repos]]
name = "业务仓库"
link = "https://example.invalid/repos/checkout"
provider = "Git"
[[Docs]]
name = "操作手册"
link = "https://example.invalid/help/checkout"
provider = "Wiki"
[Related]
AppId = ""
Tags = ["team:commerce"]
DashboardUUIDs = []
Team validation may create and submit the team first; if validation subsequently fails, the team may still be retained. After a request times out or fails, query the current service and team first, and decide whether to retry after confirming the status.
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/service_manage/sman_example/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"serviceCatelog":"[Team]\nservice = \"checkout\"\ntype = \"web\"\nteam = \"team-commerce\"\ncolour = \"#40C9C9\"\n\n[[Team.oncall]]\nname = \"值班邮箱\"\ntype = \"email\"\nemails = [\"xxx@guance.com\"]\n\n[[Repos]]\nname = \"业务仓库\"\nlink = \"https://example.invalid/repos/checkout\"\nprovider = \"Git\"\n\n[[Docs]]\nname = \"操作手册\"\nlink = \"https://example.invalid/help/checkout\"\nprovider = \"Wiki\"\n\n[Related]\nAppId = \"\"\nTags = [\"team:commerce\"]\nDashboardUUIDs = []\n"}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.uuid | string | Service List UUID. |
| content.service | string | Saved service name. |
| content.type | string | Saved service category. |
| content.declaration | object or null | Workspace common declaration. |
{
"code": 200,
"content": {
"uuid": "sman_example",
"service": "checkout",
"type": "web",
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | A request field is missing, or the field value violates the declared validation condition | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid request JSON syntax | Request JSON format error | Fix the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | JSON top level is not an object | Some JSON file format error | Format the request body as a JSON object. |
| 400 | ft.SetFormatError | serviceCatelog cannot be parsed as TOML | Failed to parse the Service List TOML format | Fix the TOML syntax and ensure that newlines and double quotes in the JSON are correctly escaped. |
| 400 | ft.MissingCustomParameters | Team exists but is missing the service field | service field is missing | Provide a service string in [Team]. |
| 400 | ft.ErrorFieldType | The service type, color, team name, array, or contact type in the TOML does not meet the requirements | {} field type error | Correct the erroneous field according to the TOML field table; use email, mobile, or slack for the contact type. |
| 406 | ft.MissParamService | Team.service is an empty string | Missing required parameter, service name | Enter the actual service name. |
| 400 | ft.ServiceNameRepeat | A matching active Service List already exists in the same Workspace | Service name already exists | Check the list first; when creating a duplicate, switch to modifying with that UUID, and when modifying to a duplicate name, use another name. |
| 400 | ft.InvalidInnerDashboardUUID | Related.DashboardUUIDs contains a UUID that does not exist in the Workspace, has been deleted, or is not a built-in view | Invalid dashboard UUID: {} | Select a valid UUID again from the Built-in View List; pass an empty array when not associating for now. |
| 400 | ft.TagScopeMismatch | An existing tag with the same name in Related.Tags is incompatible with the scene scope | For example, team:commerce: ['monitor'] -> scene | Select a tag with scene or general scope, or use another name. |
| 406 | ft.ExceedMaxCharacterLimit | A tag name in Related.Tags exceeds 128 characters | {} exceeds the maximum character length limit | Shorten the tag name. |
| 500 | ft.InternalServerError | The valid TOML is missing the Team or Related table, or an unhandled structural exception occurs during saving | Internal error | Submit a complete configuration containing [Team] and [Related]; after a failure, check the current status of the team and service before deciding whether to retry. |
| 500 | ft.InternalServerError | The service UUID in the path does not exist, has been deleted, or is not in the current Workspace | Internal error | Check the Service List first to confirm the target; do not treat this error as indicating that it has been saved. |