错误信息 | 使用HTTP CODE表示 | |
http code | 描述 | |
200 | 请求成功 | |
404 | Not Found | |
405 | 请求方法错误 | |
400 | 参数类型错误 | |
500 | 程序内部错误 |
选项 | 描述 | |||||
功能说明 | 获取token | |||||
调用说明 | 名称 | 描述 | ||||
请求方式 | GET | |||||
请求类型 | HEADER_PARAM | |||||
请求路径 | http://api2.capitalonline.net/gic/v1/get_token/ | |||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||
username | True | String | 用户名 | |||
password | True | String | 密码 | |||
参数可选 | 无 | |||||
返回结果 | 说明 | 返回格式为json | ||||
返回参数 | 名称 | 类型 | 描述 | |||
Access-Token | string | 验证后得到的token | ||||
status | string | 验证用户名密码请求的状态 | ||||
返回示例 |
{ "status": "success", "Access-Token":"UIxWcrSg1v35AukDS2rRj94Q6S+XDiN2jLQHeMSpy4bdDY71lg3isg==" } |
选项 | 描述 | |||||||
功能说明 | 创建APP | |||||||
调用说明 | 名称 | 描述 | ||||||
请求方式 | POST | |||||||
请求类型 | JSON | |||||||
请求路径 | http://api2.capitalonline.net/gic/v1/app/create/ | |||||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||||
name | True | String | 虚拟中心名称 | |||||
site_id | True | String | 数据中心id | |||||
pipe_goods_id | True | Int | 网络类型产品id | |||||
qos | True | Int |
当pipe_goods_id产品为固定带宽:最大为500M,步长为5M;当pipe_goods_id产品为流量包,代表流量包大小,单位GB,最大为51200GB(50TB); 当pipe_goods_id产品为95峰值,代表保底带宽,最大为500Mb,步长50; |
|||||
area_id | True | String | 销售区域,人民币账户”CN”,美元账户”US” | |||||
ip_number | True | Int | 公网ip的个数,个数必须为2的n次方且n>=2),出去网络地址/广播地址/组播地址,实际可用的地址为2^n-3,最大64个 | |||||
参数可选 | gic_id | False | String | 加入gpn的id | ||||
is_auto_renewal | False | Int | 公网类型为流量包或95峰值时,到期是否自动续约,只可选[0(续约关闭), 1(续约开启)],默认为1; | |||||
float_qos | False | Int | 公网类型为95峰值时,带宽大小的封顶带宽,为空时,默认为带宽大小的120% | |||||
返回结果 | 说明 | 返回格式为json | ||||||
返回参数 | 名称 | 类型 | 描述 | |||||
name | String | 虚拟数据中心的名称 | ||||||
site_id | String | 虚拟数据中心的uuid | ||||||
pipe_goods_id | int | 公网类型的产品ID | ||||||
qos | Int | 公网带宽 | ||||||
ip_number | Int | 公网ip个数 | ||||||
task_id | string | 任务的ID | ||||||
code | string | 执行代码 | ||||||
message | string | 错误信息 | ||||||
status | string | [success(成功) , false(失败)] | ||||||
返回示例 |
{ "status": "success", "code": 200, "task_id": "7876", "site_id": "a15b681e-278f-43de-938f-8656c7c1b67b", "name": "zwSite", "pipe_goods_id": 270, "qos": 5, "ip_number": 4, "message": "operation success" } |
|||||||
错误信息 | 错误码定义: | |||||||
Error code | Message | 描述 | ||||||
app.no_money | accounts less than the amount | 账户欠费 | ||||||
app.operation_denied | 割接检查 | |||||||
身份审核 | ||||||||
app.parameter_error | parameter incomplete, please check your parameter | 参数不全 | ||||||
app name already exists | 虚拟数据中心已存在 | |||||||
pipe goods error | 公网id错误 | |||||||
ip number error | ip个数错误 | |||||||
qos error | 带宽错误 | |||||||
incorrect location of your choice | 机房位置错误 | |||||||
app.purchase_error | purchase error, please contact customer service | 计费出错 | ||||||
app.purchase_exceeds_limit | order generation is successful, but the number of goods exceeds the limit, you need to wait for administrator review, task waiting to be executed | 购买受限,等待审核 | ||||||
invalid_operation | exception | 异常 | ||||||
405 | request method error! | 请求方法错误 |
选项 | 描述 | |||||||
功能说明 | 删除虚拟中心 | |||||||
调用说明 | 名称 | 描述 | ||||||
请求方式 | DELETE | |||||||
请求类型 | ||||||||
请求路径 | http://api2.capitalonline.net/gic/v1/app/{app_id} | |||||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||||
{app_id} | True | String | 虚拟数据中心uuid | |||||
参数可选 | 无 | |||||||
返回结果 | 说明 | 返回格式为json | ||||||
返回参数 | 名称 | 类型 | 描述 | |||||
status | string | 执行的结果:[success, fail] | ||||||
task_id | string | 任务的ID | ||||||
code | string | 执行代码 | ||||||
message | string | 错误信息 | ||||||
返回示例 |
{ "status": "success", "message": "task has add to the queue, please wait until it's exec done", "code": 200, "app_id": "4423aa3b-177b-4637-913b-60906ee2e38f", "task_id": "37463" } |
|||||||
错误信息 | 错误码定义: | |||||||
Error code | Message | 描述 | ||||||
app. operation_denied | permission denied | 权限拒绝 | ||||||
app.invalid_operation | the app has deleted | App已经被删除 | ||||||
the app is not be allow removed because there is an resource in the app(VM_HOST:0,PUBLIC_NET:1,PRIVATE_NET:0,GPN_NET:0) | App内还有资源,删除APP前要先删除APP下的资源 | |||||||
task is running in the queue, please wait task end | 任务正在排队 | |||||||
please check your app can be deleted | 检查APP是否可以被删除 | |||||||
invalid_operation | (异常错误信息) | 异常错误信息 |
选项 | 描述 | ||||||
功能说明 | 列虚拟数据中心 | ||||||
调用说明 | 名称 | 描述 | |||||
请求方式 | GET | ||||||
请求类型 | Parameter | ||||||
请求路径 | http://api2.capitalonline.net/gic/v1/app/list/ | ||||||
参数必选 | 名称 | 要求 | 类型 | 描述 | |||
无 | |||||||
参数可选 | site_id | false | String | 数据中心的uuid | |||
page | False | Int | 页码数(不填默认第一页) | ||||
返回结果 |
说明 | 返回格式为json | |||||
返回参数 | 名称 | 类型 | 描述 | ||||
code | string | 执行代码 | |||||
page | int | 当前页码 | |||||
page_count | Int | 总页数 | |||||
message | string | 错误信息 | |||||
data: | array | [{app_id:””} ,{ app_id:””}] | |||||
返回示例 |
{ "status": "success", "message": "get app list success", "page_count": 1, "code": 200, "data": [ { "resource": [(资源信息) { "name": "wwJPTest",(虚拟中心名称) "gic_count": 1,(gpn个数) "wan_count": 1,(公网个数) "lan_count": 1,(私网个数) "id": "15cb5b6a-db20-42f5-a987-f589e98cb6a3",(虚拟中心id) "vm_count": 3(云主机个数) } ], "site_name": "日本--东京1",(数据中心名称) "app_id": "15cb5b6a-db20-42f5-a987-f589e98cb6a3",(虚拟中心id) "name": "wwJPTest"(虚拟中心名称), "site_id": "15cb5b6a-db20-42f5-a987-f589e98cb6a3"(节点uuid) } "page": "1"(当前页码) } |
||||||
错误信息 | 错误码定义: | ||||||
Error code | Message | 描述 | |||||
app.operation_denied | the 'page' can't be grant than total pages | 当前页不能大于总页数 | |||||
Permission Denied | 权限错误 | ||||||
app.invalid_operation | please check parameter :'site_id' | site_id错误 | |||||
invalid_operation | (异常错误信息) | 异常提示 |
选项 | 描述 | |||||||
功能说明 | 查找虚拟数据中心属性 | |||||||
调用说明 | 名称 | 描述 | ||||||
请求方式 | GET | |||||||
请求类型 | Parameter | |||||||
请求路径 | http://api2.capitalonline.net/gic/v1/app/info/ | |||||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||||
无 | ||||||||
app_id | True | String | 项目uuid | |||||
参数可选 | 无 | |||||||
返回结果 | 说明 | 返回格式为json | ||||||
返回参数 | 名称 | 类型 | 描述 | |||||
code | string | 执行代码 | ||||||
message | string | 错误信息 | ||||||
data: | array | [{vm_id:””} ,{ vm_id:””}] | ||||||
返回示例 |
{ "status": "success", "message": "get app property success", "code": 200, "data": [ { "customer_user": "15101040299", (用户名 "site_name": "美国--洛杉矶1",(站点名称 "name": "vapplsj",(虚拟数据中心名称 "vms_count": 1,(vm个数 "site_id": "1a2f0825-ee1b-4c25-9332-e34dd2a621dd",(站点uuid "app_id": "0815aa62-a1bc-4574-89b0-195d15d0d2c6",(虚拟数据中心uuid "net": [ { "status": "ok",(状态-正常 "qos": 5,(带宽 "name": "GPN",(pipe名称 "create_status": 1,(创建状态-正常 "mask": 0,(掩码 "id": "0f27d4fa-b427-11e5-8f7e-0050569b4d9c",(pipe的uuid "gpn_id": "d45beb36-b426-11e5-a1ba-0050569b4d9c",(gpn的uuid "type": "gic",(pipe的类型 "net_id": "",(网络id "vlan_id": 3857(pipe所属的vlan }, { "status": "ok", "qos": -1, "name": "vapplsj私网1000009952", "create_status": 1, "mask": 24, "id": "9199c780-af8c-11e5-b95c-0050569b4d9c", "gpn_id": "d45beb36-b426-11e5-a1ba-0050569b4d9c", "type": "private", "net_id": "192.168.1.0", "vlan_id": 3380 }, { "status": "ok", "qos": 10, "name": "vapplsj", "segment_id": [ [ "6dfd08e0-b848-11e5-8b24-0050569b4d9c",(公网段uuid "38.121.60.96",(公网段网络号 28(公网段掩码 ] ], "create_status": 1, "mask": 28, "id": "a939dbc6-b36c-11e5-a7fd-0050569b4d9c", "gpn_id": "d45beb36-b426-11e5-a1ba-0050569b4d9c", "type": "public", "net_id": "38.121.60.176", "vlan_id": 2203 } ], "vms": [ { "status": "running",(vm运行状态 "app": "0815aa62-a1bc-4574-89b0-195d15d0d2c6",(vm所属虚拟数据中心 "ram": 4,(内存,单位GB "create_status": 1,(创建状态 "id": "021a3064-309f-4fdb-8d43-3529526b3104",(vm的uuid "netcard": [ { "status": "ok",(网卡状态 "ip": "192.168.1.2",(ip地址 "mac": "00:50:56:9f:6d:46",(mac地址 "connect": true,(连接状态 "type": "private",(网卡所属网络类型 "id": "4b7ca7f1-a019-41a8-8bd5-a44323261d67"(网卡的uuid }, { "status": "ok", "ip": null, "mac": "00:50:56:9f:10:95", "connect": false, "type": "gic", "id": "dce45f66-a901-438e-81d8-faa2c7540ba5" }, { "status": "ok", "ip": "38.121.60.178", "mac": "00:50:56:9f:31:ae", "connect": false, "type": "public", "id": "f56965db-bcf2-4ad2-840f-ca9b070f31ec" } ], "vm_group": "A",(vm分组 "customer": "E002478",(用户的uuid "task": "5918a7a6-b37d-11e5-a0f9-0050569b29f9",(创建vm的任务id "disk_size": 160,(磁盘总大小 "name": "aa001",(虚拟机名称 "os": "CDS-OS-CentOS5.3-64bit-General-V1",(操作系统名称 "cpu": 2(cpu个数 } ] } ] } |
|||||||
错误信息 | ||||||||
Error code | Message | 描述 | ||||||
app.operation_denied | permission denied | 权限错误 | ||||||
app.invalid_operation | please check parameter :'app_id' | app_id错误 | ||||||
invalid_operation | (错误异常提示) | 错误异常提示信息 |