批量转包年包月
更新时间:2024-07-02
该接口用于批量将BCC实例计费方式由按量付费(后付费)转为包年包月(预付费)。
请求结构
Plain Text
1 POST /v{version}/instance/batch/charging?{action} HTTP/1.1
2 Host: bcc.bj.baidubce.com
3 Authorization: authorization string
4
5 {
6 "config": [
7 {
8 "instanceId": instanceId1,
9 "duration": duration,
10 "autoPay": autoPay,
11 "cdsList": [volumeId1, volumeId2]
12 },
13 {
14 "instanceId": instanceId2,
15 "duration": duration,
16 "autoPay": autoPay,
17 "cdsList": [volumeId3, volumeId4]
18 }
19 ]
20 }
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号 |
action | String | 是 | Query参数 | 对实例执行的操作,当前取值:toPrepay |
config | List<PrepayConfig> | 是 | RequestBody参数 | 需要批量转包年包月实例的配置,最多支持20个 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
orderId | String | 订单ID。 |
请求示例
Plain Text
1POST /v2/instance/batch/charging?toPrepay HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048f***
5
6{
7 "config": [
8 {
9 "instanceId": "i-43TqYnng",
10 "duration": 1,
11 "autoPay": true,
12 ""cdsList": ["v-tP2MJ3YI","v-9eLRwv8n"]
13 },
14 {
15 "instanceId": "i-4D3Jinng",
16 "duration": 1,
17 "autoPay": true,
18 ""cdsList": ["all"]
19 }
20 ]
21}
22
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: a41fdefe-28a6-4cb5-87b5-c88caf412a1c
3Date: Thu, 23 Mar 2023 06:30:58 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "orderId": "5c001b75e24d***"
8}