You need to enable JavaScript to run this app.
导航
GetRule-获取路由规则信息
最近更新时间:2024.07.15 14:48:43首次发布时间:2023.08.21 14:31:38

获取一条路由规则的信息。

请求说明

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

请求参数

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

Query

名称类型是否必选示例值描述
ActionStringGetRuleAPI 的名称。该参数的取值是 GetRule
VersionString2023-01-01API 的版本。该参数的取值是 2023-01-01
GtmIdStringb46cf3dc-10e5-4847-8e32-e5c7696eebd0表示 GTM 实例的 UUID。您可以通过 ListGtms API 获取 UUID。
PolicyTypeStringgeo路由规则对应的策略类型。
  • geo:基础路由。
  • perf:智能路由。
RuleIdString44eed96c-12ce-4d32-9f5d-3218efa741cf路由规则的 ID。您在调用 CreateRule APIListRules API 时,返回参数中包含路由规则的 ID。

返回参数

名称
类型
描述
CreateTime
String
路由规则的创建时间。精确到毫秒。格式符合 ISO 8601 标准。
UpdateTime
String
路由规则最近的更改时间。精确到毫秒。格式符合 ISO 8601 标准。
RuleId
String
路由规则的 ID。
Name
String
路由规则的名称。
Remark
String
路由规则的备注。
Disable
Boolean
该路由规则是否处于禁用状态。
  • true:该路由规则处于禁用状态。
  • false:该路由规则处于启用状态。
Line
String
该路由规则适用的线路。
Weight
Integer
该路由规则的权重。
EffectivePoolSetIndex
Integer
生效的地址池集合的索引。
PoolSetMode
String
地址池集合的生效模式。
  • auto:自动设置生效的地址池集合。优先级最高的可用地址池自动生效。如果所有地址池都不可用,则优先级最高的地址池生效。
  • manual:手动设置生效的地址池集合。在该模式下,您需要在 EffectivePoolSetIndex 参数中设置生效的地址池集合的索引。
PoolSets
Array of Objects
路由规则关联的地址池集合。
AddrType
String
地址的类型。
  • ip4:IPv4 地址。
  • ip6:IPv6 地址。
  • host:域名,例如 www.example.com。
Probe
Object
路由规则的健康检查参数。
ProbeMode
String
健康检查模式。
  • default:继承调度策略的健康检查配置。
  • customized_base_config:使用路由规则的健康检查基础配置。继承调度策略的健康检查探测点。
  • customized_probe_nodes:使用路由规则的健康检查探测点。继承调度策略的健康检查基础配置。
  • customized_all:使用路由规则的健康检查配置和健康检查探测点。

示例

请求示例

POST https://open.volcengineapi.com?Action=GetRule&Version=2023-01-01&GtmId=b46cf3dc-10e5-4847-8e32-e5c7696eebd0&PolicyType=geo&RuleId=44eed96c-12ce-4d32-9f5d-3218efa741cf

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20240603113847070B7214B93E3A00E196",
        "Action": "GetRule",
        "Version": "2023-01-01",
        "Service": "GTM",
        "Region": "cn-north-1"
    },
    "Result": {
        "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"
    }
}

错误码

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