Zonkvm财务系统对接接口文档

API - 系统间数据同步与业务操作接口

一、概述

本接口用于Zonkvm财务系统之间的数据同步与业务操作对接。通过统一的入口接收请求,根据 action 参数路由到对应的处理方法。

注意:所有接口均需通过权限验证,即提供有效的 appid(用户ID)和 appkey(API密钥)。

二、请求方式

POST /api/same/index

公共请求参数

参数名 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string 接口方法名(如 getzones, server_start 等)
guid string 数据标识,自动去除前缀(支持下划线格式)
其他参数 mixed 视接口而定 各 action 特有的参数
说明:请求数据以 POST 方式提交,Content-Type 为 application/x-www-form-urlencodedmultipart/form-data

三、响应格式

所有接口返回统一 JSON 格式:

{
    "code": 1,          // 状态码:1=成功,0=失败
    "msg": "success",   // 提示信息
    "data": {}          // 返回数据(可选)
    "url": "",          // 跳转地址(如有)
    "wait": 3           // 等待秒数
}

📋 四、公共查询接口

以下接口返回系统公共基础数据,适用于所有服务器业务类型。

1. 可用区数据

POST action = getzones

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getzones

返回字段说明

字段 类型 说明
status int 状态 0禁用 1正常
guid string 可用区GUID
name string 可用区名称
identityStatus int 强制实名认证 1:是 0:否
whiteListStatus int 强制提交白名单 1:是 0:否
sort int 排序

返回数据示例

{
    "code": 1,
    "data": [
        {
            "status": 1,
            "guid": "1696639073705350",
            "name": "德阳电信",
            "identityStatus": 1,
            "whiteListStatus": 0,
            "sort": 111
        },
        {
            "status": 0,
            "guid": "1698529778685045",
            "name": "眉山二区",
            "identityStatus": 1,
            "whiteListStatus": 0,
            "sort": 16
        }
    ]
}

2. 系统数据

POST action = getsystems

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getsystems

返回字段说明

字段 类型 说明
type_id int 操作系统类型ID(1Windows 2Linux等)
status int 状态 0禁用 1正常
guid string 系统GUID
name string 系统名称
login_name string 默认登录名称(administrator/root)
login_password string 默认登录密码
port string 远程登录端口
mirror_name string 镜像名称
cpu_limit int CPU最低限制(0为不限制)
ram_limit int 内存最低限制(0为不限制)
type string 支持的操作类型(create创建, install重装)
system_harddisk int 系统盘大小(GB)
support string 支持的业务类型(server云服务器, lease物理服务器, idc托管)
lines string 可用区GUID列表(JSON数组)
sort int 排序
create_time datetime 创建时间
update_time datetime 更新时间
type_name string 操作系统类型名称(如Windows、Linux)
zone_names string 可用区名称(多个用"、"分隔)

返回数据示例

{
    "code": 1,
    "data": [
        {
            "type_id": 1,
            "status": 1,
            "guid": "1659170726623836",
            "name": "2016 数据中心版 64位",
            "login_name": "administrator",
            "login_password": "***",
            "port": "23543",
            "mirror_name": "Win2016_40",
            "cpu_limit": 4,
            "ram_limit": 4,
            "type": "create,install",
            "system_harddisk": 40,
            "support": "server,lease,idc",
            "lines": "[\"1696639073705350\"]",
            "sort": 16,
            "create_time": "2022-07-30 14:45:26",
            "update_time": "2025-03-31 14:33:41",
            "type_name": "Windows",
            "zone_names": "德阳电信"
        },
        {
            "type_id": 2,
            "status": 1,
            "guid": "1659170791658716",
            "name": "CentOS 7.9 64位",
            "login_name": "root",
            "login_password": "***",
            "port": "23543",
            "mirror_name": "CentOS7.9_40",
            "cpu_limit": 0,
            "ram_limit": 0,
            "type": "create,install",
            "system_harddisk": 40,
            "sort": 10,
            "type_name": "Linux",
            "zone_names": "德阳电信"
        }
    ]
}

☁️ 五、云服务器接口

1. 线路数据

POST action = getlines

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getlines

返回字段说明

字段 类型 说明
guid string 线路GUID
line_guid string 可用区GUID
name string 线路名称
descript string 线路描述
introUrl string 机房介绍链接
buyStatus int 购买状态 1开放 0关闭
upgradeStatus int 升级状态 1开放 0关闭
renewStatus int 续费状态 1开放 0关闭
harddiskMinNum int 磁盘可挂载数量最小值
harddiskMaxNum int 磁盘可挂载数量最大值
harddiskMinSize int 磁盘最小容量(G)
harddiskMaxSize int 磁盘最大容量(G)
harddiskStep int 磁盘容量步长
harddiskPrice decimal 磁盘单价(元/1G)
harddisk_free_size int 赠送硬盘容量
bandwidthMinSize int 带宽最小值(M)
bandwidthMaxSize int 带宽最大值(M)
bandwidth_free_size int 赠送带宽(M)
bandwidth_in_type int 下行限制类型 1固定值 2对等阈值
bandwidth_in_value int 带宽下行限制值(M)
bandwidth6Price decimal 5-6M带宽价格(元/月)
bandwidth_stairs_price text 带宽阶梯价格JSON
defenseMinSize int 防御最小值(G)
defenseMaxSize int 防御最大值(G)
defenseFreeSize int 免费防御值(G)
defensePrice decimal 防御价格
months string 可购买月份数(1,2,3,6,12,24,36)
status int 状态 1启用 0禁用
markup decimal 销售折扣
discount text 折扣配置JSON
lines_product_type string 线路类型 1弹性 2套餐

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "1696808021765605",
            "line_guid": "1696639073705350",
            "name": "德阳电信",
            "descript": "电信西部工业装备数据中心,自动过白",
            "introUrl": "",
            "buyStatus": 1,
            "upgradeStatus": 1,
            "renewStatus": 1,
            "harddiskMinNum": 1,
            "harddiskMaxNum": 6,
            "harddiskMinSize": 0,
            "harddiskMaxSize": 1000,
            "harddiskStep": 10,
            "harddiskPrice": "0.50",
            "harddisk_free_size": 0,
            "bandwidthMinSize": 10,
            "bandwidthMaxSize": 300,
            "bandwidth_free_size": 10,
            "bandwidth_in_type": 1,
            "bandwidth_in_value": 10,
            "bandwidth6Price": "9.00",
            "bandwidth_stairs_price": "[]",
            "defenseMinSize": 5,
            "defenseMaxSize": 100,
            "defenseFreeSize": 5,
            "defensePrice": "0.00",
            "months": "1,2,3,4,5,6,7,8,9,12,24,36",
            "status": 1,
            "markup": "1.00",
            "discount": "[{\"month\":\"1\",\"discount\":\"1\"}]",
            "lines_product_type": "1"
        }
    ]
}

返回 server_linesopen_api = 1 的线路数据。

2. 套餐数据

POST action = getproduct

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getproduct

返回字段说明

字段 类型 说明
name string 套餐名称
cpu int CPU核心数
memory int 内存大小(GB)
systemdisk int 系统盘大小(GB)
harddisk int 数据盘大小(GB)
ipnum int IP数量
bandwidth int 带宽(Mbps)
defense int 防御值(G)
price decimal 套餐价格(元/月)
description string 产品描述
sort int 排序(数值越小越靠前)
status int 状态 0禁用 1正常
lines_guid string 所属线路GUID

返回数据示例

{
    "code": 1,
    "data": [
        {
            "name": "绍兴BGP- A型",
            "cpu": 4,
            "memory": 8,
            "systemdisk": 40,
            "harddisk": 100,
            "ipnum": 1,
            "bandwidth": 20,
            "defense": 100,
            "price": "168.00",
            "description": "采用华为防火墙,上层封UDP协议",
            "sort": 23,
            "status": 1,
            "lines_guid": "20250407014442321990"
        },
        {
            "name": "绍兴BGP- B型",
            "cpu": 8,
            "memory": 8,
            "systemdisk": 40,
            "harddisk": 100,
            "ipnum": 1,
            "bandwidth": 20,
            "defense": 100,
            "price": "208.00",
            "description": null,
            "sort": 22,
            "status": 1,
            "lines_guid": "20250407014442321990"
        }
    ]
}

3. 单个订单查询

POST action = getserver

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getserver
guid int 订单ID

返回字段说明

字段 类型 说明
id int 订单ID
client_user_id int 客户方用户ID
need_reset_vnc int 是否需要重置VNC
line_guid string 线路GUID
lineID int 线路ID
system_guid string 操作系统GUID
ip string IP地址
localIP string 内网IP
cpu int CPU核心数
memory int 内存大小(GB)
harddisks string 磁盘大小(逗号分隔)
bandwidth int 带宽(Mbps)
in_bandwidth string 下行带宽值
defense int 防御值(G)
loginName string 远程登录用户名
loginPassword string 登录密码
buyTime datetime 购买时间
endTime datetime 到期时间
orderStatus int 业务状态 -2已删除 -1已回收 0开通中 1正常 3已过期
runStatus int 运行状态 -2已锁定 -1已关机 1运行中
actStatus int 操作状态 0正常 3启动中 4关机中 5重启中
snapStatus int 快照状态 0正常 1快照中 2恢复中
vnc_port int VNC端口
share_type int 共享类型 0独享 1共享
login_port int 登录端口
share_ip string 共享业务时的公网IP:端口
append_ip text 附加IP列表JSON
securityPolicyList text 安全策略信息JSON
port text 端口转发记录JSON
api_type string API接口类型

