Bandwidth package
Create bandwidth package
Function declaration
1func (c *Client) CreateCsnBp(body *CreateCsnBpRequest, clientToken string) (*CreateCsnBpResponse, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/il138q5a0
Response value
Operation succeeded:
1{
2 "csnBpId":"csnBp-66r7m28g21i4"
3}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_create_csn_bp.go
Update bandwidth package
Function declaration
1func (c *Client) UpdateCsnBp(csnBpId string, body *UpdateCsnBpRequest, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/5l139oayt
Response value
Operation succeeded:
1{}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_update_csn_bp.go
Delete bandwidth package
Function declaration
1func (c *Client) DeleteCsnBp(csnBpId string, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/9l139gf3s
Response value
Operation succeeded:
1{}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_delete_csn_bp.go
Bind a bandwidth package to a Cloud Smart Network
Function declaration
1func (c *Client) BindCsnBp(csnBpId string, body *BindCsnBpRequest, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/tl13b14ho
Response value
Operation succeeded:
1{}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to:example_bind_csn_bp.go
Query the specified bandwidth package details
Function declaration
1func (c *Client) GetCsnBp(csnBpId string) (*GetCsnBpResponse, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/Ql13a4uin
Response value
Operation succeeded:
1{
2 "csnBpId":"csnBp-gdrf6fukb36u",
3 "name":"csnBp",
4 "bandwidth":100,
5 "usedBandwidth":10,
6 "csnId":"",
7 "interworkType":"center",
8 "interworkRegion":"chinesemainland",
9 "status":"available",
10 "paymentTiming":"Prepaid",
11 "expireTime":"2018-08-13T08:10:59Z",
12 "createdTime":"2021-04-25 17:22:34",
13 "tags":[
14 {
15 "tagKey":"test",
16 "tagValue":"test"
17 },
18 {
19 "tagKey":"test",
20 "tagValue":""
21 }
22 ]
23}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_get_csn_bp.go
Query bandwidth package list
Function declaration
1func (c *Client) ListCsnBp(listCsnBpArgs *ListCsnBpArgs) (*ListCsnBpResponse, error)
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/3l139tsq9
Response value
Operation succeeded:
1{
2 "marker":"csnBp-gdrf6fukb36u",
3 "isTruncated":true,
4 "nextMarker":"csnBp-iuc756n5kkda",
5 "maxKeys":1,
6 "csnBps":[
7 {
8 "csnBpId":"csnBp-gdrf6fukb36u",
9 "name":"csnBp",
10 "bandwidth":100,
11 "usedBandwidth":10,
12 "csnId":"",
13 "interworkType":"center",
14 "interworkRegion":"chinesemainland",
15 "status":"available",
16 "paymentTiming":"Prepaid",
17 "expiredTime":"2018-08-13T08:10:59Z",
18 "createTime":"2021-04-25 17:22:34",
19 "tags":[
20 {
21 "tagKey":"test",
22 "tagValue":"test"
23 },
24 {
25 "tagKey":"test",
26 "tagValue":""
27 }
28 ]
29 }
30 ]
31}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_list_csn_bp.go
Bandwidth upgrade/downgrade for the bandwidth package
Function declaration
1func (c *Client) ResizeCsnBp(csnBpId string, body *ResizeCsnBpRequest, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/0l13bs3zx
Response value
Operation succeeded:
1{}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_resize_csn_bp.go
Unbind a bandwidth package from a Cloud Smart Network
Function declaration
1func (c *Client) UnbindCsnBp(cli bce.Client, csnBpId string, body *UnbindCsnBpRequest, clientToken string) error
Parameter meaning
Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/Xl13bcliw
Response value
Operation succeeded:
1{}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_unbind_csn_bp.go
Bandwidth package price inquiry
Function declaration
1func (c *Client) GetCsnBpPrice(body *GetCsnBpPriceRequest) (*GetCsnBpPriceResponse, error)
Parameter Meaning Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/CSN/s/Ylsy10izt
Response Value Operation succeeded:
1{
2 "price":"440.00000"
3}
Operation failed:
Return error. For the error code list, please refer to: https://cloud.baidu.com/doc/CSN/s/Tl56j65ym
Code example
For specific code examples, please refer to: example_get_csn_bp_price.go
