Updated on 2026-01-04 GMT+08:00

Creating a Microservice Engine Tag

Function

This API is used to create a microservice engine tag.

Authorization Information

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.

URI

POST /v2/{project_id}/{resource_type}/{resource_id}/tags/create

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which must be unique. The value contains 1 to 64 characters.

resource_type

Yes

String

Resource type.

resource_id

Yes

String

Resource ID.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

If this parameter is not set, the default enterprise project is default and the ID is 0.

Default Value:

0

Content-Type

Yes

String

Set it to application/json;charset=UTF-8.

Accept

Yes

String

Set it to application/json.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

tags

Yes

Array of SimpleTag

Tag list.

action

Yes

String

Action type.

sys_tags

Yes

Array of SimpleTag

System tag.

engineId

Yes

String

Engine ID.

resourceTags

No

Array of ResourceTag

Resource tag list.

resourceTagsWithoutValue

No

Array of ResourceTag

Resource tag without value.

Table 4 SimpleTag

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

value

Yes

String

Tag value.

Table 5 ResourceTag

Parameter

Mandatory

Type

Description

id

No

String

Resource tag ID.

key

No

String

Resource tag key.

value

No

String

Resource tag value.

engine_id

No

String

Engine ID.

type

No

String

Type.

date_time

No

long

Timestamp.

Response

Status code: 200

Status code: 400
Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Status code: 500
Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Request

POST https://{endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags/create

Example Response

Status code: 200

success

{
   "tags": [
     {
      "key": "key",
      "value": "value"  
     }      
   ],
  "sys_tags": [
    {
      "key": "key",
      "value": "value"
    }        
   ],
   "action": "test",
   "resourceTags": 
    [
     {
      "id": "id",
      "key": "key",
      "value": "value",
      "engine_id": "engine_id",
      "type": "type",
      "date_time": 123456
     }      
    ],
}

Status Codes

Status Code

Description

200

success

400

Bad Request

500

Internal Server Error

Error Code

See Error Codes.