Routing Information

Business Function

This API is used to query the routing information about a service.

URI

GET /v1/mesher/routeRule/{serviceName}

Table 1 describes the parameters.

Table 1 Parameter description

Parameter

Location

Type

Mandatory or Not

Description

serviceName

path

String

No

Microservice name, used for checking how microservice consumers to perform target microservice diversion.

Request

None

Response

Response Parameter

Table 2 Parameter description

Parameter

Type

Description

Route information

text

Complete routing information

Response Example

- precedence: 2
  route:
  - tags:
      app: HelloWorld
      version: "1.2"
    weight: 80
  - tags:
      app: HelloWorld
      version: "1.3"
    weight: 20
  match:
    refer: vmall-with-special-header
    source: vmall
    sourceTags:
      version: v2
    httpHeaders:
      X-Age:
        exact: "18"
      cookie:
        regex: ^(.*?;)?(user=jason)(;.*)?$
- precedence: 1
  route:
  - tags:
      version: "1.0"
    weight: 100
  match:
    refer: ""
    source: ""
    sourceTags: {}
    httpHeaders: {}

Status Code

Table 3 describes the status code.

Table 3 Status code

Code

Description

200

Request succeeded.

400

Request error.

500

Internal error.