返回数据示例

{
    "code": 1,
    "data": {
        "id": 1001,
        "client_user_id": 0,
        "need_reset_vnc": 0,
        "line_guid": "1696808021765605",
        "lineID": 26,
        "system_guid": "1659170726623836",
        "ip": "192.168.1.100",
        "localIP": "10.0.0.1",
        "cpu": 4,
        "memory": 8,
        "harddisks": "40",
        "bandwidth": 20,
        "in_bandwidth": "10",
        "defense": 10,
        "loginName": "root",
        "loginPassword": "***",
        "buyTime": "2025-01-01 10:00:00",
        "endTime": "2025-02-01 10:00:00",
        "orderStatus": 1,
        "runStatus": 1,
        "actStatus": 0,
        "snapStatus": 0,
        "vnc_port": 5900,
        "share_type": 0,
        "login_port": 23543,
        "in_bandwidth": "10",
        "share_ip": "",
        "localIP": "10.0.0.1",
        "append_ip": "[]",
        "securityPolicyList": "[]",
        "port": "[]",
        "api_type": "mofangyun"
    }
}

4. 批量订单查询

POST action = getservers

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getservers
page int 页码,每页100条

返回字段说明

字段 类型 说明
pages int 总页数
servers array 服务器订单列表(字段同getserver)

返回数据示例

{
    "code": 1,
    "data": {
        "pages": 3,
        "servers": [
            {
                "id": 1001,
                "client_user_id": 0,
                "need_reset_vnc": 0,
                "line_guid": "1696808021765605",
                "lineID": 26,
                "system_guid": "1659170726623836",
                "ip": "192.168.1.100",
                "cpu": 4,
                "memory": 8,
                "harddisks": "40",
                "bandwidth": 20,
                "defense": 10,
                "loginName": "root",
                "buyTime": "2025-01-01 10:00:00",
                "endTime": "2025-02-01 10:00:00",
                "orderStatus": 1,
                "runStatus": 1,
                "actStatus": 0,
                "api_type": "mofangyun"
            }
        ]
    }
}

5. 新业务开通 (obj_type=create_server)

POST action = create_order | obj_type = create_server

请求参数

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string create_order
obj_type string create_server
user_id int 客户用户ID
order_id string 客户订单号
content object JSON对象,包含以下子字段:
content.cpu int CPU核心数
content.ram int 内存大小(GB)
content.bandwidth int 带宽(Mbps)
content.harddisksValues string 硬盘数据,格式如 "40,80"(逗号分隔多块硬盘大小GB)
content.defense int 防御值(G)
content.ip_num int IP数量,默认1
content.months int 购买月数,默认1
content.number int 购买数量,默认1
content.renew_auto int 是否自动续费,默认0
content.loginPassword string 登录密码,不传则自动生成
line_guid string 线路GUID
system_guid string 系统GUID

说明:content 字段为一个完整的 JSON 对象,需整体传入,如上表所示。示例:{"cpu":4,"ram":8,"bandwidth":10,"harddisksValues":"40,80","defense":5,"ip_num":1}

6. 开机

POST action = server_start
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_start
guid int 订单ID

7. 关机

POST action = server_stop
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_stop
guid int 订单ID

8. 重启

POST action = server_restart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_restart
guid int 订单ID

9. 重装系统

POST action = server_install
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_install
guid int 订单ID
systemID string 系统GUID
password string 新密码

10. 升级

POST action = server_upgrade
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_upgrade
guid int 订单ID
cpu int 新CPU(不低于原值)
memory int 新内存GB
bandwidth int 新带宽Mbps
defense int 新防御G
harddisks string 新硬盘(逗号分隔)

11. 续费

POST action = server_renew
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_renew
guid int 订单ID
renewLength int 续费月数
client_order_id string 客户方订单号
client_user_id int 客户方用户ID

12. 终端管理(VNC)

POST action = server_getvncurl
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_getvncurl
guid int 订单ID

13. 重置密码

POST action = server_setpsw
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_setpsw
guid int 订单ID
password string 新密码

14. 重置VNC密码

POST action = server_setvnc
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_setvnc
guid int 订单ID
password string 新VNC密码

15. 流量图

POST action = get_server_chart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string get_server_chart
guid int 订单ID
start_time string 开始时间(毫秒级时间戳)
end_time string 结束时间(毫秒级时间戳)

返回字段说明

字段 类型 说明
date array 时间点列表,如 ["2026-05-25 10:00","2026-05-25 10:05",...]
in array 入流量数据列表(bps),与date一一对应
out array 出流量数据列表(bps),与date一一对应
start_time string 查询开始时间
end_time string 查询结束时间
unit string 流量单位,固定为 bps

返回数据示例

{
    "code": 1,
    "msg": "获取成功",
    "data": {
        "date": ["2026-05-25 10:00","2026-05-25 10:05","2026-05-25 10:10"],
        "in": [1024000, 1536000, 972000],
        "out": [512000, 768000, 486000],
        "start_time": "2026-05-25 10:00",
        "end_time": "2026-05-25 11:00",
        "unit": "bps"
    }
}

16. 安全组列表

POST action = get_security_policy
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string get_security_policy
guid int 订单ID

返回字段说明

字段 类型 说明
id int 安全组ID
product_id int 关联产品ID
guid string 安全组GUID
name string 安全组规则名称
weight int 优先级顺序(数值越小优先级越高)
direction string 方向:Inbound(入方向)、Outbound(出方向)
protocol string 协议:tcp、udp、icmp
action string 行为:allow(允许)、deny(拒绝)
remote_ip string 授权IP地址或IP段
local_port string 本地端口
service_type string 业务类型(server等)
status int 状态
create_time datetime 创建时间

返回数据示例

{
    "code": 1,
    "msg": "获取成功",
    "data": [
        {
            "id": 1,
            "product_id": 123,
            "guid": "SP202605250001",
            "name": "允许HTTP访问",
            "weight": 100,
            "direction": "Inbound",
            "protocol": "tcp",
            "action": "allow",
            "remote_ip": "0.0.0.0/0",
            "local_port": "80",
            "service_type": "server",
            "status": 1,
            "create_time": "2026-05-25 10:00:00"
        }
    ]
}

17. 创建安全组

POST action = server_add_hardpolicy
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_add_hardpolicy
guid int 订单ID
name string 规则名称
weight int 权重
direction string Inbound/Outbound
operation string allow/deny
protocol string tcp/udp/icmp
remote_ip string 授权IP
local_port string 端口

18. 删除安全组

POST action = server_del_hardpolicy
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_del_hardpolicy
guid int 订单ID
policy_guid string 安全组GUID

19. 退款

POST action = server_refund
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string server_refund
guid int 订单ID

🖥️ 六、物理服务器接口

1. 物理机线路数据

POST action = lease_lines
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_lines

返回字段说明

字段 类型 说明
guid string 线路GUID
line_guid string 可用区GUID
status int 状态 1启用 0禁用
name string 线路名称
descript string 线路描述
buy_status int 购买状态
renew_status int 续费状态
upgrade_status int 升级状态
bandwidth_price decimal 带宽价格(元/M/月)
ip_price decimal IP价格(元/月)
defense_price string 防御价格(元/G/月)
months string 可购买月份数
retention_days int 到期保留天数
discount1 decimal 满一年折扣
discount2 decimal 满两年折扣
discount3 decimal 满三年折扣

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "1661580261164386",
            "line_guid": "1696639073705350",
            "status": 1,
            "name": "德阳电信",
            "descript": "德阳电信高防,全网互通,单机600G防护",
            "intro_url": "",
            "buy_status": 1,
            "renew_status": 1,
            "upgrade_status": 1,
            "defense_status": 1,
            "buy_order_max_num": 20,
            "life_time": 4464,
            "bandwidth_share_size": 0,
            "bandwidth_share_price": "0.00",
            "bandwidth_price": "16.00",
            "bandwidth_stairs_price": "[]",
            "bandwidth_max_size": 1000,
            "ip_price": "100.00",
            "ip_min_size": 1,
            "ip_max_size": 100,
            "ip_free_size": 1,
            "ip_num_list": "1,4,8,16,32,64",
            "defense_price": "0.00",
            "defense_max_size": 600,
            "defense_num_list": "100,200,300,400,500,600",
            "defense_step": 100,
            "release_hour": 48,
            "months": "1,2,3,4,5,6,7,8,9,12,24,36",
            "ip_upgrade_type": "1",
            "user_vnc": 1,
            "retention_days": 7,
            "bandwidth_in_type": 1,
            "bandwidth_in_value": 30,
            "discount1": "1.00",
            "discount2": "1.00",
            "discount3": "1.00",
            "bandwidth_step": 10,
            "ip_bandwidth_rate": "0"
        }
    ]
}

