• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

CAS E0785 的RESTFul Web Services API的一点疑问

2024-11-26提问
  • 0关注
  • 0收藏,692浏览
粉丝:0人 关注:0人

问题描述:

CAS E0785 的RESTFul Web Services API 和 CAS Web 端的接口不是同一套吗?

执行“新建虚拟机”操作时,在浏览器控制台里看到是调用了"POST /cas/domain/add" 这个接口完成新增操作,但是在H3C_CAS-E0785版本API文档里,查询到的“新增虚拟机接口“是“POST /cas/casrs/vm/add”,两者的请求参数结构也不一致。

POST /cas/domain/add 请求参数示例:


  {

    "isEncrypt": false,

    "hostId": "1",

    "title": "Linux_WEB02",

    "description": "",

    "autoMigrate": 0,

    "system": 1,

    "vmView": {},

    "cpuSocket": 2,

    "cpuCore": 1,

    "memory": 1024,

    "cpu": 2,

    "memoryUnit": "GB",

    "autoMem": 0,

    "autoTools": false,

    "isStart": 0,

    "hugepage": false,

    "rdt": null,

    "networks": [

        {

            "vlan": null,

            "hotPluggable": true,

            "driverSwitch": true,

            "queues": 1,

            "queueSize": 1024,

            "mtu": 1500,

            "mtuMin": 1000,

            "ipAddr": "",

            "ipv6IpAddr": "",

            "driver": "vhost",

            "tcpCheckSum": true,

            "deviceModel": "virtio",

            "driverType": "",

            "vlanTrunkName": "",

            "vlanTrunkId": "",

            "profileId": 1,

            "profileName": "Default",

            "name": "why_switch",

            "vswitchId": 2,

            "mode": "veb"

        }

    ],

    "osVersion": "CentOS 6/7(64-bit)",

    "osBit": "x86_64",

    "cpuMode": "custom",

    "secretLevel": 1,

    "cpuMinRate": 10,

    "cpuMaxRate": 3800,

    "vmPriority": 1,

    "blkiotune": "300",

    "maxMemory": 7.5,

    "minMemory": 0,

    "limitMin": 1,

    "diskList": [

        {

            "targetBus": "virtio",

            "type": "file",

            "capacity": 10240,

            "diskUnit": "GB",

            "diskDevice": "disk",

            "driveType": "qcow2",

            "cache": "none",

            "realCapacity": 80,

            "selectDiskType": 0,

            "mode": 2,

            "clustersize": "262144",

            "diskMode": "subordinate",

            "diskIOMode": "native",

            "hotPluggable": true,

            "priority": 3,

            "diskFile": 0,

            "capacifyChange": false,

            "choosedImageEncrypted": false,

            "rbdExisted": false

        }

    ],

    "gpuList": [],

    "usbList": [],

    "netusbList": [],

    "pciList": [],

    "pciIndex": 0,

    "usbIndex": 0,

    "netusbIndex": 0,

    "cpuShares": "512",

    "cpuGurantee": 0,

    "enableIncreaseCPU": true,

    "cpuQuotaUnit": "MHz",

    "domainCpuGlobalQuota": false,

    "memoryLocked": 0,

    "memoryPriority": "0",

    "isClusterInSafeArea": false,

    "hostPoolId": 1,

    "clusterId": null,

    "maxCpuSocket": 4,

    "memoryInit": 1,

    "drive": "cirrus",

    "viewType": "vnc",

    "storages": [

        {

            "targetBus": "virtio",

            "type": "file",

            "capacity": 10240,

            "diskUnit": "GB",

            "diskDevice": "disk",

            "driveType": "qcow2",

            "cache": "none",

            "realCapacity": 80,

            "selectDiskType": 0,

            "mode": 2,

            "clustersize": "262144",

            "diskMode": "subordinate",

            "diskIOMode": "native",

            "hotPluggable": true,

            "priority": 3,

            "diskFile": 0,

            "capacifyChange": false,

            "choosedImageEncrypted": false,

            "rbdExisted": false

        },

        {

            "diskDevice": "floppy",

            "driveType": "autoVirtio"

        },

        {

            "diskDevice": "cdrom",

            "driveType": "imgFileName",

            "storeFile": ""

        }

    ],

    "devList": [],

    "watchdogAction": null,

    "vtpmVersion": null,

    "cpuModel": null

}

