Querying Information About a Microservice
Function
This API is used to query the definition information about a microservice based on service_id.
Restrictions
None
URI
GET /v4/{project_id}/registry/microservices/{service_id}
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
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: 200
Parameter |
Type |
Description |
---|---|---|
service |
MicroService object |
Microservice information. |
Parameter |
Type |
Description |
---|---|---|
serviceId |
String |
Microservice ID, which must be unique. The value contains 1 to 64 characters. Regular expression: ^.*$ |
environment |
String |
Microservice environment. Value: development, testing, acceptance, or production. |
appId |
String |
Application ID, which must be unique. The value contains 1 to 160 characters. Regular expression: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9_-.][a-zA-Z0-9]$ |
serviceName |
String |
Microservice name, which must be unique in an application. The value contains 1 to 128 characters. Regular expression: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9_-.][a-zA-Z0-9]$ |
version |
String |
Microservice version. The value contains 1 to 64 characters. Regular expression: ^[0-9]$|^[0-9]+(.[0-9]+)$ |
description |
String |
Microservice description. The value contains a maximum of 256 characters. |
level |
String |
Microservice level. Value: FRONT, MIDDLE, or BACK. |
registerBy |
String |
Microservice registration mode. Value: SDK, PLATFORM, SIDECAR, or UNKNOWN. |
schemas |
Array of strings |
Microservice schema content. The value must be 1 to 160 bytes long. Only digits, letters, underscores (_), hyphens (-), and periods (.) are allowed. An array contains a maximum of 100 schemas. |
status |
String |
Microservice status. Value: UP or DOWN. Default value: UP. Value:
|
timestamp |
String |
Microservice registration time. |
modTimestamp |
String |
Latest modification time (UTC). |
framework |
Framework object |
Development framework. |
paths |
Array of ServicePath objects |
Service path. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Microservice development framework. Default value: UNKNOWN. |
version |
String |
Version of the microservice development framework. |
Parameter |
Type |
Description |
---|---|---|
Path |
String |
Route address. |
Property |
Object |
Extended attribute. You can customize a key and value. The value must be at least 1 byte long. |
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
Query details about the microservice whose ID is 819706e21b7173306797d19922ce4231441c17c5.
GET https://{endpoint}/v4/{project_id}/registry/microservices/819706e21b7173306797d19922ce4231441c17c5
Example Response
Status code: 200
Successfully queried.
{ "service": { "serviceId": "819706e21b7173306797d19922ce4231441c17c5", "appId": "default", "serviceName": "SERVICECENTER", "version": "2.4.8", "level": "BACK", "schemas": [ "servicecenter.grpc.api.ServiceCtrl", "servicecenter.grpc.api.ServiceInstanceCtrl" ], "status": "UP", "timestamp": "1616426688", "modTimestamp": "1616426688", "environment": "development" } }
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