跳转到主要内容
计算管理/集群相关接口
POSTCluster Related Interfaces起始版本 0.6同步需要认证

新建集群

新建集群

调试可用性

在线调试

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

请求参数

请求体字段

  • paramsObject必填

    请求体参数结构

    • zoneUuidString必填

      数据中心UUID

    • nameString必填

      资源名称

    • descriptionString

      资源的详细描述

    • hypervisorTypeString必填

      虚拟机管理程序类型

    • typeString

      保留域, 请不要使用

    • resourceUuidString

      当reourceUuid不等于null, 虚拟化平台使用这个值作为被创建资源的UUID; 否则虚拟化平台会自动生成一个UUID

    • architectureString

      暂无描述。

    • tagUuidsList

      标签UUID。

  • systemTagsList

    系统标签

  • userTagsList

    用户标签

响应状态

200 OK

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

  • errorErrorCode必填

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

    • codeString必填

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

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

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

  • inventoryClusterInventory必填

    详情参考inventory

    • nameString必填

      资源名称

    • uuidString必填

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

    • descriptionString必填

      资源的详细描述

    • stateString必填

      集群状态

    • hypervisorTypeString必填

      虚拟机管理程序类型

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • zoneUuidString必填

      数据中心UUID

    • typeString必填

      保留域

请求地址

POST/zstack/v1/clusters

/zstack/v1/clusters

操作 ID

CreateCluster

永久链接

请求示例

curl -X POST 'http://{host}/zstack/v1/clusters' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"zoneUuid":"<zoneUuid>","name":"<name>","description":"<description>","hypervisorType":"<hypervisorType>","type":"<type>","resourceUuid":"<resourceUuid>","architecture":"<architecture>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

响应示例

200
{ "inventory": { "name": "cluster1", "uuid": "dc7442bb39674d779d688369329ba845", "description": "test", "state": "Enabled", "hypervisorType": "KVM", "createDate": "Jun 7, 2017 9:20:31 PM", "lastOpDate": "Jun 7, 2017 9:20:31 PM", "zoneUuid": "342b68c14869412984d6327a58b18f9b", "type": "zstack" } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史