tencent cloud

文档反馈

AllocateAddresses

最后更新时间:2023-08-18 14:28:16

1. API Description

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

This API is used to apply for one or multiple EIPs.

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

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 Params. The value used for this API: AllocateAddresses.
Version Yes String Common Params. The value used for this API: 2019-07-19.
Region No String Common Params. This parameter is not required for this API.
EcmRegion Yes String ECM region
AddressCount No Integer Number of EIPs. Default value: 1.
InternetServiceProvider No String CMCC: China Mobile
CTCC: China Telecom
CUCC: China Unicom
InternetMaxBandwidthOut No Integer 1–5000 Mbps. Default value: 1 Mbps.
Tags.N No Array of Tag List of tags to be bound.
InstanceId No String ID of the instance to be bound.
NetworkInterfaceId No String ID of the ENI to be bound, such as eni-11112222. NetworkInterfaceId and InstanceId cannot be specified at the same time. The ENI ID can be obtained from the networkInterfaceId field in the returned value of the DescribeNetworkInterfaces API.
PrivateIpAddress No String Private IP to be bound. If you specify NetworkInterfaceId, you must also specify PrivateIpAddress, which means to bind the EIP to the specified private IP of the specified ENI. You must also make sure that the specified PrivateIpAddress is a private IP of the specified NetworkInterfaceId. The private IP of the specified ENI can be obtained from the privateIpAddress field in the returned value of the DescribeNetworkInterfaces API.

3. Output Parameters

Parameter Name Type Description
AddressSet Array of String List of unique IDs of the EIPs applied for.
Note: this field may return null, indicating that no valid values can be obtained.
TaskId String Async task ID (TaskId). 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 Creating EIP

Input Example

https://ecm.tencentcloudapi.com/?Action=AllocateAddresses
&AddressCount=1
&InternetServiceProvider=CTCC
&EcmRegion=ap-hangzhou-ecm
&<Common request parameters>

Output Example

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

5. Developer Resources

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
FailedOperation.InternalOperationFailure Internal error.
FailedOperation.InvalidStatus This operation cannot be performed in the current status.
FailedOperation.OperationNotAllow The current operation is not allowed.
FailedOperation.PrivateIpAddressBinded The private IP has been bound to an EIP.
FailedOperation.PrivateIpAddressUnavailable The private IP is unavailable.
InternalError Internal error.
InvalidParameter The parameter is incorrect.
InvalidParameter.InvalidDataFormat The data format is incorrect.
InvalidParameter.InvalidParameterConflict The two specified parameters conflict. An EIP can only be bound to an instance or the specified private IP of the specified ENI.
InvalidParameterValue The parameter value is incorrect.
InvalidParameterValue.AddressQuotaLimitExceeded The number applied for exceeds the limit.
InvalidParameterValue.InvalidAddressCount When you bind an ENI synchronously, you can apply for only one EIP at a time.
InvalidParameterValue.InvalidBandwidth The bandwidth size is invalid.
InvalidParameterValue.InvalidPublicParam The common parameter is invalid.
InvalidParameterValue.InvalidRegion The ECM region is invalid.
InvalidParameterValue.ParameterValueTooLarge The parameter value exceeds the limit.
LimitExceeded The quota limit is exceeded.
LimitExceeded.AddressQuotaLimitExceeded The number applied for exceeds the limit.
LimitExceeded.AddressQuotaLimitExceededDailyAllocate The maximum number of applications has been reached. The maximum number of applications that can be made by a Tencent Cloud account per day in each region is equal to twice the quota.
MissingParameter.MissingPrivateIpAddress The private IP address is missing.
ResourceInsufficient.IPQuotaNotEnough Insufficient IP resource.
ResourceNotFound The resource does not exist.
ResourceNotFound.InstanceNotExist The instance is invalid.
UnauthorizedOperation.ForbiddenOperation You don't have the permission to perform this operation.
UnsupportedOperation.InvalidPrivateIpAddressAlreadyBindEip The specified private IP of the specified ENI has already been bound to an EIP. A private IP cannot be bound to more than one EIP.