[关闭]
@MatheMatrix 2017-06-19T14:02:21.000000Z 字数 1588 阅读 217

ZStack 云路由对接指南

ZStack 网络 云路由


bootstrap-info.json

以 vyos driver 为例,zstack 会通过 virtio serial 的方式向云路由注入下面的 bootstrap-info.json(具体参考 zstack-ctl/kvmagent 和 zstack-vyos/zvrboot 的代码)。

  1. {
  2. "additionalNics": [
  3. {
  4. "deviceName": "eth1",
  5. "gateway": "192.168.104.1",
  6. "ip": "192.168.104.1",
  7. "isDefaultRoute": false,
  8. "mac": "fa:74:e3:7e:b0:01",
  9. "netmask": "255.255.255.0"
  10. }
  11. ],
  12. "managementNic": {
  13. "deviceName": "eth0",
  14. "gateway": "100.64.201.1",
  15. "ip": "100.64.201.104",
  16. "isDefaultRoute": true,
  17. "mac": "fa:e4:1a:c1:cd:00",
  18. "netmask": "255.255.255.0"
  19. },
  20. "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcKCE3utraUks2vuek+JqQUkiJorRo8cgFFDS635Q2m4wqJKlWPe3IU4fq5eIRbFAk+K2+W4eMGZJYUnxN0Nm26+MxjkS1qOq+P6iJOTWrF7JPRsK/hPgt6zovHAoli9YHDHkeeO6MGecoMHWittddh6jFakWY9KEcbTdQPGlcjiMw0XDBjMj6iXSC4q8N62A0L8kRa0vE85sezJk+Z7dzeaAM5MioaPeNSP3ChXJZi0gjt2UJm/EfwO7CHt8Ay6RZFcRR3ldieiXtOtT5xPwGxE6pqv2PAuk/+Gk21Dibb4H7tBDqk9Lcn1RuE3XgsEE+FvTOeI8dw0tyEs68joGf root@172-20-14-15",
  21. "sshPort": 22,
  22. "vyosPassword": "vrouter12#"
  23. }

API

继续以 vyos driver 为例,后面会调用 /echo、/init 作为初始化的 API,以及 /ping 作为心跳的 API,其 API 格式如下:

URL 返回方式 调用参数(body) 返回值
/echo 同步 {"Host":"","callbackurl":"","taskuuid":""} 200 {"success":true,"error":""}
/init 异步 {"uuid":"557af1a07a3d4b88be1e55d0b90f6e3f","restartDnsmasqAfterNumberOfSIGUSER1":0} {"Host":"","callbackurl":"http://10.0.168.39:8080/zstack/asyncrest/callback","taskuuid":"09c4bc8c4b60496ea3b4e9ec6185e1e9"} 200 "",异步返回:POST {"success":true,"error":""}
/ping 异步 {"uuid":"557af1a07a3d4b88be1e55d0b90f6e3f"} {"Host":"","callbackurl":"http://10.0.168.39:8080/zstack/asyncrest/callback","taskuuid":"97e401115c0c4ee0b60543b147cad680"} 200 "",异步返回:POST {"uuid":"557af1a07a3d4b88be1e55d0b90f6e3f"}

image.png-92.1kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注