AllocateAddresses

Last updated: 2020-07-31 14:31:00

    1. API Description

    Domain name for API request: vpc.tencentcloudapi.com.

    This API is used to apply for one or more Elastic IP Addresses (EIPs for short).

    • An EIP is a static IP address that is dedicated for dynamic cloud computing. You can quickly re-map an EIP to another instance under your account to protect against instance failures.
    • Your EIP is associated with your Tencent Cloud account rather than an instance. It remains associated with your Tencent Cloud account until you choose to explicitly release it or your account is in arrears for more than 24 hours.
    • The maximum number of EIPs that can be applied for a Tencent Cloud account in each region is restricted. For more information, see EIP Product Introduction. You can get the quota information through the DescribeAddressQuota API.

    A maximum of 10 requests can be initiated per second for this API.

    Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: vpc.ap-shanghai-fsi.tencentcloudapi.com

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common parameter. The value used for this API: AllocateAddresses.
    Version Yes String Common parameter. The value used for this API: 2017-03-12.
    Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
    AddressCount No Integer The number of EIPs. Default: 1.
    InternetServiceProvider No String The EIP line type. Default: BGP.
    • For a user who has activated the static single-line IP allowlist, possible values are:
      • CMCC: China Mobile
      • CTCC: China Telecom
      • CUCC: China Unicom
      Note: Only certain regions support static single-line IP addresses.
    InternetChargeType No String The EIP billing method.
    • For a user who has activated bandwidth billing by IP allowlist, possible values are:
      • BANDWIDTH_PACKAGE: paid by the bandwidth package (The bandwidth sharing allowlist must be activated additionally.)
      • BANDWIDTH_POSTPAID_BY_HOUR: bandwidth postpaid by hour
      • TRAFFIC_POSTPAID_BY_HOUR: traffic postpaid by hour
      Default: TRAFFIC_POSTPAID_BY_HOUR
    • .
    • For users who do not use bill-by-bandwidth billing mode, InternetChargeType is consistent with that of the instance bound to the EIP. Therefore, it is unnecessary to pass in this parameter.
    InternetMaxBandwidthOut No Integer The maximum EIP outbound bandwidth. Unit: Mbps.
    • For a user who has activated bandwidth billing by IP allowlist, the value range is determined by the EIP billing method:
      • BANDWIDTH_PACKAGE: 1 Mbps to 1,000 Mbps
      • BANDWIDTH_POSTPAID_BY_HOUR: 1 Mbps to 100 Mbps
      • TRAFFIC_POSTPAID_BY_HOUR: 1 Mbps to 100 Mbps
      Default: 1 Mbps
    • .
    • For a user who has not activated bandwidth billing by IP allowlist, InternetMaxBandwidthOut is consistent with that of the instance bound to the EIP. Therefore, it is unnecessary to pass in this parameter.
    AddressType No String The EIP type. Default: EIP.
    • For a user who has activated the AIA allowlist, possible values are:Note: Only certain regions support Anycast EIPs.
    AnycastZone No String Anycast publishing region
    • Valid for users who have activated AIA. Values:
      • ANYCAST_ZONE_GLOBAL: global publishing region
      • ANYCAST_ZONE_OVERSEAS: overseas publishing region
      • [Disused] ANYCAST_ZONE_A: publishing region A (updated to ANYCAST_ZONE_GLOBAL)
      • [Disused] ANYCAST_ZONE_B: publishing region B (updated to ANYCAST_ZONE_GLOBAL)
      Default: ANYCAST_ZONE_OVERSEAS.
    ApplicableForCLB No Boolean [Disused]
    Whether the Anycast EIP can be bound to CLB instances.
    • Valid for users who have activated the AIA. Values:
      • TRUE: the Anycast EIP can be bound to CLB instances.
      • FALSE: the Anycast EIP can be bound to CVMs, NAT gateways, and HAVIPs.
      Default: FALSE.
    Tags.N No Array of Tag List of tags to be bound.
    BandwidthPackageId No String The unique ID of a BGP bandwidth package. If you configure this parameter and set InternetChargeType as BANDWIDTH_PACKAGE, the new EIP is added to this package and billed by the bandwidth package mode.

    3. Output Parameters

    Parameter Name Type Description
    AddressSet Array of String List of the unique IDs of the requested EIPs.
    TaskId String The Async task ID. You can use the DescribeTaskResult API to query the task status.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Creates an Anycast EIP

    You should have activated Anycast Internet Acceleration (AIA) Whitelist service.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=AllocateAddresses
    &AddressCount=1
    &AddressType=AnycastEIP
    &<Common request parameters>

    Output Example

    {
      "Response": {
        "AddressSet": [
          "eip-m44ku5d2"
        ],
        "TaskId": "61531428",
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
      }
    }

    Example2 Creates a regular IP address

    Input Example

    https://vpc.tencentcloudapi.com/?Action=AllocateAddresses
    &AddressCount=1
    &<Common request parameter>

    Output Example

    {
      "Response": {
        "AddressSet": [
          "eip-m44ku5d2"
        ],
        "TaskId": "61531421",
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
      }
    }

    Example3 Creates a static single-line IP address

    You should have activated the service of static single-line IP whitelist.

    Input Example

    https://vpc.tencentcloudapi.com/?Action=AllocateAddresses
    &AddressCount=1
    &InternetServiceProvider=CTCC
    &<Common request parameter>

    Output Example

    {
      "Response": {
        "AddressSet": [
          "eip-m44ku5d2"
        ],
        "TaskId": "61531429",
        "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
      }
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    AddressQuotaLimitExceeded The account quota is reached. Each Tencent Cloud account can create up to 20 EIPs in each region.
    AddressQuotaLimitExceeded.DailyAllocate The maximum number of requests is reached. The maximum number of requests made by a Tencent Cloud account per day in each region equals to two times the quota.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help