This topic describes how to use the Alibaba Cloud SDK for Python to add an elastic IP address (EIP) to an EIP bandwidth plan.
Prerequisites
Background information
- Create an EIP in the China (Hangzhou) region.
- Create an EIP bandwidth plan in the China (Hangzhou) region.
- Add the EIP to the EIP bandwidth plan.
- Query the status of the EIP bandwidth plan.
- Remove the EIP from the EIP bandwidth plan.
- Delete the EIP bandwidth plan
- Release the EIP.
Procedure
Result
The following output is returned:
---------------------------allocate_eip_address---------------------------
{
"EipAddress": "118.xx.xx.198",
"ResourceGroupId": "rg-acfm4odxxxxxxxx",
"RequestId": "A830A607-B7C4-49FE-A6EE-7237D64CDE2D",
"AllocationId": "eip-bp1mdyvr22qvgxxxxxxxx"
}
---------------------------create_common_bandwidth_package----------------------
-----
{
"ResourceGroupId": "rg-acfm4odxxxxxxxx",
"BandwidthPackageId": "cbwp-bp12k058pjjiexxxxxxxx",
"RequestId": "93127320-DD79-4F83-A3B9-DC99D0597B0C"
}
---------------------------add_common_bandwidth_packageIp-----------------------
----
{
"RequestId": "7F314AFE-B398-4348-AF61-B7D27B731286"
}
---------------------------add_common_bandwidth_packageIp-----------------------
----
{
"TotalCount": 1,
"CommonBandwidthPackages": {
"CommonBandwidthPackage": [
{
"Status": "Available",
"PublicIpAddresses": {
"PublicIpAddresse": [
{
"IpAddress": "118.xx.xx.198",
"AllocationId": "eip-bp1mdyvr22qvgxxxxxxxx"
}
]
},
"BusinessStatus": "Normal",
"RegionId": "cn-hangzhou",
"BandwidthPackageId": "cbwp-bp12k058pjjiexxxxxxxx",
"Name": "",
"ISP": "BGP",
"CreationTime": "2019-04-18T01:46:17Z",
"ResourceGroupId": "rg-acfm4odxxxxxxxx",
"Bandwidth": "10",
"InstanceChargeType": "PostPaid",
"HasReservationData": false,
"InternetChargeType": "PayByBandwidth",
"ExpiredTime": "",
"Ratio": 100,
"Description": ""
}
]
},
"PageNumber": 1,
"RequestId": "015DD0FA-742B-4431-92EA-E3F03FDEB8CD",
"PageSize": 10
}
---------------------------remove_common_bandwidth_packageIp--------------------
-------
{
"RequestId": "A49C9126-B703-4D34-B552-A7FE283FB5DD"
}
---------------------------delete_common_bandwidth_package----------------------
-----
{
"RequestId": "E423F648-C169-4B63-A2CF-5E6C8E441DE1"
}
---------------------------release_eip_address---------------------------
{
"RequestId": "7E0D34AE-58C3-468A-B021-378F8938AE6B"
}