查询规则列表
功能介绍
查询到所有的规则
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v2/{project_id}/routemgr/rules
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
name |
否 |
String |
规则名称 |
|
limit |
否 |
Integer |
查询返回记录的数量限制 |
|
offset |
否 |
Integer |
偏移量,表示查询该偏移量后面的记录 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
Content-Type |
是 |
String |
消息体的类型(格式),默认取值为“application/json” |
|
X-Auth-Token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
|
ief-instance-id |
否 |
String |
铂金版实例ID,专业版实例为空值 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
rules |
Array of RuleResponse objects |
规则配置 |
|
count |
Long |
满足条件的规则个数 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
created_at |
String |
创建时间 |
|
description |
String |
规则描述,最大长度255,不允许^~#$%&*<>()[]{}'"\ |
|
fail_messages |
Integer |
转发失败的消息数 |
|
id |
String |
规则ID |
|
ief_instance_id |
String |
铂金版实例ID,如果为空则表示是专业版实例。 |
|
in_using |
Boolean |
是否启用规则,默认为true(启用) |
|
name |
String |
规则名称,只允许中文字符、英文字符、数字、下划线、中划线,最大长度64 同一个账号中创建的规则名唯一 |
|
project_id |
String |
项目ID |
|
source |
EndpointObjResp object |
端点详情 |
|
source_resource |
Map<String,String> |
源端点资源。示例:
|
|
target |
EndpointObjResp object |
端点详情 |
|
target_resource |
Map<String,String> |
目的端点资源,示例:
|
|
updated_at |
String |
更新时间 |
|
success_messages |
Integer |
转发成功的消息数 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
created_at |
String |
创建时间 |
|
description |
String |
端点描述,最大长度255,不允许^~#$%&*<>()[]{}'"\ |
|
id |
String |
端点ID |
|
ief_instance_id |
String |
铂金版实例ID,如果为空则表示是专业版实例。 |
|
is_shared |
Boolean |
是否共享 |
|
name |
String |
端点名称,只允许中文字符、英文字符、数字、下划线、中划线,最大长度64 同一个账号中创建的端点名唯一 |
|
project_id |
String |
项目ID |
|
properties |
Map<String,Object> |
端点的属性,端点需要对外展示的属性,示例:
{"domain_id":"user's domain id"} {"service_port":8080} {"domain_id":"user's domain id"} |
|
type |
String |
端点类型。枚举值:
|
|
updated_at |
String |
更新时间 |
请求示例
无
响应示例
状态码:200
ok
{
"rules" : [ {
"name" : "eventbus-to-dis",
"description" : "",
"source_resource" : {
"node_id" : "5a98f0d8-6827-45e8-871d-b865111fbe68",
"topic" : "ed202955e111444e8ced21a1bd75fc59/nodes/5a98f0d8-6827-45e8-871d-b865111fbe68/user/aaa"
},
"target_resource" : {
"channel" : "dis-I5QG"
},
"in_using" : true,
"ief_instance_id" : "",
"id" : "18bcb8bb-019b-4a5b-835b-6a444b3b04e9",
"project_id" : "ed202955e111444e8ced21a1bd75fc59",
"created_at" : "2022-06-07T03:09:03Z",
"updated_at" : "2022-06-07T03:09:03Z",
"source" : {
"name" : "SystemEventBus",
"description" : "",
"type" : "eventbus",
"properties" : { },
"ief_instance_id" : "",
"is_shared" : true,
"id" : "6bf2fda9-810c-40ed-8623-ff9396fe357d",
"project_id" : "9ff38382ccc546ac9635800c3315a5e2",
"created_at" : "2019-03-09T11:42:45Z",
"updated_at" : "2021-10-11T09:16:09Z"
},
"target" : {
"name" : "test",
"description" : "",
"type" : "dis",
"properties" : {
"domain_id" : "d0857ebddc514a7381c3673363e61337"
},
"ief_instance_id" : "",
"is_shared" : false,
"id" : "da14393a-b65a-4303-b74d-4cdf1dc44784",
"project_id" : "ed202955e111444e8ced21a1bd75fc59",
"created_at" : "2022-06-07T03:06:03Z",
"updated_at" : "2022-06-07T03:06:03Z"
},
"fail_messages" : 0,
"success_messages" : 0
} ]
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
ok |
错误码
请参见错误码。