Help Center> ServiceStage> API Reference> CSE API> Dependency> Querying All Providers of a Microservice

Querying All Providers of a Microservice

Function

This API is used to query all providers of a microservice based on consumer ID. For example, if service A depends on services B and C, you can query the information about the services B and C based on the service A's ID.

URI

GET /v4/{project_id}/registry/microservices/{consumer_id}/providers

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

consumer_id

Yes

String

Consumer service ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

noSelf

No

Integer

Whether to return the self-dependency relationship. 0: Do not return such a relationship. 1: Return such a relationship.

sameDomain

No

Integer

Whether to return the dependency relationship with shared services. 0: Do not return such a relationship. 1: Return such a relationship.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

x-domain-name

Yes

String

Tenant account name.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

dependency

Array of ConDependency objects

Dependency list.

Table 5 ConDependency

Parameter

Type

Description

Providers

MicroService object

Microservice information.

Table 6 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 7 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 8 Framework

Parameter

Type

Description

name

String

Microservice development framework. Default value: UNKNOWN.

version

String

Microservice development framework version.

Table 9 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 10 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error information.

detail

String

Location details.

Status code: 500

Table 11 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/{consumer_id}/providers

Example Responses

Status code: 200

OK (The service or schema ID is returned.)

"{\n  \"dependency\": [\n    {\n      \"Providers\": {\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  ]\n}"

Status Codes

Status Code

Description

200

OK (The service or schema ID is returned.)

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.