Help Center/ Cloud Service Engine/ API Reference/ CSE API/ Microservice Governance/ Querying the Governance Policy List of a Specified Kind
Updated on 2023-12-18 GMT+08:00

Querying the Governance Policy List of a Specified Kind

Function

This API is used to query the governance policy list of a specified kind.

URI

GET /v3/{project_id}/govern/governance/{kind}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a tenant's sub-project. The value contains 1 to 64 characters.

kind

Yes

String

Governance policy kind.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Enter application/json;charset=UTF-8.

X-Auth-Token

Yes

String

User token.

x-engine-id

Yes

String

Instance ID of an exclusive microservice engine.

X-Enterprise-Project-ID

Yes

String

Enterprise project ID.

x-environment

No

String

Environment.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array of GovPolicyDetail objects

OK

Table 4 GovPolicyDetail

Parameter

Type

Description

matchGroup

CreateBussinessScene object

Traffic definition.

policies

Array of policies objects

Governance policy definition.

Table 5 CreateBussinessScene

Parameter

Type

Description

name

String

Traffic name.

status

String

Enabling status. Value: enabled or disabled.

Default: enabled

selector

GovSelector object

Governance policy delivery scope.

spec

spec object

Traffic feature description.

Table 6 spec

Parameter

Type

Description

alias

String

Feature name.

matches

Array of matches objects

Matching condition definition.

Table 7 matches

Parameter

Type

Description

name

String

Condition name.

apiPath

Object

Matched PATH.

headers

Object

Matched Headers.

method

Array of strings

List of matched Method.

serviceName

String

Matched microservice name.

Table 8 policies

Parameter

Type

Description

id

String

Governance policy ID.

name

String

Governance policy name.

kind

String

Governance kind. Value: retry, rate-limiting, loadbalance, circuit-breaker, instance-isolation, fault-injection, or bulkhead.

status

String

Enabling status. Value: enabled or disabled.

selector

GovSelector object

Governance policy delivery scope.

spec

Object

Governance policy definition content.

Table 9 GovSelector

Parameter

Type

Description

environment

String

Environment.

app

String

Application.

service

String

Optional. Governance is delivered to a microservice.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Requests

GET https://{endpoint}/v3/{project_id}/govern/governance/{kind}

Example Responses

Status code: 200

OK

[ {
  "matchGroup" : {
    "name" : "",
    "status" : "enabled",
    "selector" : {
      "environment" : "string",
      "app" : "string",
      "service" : "string"
    },
    "spec" : {
      "alias" : "string",
      "matches" : [ {
        "name" : "string",
        "apiPath" : { },
        "headers" : { },
        "method" : [ "string" ],
        "serviceName" : "string"
      } ]
    }
  },
  "policies" : [ {
    "id" : "string",
    "name" : "string",
    "kind" : "string",
    "status" : "string",
    "selector" : {
      "environment" : "string",
      "app" : "string",
      "service" : "string"
    },
    "spec" : { }
  } ]
} ]

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See CSE Error Codes.