EipBP Instance
Create bandwidth package
- Bandwidth package only supports binding to prepaid resources. Currently, it can be bound to EIP and EIPGROUP.
- name (optional): The name of the bandwidth package (auto-generated if left blank). If specified, it must begin with a letter and may include digits, letters, and special characters (- _ . /), with a maximum length of 65 characters.
- The EIP and EIPGROUP fields represent the IP address of the EIP or the ID of EIPGROUP for the resource to be bound, respectively. Only one field can take effect. If both are filled, only the "eip" field will be valid.
- An EIP must be the IP address of a standalone public IP instance and cannot belong to any EIPGROUP resource.
- The "bandwidthInMbps" field represents the public network bandwidth of the package. This must be an integer greater than 0, and the sum of this value with the bandwidth of the bound resources must not exceed 200Mbps. For acceleration packages, the combined bandwidth and the default cross-border instance bandwidth must not surpass the specified bandwidth value of the package.
- "autoReleaseTime" is optional and specifies the automatic release time of the bandwidth package. If set, it must be in UTC format (e.g., "2019-08-03T20:38:43Z") and within the range of the current time to the expiration time of the attached prepaid instance. If not specified, the package will be released when the bound resources expire.
- type is optional, indicating bandwidth package type, including BandwidthPackage or AccelerationPackage (cross-border acceleration package). The cross-border acceleration package only supports Hong Kong region. The default value is BandwidthPackage . An EipBp instance is a bandwidth package instance created on Baidu AI Cloud. Creating a bandwidth package requires real-name certification. Uncertified users can complete certification under Security Certification in the Baidu Open Cloud Official Website Console. Currently, only prepaid EIPGROUP creation is supported
Function declaration
1def create_eip_bp(self, eip, eip_group_Id, bandwidth_in_mbps, name=None, autoReleaseTime=None,
2 client_token=None, config=None):
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/mk0m4ecrk
Response Value
Operation succeeded:
1{
2 "id":"bw-xxxxxxxx"
3}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_create_eip_bp.py
Bandwidth package bandwidth scaling
- Adjust the bandwidth size of the bandwidth package
- The bandwidthInMbps field represents the public network bandwidth of the bandwidth package, which must be an integer greater than 0, and the sum of this value and the bandwidth of bound resources must not exceed 200Mbps.
- If the bandwidth package type is acceleration package, the sum of its bandwidth and the default cross-border bandwidth of the instance must not exceed its bandwidth value.
Function declaration
1def resize_eip_bp(self, id, new_bandwidth_in_mbps, client_token=None,
2 config=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Yk0m4k7im
Response value
Operation succeeded:
There are no special response parameters
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_resize_eip_bp.py
Query bandwidth package details
- Query bandwidth package details by ID
Function declaration
1def get_eip_bp_detail(self, id, config=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/hk0m4uwtc
Response value
Operation succeeded:
1{
2 "autoReleaseTime": "2023-06-07T06:46:44Z",
3 "name": "EIP_BP1588821183401",
4 "instanceId": "ip-9340430e",
5 "createTime": "2023-05-07T03:13:03Z",
6 "id": "bw-5fb3ce39",
7 "eips": [
8 "100.88.9.120"
9 ],
10 "instanceBandwidthInMbps": 1,
11 "bandwidthInMbps": 2,
12 "bindType": "eip"
13}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_get_eip_bp_detail.py
Query bandwidth package list
- Retrieve the list of bandwidth packages that meet multiple specified conditions.
- If no query criteria are provided, all bandwidth packages will be retrieved by default.
- The returned results are filtered based on the intersection of criteria. Specifically, when multiple conditions are given, the results will include only the bandwidth packages that satisfy all conditions simultaneously.
- The query results support marker-based pagination, with a default page size of 1,000. You can adjust this by setting the maxKeys parameter.
Function declaration
1def list_eip_bps(self, id=None, name=None, bind_type=None,
2 marker=None, max_keys=1000, config=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Lk0m4n7yr
Response Value
Operation succeeded:
1{
2 "marker": "bw-5fb3ce39",
3 "maxKeys": 1000,
4 "nextMarker": null,
5 "bpList": [
6 {
7 "autoReleaseTime": "2023-06-07T06:46:44Z",
8 "name": "EIP_BP1588821183401",
9 "instanceId": "ip-9340430e",
10 "createTime": "2023-05-07T03:13:03Z",
11 "id": "bw-5fb3ce39",
12 "eips": [
13 "100.88.9.120"
14 ],
15 "bandwidthInMbps": 2,
16 "bindType": "eip"
17 }
18 ],
19 "isTruncated": false
20}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_list_eip_bps.py
Update the name of the bandwidth package
- Update the name of the bandwidth package
- name field must start with a letter and can only include digits, letters, and special characters (- _ . /), with a maximum length of 65 characters
Function declaration
1def rename_eip_bp(self, id, name, client_token=None,
2 config=None):
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/lk0m4lk6d
Response Value
Operation succeeded:
There are no special response parameters
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_rename_eip_bp.py
Update the automatic release time of the bandwidth package
- Update the automatic release time of the bandwidth package
- autoReleaseTime indicates the automatic release time, which must comply with the UTC format (e.g., "2019-08-03T20:38:43Z") and fall between the current time and the expiration time of the bound prepaid instance
Function declaration
1def update_eip_bp_autoReleaseTime(self, id, auto_release_time, client_token=None,
2 config=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Fk0m4mb1h
Response Value
Operation succeeded:
There are no special response parameters
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_update_eip_bp_autoReleaseTime.py
Release bandwidth package
- Release the specified bandwidth package resources based on the bandwidth package ID
Function declaration
1def release_eip_bp(self, id, client_token=None, config=None):
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/4k0m4hayt
Response value
Operation succeeded:
There are no special response parameters
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/Fk09snej9
Code example
For specific code examples, please refer to example_release_eip_bp.py
