Creates an access policy for a Global Traffic Manager (GTM) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddDnsGtmAccessStrategy

The operation that you want to perform. Set the value to AddDnsGtmAccessStrategy.

DefaultAddrPoolType String Yes ipv4

The type of the primary address pool. Valid values:

  • IPV4
  • IPV6
  • DOMAIN
DefaultMinAvailableAddrNum Integer Yes 1

The minimum number of available addresses in the primary address pool group.

InstanceId String Yes instance1

The ID of the instance.

Lines String Yes ["default", "drpeng"]

The line codes of source regions. For example: ["default", "drpeng"] indicates Global and Dr. Peng Telecom & Media Group.

StrategyMode String Yes geo

The type of the access policy. Valid values:

  • GEO: geographical location-based
  • LATENCY: latency-based
StrategyName String Yes testStrategyName

The name of the access policy.

Lang String No en

The language to return some response parameters. Default value: en. Valid values: en, zh, and ja.

DefaultLbaStrategy String No all_rr

The load balancing policy of the primary address pool group. Valid values:

  • ALL_RR: returns all addresses.
  • RATIO: returns addresses by weight.
DefaultMaxReturnAddrNum Integer No 3

The maximum number of addresses returned from the primary address pool group.

DefaultLatencyOptimization String No open

Specifies whether to enable scheduling optimization for latency resolution for the primary address pool group. Valid values:

  • OPEN: enable
  • CLOSE: disable
FailoverAddrPoolType String No ipv4

The type of the secondary address pool. Valid values:

  • IPV4
  • IPV6
  • DOMAIN
FailoverLbaStrategy String No all_rr

The load balancing policy of the secondary address pool group. Valid values:

  • ALL_RR: returns all addresses.
  • RATIO: returns addresses by weight.
FailoverMinAvailableAddrNum Integer No 1

The minimum number of available addresses in the secondary address pool group.

FailoverMaxReturnAddrNum Integer No 1

The maximum number of addresses returned from the secondary address pool group.

FailoverLatencyOptimization String No open

Specifies whether to enable scheduling optimization for latency resolution for the secondary address pool group. Valid values:

  • OPEN: enable
  • CLOSE: disable
DefaultAddrPool.N.Id String No pool1

The ID of the address pool in the primary address pool group.

DefaultAddrPool.N.LbaWeight Integer No 1

The weight of the address pool in the primary address pool group.

FailoverAddrPool.N.Id String No pool1

The ID of the address pool in the secondary address pool group.

FailoverAddrPool.N.LbaWeight Integer No 1

The weight of the address pool in the secondary address pool group.

Response parameters

Parameter Type Example Description
RequestId String 29D0F8F8-5499-4F6C-9FDC-1EE13BF55925

The ID of the request.

StrategyId String testStrategyId1

The ID of the access policy.

Examples

Sample requests

http(s)://alidns.aliyuncs.com/? Action=AddDnsGtmAccessStrategy
&DefaultAddrPoolType=ipv4
&DefaultMinAvailableAddrNum=1
&InstanceId=instance1
&Lines=["default", "drpeng"]
&StrategyMode=geo
&StrategyName=testStrategyName
&<Common request parameters>

Sample success responses

XML format

<RequestId>29D0F8F8-5499-4F6C-9FDC-1EE13BF55925</RequestId>
<StrategyId>testStrategyId1</StrategyId>

JSON format

{
    "RequestId":"29D0F8F8-5499-4F6C-9FDC-1EE13BF55925",
    "StrategyId":"testStrategyId1"
    }

Error codes

For a list of error codes, visit the API Error Center.