2. 物理机硬盘数据

POST action = lease_harddisk
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_harddisk

返回字段说明

字段 类型 说明
guid string 硬盘GUID
type string 磁盘类型(SSD/HDD/SATA/SAS)
size int 硬盘大小(GB)
status int 状态 1显示 0隐藏
{
    "code":1,
    "data":[
        {
            "guid":"1658944863134013",
            "type":"SSD",
            "size":500,
            "status":1
        }
    ]
}

3. 物理机型数据

POST action = lease_product
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_product

返回字段说明

字段 类型 说明
product_type string 机型类型(local自产/zkeys/niaoyun)
guid string 机型GUID
name string 机型名称
line_guid string 线路GUID
cpu_value int CPU总核心数
cpu string CPU型号
cpu_num int CPU个数
memory string 内存型号
ipnum string IP数量
bandwidth int 带宽(Mbps)
defense int 防御值(G)
price decimal 月付价格(元)
size int 机箱尺寸(1=1U 2=2U)
status int 状态 0禁用 1正常
upgrade_status int 升级开关 0不支持 1支持
line_names string 线路名称(多个用"、"分隔)
{
    "code": 1,
    "data": [
        {
            "product_type": "local",
            "guid": "1721941250649658",
            "name": "基础型 24核16G(ESSD)",
            "line_guid": "20250409132657673528",
            "cpu_value": 24,
            "cpu": "E5-2620v2",
            "cpu_num": 2,
            "cpu_max_num": 2,
            "memory": "DDR3-ECC",
            "memory_num": 16,
            "memory_max_num": 128,
            "harddisk_guid": "HD202504001,HD202504002",
            "harddisk_max_num": 4,
            "system_partition_size": 40,
            "system_partition_support": "1",
            "raid_tips": "支持RAID0/1/5/10",
            "ipnum": "1",
            "bandwidth": 30,
            "defense": 100,
            "main_board": "Intel C602",
            "price": "550.00",
            "size": 1,
            "description": "入门级双路服务器",
            "status": 1,
            "upgrade_status": 1,
            "recommend_status": 0,
            "stock_type": 1,
            "cpu_threads": 24,
            "gpu": "",
            "line_names": "浙江专线二区"
        }
    ]
}

4. 单个物理机查询

POST action = getlease
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getlease
guid int 订单ID

返回字段说明

字段 类型 说明
id int 订单ID
product_guid string 机型GUID
line_guid string 线路GUID
name string 服务器名称
size int 机型尺寸 1=1U 2=2U
cabinet_sn string 机柜ID
main_board string 主机型号
cpu_value int CPU总核心数
cpu string CPU型号
cpu_num int CPU个数
memory string 内存型号
memory_num int 内存数量(GB)
bandwidth int 带宽(Mbps)
defense int 防御值(G)
ipnum int IP数量
login_name string 登录用户名
login_password string 登录密码
system_port string 远程端口
buy_time datetime 购买时间
end_time datetime 到期时间
order_status int 订单状态 0开通中 1正常 3已过期 -2已删除
run_status int 运行状态 -2已锁定 -1已关机 1运行中
act_status int 操作状态 0无操作 1重启中 2重装中 3密码重设中
ip text IP信息集合JSON
api_type string API接口类型

返回数据示例

{
    "code": 1,
    "data": {
        "id": 1,
        "product_guid": "20250408030033590712",
        "line_guid": "20250409132657673528",
        "name": "物理服务器-001",
        "size": 1,
        "cabinet_sn": "A-01-05",
        "main_board": "Intel S2600CW",
        "cpu_value": 32,
        "cpu": "Intel Xeon Silver 4214R",
        "cpu_num": 2,
        "cpu_max_num": 2,
        "memory": "DDR4 32G",
        "memory_num": 64,
        "memory_max_num": 512,
        "harddisk_guid": "HD202504001,HD202504002",
        "harddisk_max_num": 4,
        "raid_tips": "RAID1+0",
        "bandwidth": 100,
        "defense": 10,
        "ipnum": 1,
        "system_guid": "1659170791658716",
        "login_name": "root",
        "login_password": "***",
        "system_port": "23543",
        "buy_time": "2026-05-01 10:00:00",
        "start_time": "2026-05-01 12:00:00",
        "end_time": "2026-06-01 12:00:00",
        "order_status": 1,
        "run_status": 1,
        "act_status": 0,
        "ip": "[{\"ip\":\"192.168.1.100\",\"subnet\":\"255.255.255.0\",\"gateway\":\"192.168.1.1\"}]",
        "api_type": "mofang"
    }
}

5. 批量物理机查询

POST action = lease_orders
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_orders
page int 页码

返回字段说明

字段 类型 说明
pages int 总页数
servers array 物理机列表(字段同getlease)

返回数据示例

{
    "code": 1,
    "data": {
        "pages": 3,
        "servers": [
            {
                "id": 1,
                "product_guid": "20250408030033590712",
                "line_guid": "20250409132657673528",
                "name": "物理服务器-001",
                "size": 1,
                "cabinet_sn": "A-01-05",
                "main_board": "Intel S2600CW",
                "cpu_value": 32,
                "cpu": "Intel Xeon Silver 4214R",
                "cpu_num": 2,
                "memory": "DDR4 32G",
                "memory_num": 64,
                "bandwidth": 100,
                "defense": 10,
                "ipnum": 1,
                "login_name": "root",
                "system_port": "23543",
                "buy_time": "2026-05-01 10:00:00",
                "end_time": "2026-06-01 12:00:00",
                "order_status": 1,
                "run_status": 1,
                "act_status": 0,
                "ip": "[{\"ip\":\"192.168.1.100\"}]",
                "api_type": "mofang"
            }
        ]
    }
}

6. 新租用开通 (obj_type=create_lease)

POST action = create_order | obj_type = create_lease
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string create_order
obj_type string create_lease
user_id int 客户用户ID
order_id string 客户订单号
content object JSON对象,包含以下子字段:
content.bandwidth int 带宽(Mbps)
content.defense int 防御值(G)
content.ip_num int IP数量,默认1
content.months int 购买月数,默认1
content.number int 购买数量,默认1
content.renew_auto int 是否自动续费,默认0
content.loginPassword string 登录密码,不传则自动生成
line_guid string 线路GUID
product_guid string 机型GUID
system_guid string 系统GUID

说明:content 字段为一个完整的 JSON 对象,需整体传入。示例:{"bandwidth":100,"defense":10,"ip_num":1}

7. 开机

POST action = lease_start
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_start
guid int 订单ID

8. 关机

POST action = lease_stop
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_stop
guid int 订单ID

9. 重启

POST action = lease_restart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_restart
guid int 订单ID

10. 重装系统

POST action = lease_install
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_install
guid int 订单ID
systemID string 系统GUID
port int 系统端口
password string 新密码
system_partition string 分区类型
system_partition_size int 分区大小GB
install_reason string 重装原因

11. 重置密码

POST action = lease_setpsw
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_setpsw
guid int 订单ID
password string 新密码

12. 升级

POST action = lease_upgrade
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_upgrade
guid int 订单ID
ipnumAdd int IP增加数量
bandwidthAdd int 带宽增加量
defenseAdd int 防御增加量
client_order_id string 客户方订单号
client_user_id int 客户方用户ID

13. 续费

POST action = lease_renew
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_renew
guid int 订单ID
months int 续费月数
client_order_id string 客户方订单号
client_user_id int 客户方用户ID

14. 终端管理(VNC)

POST action = lease_getvncurl
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_getvncurl
guid int 订单ID

15. 流量图

POST action = get_lease_chart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string get_lease_chart
guid int 订单ID
start_time string 开始时间(毫秒级时间戳)
end_time string 结束时间(毫秒级时间戳)

返回字段说明

字段 类型 说明
date array 时间点列表,如 ["2026-05-25 10:00","2026-05-25 10:05",...]
in array 入流量数据列表(bps),与date一一对应
out array 出流量数据列表(bps),与date一一对应
start_time string 查询开始时间
end_time string 查询结束时间
unit string 流量单位,固定为 bps

返回数据示例

{
    "code": 1,
    "msg": "获取成功",
    "data": {
        "date": ["2026-05-25 10:00","2026-05-25 10:05","2026-05-25 10:10"],
        "in": [2048000, 3072000, 1944000],
        "out": [1024000, 1536000, 972000],
        "start_time": "2026-05-25 10:00",
        "end_time": "2026-05-25 11:00",
        "unit": "bps"
    }
}

16. 退款

POST action = lease_refund
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string lease_refund
guid int 订单ID
🏢 服务器托管(IDC)子接口

17. 托管线路数据

POST action = idc_lines
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_lines

返回字段说明

