Modify¶
POST /api/v1/tag/{tag_uuid}/modify
Overview¶
Partially modify a tag and clean up references that no longer apply under the new scope.
Before You Call and Usage Steps¶
Partial update: fields that are not submitted are preserved, and an empty string explicitly overrides the existing value. An identical request returns the original entity and records no modification audit. A scope change cleans up resource references that are no longer allowed and removes the tag name from the extend.incidentsTags of monitors; name/color changes do not update all externally string-bound data for you.
The current OpenAPI modify does not enforce a preview; omitting scopePreviewToken executes the cleanup directly. It is recommended to check the impact with scope_preview first, then submit with the same identity, the same scope, and the returned token. When a token is passed, its 600-second validity and the complete impact fingerprint are verified; preview again when resource relations/configurations change. An empty operation with no configuration changes does not verify the token. Scope, name validation, and reference cleanup are in the same transaction; a failure rolls back. If the synthetic test configuration fails to sync after submission, the affected task UUIDs are reported in pendingDialingTaskUUIDs; the tag has already been modified, so do not treat this as a rollback of the entire modification.
Route Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| tag_uuid | string | Y | The tag UUID in this workspace; not a tag name, a numeric list page number, or a resource UUID. Example: tag_exampleHow to obtain or fill in: Get it from content.data[].uuid in Tag List. |
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or fill in: Obtain an OpenAPI Key with the required permission from API Key management in the target workspace. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| scope[*] | string | Array member; do not mix all with specific values.Example: monitorHow to obtain or fill in: Select a single scope from the enum above. |
|
| scopePreviewToken | string | Optional; validated only when the modification actually changes the scope; maximum 128 characters. Valid for 600 seconds and bound to the calling identity/workspace/tag/new scope and the current impact range; preview again if any of these change or the token expires. The current public modify executes cleanup and modification directly when omitted, without requiring prior confirmation; when passed, it is checked for validity — do not retry with an old token. Allowed null: False Example: PREVIEW-TOKENHow to obtain or fill in: Get it from content.previewToken in Scope Preview for this tag. |
|
| scope | any | Non-empty scope array; the enum values are all (global), scene (scene), monitor (monitoring), dialing (synthetic testing), security (security), infrastructure (infrastructure), and catalog (Unified Catalog); a legacy single-value string is also supported. all cannot be mixed with other values; duplicate values are deduplicated and returned in a fixed enum order; []/null/unknown values are not accepted. When omitted on create/import, the default is ["all"]; when omitted on modify, the previous value is preserved. scope only restricts where the tag applies and does not grant resource permissions; the name bindings of infrastructure/Unified Catalog are not rewritten by the entity reference cleanup performed here.Allowed null: False Example: ["scene", "monitor"]How to obtain or fill in: Select based on the business type of the resources to which you want to bind the tag. |
|
| name | string | Required on create, optional on modify; a non-empty value is recommended, with a maximum of 50 counting units (ASCII/half-width katakana = 1, other characters = 2). Duplicate checks against non-deleted tags are case-sensitive; the display name is not treated as a UUID. Existing tags containing colons are allowed; this public list endpoint does not perform Front plain/KV dispatching. Allowed null: False Maximum length: 50 Example: productionHow to obtain or fill in: A business-defined tag name; first check the names already in use in Tag List. |
|
| description | string | Optional; omitted on create means an empty string; omitted on modify preserves the value, and an explicit empty string clears it; maximum 100 counting units as above. Allowed null: False Maximum length: 100 Example: Production resources are tagged uniformly.How to obtain or fill in: The business owner describes the purpose of this tag. |
|
| colour | string | Optional string; defaults to default on create; omitted on modify preserves the value, and an empty string is saved as a new value; maximum 50 counting units as above. The server does not fix the color enum, so choose a color representation supported by the client UI.Allowed null: False Maximum length: 50 Example: defaultHow to obtain or fill in: You can reuse an existing colour from the list or the default default. |
Additional Parameter Notes¶
Data notes
- Request parameter notes
| Parameter | type | Description |
|---|---|---|
| name | string | Tag name |
| description | string | Field description |
| color | string | Color type agreed between frontend and backend: default, style_key1, style_key2 ~~ |
- Color field type/color mapping:
{ "default": {"background": "#CCE6FF", "color": "rgba(0,0,0,0.8)"}, "style_key1": {"background": "#3333FE", "color": "#FFFFFF"}, "style_key2": {"background": "#428BCA", "color": "#FFFFFF"}, "style_key3": {"background": "#364450", "color": "#FFFFFF"}, "style_key4": {"background": "#E0E1FF", "color": "rgba(0,0,0,0.8)"}, "style_key5": {"background": "#9400D3", "color": "#FFFFFF"}, "style_key6": {"background": "#EDDBFF", "color": "rgba(0,0,0,0.8)"}, "style_key7": {"background": "#CC328B", "color": "#FFF"}, "style_key8": {"background": "#FCDEF0", "color": "rgba(0,0,0,0.8)"}, "style_key9": {"background": "#DC143D", "color": "#FFFFFF"}, "style_key10": {"background": "#FCBABA", "color": "rgba(0,0,0,0.8)"}, "style_key11": {"background": "#BD0B48", "color": "#FFFFFF"}, "style_key12": {"background": "#FDECD2", "color": "rgba(0,0,0,0.8)"}, "style_key13": {"background": "#FFC29C", "color": "rgba(0,0,0,0.8)"}, "style_key14": {"background": "#ED9120", "color": "#FFFFFF"}, "style_key15": {"background": "#CD5B44", "color": "#FFFFFF"}, "style_key16": {"background": "#FAF570", "color": "rgba(0,0,0,0.8)"}, "style_key17": {"background": "#C29953", "color": "#FFFFFF"}, "style_key18": {"background": "#02B140", "color": "#FFFFFF"}, "style_key19": {"background": "#D5F4D5", "color": "rgba(0,0,0,0.8)"}, "style_key20": {"background": "#009966", "color": "#FFFFFF"}, "style_key21": {"background": "#023220", "color": "#FFFFFF"}, "style_key22": {"background": "#E7E7E7", "color": "rgba(0,0,0,0.8)"}, "style_key23": {"background": "#808080", "color": "#FFFFFF"} }
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/tag/tag_example/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"description":"Production resource tag updated."}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.id | integer | Entity record number; the list id is a UUID string, see the list fields. |
| content.uuid | string | tag_ tag UUID. |
| content.workspaceUUID | string | The workspace it belongs to. |
| content.name | string | Tag name. |
| content.description | string | Description of the purpose. |
| content.colour | string | Color representation. |
| content.scope | array<string> |
Normalized scope; legacy null/empty scope is returned as ["all"]. |
| content.scope[] | string | One of all/scene/monitor/dialing/security/infrastructure/catalog. |
| content.status | integer | 0 = valid, 3 = deleted; other legacy statuses depend on the actual data. |
| content.creator | string | The identity that created it. |
| content.updator | string | The identity that last modified it. |
| content.createAt | integer | Creation time in Unix seconds. |
| content.updateAt | integer | Update time in Unix seconds; -1 if never updated. |
| content.deleteAt | integer | Deletion time in Unix seconds; -1 if not deleted. |
| content.affectedRelationCount | integer | Number of entity references cleaned up when the scope actually changes; may be omitted. |
| content.affectedConfigCount | integer | Number of monitor rule configurations whose incidentsTags were cleaned up when the scope actually changes; may be omitted. |
| content.pendingDialingTaskUUIDs | array<string> |
UUIDs of tasks whose synthetic test configuration failed to refresh even though the tag was committed; may be omitted. |
| content.pendingDialingTaskUUIDs[] | string | UUID of a task that an administrator must verify and redistribute. |
| content.declaration | object | Common declaration. |
{
"code": 200,
"content": {
"id": 100,
"uuid": "tag_example",
"workspaceUUID": "wksp_example",
"name": "production",
"description": "Production resource tag updated.",
"colour": "default",
"scope": [
"scene",
"monitor"
],
"status": 0,
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785427300,
"deleteAt": -1,
"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 a field value violates the declared validation rules | Parameter parsing failed | Verify parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | The request JSON syntax is invalid | Request JSON format error | Fix the JSON according to content.reason, line, and column. |
| 406 | ft.TagNameExists | A non-deleted tag with the same name exists in this workspace | A tag with the same name already exists | Use a different name, or check the original tag first. |
| 500 | ft.InternalServerError | Failure in the database, tag/permission structures, cache, or response formatting | Internal error | Review the request and then read back the current state of the tag; the write may already be committed, so avoid blind retries, and provide the traceId if the failure persists. |
| 404 | ft.ObjectNotExists | No corresponding valid tag exists in this workspace, or it has been deleted | The specified object does not exist | Obtain a valid UUID from the current workspace list. |
| 400 | ft.TagScopeConfirmationRequired | A scope change passes an empty/missing credential and this path requires confirmation, for example an explicit empty token triggers the confirmation check | Confirm the affected resources first | Preview first and submit with the returned token; the public entry point here modifies directly when the token is omitted entirely, so you must confirm the impact yourself. |
| 400 | ft.TagScopePreviewExpired | The scope actually changes and the passed token is expired or does not match the identity/scope/current impact fingerprint | The impact range has changed; preview again to confirm | Preview the same scope again, then submit the new token. |