Help Center> ServiceStage> API Reference> CSE API> Microservice> Querying Information About a Microservice

Querying Information About a Microservice

Function

This API is used to query the information about a microservice based on the service ID.

Constraints

None

URI

GET /v4/{project_id}/registry/microservices/{service_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a tenant sub-project. Length: 1–64 characters.

service_id

Yes

String

Microservice ID, which must be unique. Length: 1–64 characters. Regular expression: ^.*$

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

x-domain-name

Yes

String

Tenant account name.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

services

Array of MicroService objects

Microservice list.

Table 4 MicroService

Parameter

Type

Description

serviceId

String

Microservice ID, which must be unique. Length: 1–64 characters. Regular expression: ^.*$

environment

String

Service stage. Value: development, testing, acceptance, or production. Only when the value is development, testing, or acceptance, you can add new schemas or modify existing schemas in batches. Default value: development.

appId

String

Application ID, which must be unique. Length: 1–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. Length: 1–128 characters. Regular expression: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][a-zA-Z0-9_-.][a-zA-Z0-9]$

version

String

Microservice version. Length: 1–64 characters. Regular expression: ^[0-9]$|^[0-9]+(.[0-9]+)$

description

String

Microservice description. Length: 0–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 Schema objects

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 (default) or DOWN.

Enumeration values:

  • UP

  • DOWN

timestamp

String

Microservice registration time.

modTimestamp

String

Latest modification time (UTC).

framework

Framework object

Development framework information.

paths

Array of ServicePath objects

Service route information.

Table 5 Schema

Parameter

Type

Description

schemaId

String

Microservice schema ID. The value must be 1 to 160 bytes long. Only digits, letters, underscores (_), hyphens (-), and periods (.) are allowed.

schema

String

Microservice schema content. The value must be 1 to 2048 bytes long. Any characters are allowed.

summary

String

Microservice schema summary. The value contains a maximum of 128 bytes. Only digits and letters are allowed.

Table 6 Framework

Parameter

Type

Description

name

String

Microservice development framework. Default value: UNKNOWN.

version

String

Microservice development framework version.

Table 7 ServicePath

Parameter

Type

Description

Path

String

Route address.

Property

Object

Extended attribute. You can customize a key and value. The value contains at least 1 byte.

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error information.

detail

String

Location details.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error information.

detail

String

Location details.

Example Requests

GET https://{endpoint}/v4/{project_id}/registry/microservices/{service_id}

Example Responses

Status code: 200

OK

"{\n  \"services\": [\n    {\n      \"serviceId\": \"string\",\n      \"environment\": \"string\",\n      \"appId\": \"string\",\n      \"serviceName\": \"string\",\n      \"version\": \"string\",\n      \"description\": \"string\",\n      \"level\": \"string\",\n      \"registerBy\": \"string\",\n      \"schemas\": [\n        {\n          \"schemaId\": \"string\",\n          \"schema\": \"string\",\n          \"summary\": \"string\"\n        }\n      ],\n      \"status\": \"UP\",\n      \"timestamp\": \"string\",\n      \"modTimestamp\": \"string\",\n      \"framework\": {\n        \"name\": \"string\",\n        \"version\": \"string\"\n      },\n      \"paths\": [\n        {\n          \"Path\": \"string\"\n        }\n      ]\n    }\n  ]\n}"

Status Codes

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.