EIPGROUP Instance
Create EIPGROUP
- Create an EIPGROUP
- Real-time certification is required for creating EIPGROUP. Those who have not passed real-time certification can access the real-time certification under security certification in the Baidu Open Cloud Official Website Console for certification.
Function declaration
1type CreateEipGroupArgs struct {
2 Name string `json:"name,omitempty"`
3 EipCount int `json:"eipCount,omitempty"`
4 Eipv6Count int `json:"eipv6Count,omitempty"`
5 BandWidthInMbps int `json:"bandwidthInMbps"`
6 Billing *Billing `json:"billing"`
7 Tags []model.TagModel `json:"tags"`
8 RouteType string `json:"routeType,omitempty"`
9 Idc string `json:"idc,omitempty"`
10 Continuous bool `json:"continuous,omitempty"`
11 ClientToken string `json:"-"`
12}
13type CreateEipGroupResult struct {
14 Id string `json:"id"`
15}
16func (c *Client) CreateEipGroup(args *CreateEipGroupArgs) (*CreateEipGroupResult, error)
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/ijwvz2zq8
Response Value
Operation succeeded:
1{
2 "id":"eg-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, please refer to example_eipgroup_create_eipgroup.go
Bandwidth scaling up for EIPGROUP
- Bandwidth scale-up for the specified EIPGROUP
Function declaration
1type ResizeEipGroupArgs struct {
2 BandWidthInMbps int `json:"bandwidthInMbps"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) ResizeEipGroupBandWidth(id string, args *ResizeEipGroupArgs) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Wjwvz2zeb
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_eipgroup_resize_eipgroup_bandwidth.go
EIPGROUP IP count upgrade
- Used to specify EIPGROUP IP count upgrade
Function declaration
1type GroupAddEipCountArgs struct {
2 EipAddCount int `json:"eipAddCount"`
3 Eipv6AddCount int `json:"eipv6AddCount"`
4 ClientToken string `json:"-"`
5}
6func (c *Client) EipGroupAddEipCount(id string, args *GroupAddEipCountArgs) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/qjwvz2yol
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_eipgroup_add_eip_count.go
EIPGROUP update
- EIPGROUP update (currently supporting name modification)
Function declaration
1type RenameEipGroupArgs struct {
2 Name string `json:"name"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) RenameEipGroup(id string, args *RenameEipGroupArgs) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Sjwvz2xo5
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_eipgroup_rename_eipgroup.go
Query the EIPGROUP list
- Query the EIPGROUP list based on multiple conditions
- If no query criteria are provided, all EIPs will be queried by default
- The returned results are based on the intersection of multiple conditions, to be specific, when multiple conditions are provided, it returns EIPGROUPs that satisfy all conditions simultaneously
- The above query results support marker-based pagination, with a default page size of 1000, which can be specified via the maxKeys parameter
Function declaration
1type ListEipGroupArgs struct {
2 Id string
3 Name string
4 Marker string
5 MaxKeys int
6 Status string
7}
8type ListEipGroupResult struct {
9 Marker string `json:"marker"`
10 MaxKeys int `json:"maxKeys"`
11 NextMarker string `json:"nextMarker"`
12 IsTruncated bool `json:"isTruncated"`
13 EipGroup []EipGroupModel `json:"eipgroups"`
14}
15type EipGroupModel struct {
16 Name string `json:"name"`
17 Status string `json:"status"`
18 Id string `json:"id"`
19 BandWidthInMbps int `json:"bandwidthInMbps"`
20 DefaultDomesticBandwidth int `json:"defaultDomesticBandwidth"`
21 BwShortId string `json:"bwShortId"`
22 BwBandwidthInMbps int `json:"bwBandwidthInMbps"`
23 DomesticBwShortId string `json:"domesticBwShortId"`
24 DomesticBwBandwidthInMbps int `json:"domesticBwBandwidthInMbps"`
25 PaymentTiming string `json:"paymentTiming"`
26 BillingMethod string `json:"billingMethod"`
27 CreateTime string `json:"createTime"`
28 ExpireTime string `json:"expireTime"`
29 Region string `json:"region"`
30 RouteType string `json:"routeType"`
31 Eips []EipModel `json:"eips"`
32 Eipv6s []EipModel `json:"eipv6s"`
33 Tags []model.TagModel `json:"tags"`
34}
35func (c *Client) ListEipGroup(args *ListEipGroupArgs) (*ListEipGroupResult, error)
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Ujwvz2yd6
Response value
Operation succeeded:
1{
2 "marker": "eg-xxxxxxxx",
3 "maxKeys": 1000,
4 "nextMarker": "",
5 "isTruncated": false,
6 "eipgroups": [
7 {
8 "name": "test-sdk-eipgroup",
9 "status": "available",
10 "id": "eg-xxxxxxxx",
11 "bandwidthInMbps": 100,
12 "defaultDomesticBandwidth": 0,
13 "bwShortId": "",
14 "bwBandwidthInMbps": 0,
15 "domesticBwShortId": "",
16 "domesticBwBandwidthInMbps": 0,
17 "paymentTiming": "Postpaid",
18 "billingMethod": "ByBandwidth",
19 "createTime": "2023-11-23T07:25:34Z",
20 "expireTime": "",
21 "region": "bj",
22 "routeType": "BGP",
23 "eips": [
24 {
25 "name": "xxxxx",
26 "eip": "x.x.x.x",
27 "eipId": "ip-xxxxxxxx",
28 "status": "available",
29 "eipInstanceType": "shared",
30 "instanceType": "",
31 "instanceId": "",
32 "shareGroupId": "eg-xxxxxxxx",
33 "clusterId": "",
34 "bandwidthInMbps": 100,
35 "paymentTiming": "",
36 "billingMethod": "",
37 "createTime": "2023-11-23T07:25:34Z",
38 "expireTime": "",
39 "tags": null
40 },
41 ...
42 ],
43 "eipv6s": [],
44 "tags": [
45 {
46 "tagKey": "testKey",
47 "tagValue": "testValue"
48 }
49 ]
50 },
51 ...
52 ]
53}
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_eipgroup_list_eipgroup.go
Query EIPGROUP details
- Query specified EIPGROUP details
Function declaration
1type EipGroupModel struct {
2 Name string `json:"name"`
3 Status string `json:"status"`
4 Id string `json:"id"`
5 BandWidthInMbps int `json:"bandwidthInMbps"`
6 DefaultDomesticBandwidth int `json:"defaultDomesticBandwidth"`
7 BwShortId string `json:"bwShortId"`
8 BwBandwidthInMbps int `json:"bwBandwidthInMbps"`
9 DomesticBwShortId string `json:"domesticBwShortId"`
10 DomesticBwBandwidthInMbps int `json:"domesticBwBandwidthInMbps"`
11 PaymentTiming string `json:"paymentTiming"`
12 BillingMethod string `json:"billingMethod"`
13 CreateTime string `json:"createTime"`
14 ExpireTime string `json:"expireTime"`
15 Region string `json:"region"`
16 RouteType string `json:"routeType"`
17 Eips []EipModel `json:"eips"`
18 Eipv6s []EipModel `json:"eipv6s"`
19 Tags []model.TagModel `json:"tags"`
20}
21func (c *Client) EipGroupDetail(id string) (*EipGroupModel, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Zjwvz2xzs
Response value
Operation succeeded:
1{
2 "name": "test-sdk-eipgroup",
3 "status": "available",
4 "id": "eg-xxxxxxxx",
5 "bandwidthInMbps": 100,
6 "defaultDomesticBandwidth": 0,
7 "bwShortId": "",
8 "bwBandwidthInMbps": 0,
9 "domesticBwShortId": "",
10 "domesticBwBandwidthInMbps": 0,
11 "paymentTiming": "Postpaid",
12 "billingMethod": "ByBandwidth",
13 "createTime": "2023-11-23T07:25:34Z",
14 "expireTime": "",
15 "region": "bj",
16 "routeType": "BGP",
17 "eips": [
18 {
19 "name": "xxxxx",
20 "eip": "x.x.x.x",
21 "eipId": "ip-xxxxxxxx",
22 "status": "available",
23 "eipInstanceType": "shared",
24 "instanceType": "",
25 "instanceId": "",
26 "shareGroupId": "eg-xxxxxxxx",
27 "clusterId": "",
28 "bandwidthInMbps": 100,
29 "paymentTiming": "",
30 "billingMethod": "",
31 "createTime": "2023-11-23T07:25:34Z",
32 "expireTime": "",
33 "tags": null
34 },
35 ...
36 ],
37 "eipv6s": [],
38 "tags": [
39 {
40 "tagKey": "testKey",
41 "tagValue": "testValue"
42 }
43 ]
44}
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_eipgroup_detail.go
EIPGROUP renewal
- Renew operation for the specified EIPGROUP to extend the expiration period
- Renewal operations cannot be performed during EIPGROUP resizing
Function declaration
1type EipGroupPurchaseReservedArgs struct {
2 Billing *Billing `json:"billing"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) EipGroupPurchaseReserved(id string, args *EipGroupPurchaseReservedArgs) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/ljwvz2z0r
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_eipgroup_purchase_reserved.go
EIPGROUP release
- Release the specified EIPGROUP
- Supporting postpayment only
Function declaration
1func (c *Client) DeleteRecycleEip(eip string, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/ukghouoci
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_eipgroup_delete_eipgroup.go
Migrate EIP into EIPGROUP
- Only postpaid EIPs can be migrated
- The EIPs to be migrated must be of the same Internet connection type as the EIPGROUP
- The EIP being migrated in cannot be bound to a bandwidth package or cross-border acceleration package
- The EIPGROUP IP count after migration must comply with EIPGROUP quota requirements
Function declaration
1type EipGroupMoveInArgs struct {
2 Eips []string `json:"eips"`
3 ClientToken string `json:"-"`
4}
5func (c *Client) EipGroupMoveIn(id string, args *EipGroupMoveInArgs) error
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/ukoslf7lm
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_eipgroup_move_in.go
Migrate EIP from EIPGROUP
- The charge type of the EIPGROUP being moved out must be postpay
- EIPGROUP being removed must not contain any pending orders
- The removed EIP only supports the postpayment
- If the removed EIP is a native EIPGROUP EIP, the bandwidth and billing information of the EIP after removal must be specified
- If the removed EIP was previously a non-native EIP added to EIPGROUP, it is not necessary to specify the bandwidth and billing information after removal. The EIP will revert to its original bandwidth and charge type before being added
Function declaration
1type EipGroupMoveOutArgs struct {
2 MoveOutEips []MoveOutEip `json:"moveOutEips"`
3 ClientToken string `json:"-"`
4}
5type MoveOutEip struct {
6 Eip string `json:"eip"`
7 BandWidthInMbps int `json:"bandwidthInMbps"`
8 Billing *Billing `json:"billing"`
9}
10func (c *Client) EipGroupMoveOut(id string, args *EipGroupMoveOutArgs) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Qkoslycn3
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_eipgroup_move_out.go
Unsubscribe prepaid EIPGROUP
- Release the prepaid EIPGROUP and proceed with the refund process.
- Only prepaid EIPGROUP supports unsubscription, while postpaid EIPGROUP does not. Postpaid EIPGROUP can be directly released using the delete EIPGROUP API.
- The EIPGROUP contains blocked EIPs that cannot be unsubscribed. Please unblock them and try again.
- EIPGROUPs containing EIPs bound to a VPN or NAT cannot be unsubscribed. Please unbind them and try again.
- The EIP in the EIPGROUP is bound to a bandwidth package, and unsubscription is not allowed. Please release the bandwidth package and try again.
- The EIPGROUP refund feature includes a penalty mechanism, with the refund amount calculated as: "refund amount = max(0, total amount - consumed amount * 1.5)."
Function declaration
1func (c *Client) RefundEipGroup(id string, clientToken string) error
Parameter Meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/EIP/s/Alxkb5avn
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_eipgroup_refund_eipgroup.go