POST /cas/cars/vm/add 的请求示例:


{
    "name": "vmTest",
    "title": "虚机显示名称",
    "description": "这是一台测试虚拟机",
    "autoLoadVirtio": true,
    "hostId": 1,
    "clusterId": 1,
    "osBit": "x86_64",
    "enableHA": 1,
    "cpuFeature": false,
    "bootFirmware": 0,
    "hostPoolId": 1,
    "priority": 0,
    "autoMigrate": 0,
    "memory": 4096,
    "memoryInit": 4,
    "memoryUnit": "GB",
    "memoryBacking": 0,
    "memoryLimit": 1024,
    "memoryLimitUnit": "MB",
    "memoryPriority": 0,
    "autoMem": 0,
    "hugepage": false,
    "cpu": 1,
    "cpuSockets": 1,
    "cpuCores": 1,
    "cpuMax": 1,
    "formatEnable": 1,
    "maxCpuSocket": 2,
    "cpuMode": "custom",
    "cpuShares": 512,
    "blkiotune": 300,
    "imgFileName": "string",
    "imgFileType": "string",
    "system": 0,
    "osVersion": "Microsoft Windows Server 2019(64-bit)",
    "vmType": 1,
    "viewType": "vnc",
    "auto": 0,
    "bootingDevice": 1,
    "autoBooting": 0,
    "autoTools": 0,
    "cpuQuota": 1600,
    "cpuQuotaUnit": "MHz",
    "cpuGurantee": 0,
    "enableReduceCPU": false,
    "domainCpuGlobalQuota": false,
    "videoType": "Qxl",
    "vram": 64,
    "vgamem": 11,
    "gpuDev": {
      "resPoolId": 0,
      "resPool": "string",
      "businessTemId": 0,
      "deviceDriver": "vfio",
      "businessTem": "string",
      "count": 0,
      "shared": 0,
      "bus": "string",
      "producers": "string",
      "type": "string",
      "name": "string",
      "maxInstance": 0,
      "framebuffer": "string",
      "maxResolution": "string",
      "uuid": "string",
      "heads": 0
    },
    "bindcpuList": [
      {
        "vcpu": 1,
        "pcpu": [
          1
        ]
      }
    ],
    "network": [
      {
        "vsId": 1,
        "vsName": "vswitch0",
        "mtu": 1500,
        "profileId": 1,
        "mac": "0c:da:41:1d:19:d0",
        "ipAddr": "10.125.34.62",
        "deviceModel": "virtio",
        "isKernelAccelerated": 0,
        "queues": 1,
        "vsiMngId": "string",
        "vsiTypeId": "string",
        "vsiTypeVer": "string",
        "vsiIdFormat": "string",
        "address": "0000:07:09.0",
        "driverType": "VIFO",
        "ethName": "eth3",
        "vlan": 1,
        "securityGroupId": 1,
        "tcpCheckSum": "false"
      }
    ],
    "storage": [
      {
        "device": "disk",
        "storeFile": "/vms/images/test",
        "capacity": 1,
        "cacheType": "directsync",
        "targetBus": "virtio",
        "type": "file",
        "driveType": "qcow2",
        "mode": 2,
        "assignType": 1,
        "priority": 0,
        "poolName": "defaultpool",
        "clusterSize": 262144,
        "diskMode": "subordinate",
        "writeBytesSec": 0,
        "readBytesSec": 0,
        "writeIopsSec": 0,
        "readIopsSec": 0,
        "imgFileName": "string"
      }
    ],
    "usb": [
      {
        "controller": 2,
        "bus": 3,
        "device": 1,
        "devName": "usb_usb3",
        "vendorId": "0x1d6b",
        "vendor": "Linux 3.13.6 uhci_hcd",
        "productId": "0x0001",
        "product": "UHCI Host Controller"
      }
    ],
    "pci": [
      {
        "driver": "VFIO",
        "bus": 3,
        "slot": 0,
        "function": 2,
        "ethName": "eth2",
        "devName": "pci_0000_03_00_2",
        "vendorId": "0x14e4",
        "vendor": "Broadcom Corporation",
        "productId": "0x1657",
        "product": "NetXtreme BCM5719 Gigabit Ethernet PCIe"
      }
    ]
}

1 个回答
粉丝:32人 关注:1人

调用API接口的参数建议直接咨询二线,打400确认吧

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明