字段 类型 说明
guid string 线路GUID
line_guid string 可用区GUID
status int 状态 0禁用 1正常
name string 线路名称
descript string 线路描述
bandwidth_price decimal 带宽基础价格(元/M/月)
bandwidth_stairs_price text 带宽阶梯价格JSON
bandwidth_max_size int 带宽最大可选值(Mbps)
ip_price decimal IP单价(元/个/月)
ip_min_size int IP最少购买数量
ip_max_size int IP最多购买数量
ip_free_size int 免费IP数量
ip_num_list string 可选IP数量列表(逗号分隔)
defense_price string 防御价格(元/G/月)
defense_max_size int 防御最大可选值(G)
defense_num_list string 可选防御值列表(逗号分隔)
defense_step int 防御递增步长(G)
months string 可购买月份数(逗号分隔)
retention_days int 到期保留天数
discount1 decimal 12个月折扣(0~1)
discount2 decimal 24个月折扣(0~1)
discount3 decimal 36个月折扣(0~1)
buy_status int 购买状态 0不可购买 1可购买
sort int 排序权重

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "20250409132657673520",
            "line_guid": "20250409132657673518",
            "status": 1,
            "name": "温州BGP",
            "descript": "温州BGP高防机房",
            "bandwidth_price": "10.00",
            "bandwidth_stairs_price": "[]",
            "bandwidth_max_size": 1000,
            "ip_price": "300.00",
            "ip_min_size": 1,
            "ip_max_size": 100,
            "ip_free_size": 1,
            "ip_num_list": "1,4,8,16,32,64",
            "defense_price": "0.00",
            "defense_max_size": 600,
            "defense_num_list": "100,200,300,400,500,600",
            "defense_step": 100,
            "months": "1,2,3,4,5,6,7,8,9,12,24,36",
            "retention_days": 7,
            "discount1": "0.00",
            "discount2": "0.00",
            "discount3": "0.00",
            "buy_status": 1,
            "sort": 0
        }
    ]
}

18. 托管产品数据

POST action = idc_product
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_product

返回字段说明

字段 类型 说明
product_type int 托管类型
guid string 产品GUID
name string 产品名称(1U/2U等)
line_guid string 线路GUID
power text 电力规格JSON
bandwidth int 带宽(Mbps)
defense int 防御值(G)
ipnum string IP数量
price decimal 月付价格(元)
status int 状态 0禁用 1正常
market_status int 库存状态 0售罄 1正常
line_names string 线路名称(多个用"、"分隔)
{
    "code":1,
    "data":[
        {
            "product_type":1,
            "guid":"20250409132727581219",
            "name":"1U",
            "line_guid":"20250409132657673520",
            "power":"[
                {
                    "name":"0.5A/220V",
                    "price":"0.00"
                }
            ]",
            "bandwidth":50,
            "defense":5,
            "ipnum":"1",
            "price":"800.00",
            "size":"1U",
            "description":"1U标准机架式服务器托管",
            "status":1,
            "market_status":1,
            "stock_type":1,
            "sort":0,
            "server_group":"",
            "line_names":"温州BGP"
        }
    ]
}

19. 单个托管订单查询

POST action = getidc
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getidc
guid int 订单ID

返回字段说明

字段 类型 说明
id int 订单ID
product_guid string 产品GUID
line_guid string 线路GUID
name string 服务器名称
product_type int 托管类型
size string 规格(1U/2U)
power string 电力规格
bandwidth int 带宽(Mbps)
defense int 防御值(G)
ipnum int IP数量
buy_time datetime 购买时间
end_time datetime 到期时间
order_status int 订单状态 0开通中 1正常 3已过期 -2已删除
run_status int 运行状态
act_status int 操作状态
ip text IP信息JSON
login_name string 登录用户名
login_password string 登录密码
api_type string API接口类型

返回数据示例

{
    "code": 1,
    "data": {
        "id": 1,
        "product_guid": "20250409132727581219",
        "line_guid": "20250409132657673520",
        "name": "托管服务器-001",
        "product_type": 1,
        "size": "1U",
        "power": "0.5A/220V",
        "bandwidth": 50,
        "defense": 10,
        "ipnum": 1,
        "buy_time": "2026-05-01 10:00:00",
        "start_time": "2026-05-01 14:00:00",
        "end_time": "2026-06-01 14:00:00",
        "order_status": 1,
        "run_status": 1,
        "act_status": 0,
        "ip": "[{\"ip\":\"192.168.2.100\",\"subnet\":\"255.255.255.0\",\"gateway\":\"192.168.2.1\"}]",
        "system_port": "23543",
        "login_name": "root",
        "login_password": "***",
        "api_type": "mofang"
    }
}

20. 批量托管订单查询

POST action = idc_orders
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_orders
page int 页码

返回字段说明

字段 类型 说明
pages int 总页数
servers array 托管订单列表(字段同getidc)

返回数据示例

{
    "code": 1,
    "data": {
        "pages": 2,
        "servers": [
            {
                "id": 1,
                "product_guid": "20250409132727581219",
                "line_guid": "20250409132657673520",
                "name": "托管服务器-001",
                "product_type": 1,
                "size": "1U",
                "power": "0.5A/220V",
                "bandwidth": 50,
                "defense": 10,
                "ipnum": 1,
                "buy_time": "2026-05-01 10:00:00",
                "end_time": "2026-06-01 14:00:00",
                "order_status": 1,
                "run_status": 1,
                "act_status": 0,
                "ip": "[{\"ip\":\"192.168.2.100\"}]",
                "login_name": "root",
                "system_port": "23543",
                "api_type": "mofang"
            }
        ]
    }
}

21. 新业务开通 (obj_type=create_idc)

POST action = create_order | obj_type = create_idc
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string create_order
obj_type string create_idc
user_id int 客户用户ID
order_id string 客户订单号
content object JSON对象,包含以下子字段:
content.bandwidth int 带宽(Mbps)
content.power string 电力规格
content.defense int 防御值(G)
content.ipnum int IP数量,默认1
content.months int 购买月数,默认1
content.number int 购买数量,默认1
content.renew_auto int 是否自动续费,默认0
line_guid string 线路GUID
product_guid string 产品GUID

说明:content 字段为一个完整的 JSON 对象,需整体传入。示例:{"bandwidth":100,"power":"0.5A/220V","defense":5,"ipnum":1}

22. 开机

POST action = idc_start
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_start
guid int 订单ID

23. 关机

POST action = idc_stop
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_stop
guid int 订单ID

24. 重启

POST action = idc_restart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_restart
guid int 订单ID

25. 重装系统

POST action = idc_install
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_install
guid int 订单ID
systemID string 系统GUID
port int 端口
password string 新密码
system_partition string 分区类型
system_partition_size int 分区大小GB
install_reason string 重装原因

26. 重置密码

POST action = idc_setpsw
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_setpsw
guid int 订单ID
password string 新密码

27. 升级

POST action = idc_upgrade
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_upgrade
guid int 订单ID
ipnumAdd int IP增加
bandwidthAdd int 带宽增加
defenseAdd int 防御增加

28. 续费

POST action = idc_renew
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_renew
guid int 订单ID
months int 续费月数

29. 退款

POST action = idc_refund
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_refund
guid int 订单ID

30. 终端管理(VNC)

POST action = idc_getvncurl
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string idc_getvncurl
guid int 订单ID

31. 流量图

POST action = get_idc_chart
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string get_idc_chart
guid int 订单ID
start_time string 开始时间(毫秒级时间戳)
end_time string 结束时间(毫秒级时间戳)

返回字段说明

字段 类型 说明
date array 时间点列表,如 ["2026-05-25 10:00","2026-05-25 10:05",...]
in array 入流量数据列表(bps),与date一一对应
out array 出流量数据列表(bps),与date一一对应
start_time string 查询开始时间
end_time string 查询结束时间
unit string 流量单位,固定为 bps

返回数据示例

{
    "code": 1,
    "msg": "操作成功",
    "data": {
        "date": ["2026-05-25 10:00","2026-05-25 10:05","2026-05-25 10:10"],
        "in": [3072000, 4608000, 2916000],
        "out": [1536000, 2304000, 1458000],
        "start_time": "2026-05-25 10:00",
        "end_time": "2026-05-25 11:00",
        "unit": "bps"
    }
}

🌐 七、虚拟主机接口

1. 线路数据

POST action = hosting_lines
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string hosting_lines

返回字段说明

字段 类型 说明
guid string 线路GUID
name string 主机名/线路名称
domain string 赠送域名
ip string 解析地址IP
status int 状态 0禁用 1正常
stock int 库存 0无货 1有货
descript string 线路描述
cname string 解析地址别名(CNAME)
sort int 排序权重
white int 是否白名单 0否 1是
renew int 续费状态 0不可续费 1可续费
retention_days int 到期保留天数

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "20250409132657673528",
            "name": "浙江专线二区",
            "domain": "jhgf.gyhost.cn",
            "ip": "61.164.174.128",
            "status": 1,
            "stock": 1,
            "descript": "浙江BGP多线虚拟主机线路",
            "cname": "jhgf.gyhost.cn",
            "sort": 0,
            "white": 0,
            "renew": 1,
            "retention_days": 30
        }
    ]
}

2. 产品数据

