Modifying Status of a Microservice Instance
Function
This API is used to update the status of a microservice instance based on instance_id after the instance is registered.
Restrictions
The TESTING state is supported only in version 2.3.X.
URI
PUT /v4/{project_id}/registry/microservices/{service_id}/instances/{instance_id}/status
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. |
instance_id |
Yes |
String |
Microservice instance ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^[A-Za-z0-9_.-]*$. See Querying a Microservice Instance Based on service_id. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
value |
Yes |
String |
Instance status. UP: online; OUTOFSERVICE: off-hook; STARTING: starting; DOWN: offline; TESTING: dialing test. |
Request
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. |
Response
Status code: 400
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. |
errorMessage |
String |
Error message. |
detail |
String |
Location details. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. |
errorMessage |
String |
Error message. |
detail |
String |
Location details. |
Example Request
Update the status of an instance with specified instance_id to UP.
PUT https://{endpoint}/v4/{project_id}/registry/microservices/{service_id}/instances/{instance_id}/status?value=UP
Example Response
None
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
500 |
Internal Server Error |
Error Code
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot