Querying a Microservice Instance by Filter Criteria
Function
This API is used to query a microservice instance based on microservice version rules or field filter criteria after the instance is registered.
URI
GET /v4/{project_id}/registry/instances
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Fixed value: default. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
appId |
String |
Yes |
Application ID, which must be unique. The value must be 1 to 160 characters long. Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ |
serviceName |
String |
Yes |
Microservice name. The value must be 1 to 128 characters long. Regular expression: ^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$ |
version |
String |
Yes |
Version rule. Options:
|
env |
String |
No |
Value: development, testing, acceptance, or production. |
tags |
String |
No |
Tag for filtering services. When there are multiple tags, separate them using commas (,). Regular expression: ^[a-zA-Z][a-zA-Z0-9_\-\.]{0,63}$ |
Request
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
X-ConsumerId |
String |
No |
Unique ID of a service consumer. |
Response
Response parameters
Table 4 describes the parameters.
Parameter |
Type |
Description |
---|---|---|
instances |
Array of objects |
Set of microservice instances. Each item in the array is an instance. For details, see MicroServiceInstance. |
Example
Example request
GET /v4/default/registry/instances
Example response
{ "instances": [ { "instanceId": "string", "serviceId": "string", "version": "string", "hostName": "string", "endpoints": [ "string" ], "status": "string", "healthCheck": { "mode": "string", "port": 0, "interval": 0, "times": 0 }, "dataCenterInfo": { "name": "string", "region": "string", "availableZone": "string" }, "timestamp": "string", "modTimestamp": "string" } ] }
Status Code
See Status Codes.
Error Code
See CSE Error Codes.
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