POST action = hosting_product
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string hosting_product

返回字段说明

字段 类型 说明
guid string 产品GUID
name string 套餐名称
lines_guid string 线路GUID列表(多个用逗号分隔)
desc string 简短描述
price decimal 月付价格(元)
months string 可购买月份数(逗号分隔)
discount text 多月优惠折扣JSON
disk int 网页空间大小(MB)
db int 数据库大小(MB)
domain int 可绑定域名数量
domainsub int 可绑定子域名数量
flow int 月流量(GB)
max_flow int 月流量上限(GB)
up_flow int 流量叠加包大小(GB/步长)
up_flow_price decimal 流量叠加包价格(元)
def int 默认配置标识
buy_limit int 购买数量限制
is_limit_rate int 是否限制速率 0不限 1限制
perserver int 每服务器限制数
perip int 每IP限制数
limit_rate int 速率限制值
timeout int 超时时间(秒)
sort int 排序权重
stock int 库存 0无货 1有货
status int 状态 0禁用 1正常
suggest int 推荐标识 0不推荐 1推荐
upgradation int 是否支持升级 0不支持 1支持
line_names string 线路名称(多个用"、"分隔)

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "20250408030033590712",
            "name": "防劫持IP空间-A型",
            "lines_guid": "20250409132657673528",
            "desc": "入门型虚拟主机",
            "price": "80.00",
            "months": "1,2,3,4,5,6,7,8,9,12,24,36",
            "discount": "[{\"month\":12,\"discount\":85},{\"month\":24,\"discount\":75}]",
            "disk": 200,
            "db": 100,
            "domain": 5,
            "domainsub": 10,
            "flow": 30,
            "max_flow": 100,
            "up_flow": 10,
            "up_flow_price": "5.00",
            "def": 1,
            "buy_limit": 0,
            "is_limit_rate": 0,
            "perserver": 0,
            "perip": 0,
            "limit_rate": 0,
            "timeout": 0,
            "sort": 0,
            "stock": 1,
            "status": 1,
            "suggest": 0,
            "upgradation": 1,
            "line_names": "浙江专线二区"
        }
    ]
}

3. 单个订单查询

POST action = gethosting
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string gethosting
guid int 订单ID

返回字段说明

字段 类型 说明
id int 订单ID
client_user_id int 客户用户ID
name string 主机名称
product_guid string 产品GUID
line_guid string 线路GUID
domain string 赠送域名
domain_list text 绑定域名列表JSON
path string 网站路径
use_disk int 已使用空间(MB)
disk int 总空间大小(MB)
db_size int 数据库大小(MB)
db_type string 数据库类型(mysql等)
db_code string 数据库编码(utf8、gbk等)
program string 程序语言(php等)
program_version string 语言版本(php81等)
analysis_url string 解析地址
use_flow int 已使用流量(MB)
flow int 总月流量(GB)
ftpport int FTP端口号
ftp_id int FTP用户ID
ftp_status int FTP状态 0禁用 1正常
ftp_name string FTP登录账号
ftp_password string FTP密码
buy_time datetime 购买时间
start_time datetime 开始时间
end_time datetime 到期时间
order_status int 订单状态 0开通中 1正常 3已过期 -2已删除
run_status int 运行状态 -1已停止 1运行中
remarks string 备注信息
renew_auto int 是否自动续费 0否 1是
renew_price decimal 续费价格(元)
buymonths int 购买月数

返回数据示例

{
    "code": 1,
    "data": {
        "id": 1,
        "client_user_id": 1001,
        "name": "test_hosting",
        "product_guid": "20250408030033590712",
        "line_guid": "20250409132657673528",
        "domain": "test.jhgf.gyhost.cn",
        "domain_list": "[\"test1.com\",\"test2.cn\"]",
        "path": "/www/wwwroot/test_hosting",
        "use_disk": 50,
        "disk": 200,
        "db_size": 100,
        "db_type": "mysql",
        "db_code": "utf8",
        "program": "php",
        "program_version": "php81",
        "analysis_url": "61.164.174.128",
        "use_flow": 512,
        "flow": 30,
        "ftpport": 21,
        "ftp_id": 10001,
        "ftp_status": 1,
        "ftp_name": "test_hosting",
        "ftp_password": "Abcd1234",
        "buy_time": "2026-05-01 10:00:00",
        "start_time": "2026-05-01 10:00:00",
        "end_time": "2026-06-01 10:00:00",
        "order_status": 1,
        "run_status": 1,
        "remarks": "",
        "renew_auto": 0,
        "renew_price": "80.00",
        "buymonths": 1
    }
}

4. 批量订单查询

POST action = hosting_orders
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string hosting_orders
page int 页码,从1开始,默认1

返回字段说明

字段 类型 说明
pages int 总页数
servers array 虚拟主机订单列表,每项字段同 gethosting 返回字段

返回数据示例

{
    "code": 1,
    "data": {
        "pages": 1,
        "servers": [
            {
                "id": 1,
                "client_user_id": 1001,
                "name": "test_hosting",
                "product_guid": "20250408030033590712",
                "line_guid": "20250409132657673528",
                "domain": "test.jhgf.gyhost.cn",
                "domain_list": "[\"test1.com\"]",
                "path": "/www/wwwroot/test_hosting",
                "use_disk": 50,
                "disk": 200,
                "db_size": 100,
                "db_type": "mysql",
                "db_code": "utf8",
                "program": "php",
                "program_version": "php81",
                "analysis_url": "61.164.174.128",
                "use_flow": 512,
                "flow": 30,
                "ftpport": 21,
                "ftp_id": 10001,
                "ftp_status": 1,
                "ftp_name": "test_hosting",
                "ftp_password": "Abcd1234",
                "buy_time": "2026-05-01 10:00:00",
                "start_time": "2026-05-01 10:00:00",
                "end_time": "2026-06-01 10:00:00",
                "order_status": 1,
                "run_status": 1,
                "remarks": "",
                "renew_auto": 0,
                "renew_price": "80.00",
                "buymonths": 1
            }
        ]
    }
}

5. 获取PHP版本

POST action = get_php_version

根据线路 GUID 获取该线路节点支持的 PHP 版本列表。

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string get_php_version
line_guid string 线路GUID(hosting_lines 表的 guid)

返回字段说明

字段 类型 说明
- array PHP版本列表,每项包含 name(版本名称,如 PHP 8.1)和 version(版本号,如 81)

返回数据示例

{
    "code": 1,
    "data": [
        {"name": "PHP 56", "version": "56"},
        {"name": "PHP 74", "version": "74"},
        {"name": "PHP 80", "version": "80"},
        {"name": "PHP 81", "version": "81"},
        {"name": "PHP 82", "version": "82"}
    ]
}

6. 新业务开通 (obj_type=create_hosting)

POST action = create_order | obj_type = create_hosting
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string create_order
obj_type string create_hosting
user_id int 客户用户ID
order_id string 客户订单号
content object JSON对象,包含以下子字段:
content.program string 程序语言类型(php、asp等)
content.program_version string 程序版本(如 php81、asp_net 等)
content.db string 数据库类型(mysql、sqlserver等)
content.code string 网站编码(utf8、gbk等)
content.flow int 月流量(GB),不传则使用产品默认值
content.months int 购买月数,默认1
content.number int 购买数量,默认1
content.renew_auto int 是否自动续费,默认0
prefix string FTP前缀
pwd string FTP密码
line_guid string 线路GUID
product_guid string 产品GUID

说明:content 字段为一个完整的 JSON 对象,需整体传入。示例:{"program":"php","program_version":"php81","db":"mysql","code":"utf8"}

7. 查询软件信息

POST action = hosting_get_soft_find

查询虚拟主机站点可用的软件/工具地址,如 phpMyAdmin 数据库管理工具的访问链接。

参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string hosting_get_soft_find
line_guid string 线路GUID(hosting_lines 表的 guid),用于定位节点
sNname string 软件名称,如 phpmyadmin

返回字段说明

字段 类型 说明
ext object 扩展信息,包含 url(软件/工具访问地址)等

返回数据示例

{
    "code": 1,
    "data": {
        "ext": {
            "url": "https://panel.example.com/phpmyadmin_abc123/index.php"
        }
    }
}

8. 主机业务操作

入口:POST action = hosting_operate,所有子操作共用以下公共参数 + 各自的专用参数:

公共参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string hosting_operate
guid int 虚拟主机订单ID
operate string 操作类型(见下方各子操作)

📦 基础操作

operate=hosting_stop 停用站点(暂停主机运行),无需额外参数
operate=hosting_start 启用站点(恢复主机运行),无需额外参数
operate=hosting_edit_name 修改主机名称,额外:name必填 — 新的主机名称
operate=hosting_edit_pwd 修改FTP密码,额外:ftp_password必填 — 新的FTP登录密码
operate=hosting_set_php_version 设置PHP版本,额外:version必填 — PHP版本号(如 php81、php74 等)

🛡️ 安全相关

