跳转到主要内容
资源中心/云资源池/云主机相关接口
PUTVM Instance Operations起始版本 4.7.0同步需要认证

扁平合并云主机

扁平合并云主机

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

路径参数

请求参数

路径参数

  • uuidString必填

    资源的UUID,唯一标示该资源

请求体字段

  • flattenvminstanceObject必填

    flattenvminstance 请求体结构

    • fullString

      扁平合并云主机上所有云盘

    • dryRunString

      试运行,可用于预测数据用量

  • systemTagsString

    系统标签

  • userTagsString

    用户标签

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • successboolean必填

    操作是否成功。

  • inventoryVmInstanceInventory必填

    详情参考inventory

    • uuidString必填

      资源的UUID,唯一标示该资源

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • zoneUuidString必填

      区域UUID

    • clusterUuidString必填

      集群UUID

    • imageUuidString必填

      镜像UUID

    • hostUuidString必填

      物理机UUID

    • lastHostUuidString必填

      最近一次主机UUID。

    • instanceOfferingUuidString必填

      计算规格UUID

    • rootVolumeUuidString必填

      根云盘UUID

    • platformString必填

      平台。

    • architectureString必填

      暂无描述。

    • defaultL3NetworkUuidString必填

      暂无描述。

    • typeString必填

      类型。

    • hypervisorTypeString必填

      暂无描述。

    • memorySizeLong必填

      内存大小。

    • cpuNumInteger必填

      暂无描述。

    • cpuSpeedLong必填

      暂无描述。

    • allocatorStrategyString必填

      暂无描述。

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • stateString必填

      当前状态。

    • guestOsTypeString必填

      暂无描述。

    • vmNicsList必填

      详情参考vmNics

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        云主机UUID

      • l3NetworkUuidString必填

        三层网络UUID

      • ipString必填

        来源IP地址。

      • macString必填

        暂无描述。

      • hypervisorTypeString必填

        暂无描述。

      • netmaskString必填

        暂无描述。

      • gatewayString必填

        暂无描述。

      • metaDataString必填

        元数据。

      • ipVersionInteger必填

        IP版本。

      • driverTypeString必填

        暂无描述。

      • internalNameString必填

        内部名称。

      • deviceIdInteger必填

        设备ID。

      • typeString必填

        类型。

      • stateString必填

        网卡状态

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • usedIpsList必填

        详情参考usedIps

        • uuidString必填

          资源的UUID,唯一标示该资源

        • ipRangeUuidString必填

          IP段UUID

        • l3NetworkUuidString必填

          三层网络UUID

        • ipVersionInteger必填

          IP版本。

        • ipString必填

          来源IP地址。

        • netmaskString必填

          暂无描述。

        • gatewayString必填

          暂无描述。

        • usedForString必填

          已使用用于。

        • ipInLonglong必填

          暂无描述。

        • vmNicUuidString必填

          云主机网卡UUID

        • createDateTimestamp必填

          创建时间

        • lastOpDateTimestamp必填

          最后一次修改时间

    • allVolumesList必填

      详情参考allVolumes

      • uuidString必填

        资源的UUID,唯一标示该资源

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • primaryStorageUuidString必填

        主存储UUID

      • vmInstanceUuidString必填

        云主机UUID

      • diskOfferingUuidString必填

        云盘规格UUID

      • rootImageUuidString必填

        根镜像UUID。

      • installPathString必填

        安装路径。

      • typeString必填

        类型。

      • formatString必填

        数据格式或导出格式。

      • sizeLong必填

        返回记录数。

      • actualSizeLong必填

        实际大小。

      • deviceIdInteger必填

        设备ID。

      • stateString必填

        当前状态。

      • statusString必填

        状态信息。

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • isShareableBoolean必填

        是否可分享。

      • volumeQosString必填

        暂无描述。

      • lastDetachDateTimestamp必填

        最近一次detach时间。

      • lastVmInstanceUuidString必填

        最近一次云主机实例UUID。

    • vmCdRomsList必填

      详情参考vmCdRoms

      • uuidString必填

        资源的UUID,唯一标示该资源

      • vmInstanceUuidString必填

        云主机UUID

      • deviceIdInteger必填

        设备ID。

      • isoUuidString必填

        暂无描述。

      • isoInstallPathString必填

        iso安装路径。

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

  • errorErrorCode必填

    错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

请求地址

PUT/zstack/v1/vm-instances/{uuid}/actions

/zstack/v1/vm-instances/{uuid}/actions

操作 ID

FlattenVmInstance

永久链接

请求示例

curl -X PUT 'http://{host}/zstack/v1/vm-instances/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"flattenvminstance":{"full":"<full>","dryRun":"<dryRun>"},"systemTags":"<systemTags>","userTags":"<userTags>"}'

响应示例

200
{ "inventory": { "uuid": "ce09028b684c3eb78219f5e20bddc3d5", "name": "Test-VM", "description": "web server VM", "zoneUuid": "195b75808f5e334da0c35051b798605c", "clusterUuid": "9b24facbfe7e38d4a7959e15cb49932e", "imageUuid": "8cc2d322e48031a685dd7cf69bf69614", "hostUuid": "01dd8eacdf0b3b809f420fad019b4359", "lastHostUuid": "3462e6ec5e333d5f958c029bc9678610", "instanceOfferingUuid": "9b45c2c9d9323793a012be186db3dd5b", "rootVolumeUuid": "7197e64d225232a8947765e00de9b58c", "platform": "Linux", "defaultL3NetworkUuid": "9f1d4713936036fa905da008dc91311f", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "12dadcafdbe2331fa1b5048a86f262c9", "vmInstanceUuid": "ce09028b684c3eb78219f5e20bddc3d5", "usedIpUuid": "592c4dc8c1c83a5185488e3aded371b4", "l3NetworkUuid": "9f1d4713936036fa905da008dc91311f", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0, "state": "enable", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "7197e64d225232a8947765e00de9b58c", "name": "Root-Volume-For-VM-ce09028b684c3eb78219f5e20bddc3d5", "primaryStorageUuid": "a8c0be2045ef3d5eacd48a201bccf5b8", "vmInstanceUuid": "ce09028b684c3eb78219f5e20bddc3d5", "diskOfferingUuid": "a6eb081851d531b29f771c672c194dbd", "rootImageUuid": "8cc2d322e48031a685dd7cf69bf69614", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-7197e64d225232a8947765e00de9b58c/7197e64d225232a8947765e00de9b58c.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史