Querying All Schema Information About a Microservice
Function
Query all schema information (including schemaId and summary) about a microservice.
URI
GET /v4/{project_id}/registry/microservices/{service_id}/schemas
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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
withSchema |
No |
Integer |
Whether to query the schema content. Default value: 0. 0: Only schema_id and summary are displayed. 1: schema_id, summary, and schema are displayed. |
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 |
---|---|---|
schemas |
Array of Schema objects |
Schema list. |
Parameter |
Type |
Description |
---|---|---|
schemaId |
String |
Schema ID. |
schema |
String |
Schema content. |
summary |
String |
Schema summary. |
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 the schema of a microservice with specified service_id, including schema_id, summary, and schema.
GET /v4/{project_id}/registry/microservices/{service_id}/schemas?withSchema=1
Example Response
Status code: 200
Successfully queried.
{ "schemas": [{ "schemaId": "xxxxmvc", "schema": "---\nswagger: \"2.0\"\ninfo:\n version: \"1.0.0\"\n title: \"swagger definition for com.service.provider.controller.ProviderImpl\"\n x-java-interface: \"cse.gen.springmvc.provider.provider.ProviderImplIntf\"\nbasePath: \"/provider\"\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\npaths:\n /helloworld:\n get:\n operationId: \"helloworld\"\n produces:\n - \"application/json\"\n parameters:\n - name: \"name\"\n in: \"query\"\n required: true\n type: \"string\"\n responses:\n 200:\n description: \"response of 200\"\n schema:\n type: \"string\"\nxxxx", "summary": "abcda7b4072ef2d7a5fc9aefccf03e5548029ae31c6cd5fc29da7685d6d9e14adea3" }] }
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