operate=hosting_get_security 获取安全配置(防盗链设置)
返回字段说明:
字段 类型 说明
domains string/array 允许访问的域名白名单,多个用换行或逗号分隔
fix string 防盗链文件后缀,如 .jpg|.png|.gif|.mp4
status int 防盗链状态 0关闭 1开启
http_status string 阻断HTTP状态码,如 403、404 等(Linux系统专用)
none string 阻断HTTP状态码(Windows系统专用)
返回数据示例:
{
    "code": 1,
    "msg": "获取成功",
    "data": {
        "domains": "test.com\ntest2.com",
        "fix": ".jpg|.png|.gif|.mp4|.wmv|.avi|.doc|.pdf|.xls|.rar|.zip|.mp3",
        "status": 1,
        "http_status": "403",
        "none": "403"
    }
}
operate=hosting_set_security 设置安全配置(防盗链)
参数说明:
参数 类型 必填 说明
fix string 防盗链文件后缀,格式如 .jpg|.png|.gif,多个用 | 分隔
domains string 允许访问的域名白名单,多个域名用换行(\n)分隔
statusSecurity int 防盗链状态 0关闭 1开启
http_status string 阻断时返回的HTTP状态码,如 403、404 等

🌐 站点管理

operate=hosting_get_index 获取站点默认首页/配置
参数说明:
参数 类型 必填 说明
name string 插件/功能名称,如 get_index、get_site_config_byname
s string 子操作标识,支持:get_index(获取站点首页信息)、get_site_config_byname(获取站点WAF配置)
返回字段说明:
s取值 返回字段 说明
get_index siteName 站点域名
get_index index 默认首页文件名
get_index runPath 网站运行目录
get_site_config_byname cc CC防护配置信息
get_site_config_byname user_agent User-Agent拦截规则
get_site_config_byname retry 攻击拦截次数配置
返回数据示例(s=get_index):
{
    "code": 1,
    "data": {
        "siteName": "test.jhgf.gyhost.cn",
        "index": "index.html,index.php",
        "runPath": "/"
    }
}
返回数据示例(s=get_site_config_byname):
{
    "code": 1,
    "data": {
        "cc": {"status": 1, "mode": "hard"},
        "user_agent": {"status": 1},
        "retry": {"status": 1, "count": 300}
    }
}
operate=hosting_set_site_status 设置站点状态(防篡改/WAF开关)
参数说明:
参数 类型 必填 说明
name string 插件功能名称;支持 set_site_status(防篡改)、set_site_obj_open(WAF功能开关)
s string 子操作标识,与 name 对应
status int 目标状态:1开启 0关闭
obj string 可选 WAF功能对象名。当 s=set_site_obj_open 时必填,支持:readonly(护网模式)、cdn、spider_status、scan_open、drop_china、drop_abroad、cookie、user-agent、get、file_upload、rce_injection、xss_injection、sql_injection、cc 等
operate=hosting_set_site_cc_conf 设置WAF防火墙CC防护配置
参数说明:
参数 类型 必填 说明
post object JSON对象,包含以下子字段:
post.name string 插件功能名称
post.s string 子操作标识
post.cc_mode int CC防护模式(0=标准 1=增强 2=严格)
post.cycle int 统计周期(秒)
post.limit int 周期内访问次数限制
post.endtime int 封禁时间(秒)
post.is_open_global int 是否全局模式:0关闭 1开启
post.increase int 周期内访问次数递增步长
post.increase_wu_heng int 无痕浏览递增步长
post.cc_increase_type int 递增类型
post.cc_type_status int CC类型状态
post.is_cc_url int 是否CC拦截URL:0否 1是
post.cc_ip_max object IP最大连接数配置,如 {"open":1,"ip_max":50,"static":0}
operate=hosting_set_site_retry 设置WAF攻击拦截次数
参数说明:
参数 类型 必填 说明
post object JSON对象,包含以下子字段:
post.name string 插件功能名称
post.s string 子操作标识
post.retry int 周期内允许的最大攻击次数
post.retry_time int 超过次数后封禁时间(秒)
post.retry_cycle int 统计周期(秒)
operate=hosting_get_site_total_list_custom 获取站点监控统计报表
参数说明:
参数 类型 必填 说明
part_type string 统计类型,如 site_total(站点统计)、visit_total(访问统计)等
start_date string 开始日期,格式 Y-m-d
end_date string 结束日期,格式 Y-m-d
返回字段说明:
字段 类型 说明
list array 统计数据列表,每项包含时间点和对应数值
total int 总记录数
返回数据示例:
{
    "code": 1,
    "msg": "获取成功",
    "data": {
        "list": [
            {"time": "2026-05-25 00:00", "count": 150},
            {"time": "2026-05-25 01:00", "count": 230},
            {"time": "2026-05-25 02:00", "count": 180}
        ],
        "total": 24
    }
}

🔄 代理相关

operate=hosting_get_proxy_list 获取代理列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {
            "id": "1",
            "sitename": "test.jhgf.gyhost.cn",
            "proxyname": "myproxy",
            "cache": 1,
            "cachetime": 24,
            "proxydir": "/api",
            "proxysite": "https://api.example.com",
            "todomain": "api.example.com",
            "advanced": 1,
            "type": 1,
            "subfilter": "[]"
        }
    ]
}
operate=hosting_create_proxy 创建代理
参数:proxyData必填 — JSON对象,包含以下子字段:
字段 类型 必填 说明
proxyData.cache int 是否缓存:0关闭 1开启
proxyData.proxyname string 代理名称(唯一标识)
proxyData.cachetime int 缓存时长(小时)
proxyData.proxydir string 代理目录,如 /api
proxyData.proxysite string 反代目标URL,如 https://api.example.com
proxyData.todomain string 目标域名(源站域名)
proxyData.advanced int 高级功能-开启代理目录:0关闭 1开启
proxyData.subfilter string 文本替换规则JSON,如 [{"sub1":"旧文本","sub2":"新文本"}]
proxyData.type int 开启或关闭:0关闭 1开启
operate=hosting_modify_proxy 修改代理
参数:proxyData必填 — JSON对象,字段同创建代理
operate=hosting_delete_proxy 删除代理
参数:proxyname必填 — 代理名称
operate=hosting_get_proxy_file 获取代理配置文件内容
参数:proxyname必填 — 代理名称 返回数据示例:
{
    "code": 1,
    "data": {
        "content": "#PROXY-START myproxy\nlocation /api {\n    proxy_pass https://api.example.com;\n    proxy_set_header Host api.example.com;\n}\n#PROXY-END myproxy",
        "status": true
    }
}

↪️ 重定向管理

operate=hosting_get_redirect_list 获取重定向规则列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {
            "id": "1",
            "sitename": "test.jhgf.gyhost.cn",
            "redirectname": "redirect_1",
            "redirectdomain": ["old-domain.com"],
            "redirectpath": "/old-path",
            "redirecttype": 1,
            "type": 1,
            "domainorpath": "domain",
            "holdpath": 0,
            "tourl": "https://new-domain.com"
        }
    ]
}
operate=hosting_create_redirect 创建重定向规则
参数:post必填 — JSON对象:
字段 类型 必填 说明
post.redirectdomain string 匹配域名(逗号分隔多个)
post.redirectpath string 匹配路径(domainorpath=path时有效)
post.redirecttype int 重定向类型:0=正向代理 301=永久重定向 302=临时重定向
post.type int 状态:0关闭 1开启
post.domainorpath string 匹配模式:domain(按域名)或 path(按路径)
post.holdpath int 是否保留路径:0不保留 1保留
post.tourl string 目标URL,如 https://new-domain.com
operate=hosting_modify_redirect 修改重定向规则
参数:post必填 — JSON对象,字段同创建重定向,额外增加:
字段 类型 必填 说明
post.redirectname string 重定向名称(用于定位要修改的规则)
post.topath string 可选 目标路径(路径重定向时使用)
post.errorpage int 可选 自定义错误页面:0关闭 1开启
operate=hosting_delete_redirect 删除重定向规则
参数:redirectname必填 — 重定向名称
operate=hosting_get_redirect_file 获取重定向配置文件内容
参数:redirectname必填 — 重定向名称
operate=hosting_save_redirect_file 保存重定向配置文件
参数说明:
参数 类型 必填 说明
path string 文件保存路径(规则名或完整路径)
text string 文件内容(重定向配置内容)

🌍 域名管理

operate=hosting_domain_list 获取已绑定域名列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {
            "id": "1",
            "pid": "1",
            "name": "test.jhgf.gyhost.cn",
            "port": "80",
            "addtime": "2024-01-01 00:00:00"
        },
        {
            "id": "2",
            "pid": "1",
            "name": "www.example.com",
            "port": "443",
            "addtime": "2024-01-02 00:00:00"
        }
    ]
}
operate=hosting_add_domain 添加域名绑定
参数说明:
参数 类型 必填 说明
domainText string 要添加的域名,多个用换行符\n分隔;格式:域名:端口,80端口可省略端口
operate=hosting_del_domain 删除域名绑定
参数说明:
参数 类型 必填 说明
name string 要删除的域名
port string 域名端口号,如 80、443

💾 备份管理

