You need to enable JavaScript to run this app.
导航
ListRules-获取路由规则列表
最近更新时间:2024.07.22 14:15:22首次发布时间:2023.08.21 14:31:38

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

请求说明

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

请求参数

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

Query

名称类型是否必选示例值描述
ActionStringListRulesAPI 的名称。该参数的取值是 ListRules
VersionString2023-01-01API 的版本。该参数的取值是 2023-01-01
GtmIdString8234cb50-f957-4be9-b515-55c5d419ea9e表示 GTM 实例的 UUID。您可以通过 ListGtms API 获取 UUID。
PolicyTypeStringgeo路由规则对应的策略类型。
  • geo:基础路由。
  • perf:智能路由。
NameStringrule表示路由规则的名称。
默认为空值,即该参数不作为查询条件。
LineStringcn_mobile_anhui路由规则所适用的线路。您可以通过调用 ListLines API 获取可用的线路名称。您必须填入 API 返回的 value 字段的值。
默认为空值,即该参数不作为查询条件。
AddressString1.1.1.1路由规则的目标地址。
默认为空值,即该参数不作为查询条件。
SearchModeStringlike查询模式。包括以下模式:
  • like:(默认)模糊查询。
  • exact:精确查询。
PoolNameStringpool路由规则中地址池的名称。
默认为空值,即该参数不作为查询条件。
SortByStringUpdateTime对返回结果排序的键值。
  • Name:按 Name 参数的值对返回结果进行排列。
  • Line:按 Line 参数的值对返回结果进行排列。
  • UpdateTime:按 UpdateTime 参数的值对返回结果进行排列。
SortOrderStringDesc返回结果的排序方向。
  • Asc:升序。
  • Desc(默认):降序。
PageSizeInteger50每页包含的地址池的数量。默认为 50。云调度 GTM 会将获取的地址池进行分页显示。页数由获取的地址池总数和 PageSize 确定。
PageNumberInteger1页码。默认为 1。页数由获取的路由规则总数和 PageSize 确定。

返回参数

ResponseMetadata 对象

参数名称
数据类型
参数说明
RequestId
String
标识本次请求的 ID。
Action
String
Action 查询参数的值。
Version
String
API 版本。
Service
String
服务类型。
Region
String
服务所在区域。

Result 对象

参数名称
数据类型
参数说明
TotalCount
Integer
地址池的总数量。
PageNumber
Integer
分页的页码。
PageSize
Integer
每个分页的地址池数量。
Data
Array of Objects
路由规则的信息。

示例

请求示例

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

返回示例

{
    "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
                },
                "ProbeMode": "customized_base_config",
                "CreateTime": "2024-05-28T07:20:10.207Z",
                "UpdateTime": "2024-05-28T08:35:03.213Z"
            }
        ]
    }
}

错误码

您可访问公共错误码,获取详细信息。