Associates an elastic IP address (EIP) with an EIP bandwidth plan.
Usage notes
- When you call this operation to associate an EIP with an EIP bandwidth plan, make
sure that the EIP meets the following requirements:
- The EIP uses the pay-as-you-go billing method.
- The EIP and the EIP bandwidth plan belong to the same region.
- The line type of the EIP is the same as that of the EIP bandwidth plan.
- The AddCommonBandwidthPackageIp operation is asynchronous. After you send the request, the system returns a request
ID. However, the operation is still being performed in the system background. You
can call the DescribeCommonBandwidthPackages operation to query the status of an EIP bandwidth plan:
- If the EIP bandwidth plan is in the BINDING state, the EIP is being associated with the EIP bandwidth plan. In this state, you can only query the EIP bandwidth plan and cannot perform other operations.
- If the EIP bandwidth plan is in the BINDED state, the EIP is associated with the EIP bandwidth plan.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddCommonBandwidthPackageIp |
The operation that you want to perform. Set the value to AddCommonBandwidthPackageIp. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the EIP bandwidth plan. You can call the DescribeRegions operation to query the most recent region list. |
BandwidthPackageId | String | Yes | cbwp-2ze2ic1xd2qeqasdf**** |
The ID of the EIP bandwidth plan. |
IpInstanceId | String | Yes | eip-2zeerraiwb7uqwed**** |
The ID of the EIP. You can call the DescribeEipAddresses operation to query the most recent region list. |
IpType | String | No | EIP |
The type of IP address. Set the value to EIP to associate an EIP with the EIP bandwidth plan. |
ClientToken | String | No | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The client token can contain only ASCII characters. Note If you do not set this parameter, the system uses RequestId as ClientToken. The value of RequestId for each API request may be different.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 01FDDD49-C4B7-4D2A-A8E5-A93915C450A6 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=AddCommonBandwidthPackageIp
&RegionId=cn-hangzhou
&BandwidthPackageId=cbwp-2ze2ic1xd2qeqasdf****
&IpInstanceId=eip-2zeerraiwb7uqwed****
&IpType=EIP
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<AddCommonBandwidthPackageIpResponse>
<RequestId>01FDDD49-C4B7-4D2A-A8E5-A93915C450A6</RequestId>
</AddCommonBandwidthPackageIpResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "01FDDD49-C4B7-4D2A-A8E5-A93915C450A6"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidInstanceId.NotFound | The InstanceId is not found. | The error message returned because InstanceId is set to an invalid value. |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. | The error message returned because the specified region ID does not exist. |
404 | InvalidBandwidthPackageId.NotFound | The specified bandwidthPackageId does not exist in our records. | The error message returned because the ID of the specified EIP bandwidth plan does not exist. |
404 | InvalidIpInstanceId.NotFound | The specified Eip InstanceId does not exist in our records. | The error message returned because the specified EIP does not exist. |
For a list of error codes, visit the API Error Center.