获取一条路由规则的信息。
除了以下参数,您还需要 对请求进行鉴权。
参数 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | GetRule | 要执行的操作,取值:GetRule。 |
Version | String | 是 | 2023-01-01 | API的版本,取值:2023-01-01。 |
GtmId | String | 是 | b46cf3dc-10e5-4847-8e32-e5c7696eebd0 | 表示 GTM 实例的 UUID。您可以通过 ListGtms API 获取 UUID。 |
PolicyType | String | 是 | geo | 路由规则对应的策略类型。
|
RuleId | String | 是 | 44eed96c-12ce-4d32-9f5d-3218efa741cf | 路由规则的 ID。您在调用 CreateRule API 或 ListRules API 时,返回参数中包含路由规则的 ID。 |
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Name | String | rule | 路由规则的名称。 |
Remark | String | remark | 路由规则的备注。 |
Disable | Boolean | true | 该路由规则是否处于禁用状态。
|
Line | String | default | 路由规则适用的线路。 |
Weight | Integer | 1 | 路由规则的权重。 |
PoolSets | Array of Object | 无 | 路由规则关联的地址池集合。 |
Probe | Object | 无 | 路由规则的健康检查参数。 |
PoolSetMode | String | auto | 地址池集合的生效模式。
|
EffectivePoolSetIndex | Integer | 1 | 生效的地址池集合的索引。 |
RuleId | String | 44eed96c-12ce-4d32-9f5d-3218efa741cf | 路由规则的 ID。 |
CreateTime | String | 2024-05-28T07:20:10.207Z | 路由规则的创建时间。精确到毫秒。格式符合 ISO 8601 标准。 |
UpdateTime | String | 2024-05-28T07:20:10.207Z | 路由规则最近的更改时间。精确到毫秒。格式符合 ISO 8601 标准。 |
POST https://gtm.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 }, "UseRuleProbeConfig": true, "UsePolicyProbeNodes": false, "ProbeMode": "customized_base_config", "CreateTime": "2024-05-28T07:20:10.207Z", "UpdateTime": "2024-05-28T08:35:03.213Z" } }
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码 | 错误码 | 说明 |
|---|---|---|
504 | internal error | 内部错误 |