operate=hosting_backup_list 获取备份列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {
            "id": "1",
            "pid": "1",
            "type": "0",
            "name": "backup_20240101.tar.gz",
            "filename": "www_test_jhgf_20240101.tar.gz",
            "size": "1048576",
            "addtime": "2024-01-01 00:00:00"
        }
    ]
}
operate=hosting_to_backup 创建备份
无需额外参数 — 触发执行网站全量备份
operate=hosting_del_backup 删除备份
参数说明:
参数 类型 必填 说明
guid string 备份记录ID(备份列表中的id字段值)

🔒 SSL管理

operate=hosting_get_ssl 获取SSL证书配置信息
无需额外参数 返回字段说明:
字段 类型 说明
status bool SSL是否已部署
startDate string 证书生效日期
endDate string 证书到期日期
issuer string 证书颁发者
dns array 证书包含的域名列表
返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "startDate": "2024-01-01",
        "endDate": "2025-01-01",
        "issuer": "Let's Encrypt",
        "dns": ["test.jhgf.gyhost.cn"]
    }
}
operate=hosting_set_ssl 部署SSL证书
参数说明:
参数 类型 必填 说明
type int 证书类型
key string SSL私钥内容(-----BEGIN PRIVATE KEY----- ...)
csr string SSL证书内容(PEM格式,-----BEGIN CERTIFICATE----- ...)
operate=hosting_unset_ssl 取消SSL证书
参数说明:
参数 类型 必填 说明
name string 证书名称(用于IIS未识别证书部署)
password string 证书密码
operate=hosting_http_to_https 开启HTTP强制跳转HTTPS
无需额外参数 — 将HTTP请求301重定向到HTTPS
operate=hosting_close_to_https 关闭HTTPS跳转(恢复HTTP访问)
无需额外参数 — 取消HTTP到HTTPS的强制跳转
operate=hosting_close_ssl_conf 关闭SSL配置
无需额外参数 — 移除站点的SSL监听配置
operate=hosting_get_iis_ssl_bydomain 按域名查询IIS SSL状态
无需额外参数 — 仅IIS环境有效,返回SSL状态及证书信息
operate=hosting_get_iis_ssl_file_list 获取IIS SSL证书文件列表
无需额外参数 — 仅IIS环境有效,返回可用的证书文件列表
operate=hosting_set_domain_iis_byfile 通过文件设置域名IIS SSL
参数说明:
参数 类型 必填 说明
domain string 域名(纯域名,不含http://)
path string 证书文件(.pfx/.p12)在服务器上的完整路径

📂 目录/文件管理

operate=hosting_get_dir_binding 获取域名绑定二级目录信息
无需额外参数
operate=hosting_get_dir_user_ini_switch 获取防跨站/日志/密码访问开关状态
无需额外参数 返回字段说明:
字段 类型 说明
userini string 三项配置状态(防跨站、日志、密码访问),JSON字符串
返回数据示例:
{
    "code": 1,
    "msg": "获取成功",
    "data": {
        "userini": "{\"open_basedir\":1,\"log_access\":0,\"password_access\":0}"
    }
}
operate=hosting_get_user_ini 获取用户自定义INI配置内容
无需额外参数 — 返回防跨站等三项配置的详细状态
operate=hosting_set_dir_user_ini 设置防跨站开启/关闭
参数说明:
参数 类型 必填 说明
status int 状态:1开启防跨站 0关闭防跨站
operate=hosting_set_run_path 设置网站运行目录
参数说明:
参数 类型 必填 说明
runPath string 运行目录路径,如 /public、/web 等
operate=hosting_get_rewrite_list 获取预定义伪静态规则列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {"name": "thinkphp", "title": "ThinkPHP"},
        {"name": "laravel", "title": "Laravel"},
        {"name": "wordpress", "title": "WordPress"},
        {"name": "ecshop", "title": "ECShop"}
    ]
}
operate=hosting_get_file_body 获取伪静态文件内容
参数说明:
参数 类型 必填 说明
rewrite string 伪静态文件名(如 thinkphp、wordpress)或完整路径
path string 可选 自定义文件路径;不传则从内置规则模板或站点伪静态目录读取
operate=hosting_save_file_body 保存文件内容
参数说明:
参数 类型 必填 说明
file_type int 文件类型标识:0使用系统默认路径(/vhost/rewrite/) 1自定义完整路径
path string 文件保存路径;file_type=0时为规则名,file_type=1时为完整路径
text string 文件内容
operate=hosting_web_get_index 获取WEB默认首页设置
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": {
        "index": "index.html,index.php"
    }
}
operate=hosting_web_set_index 设置WEB默认首页
参数说明:
参数 类型 必填 说明
indexText string 首页文件名列表,多个用逗号分隔,优先级从前到后,如 index.html,index.php,default.html
operate=hosting_create_file 创建文件
参数说明:
参数 类型 必填 说明
path string 文件完整路径(含文件名),如 /www/wwwroot/test/index.html
operate=hosting_create_dir 创建目录
参数说明:
参数 类型 必填 说明
path string 目录完整路径,如 /www/wwwroot/test/newdir
operate=hosting_get_dir_new 获取目录文件列表
参数说明:
参数 类型 必填 说明
path string 目录路径,如 /www/wwwroot/test
返回数据示例:
{
    "code": 1,
    "data": [
        {
            "filename": "index.php",
            "type": "file",
            "size": "1024",
            "modify_time": "2024-01-01 00:00:00"
        },
        {
            "filename": "public",
            "type": "dir",
            "size": "4096",
            "modify_time": "2024-01-01 00:00:00"
        }
    ]
}
operate=hosting_get_dir_size 获取目录占用空间大小
参数说明:
参数 类型 必填 说明
path string 目录路径
operate=hosting_zip 压缩文件/目录
参数说明:
参数 类型 必填 说明
filename string 源文件/目录名(sfile参数,要压缩的文件或目录名)
path string 要压缩的路径(源文件所在目录)
z_type string 压缩类型,如 zip、tar.gz
dfile string 目标压缩包文件名(含路径)
operate=hosting_unzip 解压文件
参数说明:
参数 类型 必填 说明
path string 解压目标路径(sfile参数)
dfile string 压缩包文件路径
password string 解压密码(无密码传空字符串)
operate=hosting_delete_file 删除文件或目录
参数说明:
参数 类型 必填 说明
path string 要删除的文件或目录完整路径
operate=hosting_set_batch_data 批量删除/复制/剪切标记文件
参数说明:
参数 类型 必填 说明
path string 目录路径
type string 操作类型:Delete(删除)、Copy(复制标记)、Cut(剪切标记)
arr array 文件名数组,如 ["file1.txt","dir1"]
operate=hosting_mv_file 移动/重命名文件
参数说明:
参数 类型 必填 说明
sfile string 源文件完整路径
dfile string 目标文件完整路径
rename string 是否重命名:true(仅重命名,不移动目录) false(移动文件)
operate=hosting_check_exists_files 检查文件/目录是否存在
参数说明:
参数 类型 必填 说明
contents_path string 目标目录路径(BT接口dfile参数)
filename string 可选 要检查的文件名,不传则检查目录下所有文件
operate=hosting_paste_file 粘贴(复制/移动)文件
参数说明:
参数 类型 必填 说明
type string 操作类型:copy(复制) cut(剪切/移动)
sfile string 源文件完整路径(已通过set_batch_data标记过)
dfile string 目标目录路径
isOverride string 可选 是否覆盖已存在的文件:true覆盖 false跳过
operate=hosting_batch_paste 批量粘贴文件
参数说明:
参数 类型 必填 说明
contents_path string 目标路径(粘贴到哪个目录)
type string 操作类型:copy(复制) cut(剪切/移动)
skip string 要跳过的文件名(已存在不覆盖的文件名,逗号分隔)
operate=hosting_upload_files_exists 检查上传文件是否已存在
参数说明:
参数 类型 必填 说明
files array 文件名列表,如 ["file1.zip","file2.zip"]
operate=hosting_upload 上传文件分片
参数说明:
参数 类型 必填 说明
contents_path string 上传目标目录路径
start int 分片起始位置(字节),首次传0,续传传已上传大小
file file 文件数据(实际为上传文件流,通过HTTP multipart/form-data提交)

💼 业务操作

operate=hosting_refund 退款/删除主机(已到期直接删除,未到期计算剩余价值退还余额),无需额外参数
operate=hosting_resume_after_renew 续费后恢复主机(将已过期的主机恢复运行),无需额外参数
operate=hosting_renew 续费主机,额外:newEndTimeStr必填 — 新到期时间(Y-m-d H:i:s格式) renewLength可选 — 续费月数(不传则从时间差自动推算) coupon_id可选 — 优惠券ID
operate=hosting_upgrade 升级主机,额外:flow可选 — 升级月流量(GB) new_product_guid可选 — 升级目标产品GUID coupon_id可选 — 优惠券ID
注:flow和new_product_guid至少传一个,同时传时先处理流量升级再处理规格升级
operate=hosting_add_database 添加赠送数据库,额外:db_password必填 — 数据库密码 db_type可选 — 数据库类型(默认mysql)

