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.
Function declaration
1type CreateEipBpArgs struct {
2 Name string `json:"name"`
3 Eip string `json:"eip"`
4 EipGroupId string `json:"eipGroupId"`
5 BandwidthInMbps int `json:"bandwidthInMbps"`
6 Type string `json:"type"`
7 AutoReleaseTime string `json:"autoReleaseTime"`
8 ClientToken string `json:"-"`
9}
10type CreateEipBpResult struct {
11 Id string `json:"id"`
12}
13func (c *Client) CreateEipBp(args *CreateEipBpArgs) (*CreateEipBpResult, error)
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/nkcu555a4
Code example
For specific code examples, refer to example_eipbp_create_eipbp.go
Adjust the bandwidth of the bandwidth package
- 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
1type ResizeEipBpArgs struct {
2 BandwidthInMbps int `json:"bandwidthInMbps"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) ResizeEipBp(id string, args *ResizeEipBpArgs) error
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/nkcu555a4
Code example
For specific code examples, please refer to example_eipbp_resize_eipbp.go
Query bandwidth package details
- Query bandwidth package details by ID
Function declaration
1type EipBpDetail struct {
2 Name string `json:"name"`
3 Id string `json:"id"`
4 BindType string `json:"bindType"`
5 BandwidthInMbps int `json:"bandwidthInMbps"`
6 InstanceId string `json:"instanceId"`
7 Eips []string `json:"eips"`
8 InstanceBandwidthInMbps int `json:"instanceBandwidthInMbps"`
9 CreateTime string `json:"createTime"`
10 AutoReleaseTime string `json:"autoReleaseTime"`
11 Type string `json:"type"`
12 Region string `json:"region"`
13}
14func (c *Client) GetEipBp(id, clientToken string) (*EipBpDetail, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/hk0m4uwtc
Response value
Operation succeeded:
1{
2 "name": "xxxxx",
3 "id": "bw-xxxxxxxx",
4 "bindType": "eip",
5 "bandwidthInMbps": 199,
6 "instanceId": "ip-xxxxxxxx",
7 "eips": [
8 "x.x.x.x"
9 ],
10 "instanceBandwidthInMbps": 1,
11 "createTime": "2023-11-29T11:29:54Z",
12 "autoReleaseTime": "2023-12-29T08:09:54Z",
13 "type": "BandwidthPackage",
14 "region": "bj"
15}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_eipbp_get_eipbp.go
Query bandwidth package list information of users
- Query information about all bandwidth packages under the user's account
- Support querying by bandwidth package ID, name, and bindType
- The response result is the intersection of multiple query conditions.
- Results support marker-based pagination, with a default page size of 1000, which can be specified via the maxKeys parameter.
Function declaration
1type ListEipBpArgs struct {
2 Id string `json:"id"`
3 Name string `json:"name"`
4 Marker string `json:"marker"`
5 MaxKeys int `json:"maxKeys"`
6 BindType string `json:"bindType"`
7 Type string `json:"type"`
8}
9type ListEipBpResult struct {
10 Marker string `json:"marker"`
11 MaxKeys int `json:"maxKeys"`
12 NextMarker string `json:"nextMarker"`
13 IsTruncated bool `json:"isTruncated"`
14 EipGroup []EipBpList `json:"bpList"`
15}
16type EipBpList struct {
17 Name string `json:"name"`
18 Id string `json:"id"`
19 BindType string `json:"bindType"`
20 BandwidthInMbps int `json:"bandwidthInMbps"`
21 InstanceId string `json:"instanceId"`
22 Eips []string `json:"eips"`
23 CreateTime string `json:"createTime"`
24 AutoReleaseTime string `json:"autoReleaseTime"`
25 Type string `json:"type"`
26 Region string `json:"region"`
27}
28func (c *Client) ListEipBp(args *ListEipBpArgs) (*ListEipBpResult, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Lk0m4n7yr
Response Value
Operation succeeded:
1{
2 "marker": "bw-xxxxxxxx",
3 "maxKeys": 1000,
4 "nextMarker": "",
5 "isTruncated": false,
6 "bpList": [
7 {
8 "name": "test_eip_bp",
9 "id": "bw-xxxxxxxx",
10 "bindType": "eip",
11 "bandwidthInMbps": 10,
12 "instanceId": "ip-xxxxxxxx",
13 "eips": [
14 "x.x.x.x",
15 ...
16 ],
17 "createTime": "2023-11-24T09:46:26Z",
18 "autoReleaseTime": "2023-12-30T16:45:00Z",
19 "type": "BandwidthPackage",
20 "region": "bj"
21 },
22 ...
23 ]
24}
Operation failed:
Throw an exception. For the exception list, refer to https://cloud.baidu.com/doc/EIP/s/nkcu555a4
Code example
For specific code examples, please refer to example_eipbp_list_eipbp.go
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
1type UpdateEipBpAutoReleaseTimeArgs struct {
2 AutoReleaseTime string `json:"autoReleaseTime"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) UpdateEipBpAutoReleaseTime(id string, args *UpdateEipBpAutoReleaseTimeArgs) error
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/nkcu555a4
Code example
For specific code examples, refer to example_eipbp_update_eipbp_autoreleasetime.go
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
1type UpdateEipBpNameArgs struct {
2 Name string `json:"name"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) UpdateEipBpName(id string, args *UpdateEipBpNameArgs) error
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/nkcu555a4
Code example
For specific code examples, please refer to example_eipbp_update_eipbp_name.go
Release bandwidth package
- Release the specified bandwidth package resources based on the bandwidth package ID
Function declaration
1func (c *Client) DeleteEipBp(id, clientToken string) error
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/nkcu555a4
Code example
For specific code examples, please refer to example_eipbp_delete_eipbp.go
