🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 创建云主机 ~~~[api] post:http://www.tasiyun.com/api/virtual *users_id=1#用户ID *username=93666512#用户名 *areas_id=1#数据中心ID nodes_id=1#计算节点ID (可选,不传递系统将自动分配) *core=2#核心数 *cpu_mode=1#处理器模式(0显示,1隐藏) *memory=2048#内存(MB) sys_disk_mode=writeback #系统盘模式:writeback | writethrough | unsafe | directsync | none,(可选) sys_disk_iops=300#系统盘IOPS (可选) sys_disk_read=200#系统盘读取(可选) sys_disk_write=200#系统盘写入(可选) data_disk_mode=writeback #数据盘模式:writeback | writethrough | unsafe | directsync | none,(可选) *data_disk_size=20#数据盘大小(GB) data_disk_iops=300#数据盘IOPS(可选) data_disk_read=200#数据盘读取(可选) data_disk_write=200#数据盘写入(可选) *net_out=128#上行带宽(KB) *net_in=128#下行带宽(KB) *snapshoot=2#快照数 *backups=2#备份数 *templates_id=1#系统模版ID *sys_pwd=123456#系统密码(最少6位,最长32位) *vnc_pwd=123456#系统密码(最少6位,最长32位) *expire_time=2019-06-30 23:59:59#到期时间(必须是正确的时间格式) *ip_num=3#分配IP数 flow_limit=50#限制流量,上行+下行总数 GB(可选,不传递不限制)v2.0.6+ nat_acl_limit=5#转发策略限制条数(可选,建议节点开启NAT时,请传递)v2.0.6+ nat_web_limit=5#NAT建站限制数(可选,建议节点开启NAT时,请传递) v2.0.6+ priority=high#cpu优先级(low|medium|high) int:create_mode=0#创建模式(0:完整创建 1:链接创建) <<< success { "code": 0, "message": "创建成功", "data": { "id": 19, //ID "name": "ecs19", //名称 "nodes_id": 2, //计算节点 "ip_address_id": 3, //主公网IP的ID "public_ip": [ //分配的公网IP { "id": 3, //ID 此处ID和上方 "ip_address_id"的值一致,代表着该IP为主IP "ip_pools_id": 1, //IP池 "ip": "192.168.0.3", //IP "virtuals_id": 19, //云主机ID "created_at": "2019-06-08 15:58:35", "updated_at": "2019-06-08 20:10:55", "deleted_at": null }, { "id": 7, "ip_pools_id": 2, "ip": "192.168.1.2", "virtuals_id": 19, "created_at": "2019-06-08 16:07:49", "updated_at": "2019-06-08 20:10:55", "deleted_at": null }, { "id": 9, "ip_pools_id": 2, "ip": "192.168.1.4", "virtuals_id": 19, "created_at": "2019-06-08 16:07:49", "updated_at": "2019-06-08 20:10:55", "deleted_at": null } ], "private_ip": "10.0.51.47", "vnc_port": 22944, "mac": "00:DE:5B:D3:EC:F9", "uuid": "cadc5cb7-1a83-4b61-1594-dfc6f1ec434b" } } <<< error { "code": 1, "message": "创建失败" } ~~~