主题
魔方财务(自定义配置)-前台
获取订购页面配置
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取订购页面配置 |
| 接口地址 | /console/v1/product/:id/remf_finance/order_page |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
响应参数
无
获取订购页面配置
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取订购页面配置(层级联动) |
| 接口地址 | /console/v1/product/:id/remf_finance/link |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
| cid | int | - | require | 配置项ID |
| sub_id | int | - | require | 子项ID |
响应参数
无
id:文件标题
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取实例详情 |
| 接口地址 | /console/v1/remf_finance/:id |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | - | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| - | host_data:基础数据@ | - | - |
| - | config_options:可配置选项@ | - | - |
| - | custom_field_data:自定义字段@ | - | - |
| - | download_data:可下载数据@ | - | - |
| - | module_button:模块按钮@ | - | - |
| - | module_client_area:模块页面输出 | - | - |
| - | hook_output:钩子在本页面的输出,数组,循环显示的html | - | - |
| - | dcim.flowpacket:当前产品可购买的流量包@ | - | - |
| - | dcim.auth:服务器各种操作权限控制(on有权限off没权限) | - | - |
| - | dcim.area_code:区域代码 | - | - |
| - | dcim.area_name:区域名称 | - | - |
| - | dcim.os_group:操作系统分组@ | - | - |
| - | dcim.os:操作系统数据@ | - | - |
| - | flow_packet_use_list:流量包使用情况@ | - | - |
| 取消请求数据,空对象 | host_cancel: | - | - |
其他文档字段
json
{
"host_data": "remark:备注",
"config_options": "sub_name:配置项值",
"custom_field_data": "value:字段值",
"download_data": "id:文件id",
"down_link": "id:下载链接",
"location": "id:文件名",
"module_button": "type:name:名称",
"dcim.flowpacket": "stock:库存(0不限)",
"dcim.os_group": "svg:分组svg号",
"dcim.os": "group_id:所属分组ID",
"flow_packet_use_list": "used:已用流量"
}开机
| 项目 | 内容 |
|---|---|
| 接口描述 | 开机 |
| 接口地址 | /console/v1/remf_finance/:id/on |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
关机
| 项目 | 内容 |
|---|---|
| 接口描述 | 关机 |
| 接口地址 | /console/v1/remf_finance/:id/off |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
重启
| 项目 | 内容 |
|---|---|
| 接口描述 | 重启 |
| 接口地址 | /console/v1/remf_finance/:id/reboot |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
批量操作
| 项目 | 内容 |
|---|---|
| 接口描述 | 批量操作 |
| 接口地址 | /console/v1/remf_finance/batch_operate |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | array | - | require | 产品ID |
| action | string | - | require | 动作on开机off关机reboot重启hard_off强制关机hard_reboot强制重启 |
响应参数
无
获取控制台地址
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取控制台地址 |
| 接口地址 | /console/v1/remf_finance/:id/vnc |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
无
响应参数
| name | type | default | desc |
|---|---|---|---|
| data.url | string | - | 控制台地址 |
控制台页面
| 项目 | 内容 |
|---|---|
| 接口描述 | 控制台页面 |
| 接口地址 | /console/v1/remf_finance/:id/vnc |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
获取实例状态
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取实例状态 |
| 接口地址 | /console/v1/remf_finance/:id/status |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| data.status | string | - | 实例状态(pending=开通中,on=开机,off=关机,operating=操作中,fault=故障) |
| data.desc | string | - | 实例状态描述 |
重置密码
| 项目 | 内容 |
|---|---|
| 接口描述 | 重置密码 |
| 接口地址 | /console/v1/remf_finance/:id/reset_password |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| password | string | - | require | 新密码 |
响应参数
无
救援模式
| 项目 | 内容 |
|---|---|
| 接口描述 | 救援模式 |
| 接口地址 | /console/v1/remf_finance/:id/rescue |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| type | int | - | require | 指定救援系统类型(1=windows,2=linux) |
| temp_pass | int | - | require | 临时密码 |
响应参数
无
重装系统
| 项目 | 内容 |
|---|---|
| 接口描述 | 重装系统 |
| 接口地址 | /console/v1/remf_finance/:id/reinstall |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| os | int | - | require | 重装系统的操作系统id |
| port | int | - | require | 端口 |
| format_data_disk | int | 0 | - | 是否格式化数据盘(0=不格式,1=格式化) |
响应参数
无
硬关机
| 项目 | 内容 |
|---|---|
| 接口描述 | 硬关机 |
| 接口地址 | /console/v1/remf_finance/:id/hard_off |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
硬重启
| 项目 | 内容 |
|---|---|
| 接口描述 | 硬重启 |
| 接口地址 | /console/v1/remf_finance/:id/hard_reboot |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
获取模块图表数据
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取模块图表数据 |
| 接口地址 | /console/v1/remf_finance/:id/chart |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| type:string | .name:type | require:1 | other:desc:module_chart里面的type:比如:cpu/dist/memory/flow | default: |
| type:string | .name:select | require:0 | other:desc:module_chart里面的select的value | default: |
| type:int | .name:start | require:0 | desc:开始毫秒时间戳 | default: |
| type:int | .name:end | require:0 | desc:结束毫秒时间戳 | default: |
响应参数
| name | type | default | desc |
|---|---|---|---|
| - | unit:单位 | - | - |
| - | chart_type:line线性图 | - | - |
| - | list:图表数据@ | - | - |
| - | label:对应list鼠标over显示内容 | - | - |
其他文档字段
json
{
"list": "time:时间",
"value": "value:值"
}获取商品配置所有周期价格
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取商品配置所有周期价格 |
| 接口地址 | /console/v1/product/:id/remf_finance/duration |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| duration | object | - | 周期 |
| duration.product_price | float | - | 价格 |
| duration.setup_fee | float | - | 初装费 |
| duration.billingcycle | string | - | 周期 |
| duration.billingcycle_zh | string | - | 周期 |
| duration.pay_ontrial_cycle | string | - | 试用 |
产品列表
| 项目 | 内容 |
|---|---|
| 接口描述 | 产品列表 |
| 接口地址 | /console/v1/remf_finance |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| page | int | 1 | - | 页数 |
| limit | int | - | - | 每页条数 |
| orderby | string | - | - | 排序(id,due_time,status) |
| sort | string | - | - | 升/降序 |
| keywords | string | - | - | 关键字搜索:商品名称/产品名称/IP |
| country_id | int | - | - | 搜索:国家ID |
| city | string | - | - | 搜索:城市 |
| area | string | - | - | 搜索:区域 |
| status | string | - | - | 产品状态(Unpaid=未付款,Pending=开通中,Active=已开通,Suspended=已暂停,Deleted=已删除) |
| tab | string | - | - | 状态using使用中expiring即将到期overdue已逾期deleted已删除 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| list | array | - | 列表数据 |
| list[].id | int | - | 产品ID |
| list[].product_id | int | - | 商品ID |
| list[].name | string | - | 产品标识 |
| list[].status | string | - | 产品状态(Unpaid=未付款,Pending=开通中,Active=已开通,Suspended=已暂停,Deleted=已删除) |
| list[].active_time | int | - | 开通时间 |
| list[].due_time | int | - | 到期时间 |
| list[].client_notes | string | - | 用户备注 |
| list[].product_name | string | - | 商品名称 |
| list[].country | string | - | 国家 |
| list[].country_code | string | - | 国家代码 |
| list[].country_id | int | - | 国家ID |
| list[].city | string | - | 城市 |
| list[].area | string | - | 区域 |
| list[].power_status | string | - | 电源状态(on=开机,off=关机,operating=操作中,fault=故障) |
| list[].image_name | string | - | 镜像名称 |
| list[].image_icon | string | - | 镜像图标(Windows,CentOS,Ubuntu,Debian,ESXi,XenServer,FreeBSD,Fedora,ArchLinux,Rocky,AlmaLinux,OpenEuler,RedHat,其他) |
| list[].ip_num | int | - | IP数量 |
| list[].dedicate_ip | string | - | 主IP |
| list[].assign_ip | string | - | 附加IP(英文逗号分隔) |
| list[].self_defined_field | object | - | 自定义字段值(键是自定义字段ID,值是填的内容) |
| list[].is_auto_renew | int | - | 是否自动续费(0=否,1=是) |
| count | int | - | 总条数 |
| using_count | int | - | 使用中产品数量 |
| expiring_count | int | - | 即将到期产品数量 |
| overdue_count | int | - | 已逾期产品数量 |
| deleted_count | int | - | 已删除产品数量 |
| all_count | int | - | 全部产品数量 |
| data_center[].country_id | int | - | 国家ID |
| data_center[].city | string | - | 城市 |
| data_center[].area | string | - | 区域 |
| data_center[].country_name | string | - | 国家 |
| data_center[].country_code | string | - | 国家代码 |
| self_defined_field[].id | int | - | 自定义字段ID |
| self_defined_field[].field_name | string | - | 自定义字段名称 |
| self_defined_field[].field_type | string | - | 字段类型(text=文本框,link=链接,password=密码,dropdown=下拉,tickbox=勾选框,textarea=文本区) |
获取自定义内容
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取自定义内容 |
| 接口地址 | /console/v1/remf_finance/:id/custom/content |
| 请求方式 | POST |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| type:int | .name:id | require:1 | other:desc:hostid | default: |
| type:string | .name:key | require:1 | other:desc:module_client_area里面的key:比如security_groups,setting | default: |
| type:string | .name:api_url | require:1 | other:desc:替换原来模板内的接口地址 | default: |
响应参数
| name | type | default | desc |
|---|---|---|---|
| - | html:html内容 | - | - |
执行自定义模块方块
| 项目 | 内容 |
|---|---|
| 接口描述 | 执行自定义模块方块 |
| 接口地址 | /console/v1/remf_finance/:id/custom |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| type:string | .name:func | require:1 | other:desc:执行的方法 | default: |
响应参数
| name | type | default | desc |
|---|---|---|---|
| [description] | [type] | - | - |
获取用量信息
| 项目 | 内容 |
|---|---|
| 接口地址 | /console/v1/remf_finance/:id/trafficusage |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| type:int | .name:id | require:1 | ID | desc:host |
| type:string | .name:start | require:0 | - | desc:开始日期(YYYY-MM-DD) |
| type:string | .name:end | require:0 | - | desc:结束日期(YYYY-MM-DD) |
响应参数
| name | type | default | desc |
|---|---|---|---|
| - | 0:流量数据@ | - | - |
其他文档字段
json
{
"time": "2020-07-12",
"description": "获取用量信息",
"0": "value:纵坐标值(单位Mbps)"
}获取快照信息
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取快照信息 |
| 接口地址 | /console/v1/remf_finance/:id/snapshot |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
创建快照
| 项目 | 内容 |
|---|---|
| 接口描述 | 创建快照 |
| 接口地址 | /console/v1/remf_finance/:id/snapshot |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| disk_id | int | - | required | 磁盘ID |
| name | string | - | required | 名称 |
响应参数
无
恢复快照
| 项目 | 内容 |
|---|---|
| 接口描述 | 恢复快照 |
| 接口地址 | /console/v1/remf_finance/:id/snapshot/restore |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| snapshot_id | int | - | required | 快照ID |
响应参数
无
删除快照
| 项目 | 内容 |
|---|---|
| 接口描述 | 删除快照 |
| 接口地址 | /console/v1/remf_finance/:id/snapshot/:snapshot_id |
| 请求方式 | DELETE |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| snapshot_id | int | - | required | 快照ID |
响应参数
无
获取备份信息
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取备份信息 |
| 接口地址 | /console/v1/remf_finance/:id/backup |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
创建备份
| 项目 | 内容 |
|---|---|
| 接口描述 | 创建备份 |
| 接口地址 | /console/v1/remf_finance/:id/backup |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| name | string | - | required | 备份名称 |
响应参数
无
恢复备份
| 项目 | 内容 |
|---|---|
| 接口描述 | 恢复备份 |
| 接口地址 | /console/v1/remf_finance/:id/backup/restore |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| backup_id | int | - | required | 备份ID |
响应参数
无
删除备份
| 项目 | 内容 |
|---|---|
| 接口描述 | 删除备份 |
| 接口地址 | /console/v1/remf_finance/:id/backup/:backup_id |
| 请求方式 | DELETE |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
| backup_id | int | - | required | 备份ID |
响应参数
无
远程信息
| 项目 | 内容 |
|---|---|
| 接口描述 | 远程信息 |
| 接口地址 | /console/v1/remf_finance/:id/remote_info |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
退出救援
| 项目 | 内容 |
|---|---|
| 接口描述 | 退出救援 |
| 接口地址 | /console/v1/remf_finance/:id/exit_rescue |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
磁盘
| 项目 | 内容 |
|---|---|
| 接口描述 | 磁盘 |
| 接口地址 | /console/v1/remf_finance/:id/disk |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
日志
| 项目 | 内容 |
|---|---|
| 接口描述 | 日志 |
| 接口地址 | /console/v1/remf_finance/:id/log |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
流量
| 项目 | 内容 |
|---|---|
| 接口描述 | 流量 |
| 接口地址 | /console/v1/remf_finance/:id/flow |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | required | 产品ID |
响应参数
无
升降级配置页面
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级配置页面 |
| 接口地址 | /console/v1/remf_finance/:id/upgrade_config |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| host | array | - | 配置数据 |
升降级配置计算价格
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级配置计算价格 |
| 接口地址 | /console/v1/remf_finance/:id/sync_upgrade_config_price |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| configoption | array | - | require | 配置信息 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| price | float | - | 价格 |
升降级配置结算
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级配置结算 |
| 接口地址 | /console/v1/remf_finance/:id/upgrade_config |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| customfield | object | - | - | 自定义字段 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| id | int | - | 订单ID |
升降级商品
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级商品 |
| 接口地址 | /console/v1/remf_finance/:id/upgrade_product |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| old_host | object | - | 原产品数据 |
| host | array | - | 可升降级的商品数组 |
| host[].pid | int | - | 商品ID |
| host[].host | string | - | 商品名称 |
| host[].cycle | array | - | 周期 |
| host[].cycle[].price | float | - | 价格 |
| host[].cycle[].billingcycle | string | - | 周期 |
| host[].cycle[].billingcycle_zh | string | - | 周期 |
升降级商品计算价格
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级商品计算价格 |
| 接口地址 | /console/v1/remf_finance/:id/sync_upgrade_product_price |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| product_id | int | - | require | 新商品ID |
| cycle | string | - | require | 周期,传billingcycle的值 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| price | float | - | 价格 |
升降级商品结算
| 项目 | 内容 |
|---|---|
| 接口描述 | 升降级商品结算 |
| 接口地址 | /console/v1/remf_finance/:id/upgrade_product |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| id | int | - | 订单ID |