主题
DCIM代理(WHMCS)-前台
获取订购页面配置
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取订购页面配置 |
| 接口地址 | /console/v1/product/:id/rewhmcs_dcim/order_page |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| cycle | array | - | 周期 |
| pricing | object | - | 商品价格 |
| pricing.setupfee | string | - | 一次性初装费 |
| pricing.msetupfee | string | - | 月初装费 |
| pricing.qsetupfee | string | - | 季初装费 |
| pricing.ssetupfee | string | - | 半年初装费 |
| pricing.asetupfee | string | - | 年初装费 |
| pricing.bsetupfee | string | - | 两年初装费 |
| pricing.tsetupfee | string | - | 三年初装费 |
| pricing.onetime | string | - | 一次性 |
| pricing.monthly | string | - | 月付 |
| pricing.quarterly | string | - | 季付 |
| pricing.semiannually | string | - | 半年付 |
| pricing.annually | string | - | 年付 |
| pricing.biennially | string | - | 两年付 |
| pricing.triennially | string | - | 三年付 |
| configoption | array | - | 配置 |
| configoption[].id | int | - | 配置项ID |
| configoption[].optionname | string | - | 配置项名称 |
| configoption[].firstname | string | - | 配置项真实值 |
| configoption[].lastname | string | - | 配置项描述 |
| configoption[].optiontype | string | - | 配置项类型1下拉2单选3是否4数量 |
| configoption[].qtyminimum | int | - | 配置项最小值,类型为数量时才有 |
| configoption[].qtymaximum | int | - | 配置项最大值,类型为数量时才有 |
| configoption[].options | array | - | 配置子项 |
| configoption[].options[].id | int | - | 配置子项ID |
| configoption[].options[].optionname | string | - | 配置子项名称 |
| configoption[].options[].firstname | string | - | 配置子项真实值 |
| configoption[].options[].lastname | string | - | 配置子项描述 |
| configoption[].options[].currency | int | - | 货币 |
| configoption[].options[].setupfee | string | - | 一次性初装费 |
| configoption[].options[].msetupfee | string | - | 月初装费 |
| configoption[].options[].qsetupfee | string | - | 季初装费 |
| configoption[].options[].ssetupfee | string | - | 半年初装费 |
| configoption[].options[].asetupfee | string | - | 年初装费 |
| configoption[].options[].bsetupfee | string | - | 两年初装费 |
| configoption[].options[].tsetupfee | string | - | 三年初装费 |
| configoption[].options[].onetime | string | - | 一次性 |
| configoption[].options[].monthly | string | - | 月付 |
| configoption[].options[].quarterly | string | - | 季付 |
| configoption[].options[].semiannually | string | - | 半年付 |
| configoption[].options[].annually | string | - | 年付 |
| configoption[].options[].biennially | string | - | 两年付 |
| configoption[].options[].triennially | string | - | 三年付 |
| customfield | array | - | 自定义字段 |
| customfield[].id | int | - | 自定义字段ID |
| customfield[].fieldname | string | - | 自定义字段名称 |
| customfield[].fieldtype | string | - | 自定义字段类型text,textarea,tickbox,link,password,dropdown |
| customfield[].description | string | - | 自定义字段描述 |
| customfield[].fieldoptions | string | - | 自定义字段选项,以,分隔 |
| customfield[].regexpr | string | - | 自定义字段验证规则 |
| customfield[].required | string | - | 是否必填on是 |
获取升降级配置
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取升降级配置 |
| 接口地址 | /console/v1/product/:id/rewhmcs_dcim/upgrade_page |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| configoption | array | - | 配置 |
| configoption[].id | int | - | 配置项ID |
| configoption[].optionname | string | - | 配置项名称 |
| configoption[].firstname | string | - | 配置项真实值 |
| configoption[].lastname | string | - | 配置项描述 |
| configoption[].optiontype | string | - | 配置项类型1下拉2单选3是否4数量 |
| configoption[].qtyminimum | int | - | 配置项最小值,类型为数量时才有 |
| configoption[].qtymaximum | int | - | 配置项最大值,类型为数量时才有 |
| configoption[].options | array | - | 配置子项 |
| configoption[].options[].id | int | - | 配置子项ID |
| configoption[].options[].optionname | string | - | 配置子项名称 |
| configoption[].options[].firstname | string | - | 配置子项真实值 |
| configoption[].options[].lastname | string | - | 配置子项描述 |
| configoption[].options[].currency | int | - | 货币 |
获取操作系统列表
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取操作系统列表 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/image |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| os | array | - | 操作系统 |
| os[].id | string | - | 操作系统ID |
| os[].name | string | - | 操作系统名称 |
| config | array | - | 分区配置 |
| config[].id | string | - | 分区配置ID |
| config[].name | string | - | 分区配置名称 |
| config[].osname | string | - | 关联操作系统ID |
| scripts | array | - | 安装脚本 |
| scripts[].id | string | - | 安装脚本ID |
| scripts[].name | string | - | 安装脚本名称 |
| scripts[].osname | string | - | 关联操作系统ID |
获取商品配置所有周期价格
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取商品配置所有周期价格 |
| 接口地址 | /console/v1/product/:id/rewhmcs_dcim/duration |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 商品ID |
| configoptions | object | - | - | 配置项 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| [].name | string | - | 周期名称 |
| [].price | string | - | 周期总价 |
| [].discount | float | - | 折扣(0=没有折扣) |
产品列表
| 项目 | 内容 |
|---|---|
| 接口描述 | 产品列表 |
| 接口地址 | /console/v1/rewhmcs_dcim |
| 请求方式 | 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/rewhmcs_dcim/:id |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | - | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| serverid | int | - | 服务器ID |
| server | object | - | 服务器 |
| server.id | string | - | 服务器ID |
| server.wltag | string | - | 物理标签 |
| server.osname | string | - | 操作系统 |
| server.power | string | - | 电源状态 |
| server.power_msg | string | - | 电源状态描述 |
| server.osusername | string | - | 操作系统用户名 |
| server.ospassword | string | - | 操作系统密码 |
| server.crack_success_info | string | - | 破解密码信息 |
| server.crack_user | string | - | 破解用户 |
| server.default_user | string | - | 默认用户 |
| server.ippassword | string | - | 面板密码 |
| server.port | string | - | 端口 |
| server.main_ip | string | - | 主IP |
| server.configoptionsupgrade | string | - | 支持升降级0否1是 |
| ip | array | - | 附加IP |
| ip[].ipaddress | string | - | IP地址 |
| ip[].subnetmask | string | - | 子网掩码 |
| ip[].gateway | string | - | 网关 |
| configoptions | object | - | 当前配置 |
| configoptions.area.name | object | - | 配置area对应的名称 |
| configoptions.area.value | object | - | 配置area对应的值 |
| oldconfigoptions | object | - | 当前配置ID对应的值,例如 |
| customfields | object | - | 自定义字段 |
开机
| 项目 | 内容 |
|---|---|
| 接口描述 | 开机 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/on |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
关机
| 项目 | 内容 |
|---|---|
| 接口描述 | 关机 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/off |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
重启
| 项目 | 内容 |
|---|---|
| 接口描述 | 重启 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/reboot |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
批量操作
| 项目 | 内容 |
|---|---|
| 接口描述 | 批量操作 |
| 接口地址 | /console/v1/rewhmcs_dcim/batch_operate |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | array | - | require | 产品ID |
| action | string | - | require | 动作on开机off关机reboot重启 |
响应参数
无
获取控制台地址
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取控制台地址 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/vnc |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
无
响应参数
| name | type | default | desc |
|---|---|---|---|
| data.url | string | - | 控制台地址 |
控制台页面
| 项目 | 内容 |
|---|---|
| 接口描述 | 控制台页面 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/vnc |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
无
获取实例状态
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取实例状态 |
| 接口地址 | /console/v1/rewhmcs_dcim/: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/rewhmcs_dcim/:id/reset_password |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| password | string | - | require | 新密码 |
响应参数
无
救援模式
| 项目 | 内容 |
|---|---|
| 接口描述 | 救援模式 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/rescue |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| system | int | - | require | 指定救援系统类型(1=linux,2=windows) |
响应参数
无
重装系统
| 项目 | 内容 |
|---|---|
| 接口描述 | 重装系统 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/reinstall |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| mos | int | - | require | 镜像ID |
| password | string | - | require | 密码 |
| port | int | - | require | 端口 |
响应参数
无
获取图表数据
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取图表数据 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/chart |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| start_time | int | - | - | 开始秒级时间 |
| end_time | int | - | - | 结束秒级时间 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| in | object | - | 入方向流量,毫秒时间戳对应的流量,例如 |
| out | object | - | 出方向流量,毫秒时间戳对应的流量,例如 |
| in_info | object | - | 入方向流量信息 |
| in_info.max | int | - | 最大 |
| in_info.average | int | - | 平均 |
| in_info.last | int | - | 最新 |
| in_info.unit | string | - | 单位 |
| out_info | object | - | 出方向流量信息 |
| out_info.max | int | - | 最大 |
| out_info.average | int | - | 平均 |
| out_info.last | int | - | 最新 |
| out_info.unit | string | - | 单位 |
| start_time | int | - | 开始毫秒级时间 |
| end_time | int | - | 结束毫秒级时间 |
| y_max | int | - | Y轴最高值 |
| y_unit | int | - | Y轴单位 |
获取网络流量
| 项目 | 内容 |
|---|---|
| 接口描述 | 获取网络流量 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/flow |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
响应参数
| name | type | default | desc |
|---|---|---|---|
| total | string | -总流量 | - |
| used | string | -已用流量 | - |
| leave | string | - | 剩余流量 |
| reset_flow_date | string | - | 流量归零时间 |
日志
| 项目 | 内容 |
|---|---|
| 接口描述 | 日志 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/log |
| 请求方式 | GET |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | - | 产品ID |
| keywords | string | - | - | 关键字 |
| page | int | - | - | 页数 |
| limit | int | - | - | 每页条数 |
| orderby | string | - | id,description,create_time,ip | 排序 |
| sort | string | - | asc,desc | 升/降序 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| list | array | - | 系统日志 |
| list[].id | int | - | 系统日志ID |
| list[].description | string | - | 描述 |
| list[].create_time | string | - | 时间 |
| list[].ip | int | - | IP |
| count | int | - | 系统日志总数 |
计算产品配置升级价格
| 项目 | 内容 |
|---|---|
| 接口描述 | 计算产品配置升级价格 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/common_config |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| configoptions | object | - | require | 配置 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| price | string | - | 价格 |
| description | string | - | 生成的订单描述 |
生成产品配置升级订单
| 项目 | 内容 |
|---|---|
| 接口描述 | 生成产品配置升级订单 |
| 接口地址 | /console/v1/rewhmcs_dcim/:id/common_config/order |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
| name | type | default | validate | desc |
|---|---|---|---|---|
| id | int | - | require | 产品ID |
| configoptions | object | - | require | 配置 |
响应参数
| name | type | default | desc |
|---|---|---|---|
| data.id | string | - | 订单ID |
验证下单
| 项目 | 内容 |
|---|---|
| 接口描述 | 验证下单 |
| 接口地址 | /console/v1/product/:id/rewhmcs_dcim/validate_settle |
| 请求方式 | POST |
| 接口版本 | v1 |
请求参数
无
响应参数
无