You need to enable JavaScript to run this app.
导航
ListRules - 查询路由规则列表
最近更新时间:2025.05.30 11:49:18首次发布时间:2023.08.21 14:31:38
我的收藏
有用
有用
无用
无用

获取一个 GTM 实例的路由规则列表。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com/?Action=ListRules&Version=2023-01-01

调试

请求参数

除了以下参数,您还需要 对请求进行鉴权

参数
类型
是否必填
示例值
描述
Action
String

ListRules

要执行的操作,取值:ListRules。

Version
String

2023-01-01

API的版本,取值:2023-01-01。

GtmId
String

8234cb50-f957-4be9-b515-55c5d419ea9e

GTM 实例的 UUID。您可以通过 ListGtms API 获取 UUID。

PolicyType
String

geo

路由规则对应的策略类型。

  • geo:基础路由。
  • perf:智能路由。
Name
String

rule

路由规则的名称。默认为空值,即该参数不作为查询条件。

Line
String

cn_mobile_anhui

路由规则所适用的线路。您可以通过调用 ListLines API 获取可用的线路名称。您必须填入 API 返回的 value 字段的值。默认为空值,即该参数不作为查询条件。

Address
String

203.0.113.0

路由规则的目标地址。默认为空值,即该参数不作为查询条件。

SearchMode
String

like

查询模式。包括以下模式:

  • like:(默认)模糊查询。
  • exact:精确查询。
PageNumber
Integer

1

页码。默认为 1。页数由获取的路由规则总数和 PageSize 确定。

PageSize
Integer

50

每页包含的地址池的数量。默认为 50。云调度 GTM 会将获取的地址池进行分页显示。页数由获取的地址池总数和 PageSize 确定。

SortBy
String

Name

对返回结果排序的键值。

  • Name:按 Name 参数的值对返回结果进行排列。
  • Line:按 Line 参数的值对返回结果进行排列。
  • UpdateTime:按 UpdateTime 参数的值对返回结果进行排列。
SortOrder
String

Desc

返回结果的排序方向。

  • Asc:升序。
  • Desc(默认):降序。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
TotalCount
Integer

10

地址池的总数量。

PageNumber
Integer

1

分页的页码。

PageSize
Integer

50

每个分页的地址池数量。

Data
Array of Object

路由规则的信息。

请求示例

POST https://open.volcengineapi.com/?Action=ListRules&Version=2023-01-01&GtmId=b46cf3dc-10e5-4847-8e32-e5c7696eebd0&PolicyType=geo
text

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20240528163510DAE426781C7A5702C3DB",
        "Action": "ListRules",
        "Version": "2023-01-01",
        "Service": "GTM",
        "Region": "cn-north-1"
    },
    "Result": {
        "TotalCount": 1,
        "PageNumber": 1,
        "PageSize": 100,
        "Data": [
            {
                "RuleId": "44eed96c-12ce-4d32-9f5d-3218efa741cf",
                "Name": "csdcsdccsd",
                "Remark": "",
                "Disable": false,
                "Line": "default",
                "Weight": 1,
                "EffectivePoolSetIndex": 0,
                "PoolSetMode": "auto",
                "PoolSets": [
                    {
                        "PoolSetId": "9d91d3dc-f68e-4223-943a-a4e30beba78c",
                        "Name": "pool_set_1",
                        "Weight": 1,
                        "ActiveAddrThr": 1,
                        "Pools": [
                            {
                                "PoolId": "0a6f9638-f7a6-464b-a07b-1a48fb3b9c4e",
                                "Weight": 1,
                                "PoolName": "移动-浙江",
                                "Addresses": [
                                    {
                                        "Value": "x.x.x.x",
                                        "Weight": 1,
                                        "Capacity": 100,
                                        "Mode": "auto",
                                        "Geo": "中国_电信_福建",
                                        "Active": true,
                                        "Latency": 0,
                                        "PlatId": 0,
                                        "Area": ""
                                    },
                                    {
                                        "Value": "x.x.x.x",
                                        "Weight": 1,
                                        "Capacity": 100,
                                        "Mode": "auto",
                                        "Geo": "中国_电信_福建",
                                        "Active": true,
                                        "Latency": 0,
                                        "PlatId": 0,
                                        "Area": ""
                                    }
                                ],
                                "InactiveAddrNumber": 0
                            }
                        ],
                        "Active": true,
                        "Disable": false,
                        "Addresses": [
                            {
                                "Value": "x.x.x.x",
                                "Weight": 1,
                                "Capacity": 100,
                                "Mode": "auto",
                                "Geo": "中国_电信_福建",
                                "AddrId": "9dbf70ba-8b4b-42c1-90c0-df1d7a2b2e62",
                                "Active": false,
                                "Latency": 0,
                                "PlatId": 0,
                                "Area": ""
                            },
                            {
                                "Value": "x.x.x.x",
                                "Weight": 1,
                                "Capacity": 100,
                                "Mode": "auto",
                                "Geo": "中国_电信_福建",
                                "AddrId": "35e50b42-37f8-4a26-bc71-b91cd13e82c6",
                                "Active": false,
                                "Latency": 0,
                                "PlatId": 0,
                                "Area": ""
                            }
                        ],
                        "AddrType": "ipv4"
                    }
                ],
                "Probe": {
                    "Nodes": [
                        "山东 济南市 中国移动",
                        "福建 厦门市 中国移动",
                        "浙江 杭州市 中国移动",
                        "江西 南昌市 中国联通",
                        "山东 济南市 中国联通",
                        "山东 济南市 中国电信",
                        "江西 南昌市 中国电信",
                        "河北 廊坊市 中国电信"
                    ],
                    "IsManualNodes": false,
                    "AdvisedNodeCount": 8,
                    "Protocol": "tcp",
                    "Interval": 60,
                    "Timeout": 5,
                    "PingLossPercent": 10,
                    "PingCount": 20,
                    "FailedCount": 3,
                    "TcpConnTimeout": 2,
                    "Host": "",
                    "Port": 80,
                    "Url": "",
                    "HttpMethod": "GET",
                    "Disable": false
                },
                "UseRuleProbeConfig": true,
                "UsePolicyProbeNodes": false,
                "ProbeMode": "customized_base_config",
                "CreateTime": "2024-05-28T07:20:10.207Z",
                "UpdateTime": "2024-05-28T08:35:03.213Z"
            }
        ]
    }
}
json

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
504
internal error

内部错误

内部错误