Help Center/ Cloud Service Engine/ API Reference/ ServiceComb API/ Microservice/ Modifying Extended Attributes of a Microservice
Updated on 2023-11-08 GMT+08:00

Modifying Extended Attributes of a Microservice

Function

This API is used to modify static information about a microservice. To update some fields in the static information, input all static information (including the fields that do not need to be updated) in JSON format.

Restrictions

None

URI

PUT /v4/{project_id}/registry/microservices/{service_id}/properties

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Fixed value: default.

service_id

Yes

String

Microservice ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^.*$. See Querying Information About All Microservices.

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

Authorization

No

String

This parameter is mandatory if security authentication is enabled for an exclusive ServiceComb engine. Otherwise, this parameter is not required.

The token of an exclusive ServiceComb engine with security authentication enabled is in the following format:

Authorization:Bearer {Token}

For details about how to obtain the token, see Obtaining the User Token of an Exclusive ServiceComb Engine.

Table 3 Request body parameter

Parameter

Mandatory

Type

Description

properties

No

Object

Extended attribute. You can customize a key and value. The value must be at least 1 byte long.

Response

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Example Request

Modify extended information about a microservice with specified service_id.

PUT https://{endpoint}/v4/{project_id}/registry/microservices/{service_id}/properties

{
  "properties" : {
    "a" : "test"
  }
}

Example Response

None

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See ServiceComb Error Codes.