Storage Gateway - Console-API
Create Baidu Storage Gateway
Description
- Create a Baidu Storage Gateway and return the allocated service address as well as the instance ID.
- Billing type: Postpay.
Request structure
1POST /v{version}/bsg HTTP/1.1
2Host: bsg.bj.baidubce.com
3Authorization: authorization string
4
5 {
6 "bsgClass": "STANDARD",
7 "location": "CLOUD",
8 "type": "FILE"
9 }
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| paymentMethod | Set< PaymentModel> | No | RequestBody | Order-level payment discount information. Refer to the order document: paymentMethod for details |
| items | List< AbstractCreateOrderItem> | Yes | RequestBody | Order items information Refer to the order document: AbstractCreateOrderItem for details |
| paymentMethod | Set< PaymentModel> | No | AbstractCreateOrderItem | items-level payment discount information. Refer to the order document: paymentMethod for details |
| config | BsgInfo | Yes | AbstractCreateOrderItem | Information on the project to be created (Baidu Storage Gateway) |
| name | String | No | BsgInfo | Name of Baidu Storage Gateway. If not specified, it will be automatically generated |
| bsgClass | String | Yes | BsgInfo | Specify the gateway specifications, optionally standard version: STANDARD and high performance version: PERFORMANCE. Currently, only STANDARD is supported |
| location | String | Yes | BsgInfo | Specify the gateway deployment location, optionally Baidu AI Cloud: CLOUD or local: LOCAL. Currently, only CLOUD is supported |
| type | String | Yes | BsgInfo | Specify the Baidu Storage Gateway type, optionally file gateway FILE and block gateway ISCS. Currently, only FILE is supported |
| eip | String | No | BsgInfo | Specify the EIP to be bound to Baidu Storage Gateway. If null, it indicates no EIP is bound, and "new" indicates creating a new one |
| descr | string | No | BsgInfo | Specify the description of this Baidu Storage Gateway |
| vpcId | string | Yes | BsgInfo | Create the gateway within the specified VPC (short ID) |
| subnet | SubnetModel | Yes | BsgInfo | Subnet information |
| zoneName | String | Yes | SubnetModel | Specify zone |
| subnetId | String | No | SubnetModel | Specify the subnetId (short ID). If null, the default subnet will be fetched based on the VPC |
| region | String | Yes | BsgInfo | Specify the purchase region, such as Beijing/Baoding/Suzhou, etc. |
| billing | Billing | Yes | BsgInfo | Specify billing information |
| isAutoRenewal | bool | Yes | Billing | Whether to enable auto-renewal |
| paymentTiming | String | Yes | Billing | Payment type information: prepay and postpay, where prepay is currently supported |
| reservation | Reservation | Yes | Billing | Prepay period information |
| reservationLength | int | Yes | Reservation | Prepay quantity, e.g.,1/3/6, etc. |
| reservationTimeUnit | String | Yes | Reservation | Prepay period unit: currently only "MONTH" is supported |
| autoRenewReservation | Reservation | Yes | Billing | Auto-renewal period information (similar to prepay period) |
| reservationLength | int | Yes | Reservation | Prepay quantity, e.g.,1/3/6, etc. |
| reservationTimeUnit | String | Yes | Reservation | Prepay period unit: currently only "MONTH" is supported |
Response Status Code
Respond with 200 after successful operation, and respond with error codes after failed operation, as shown in Error Codes
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| bsgId | String | Yes | ResponseBody parameter | Baidu Storage Gateway ID |
| bsgUuid | String | Yes | ResponseBody parameter | Baidu Storage Gateway UUID |
| orderId | String | Yes | ResponseBody parameter | Bill ID |
Request example
1POST http://bsg.bj.baidubce.com/v1/bsg?clientToken=3A8d84403d-a94b-40ce-9d6a-f6225dd26676
2Host: bsg.bj.baidubce.com
3Authorization: bce-auth-v1/0a71d43401344af786ff328451073529/2022-02-08T07:17:51Z/1800/content-length;x-bce-date;content-md5;host;x-bce-request-id;x-bce-content-sha256;content-type/37f551cf056a694cbdcf2cae27f4c2d304d2563e3f2e340b330c0ac141dc9246
4{
5 "items": [
6 {
7 "config": {
8 "billing": {
9 "paymentTiming": "prepay",
10 "reservation": {
11 "reservationLength": 1,
12 "reservationTimeUnit": "MONTH"
13 },
14 "autoRenewReservation": {
15 "reservationLength": 1,
16 "reservationTimeUnit": "MONTH"
17 }
18 },
19 "bsgClass": "STANDARD",
20 "description": "",
21 "location": "CLOUD",
22 "name": "",
23 "orderId": "412aa51b-eff5-4667-b240-5128edd93937",
24 "subnet": {
25 "subnetId": "sbn-ap29xamu7d7c",
26 "zoneName": "zoneA"
27 },
28 "type": "FILE",
29 "vpcId": "vpc-g7pn8fgeajh0"
30 }
31 }
32 ]
33}
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4 {
5 "bsgId": "bsg-Khgzlg",
6 "bsgUuid": "1a222bd7-9fe8-4b2c-86fe-88ec4868dbb2"
7}
Query Baidu Storage Gateway list
Description
Return Baidu Storage Gateway list
Request structure
1GET /v{version}/bsg/{bsgId}?manner=page&pageNo=1&pageSize=10&order=desc&orderBy=ctime HTTP/1.1
2Host: bsg.bj.baidubce.com
3Authorization: authorization string
4{
5}
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgId | String | No | URL parameter | If a specific bsgId is specified, the detailed information of Baidu Storage Gateway will be returned. If this parameter is not specified, all Baidu Storage Gateway lists are returned |
| bsgClass | String | No | Query | Filter fields, specify the gateway specifications, optionally standard version: STANDARD and high performance version: PERFORMANCE. Currently, only STANDARD is supported |
| location | String | No | Query | Filter fields, specify the gateway deployment location, optionally Baidu AI Cloud: CLOUD or local: LOCAL. Currently, only CLOUD is supported |
| type | String | No | Query | Filter fields, specify the Baidu Storage Gateway type, optionally file gateway FILE and block gateway ISCS. Currently, only FILE is supported |
| manner | String | Yes | Query | Specify the pagination strategy, fixed as: manner=page |
| pageNo | int | Yes | Query | Current pages |
| pageSize | int | Yes | Query | Count of data items per page |
| order | String | No | Query | Ascending/descending |
| orderBy | String | No | Query | Sort data items |
| keyword | String | No | Query | Search this field |
| keywordType | String | No | Query | Search field type, currently supported fields: bsgId and name |
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| pageNo | int | Yes | ResponseBody parameter | Current pages |
| pageSize | int | Yes | ResponseBody parameter | Count of data items per page |
| totalCount | int | Yes | ResponseBody parameter | Total count of data items |
| orders | OrderInfo | Yes | ResponseBody parameter | Sorting information |
| order | String | Yes | OrderInfo | Ascending/descending |
| orderBy | String | Yes | OrderInfo | Sort data items |
| result | List< BsgInfo> | Yes | ResponseBody parameter | Returned Baidu Storage Gateway information list |
| name | String | Yes | BsgInfo | Name of Baidu Storage Gateway |
| bsgClass | String | Yes | BsgInfo | Gateway specifications |
| location | String | Yes | BsgInfo | Gateway deployment location |
| type | String | Yes | BsgInfo | Baidu Storage Gateway type |
| eip | String | No | BsgInfo | EIP to be bound to Baidu Storage Gateway. If null, it indicates no EIP is bound |
| descr | string | No | BsgInfo | Baidu Storage Gateway description information |
| vpcId | string | Yes | BsgInfo | Baidu Storage Gateway VPC |
| domain | String | Yes | BsgInfo | Mount target of Baidu Storage Gateway |
| ctime | String | Yes | BsgInfo | Creation time of Baidu Storage Gateway |
| expireTime | String | Yes | BsgInfo | Expiration time of Baidu Storage Gateway |
| status | String | Yes | BsgInfo | Current status of Baidu Storage Gateway |
Request example
1GET http://bsg.bj.baidubce.com/v1/bsg?manner=page&pageNo=1&pageSize=10&order=desc&orderBy=ctime
2Host: bsg.bj.baidubce.com
3Authorization: bce-auth-v1/0a71d43401344af786ff328451073529/2022-02-08T07:17:51Z/1800/content-length;x-bce-date;content-md5;host;x-bce-request-id;x-bce-content-sha256;content-type/37f551cf056a694cbdcf2cae27f4c2d304d2563e3f2e340b330c0ac141dc9246
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4
5{
6 "order": "desc",
7 "orderBy": "ctime",
8 "orders": [
9 {
10 "order": "desc",
11 "orderBy": "ctime"
12 }
13 ],
14 "pageNo": 1,
15 "pageSize": 10,
16 "result": [
17 {
18 "bsgClass": "STANDARD",
19 "bsgId": "bsg-bUP9MYF2",
20 "ctime": "2022-03-02T15:15:35Z",
21 "descr": "",
22 "domain": "192.168.0.6",
23 "eip": "",
24 "errcode": "NONE",
25 "location": "CLOUD",
26 "mtime": "2022-03-02T15:50:18Z",
27 "name": "bsg-1LVt3FueBG",
28 "status": "RUNNING",
29 "subnet": {
30 "cidr": null,
31 "physicalZone": null,
32 "subnetId": "7aafd389-ee91-4750-8b72-99eefc346de3",
33 "zoneName": "zoneA"
34 },
35 "type": "FILE",
36 "uuid": "c1d2acbf-c9ef-4f8b-a2b3-450ee659316d",
37 "vpcId": "35856bf8-66ca-4031-b1ed-f37525ce2dac"
38 }
39 ],
40 "totalCount": 1
41}
Modify Baidu Storage Gateway
Description
- Modify Baidu Storage Gateway
Request structure
1PUT /v{version}/bsg/{bsgId}?{action} HTTP/1.1
2Host: bsg.bj.baidubce.com
3Authorization: authorization string
4
5 {
6 name: "bsg-newname"
7 }
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgId | String | Yes | URL parameter | Baidu Storage Gateway ID to be modified |
| action | String | Yes | Query | Fixed as: modify |
| name | String | No | RequestBody | Name of Baidu Storage Gateway |
| descr | string | No | RequestBody | Baidu Storage Gateway description information |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Response headers
No special headers beyond common headers.
Response parameters
None
Request example
1PUT http://bsg.bj.baidubce.com/v1/bsg/bsg-pcm5PJ?modify
2Host: bsg.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4Server: BWS
Delete Baidu Storage Gateway
Description
Delete the specified Baidu Storage Gateway. Please note that deleted Baidu Storage Gateways cannot be recovered.
Request structure
1DELETE /v{version}/bsg/{bsgId} HTTP/1.1
2Host: bsg.bj.baidubce.com
3Authorization: authorization string
4{
5}
Request headers
No special headers beyond common headers.
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgId | String | Yes | URL parameter | Baidu Storage Gateway ID to be released |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Response headers
No special headers beyond common headers.
Response parameters
None
Request example
1DELETE http://bsg.bj.baidubce.com/v1/bsg/bsg-pcm5PJ
2Host: bsg.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6}
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4Server: BWS
Bind EIP to Baidu Storage Gateway
Description
Mount the specified EIP to the designated Baidu Storage Gateway.
Request structure
1PUT /v{version}/bsg/{bsgId}?{action}&eip={eip} HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
4 {
5 "eip": eip
6 }
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgId | String | Yes | URL parameter | Baidu Storage Gateway ID |
| action | String | Yes | Query | Fixed as: bindEip |
| eip | String | Yes | Query | EIP to be bound. "new" indicates creating a new one |
Request example
1PUT /v{version}/bsg/sg-ksrvejrksvcy?bindEip&eip=127.0.0.1 HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Unbind EIP
Description
Unbind the IP linked to the specified Baidu Storage Gateway.
Request structure
1PUT /v{version}/bsg/{bsgId}?{action}&eip={eip} HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgId | String | Yes | URL parameter | Baidu Storage Gateway ID |
| action | String | Yes | Query | Fixed as: unbindEip |
| eip | String | Yes | Query | EIP to be unbound |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1PUT /v{version}/bsg/bsg-Khgzlg?unbindEip&eip=127.0.0.1 HTTP/1.1
2 Host: bce.bj.baidubce.com
3 Authorization: authorization string
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Obtain Baidu Storage Gateway specification information
Description
Obtain gateway specifications.
Request structure
1GET /v{version}/bsg?{action} HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| action | String | Yes | Query | Fixed as: getBsgClass |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1GET /v{version}/bsg?getBsgClass HTTP/1.1
2Host: bsg.bj.baidubce.com
3Authorization: authorization string
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| bsgClassList | List< BsgClassInfo> | ResponseBody parameter | Baidu Storage Gateway specifications information |
| bsgClass | String | BsgClassInfo | Baidu Storage Gateway specifications: standard version STANDARD and high-performance version PERFORMANCE |
| bccCpuCore | long | BsgClassInfo | BCC CPU core count |
| bccMemSize | long | BsgClassInfo | BCC memory size (GB) |
| bccDiskSize | long | BsgClassInfo | BCC disk size (GB) |
| bccNum | int | BsgClassInfo | BCC count (default: 1) |
| eipBandwidth | int | BsgClassInfo | EIP bandwidth (Mbps), default for standard version: 20 |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4
5{
6 "bsgClassList": [
7 {
8 "bccDiskSize": 100,
9 "bccCpuCore": 4,
10 "bccMemSize": 12,
11 "bccNum": 1,
12 "bsgClass": "STANDARD"
13 }
14 ]
15}
Obtain zone information
Description
Obtain zone information
Request structure
1GET /v{version}/zone HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1GET /v{version}/zone HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| zoneList | ZoneInfo | ResponseBody parameter | Availability zone information |
| zoneNames | List< String> | ZoneInfo | Availability zone name list |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4
5{
6 "zoneList": {
7 "zoneNames": [
8 "zoneA",
9 "zoneB"
10 ]
11 }
12}
Obtain order price
Description
Obtain zone information
Request structure
1GET /v{version}/order/price?type=new HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| bsgType | String | Yes | RequestBody | Baidu Storage Gateway type |
| bsgClass | String | Yes | RequestBody | Baidu Storage Gateway specifications |
| region | String | Yes | RequestBody | Baidu Storage Gateway region |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1GET /v{version}/order/price HTTP/1.1
2 Host: bce.bj.baidubce.com
3 Authorization: authorization string
4 {
5 bsgType:"FILE",
6 bsgClass: "STANDARD"
7 }
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| priceInfo | PriceInfo | ResponseBody parameter | Price information |
| price | long | PriceInfo | Price |
| perPrice | long | PriceInfo | Unit price |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Obtain order details
Description
Obtain zone information
Request structure
1GET /v{version}/order/{orderId} HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| orderId | String | Yes | URL parameter | Order ID |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1GET /v{version}/order/orderId HTTP/1.1
2 Host: bce.bj.baidubce.com
3 Authorization: authorization string
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| order | Order | ResponseBody parameter | Order information. See billing for details |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Order renewal
Description
Order renewal
Request structure
1POST /v{version}/bsg/renew HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| reservationLength | int | Yes | RequestBody | Renewal duration, e.g., 1/3/6, etc. |
| reservationTimeUnit | String | Yes | RequestBody | Renewal period unit: currently only "MONTH" is supported |
| paymentMethod | Set< PaymentModel> | No | RequestBody | Prepay discount information. [Refer to order document] for details |
| bsgId | String | Yes | RequestBody | Baidu Storage Gateway ID to be renewed |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1POST /v{version}/bsg/renew HTTP/1.1
2 Host: bce.bj.baidubce.com
3 Authorization: authorization string
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| orderId | long | ResponseBody parameter | Created order ID |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Obtain allow list user information
Description
Obtain zone information
Request structure
1GET /v{version}/whiteList HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
Request parameters
| Parameter name | Types | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number, current value is 1. |
| userId | String | No | RequestBody | User ID |
Response Status Code
Respond with 200 upon successful operation or provide error codes in case of failure, as detailed in the Error Codes section.
Request example
1GET /v1/whiteList HTTP/1.1
2Host: bce.bj.baidubce.com
3Authorization: authorization string
4{
5 userId: "1bbb8693967a4f14b60b7cbd5c4c954d"
6}
Response parameters
| Parameter name | Types | Parameter location | Description |
|---|---|---|---|
| whiteList | List< String> | ResponseBody parameter | Allow list |
| effect | int | ResponseBody parameter | Effective methods of allow list 1:Allow list active 2: No allow list, fully open |
Response example
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
4
5{
6 "effect": 1,
7 "whiteList": [
8 "1bbb8693967a4f14b60b7cbd5c4c954d"
9 ]
10}