🗄️ 八、云数据库接口

1. 产品数据

POST action = sql_product
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string sql_product

返回字段说明

字段 类型 说明
guid string 产品GUID
name string 产品名称
lines_guid string 线路GUID列表(多个用逗号分隔)
desc string 产品描述
price decimal 月付价格(元)
months string 可购买月份数(逗号分隔)
discount text 优惠折扣JSON
db int 数据库大小(MB)
buy_limit int 购买数量限制
timeout int 超时时间(秒)
sort int 排序权重
stock int 库存 0无货 1有货
status int 状态 0禁用 1正常
suggest int 推荐标识 0不推荐 1推荐
upgradation int 是否支持升级 0不支持 1支持
line_names string 线路名称(多个用"、"分隔)

返回数据示例

{
    "code": 1,
    "data": [
        {
            "guid": "20250407053315151712",
            "name": "云数据库1G-A型",
            "lines_guid": "20250409132657673528",
            "desc": "入门型云数据库,适合小型网站",
            "price": "28.00",
            "months": "1,2,3,4,5,6,7,8,9,12,24,36",
            "discount": "[{\"month\":12,\"discount\":85},{\"month\":24,\"discount\":75}]",
            "db": 1000,
            "buy_limit": 0,
            "timeout": 0,
            "sort": 0,
            "stock": 1,
            "status": 1,
            "suggest": 0,
            "upgradation": 1,
            "line_names": "浙江专线二区"
        }
    ]
}

2. 单个订单查询

POST action = getsql
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string getsql
guid int 订单ID

返回字段说明

字段 类型 说明
id int 订单ID
client_user_id int 客户用户ID
hosting_id int 关联虚拟主机ID(独立数据库时为0)
name string 数据库名称
product_guid string 产品GUID
line_guid string 线路GUID
use_disk int 已使用空间(MB)
db_size int 数据库大小(MB)
db_type string 数据库类型(mysql等)
db_code string 数据库编码(utf8mb4等)
db_name string 数据库名称
db_user string 数据库用户名
db_password string 数据库密码
buy_time datetime 购买时间
start_time datetime 开始时间
end_time datetime 到期时间
order_status int 订单状态 0开通中 1正常 3已过期 -2已删除
run_status int 运行状态 -1已停止 1运行中
remarks string 备注信息
renew_auto int 是否自动续费 0否 1是
renew_price decimal 续费价格(元)
buymonths int 购买月数

返回数据示例

{
    "code": 1,
    "data": {
        "id": 1,
        "client_user_id": 1001,
        "hosting_id": 0,
        "name": "test_db",
        "product_guid": "20250407053315151712",
        "line_guid": "20250409132657673528",
        "use_disk": 100,
        "db_size": 1000,
        "db_type": "mysql",
        "db_code": "utf8mb4",
        "db_name": "test_db",
        "db_user": "test_db_user",
        "db_password": "DbPwd1234",
        "buy_time": "2026-05-01 10:00:00",
        "start_time": "2026-05-01 10:00:00",
        "end_time": "2026-06-01 10:00:00",
        "order_status": 1,
        "run_status": 1,
        "remarks": "",
        "renew_auto": 0,
        "renew_price": "28.00",
        "buymonths": 1
    }
}

3. 批量订单查询

POST action = sql_orders
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string sql_orders
page int 页码,从1开始,默认1

返回字段说明

字段 类型 说明
pages int 总页数
servers array 数据库订单列表,每项字段同 getsql 返回字段

返回数据示例

{
    "code": 1,
    "data": {
        "pages": 1,
        "servers": [
            {
                "id": 1,
                "client_user_id": 1001,
                "hosting_id": 0,
                "name": "test_db",
                "product_guid": "20250407053315151712",
                "line_guid": "20250409132657673528",
                "use_disk": 100,
                "db_size": 1000,
                "db_type": "mysql",
                "db_code": "utf8mb4",
                "db_name": "test_db",
                "db_user": "test_db_user",
                "db_password": "DbPwd1234",
                "buy_time": "2026-05-01 10:00:00",
                "start_time": "2026-05-01 10:00:00",
                "end_time": "2026-06-01 10:00:00",
                "order_status": 1,
                "run_status": 1,
                "remarks": "",
                "renew_auto": 0,
                "renew_price": "28.00",
                "buymonths": 1
            }
        ]
    }
}

4. 新业务开通 (obj_type=create_database)

POST action = create_order | obj_type = create_database
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string create_order
obj_type string create_database
user_id int 客户用户ID
order_id string 客户订单号
content object JSON对象,包含以下子字段:
content.db string 数据库大小(如 "1000" 表示1000MB)
content.code string 数据库编码(utf8mb4、utf8、gbk等)
content.months int 购买月数,默认1
content.number int 购买数量,默认1
content.renew_auto int 是否自动续费,默认0
prefix string 数据库前缀
pwd string 数据库密码
line_guid string 线路GUID
product_guid string 产品GUID

说明:content 字段为一个完整的 JSON 对象,需整体传入。示例:{"db":"1000","code":"utf8mb4"}

5. 数据库业务操作

POST action = sql_operate
参数 类型 必填 说明
appid string 用户ID
appkey string API密钥
action string sql_operate
guid int 数据库订单ID
operate string 操作类型(见下方各操作说明)

📝 基本信息管理

operate=sql_edit_name 修改数据库备注名称
参数说明:
参数 类型 必填 说明
name string 新的备注名称(仅更新本地数据库记录,不调用节点API)
operate=sql_reissue 重发数据库配置(重新创建数据库)
无需额外参数 — 根据已保存的创建参数在面板上重新创建数据库

🔐 访问权限管理

operate=sql_get_access 获取数据库访问权限
无需额外参数 返回字段说明:
字段 类型 说明
status bool 是否获取成功
msg string 当前访问权限描述,如 %(所有IP)、127.0.0.1(仅本地)或指定IP
返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "msg": "%"
    }
}
operate=sql_set_access 设置数据库访问权限
参数说明:
参数 类型 必填 说明
dataAccess string 访问权限类型:%(所有IP)、127.0.0.1(仅本地)、ip(指定IP列表)
access string 当 dataAccess=ip 时,填写允许访问的IP列表(多IP用换行符分隔)
address string 可选 允许访问的附加IP地址

🔑 密码管理

operate=sql_reset_password 重置数据库密码
参数说明:
参数 类型 必填 说明
password string 新密码

💾 备份管理

operate=sql_backup_list 获取数据库备份列表
无需额外参数 返回数据示例:
{
    "code": 1,
    "data": [
        {
            "id": "1",
            "pid": "1",
            "type": "1",
            "name": "db_test_20240101.sql.gz",
            "filename": "db_test_20240101_123456.sql.gz",
            "size": "204800",
            "addtime": "2024-01-01 00:00:00"
        }
    ]
}
operate=sql_to_backup 创建数据库备份
无需额外参数 — 触发面板执行数据库备份(最多保留3个备份,超出需先删除旧备份) 返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "msg": "备份中"
    }
}
operate=sql_del_backup 删除数据库备份
参数说明:
参数 类型 必填 说明
bak_guid int 备份记录ID(备份列表中的id字段)
operate=sql_get_backup_size 获取数据库备份进度
无需额外参数 — 返回当前备份操作的进度百分比 返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "msg": "75%"
    }
}
operate=sql_input_backup 导入数据库备份
参数说明:
参数 类型 必填 说明
file string 备份文件在服务器上的完整路径,如 /www/backup/database/db_test.sql.gz
返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "msg": "导入中"
    }
}
operate=sql_get_import_size 获取数据库导入进度
无需额外参数 — 返回当前导入操作的进度百分比 返回数据示例:
{
    "code": 1,
    "data": {
        "status": true,
        "msg": "50%"
    }
}

💼 业务操作

operate=sql_refund 退款/删除数据库(已到期直接删除,未到期计算剩余价值退还余额)
无需额外参数 — 自动计算退款金额,删除数据库资源
operate=sql_renew 续费数据库
参数说明:
参数 类型 必填 说明
newEndTimeStr string 新到期时间,格式 Y-m-d H:i:s
renewLength int 可选 续费月数(不传则从时间差自动推算)
coupon_id int 可选 优惠券ID
operate=sql_upgrade 升级数据库规格
参数说明:
参数 类型 必填 说明
new_product_guid string 升级目标产品GUID(sql_product 返回的 guid)
coupon_id int 可选 优惠券ID

📌 附录:错误码说明

返回 code 说明
1 请求成功,data 中包含返回数据
0 请求失败,msg 中包含错误描述

常见错误信息

错误信息 可能原因
缺少必要参数 未传递 appid/appkey/action 或某必填参数
权限不足 appid 或 appkey 错误,或用户未开通API权限
请求错误 action 方法不存在
该线路节点不存在或已下架 线路GUID无效或线路已下架
余额不足 用户余额+授信额度不足以支付
未找到产品记录 订单ID不存在或不属于该用户
产品超出可退款时间 已超过无理由退款期限

ZONKVM API接口文档 V2.0