forked from tencentyun/qcloud-documents
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
skipzhang
committed
Jul 21, 2016
1 parent
1dbeef7
commit f23b7e6
Showing
18 changed files
with
1,139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
## 1. 云硬盘相关接口 | ||
|
||
| 修改云硬盘属性 | [ModifyCbsStorageAttributes](/doc/api/364/2523) | 修改云硬盘的属性 | | ||
| 查询云硬盘信息 | [DescribeCbsStorages](/doc/api/364/2519) | 根据用户输入的信息,如磁盘类型、可用区等查询对应云硬盘的详细信息 | | ||
|
||
## 2. 弹性云盘相关接口 | ||
|
||
| 接口名 | Action Name | 功能描述 | | ||
| --------- | --------- | ----- | | ||
| 创建弹性云盘 | [CreateCbsStorages](/doc/api/364/2524) | 根据指定的配置购买新的弹性云盘 | | ||
| 挂载弹性云盘 | [AttachCbsStorages](/doc/api/364/2520) | 将指定的弹性云盘挂载到指定的云主机上 | | ||
| 解挂弹性云盘 | [DetachCbsStorages](/doc/api/364/2521) | 将指定的弹性云盘从云主机上解挂 | | ||
| 续费弹性云盘 | [RenewCbsStorage](/doc/api/364/2526) | 对指定的弹性云盘进行续费操作 | | ||
| 扩容弹性云盘 | [ResizeCbsStorage](/doc/api/364/2527) | 对指定的弹性云盘进行扩容操作 | | ||
| 查询弹性云盘价格 | [InquiryStoragePrice](/doc/api/364/2522) | 查询指定类型的弹性云盘的价格 | | ||
| 查询云主机已挂载弹性云盘数量 | [DescribeInstancesCbsNum](/doc/api/364/2528) | 查询云主机已挂载的弹性云盘数量 | | ||
|
||
## 3. 快照相关接口 | ||
|
||
| 接口名称 | Action Name | 功能描述 | | ||
| -------- | --------- | ------ | | ||
| 创建快照 | [CreateSnapshot](/doc/api/364/2529) | 对指定的云硬盘创建快照 | | ||
| 查询快照列表 | [DescribeSnapshots](/doc/api/364/2530) | 根据指定的参数,如云硬盘ID、类型等查询对应的快照详细信息 | | ||
| 修改快照名称 | [ModifySnapshot](/doc/api/364/2532) | 修改指定快照的展示名称 | | ||
| 回滚快照 | [ApplySnapshot](/doc/api/364/2533) | 回滚快照到原云硬盘 | | ||
| 删除快照 | [DeleteSnapshot](/doc/api/364/2531) | 删除指定的快照 | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## 1. 接口描述 | ||
|
||
本接口(ModifyCbsStorageAttributes)用于修改指定的云硬盘名称或项目ID。 | ||
|
||
接口调用域名:<font style="color:red">cbs.api.qcloud.com</font> | ||
|
||
使用限制: | ||
1. 只支持修改弹性云盘项目ID,随云主机创建的云硬盘项目与云主机联动。详见[DescribeCbsStorages(查询云硬盘信息)](https://www.qcloud.com/doc/api/364/2519)接口回包中portable字段解释。 | | ||
|
||
|
||
## 2. 输入参数 | ||
|
||
以下请求参数列表仅列出了接口请求参数,其它参数见[公共请求参数](https://www.qcloud.com/doc/api/364/2745)页面。 | ||
|
||
| 参数名称 | 必选 | 类型 | 描述 | | ||
| ------- | ------- | ------- | ------- | | ||
| storageId | 是 | String |云硬盘ID, 通过[DescribeCbsStorages(查询云硬盘信息)](/doc/api/364/2519)接口查询 | | ||
| storageName | 否 | String | 新的云硬盘名称| | ||
| projectId | 否 | Int | 新的弹性云盘项目ID,只能修改弹性云盘的项目ID。通过[DescribeProject(查询项目列表)](https://www.qcloud.com/doc/api/229/1330)接口查询可用项目及其ID。 | | ||
|
||
|
||
## 3. 输出参数 | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| code | Int | 公共错误码,0表示成功,其他值表示失败。详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81) | | ||
| message | String | 错误信息,详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81)| | ||
|
||
|
||
## 4. 示例 | ||
|
||
输入 | ||
``` | ||
https://cbs.api.qcloud.com/v2/index.php? | ||
<公共请求参数> | ||
&Action=ModifyCbsStorageAttributes | ||
&storageId=disk-3clz8g94 | ||
&storageName=nihao | ||
``` | ||
|
||
输出 | ||
``` | ||
{ | ||
"code":"0", | ||
"message":"" | ||
} | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
## 1. 接口描述 | ||
|
||
本接口(CreateCbsStorages)用于创建新的弹性云盘。 | ||
|
||
接口请求域名:<font style="color:red">cbs.api.qcloud.com</font> | ||
|
||
使用限制: | ||
1. 普通弹性云盘和SSD弹性云盘售卖限制请见[云硬盘使用限制](https://www.qcloud.com/doc/product/362/5145) | ||
|
||
|
||
## 2. 输入参数 | ||
|
||
以下请求参数列表仅列出了接口请求参数,其它参数见[公共请求参数](https://www.qcloud.com/doc/api/364/2745)页面。 | ||
|
||
| 参数名称 | 是否必选 | 类型 | 描述 | | ||
| ------- | ------- | ------- | ------- | | ||
| storageType | 是 | String | 硬盘介质类型。只有两种取值:cloudBasic表示普通云硬盘,cloudSSD表示SSD云硬盘 | | ||
| goodsNum | 是 | Int | 购买数量,最大值为10 | | ||
| period | 是 | Int | 购买时长,单位为月 | | ||
| zoneId | 是 | Int | 购买的云盘所处可用区ID,通过 [DescribeAvailabilityZones(查询可用区)](http://www.qcloud.com/doc/api/229/1286) 接口查询 | | ||
| storageSize | 否 | Int | 磁盘大小,单位为GB。如果传入snapshotId则可不传storageSize,此时新建云盘的大小为快照大小。<br>如果传入快照ID同时传入磁盘大小,则磁盘大小必须大于或等于快照大小。<br>取值范围为10GB~4000GB(普通云硬盘)或250GB~4000GB(SSD云硬盘),步长为10GB | | ||
| projectId | 否 | Int | 项目ID,不带此参数时将在默认项目下进行创建 | | ||
| snapshotId | 否 | String | 快照ID,如果传入则根据此快照创建云盘,快照类型必须为数据盘快照,通过[DescribeSnapshots(查询快照列表)](https://www.qcloud.com/doc/api/364/2530) 接口查询 | | ||
|
||
|
||
## 3. 输出参数 | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| code | Int | 公共错误码,0表示成功,其他值表示失败。详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81) | | ||
| message | String | 错误信息,详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81)| | ||
| storageIds | Array[String] | 创建的云硬盘ID列表 | | ||
|
||
|
||
## 4. 示例 | ||
|
||
输入 | ||
``` | ||
https://cbs.api.qcloud.com/v2/index.php? | ||
<公共请求参数> | ||
$Action=CreateCbsStorages | ||
&storageType=cloudBasic | ||
&storageSize=10 | ||
&goodsNum=1 | ||
&period=1 | ||
&zoneId=100002 | ||
``` | ||
|
||
输出 | ||
``` | ||
{ | ||
"code":"0", | ||
"message":"", | ||
"storageIds":[ | ||
"disk-jpehowjo" | ||
] | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## 1. 接口描述 | ||
|
||
本接口(ResizeCbsStorage)用于扩容指定的弹性云盘。 | ||
|
||
接口调用域名:<font style="color:red">cbs.api.qcloud.com</font> | ||
|
||
使用限制: | ||
1. 只支持扩容弹性云盘。详见[DescribeCbsStorages(查询云硬盘信息)](https://www.qcloud.com/doc/api/364/2519)接口回包中portable字段解释。随云主机创建的云硬盘需通过[ResizeInstance(调整实例配置(包年包月))](/doc/api/229/1306) 或 [ResizeInstanceHour(调整实例配置(按量计费))](/doc/api/229/1344) 接口扩容 | ||
|
||
## 2. 输入参数 | ||
|
||
以下请求参数列表仅列出了接口请求参数,其它参数见[公共请求参数](https://www.qcloud.com/doc/api/364/2745)页面。 | ||
|
||
| 参数名称 | 必选 | 类型 | 描述 | | ||
| --- | --- | --- | --- | | ||
| storageId | 是 | String | 云硬盘ID, 通过[DescribeCbsStorages(查询云硬盘信息)](/doc/api/364/2519)接口查询 | | ||
| storageSize | 是 | Int | 扩容后的磁盘大小。必须大于当前值,最大值为4000,步长为10| | ||
|
||
## 3. 输出参数 | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| code | Int | 公共错误码,0表示成功,其他值表示失败。详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81) | | ||
| message | String | 错误信息,详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81)| | ||
|
||
|
||
## 4. 示例 | ||
|
||
输入 | ||
``` | ||
https://cbs.api.qcloud.com/v2/index.php? | ||
<公共请求参数> | ||
&Action=ResizeCbsStorage | ||
&storageId=disk-cw6a3g9w | ||
&storageSize=100 | ||
``` | ||
|
||
输出 | ||
``` | ||
{ | ||
"code":"0", | ||
"message":"" | ||
} | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
## 1. 接口描述 | ||
本接口(AttachCbsStorages)用于挂载指定的弹性云盘到指定的云主机上。 | ||
|
||
接口请求域名:<font style="color:red">cbs.api.qcloud.com</font> | ||
|
||
使用限制: | ||
1. 只支持弹性云盘。详见[DescribeCbsStorages(查询云硬盘信息)](https://www.qcloud.com/doc/api/364/2519)接口输出参数中portable字段解释 | ||
1. 云硬盘必须处于非挂载状态,且状态为normal。详见[DescribeCbsStorages(查询云硬盘信息)](https://www.qcloud.com/doc/api/364/2519)接口输出参数中storageStatus、attached字段解释 | ||
1. 单个云主机最多可挂载云硬盘限制见[DescribeInstancesCbsNum(查询云主机已挂载弹性云盘数量)](https://www.qcloud.com/doc/api/364/2528)输出参数说明 | ||
|
||
## 2. 输入参数 | ||
|
||
以下请求参数列表仅列出了接口请求参数,其它参数见[公共请求参数](https://www.qcloud.com/doc/api/364/2745)页面。 | ||
|
||
| 参数名称 | 必选 | 类型 | 描述 | | ||
| ------- | ------- | ------- | ------- | | ||
| storageIds| 是 | Array[String] | 将要被挂载的弹性云盘ID。通过[DescribeCbsStorages(查询云硬盘信息)](/doc/api/364/2519)接口查询。单次最多可操作10块弹性云盘 | | ||
| uInstanceId | 是 | String | 云服务器实例ID,云盘将被挂载到此云服务器上。通过[DescribeInstances(查看实例列表)](/doc/api/229/831)接口查询 | | ||
|
||
|
||
## 3. 输出参数 | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| code | Int | 公共错误码,0表示成功,其他值表示失败。详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81) | | ||
| message | String | 错误信息,详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81)| | ||
| detail | Array[object] | 见[批量异步任务接口返回格式](http://www.qcloud.com/doc/api/364/%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E6%8E%A5%E5%8F%A3%E8%BF%94%E5%9B%9E%E6%A0%BC%E5%BC%8F) | | ||
|
||
|
||
## 4. 示例 | ||
|
||
输入 | ||
``` | ||
https://cbs.api.qcloud.com/v2/index.php? | ||
<公共请求参数> | ||
&Action=AttachCbsStorages | ||
&storageIds.0=disk-a2dbffgk | ||
&uInstanceId=ins-9spojch6 | ||
``` | ||
|
||
输出 | ||
``` | ||
{ | ||
"code":"0", | ||
"message":"", | ||
"detail":{ | ||
"disk-a2dbffgk":{ | ||
"code":"0", | ||
"message":"ok" | ||
}, | ||
"taskId":"2377970" | ||
} | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## 1. 接口描述 | ||
|
||
本接口(DescribeInstancesCbsNum)用于查询云主机已挂载的弹性云盘数量和可挂载的弹性云盘的总数。 | ||
|
||
接口请求域名:<font style="color:red">cbs.api.qcloud.com</font> | ||
|
||
使用限制: | ||
|
||
无特殊限制,具体参数限制见下表。 | ||
|
||
## 3. 输入参数 | ||
|
||
以下请求参数列表仅列出了接口请求参数,其它参数见[公共请求参数](https://www.qcloud.com/doc/api/364/2745)页面。 | ||
|
||
| 参数名称 | 必选 | 类型 | 描述 | | ||
| ------- | ------- | ------- | ------- | | ||
| uInstanceIds | 是 | Array[String] | 云服务器实例ID,通过[DescribeInstances(查看实例列表)](/doc/api/229/831)接口查询 | | ||
|
||
|
||
## 4. 输出参数 | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| code | Int | 公共错误码,0表示成功,其他值表示失败。详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81) | | ||
| message | String | 错误信息,详见[错误码页面](https://www.qcloud.com/doc/api/364/%E9%94%99%E8%AF%AF%E7%A0%81)| | ||
| detail | Array[Object] | 云服务器可挂载与最大可挂载弹性云盘数量信息的详情,见下表| | ||
|
||
detail结构: | ||
|
||
| 参数名称 | 类型 | 描述 | | ||
| ------- | ------- | ------- | | ||
| count | Int | 当前云服务器已挂载弹性云盘数量| | ||
| maxAttachNum | String | 当前云服务器最大可挂载弹性云盘数量| | ||
|
||
|
||
## 5. 示例 | ||
|
||
输入 | ||
``` | ||
https://cbs.api.qcloud.com/v2/index.php? | ||
<公共请求参数> | ||
&Action=DescribeInstancesCbsNum | ||
&uInstanceIds.0=ins-ka40hchw | ||
``` | ||
|
||
输出 | ||
``` | ||
{ | ||
"code":"0", | ||
"message":"", | ||
"detail":{ | ||
"ins-ka40hchw":{ | ||
"count":"5", | ||
"maxAttachNum":"10" | ||
} | ||
} | ||
} | ||
``` |
Oops, something went wrong.