项目作者: ymx8383521

项目描述 :
django-restframework 的后端虚拟机增删改查的api接口提供
高级语言: Python
项目地址: git://github.com/ymx8383521/vm_api.git
创建时间: 2019-04-18T02:11:15Z
项目社区:https://github.com/ymx8383521/vm_api

开源协议:GNU General Public License v3.0

下载


数据库

  1. python3 manage.py makemigrations
  2. python3 manage.py migrate

创建超级用户

python3 manage.py createsuperuser

运行

python3 manage.py runserver 127.0.0.1:8000

填充数据

GET http://127.0.0.1:8000/admin

示例

GET http://127.0.0.1:8000/api/v1/host/?host_ip=172.25.10.10

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 1,
  8. "machine_name": "ji11",
  9. "room_name": "机房",
  10. "cpu": 64,
  11. "memory": 128,
  12. "host_ip": "172.25.10.10",
  13. "idrac_ip": "172.25.3.10",
  14. "host_mode": "DELL630",
  15. "host_active": "有可用资源",
  16. "physicaldisk": [
  17. {
  18. "disk_name": "datastore33",
  19. "disk_space": "3T"
  20. }
  21. ]
  22. }
  23. ]
  24. }