1. 请求需要token验证,通过用户名和密码获取token后,在请求header中加上token和对应的值,如:{token:”8rl8iSwhP7wC/7uqDTD1kR/i12LNl/Uc4DfWeRmSjXSFbGCawOMqlw==”};
2. 当执行操作动作的时候,会返回task_id参数,该参数用于查询任务执行的中间状态;
3. 该文档至在版本v1.4时候可用
4. 公共返回参数:code/message,分别用于表示调用该API执行的状态,以及对该状态的描述
错误信息 |
使用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 |
验证用户名密码请求的状态 |
||||
返回示例 |
{ |
选项 | 描述 | |||||
功能说明 | 查询账单 | |||||
调用说明 | 名称 | 描述 | ||||
请求方式 | GET | |||||
请求类型 | JSON | |||||
请求路径 | http://api2.capitalonline.net/gic/v1/bill/query/ | |||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||
date_from_to | True | string | 例子:2017.07.12 - 2017.07.13 注意横杠两侧各有一个空格 | |||
area_id | True | string | CN[人民币账户],[US]美元账户 | |||
参数可选 | 无 | |||||
返回结果 | 说明 | 返回格式为json | ||||
返回参数 | 名称 | 类型 | 描述 | |||
total_vice_cost | String | GPN uuid | ||||
total_master_cost | String | gpn的名称 | ||||
bill_day | Array |
site_name app_name goods_name total_cost site_id app_id cloud_name create_time delete_time cloud_id goods_type |
||||
返回示例 |
{ "total_vice_cost": 0, "total_master_cost": 1972518, "bill_day": [ { "site_name": "研发GIC", "app_name": "lina_005", "goods_name": "IP", "total_cost": 984906, "site_id": "b13d22e9-c078-4979-a06e-cc1c2cbaeb9c", "app_id": "7e7c6360-c967-47d9-a328-e81cdcad36de", "cloud_name": "ip", "create_time": "2017-07-12 16:44:08", "delete_time": null, "cloud_id": "44c83a80-66de-11e7-b794-0242ac1107ce", "goods_type": "ip" }, ] } |
选项 | 描述 | |||||
功能说明 | 查询账单 | |||||
调用说明 | 名称 | 描述 | ||||
请求方式 | GET | |||||
请求类型 | JSON | |||||
请求路径 | http://api2.capitalonline.net/gic/v1/bill/detail/ | |||||
参数必选 | 名称 | 要求 | 类型 | 描述 | ||
date_from | True | string | 例子:2017.07.12 | |||
date_to | True | string | 例子:2017.07.13 | |||
cloud_id | True | string | 云资源id | |||
area_id | True | String | CN[人民币账户],[US]美元账户 | |||
参数可选 | 无 | |||||
返回结果 | 说明 | 返回格式为json | ||||
返回参数 | 名称 | 类型 | 描述 | |||
bill_total_cost | String | GPN uuid | ||||
bill_day | Array |
site_name measure_value_unit site_id period id cost goods_type pay_type cloud_id area total_cost cost_detail detail_time status pay_desc measure_value goods_name vm_group app_id cloud_name begin_time configuration customer goods create_time end_time app_name |
||||
返回示例 |
{ "bill_total_cost": 984906 "bill_details": [ { "site_name": "研发GIC", "measure_value_unit": "个", "site_id": "b13d22e9-c078-4979-a06e-cc1c2cbaeb9c", "period": 1499788800, "cost": 1660.4, "id": 7569, "goods_type": "ip", "pay_type": "0", "cloud_id": "44c83a80-66de-11e7-b794-0242ac1107ce", "area": "CN", "total_cost": 24906, "cost_detail": "IP:IP:16.604", "delete_time": null, "status": "fixed", "pay_desc": "包年包月计费", "measure_value": 4, "goods_name": "IP", "vm_group": null, "app_id": "7e7c6360-c967-47d9-a328-e81cdcad36de", "cloud_name": "ip", "begin_time": 1499849058, "configuration": "IP:IP:4个", "customer": "E020868", "goods": "4375", "create_time": "2017-07-12 16:44:08", "end_time": 1499849958, "app_name": "lina_005" }, ] } |