跳转到主要内容
资源中心/裸金属管理(Plus)/裸金属管理相关接口

创建裸机实例

创建裸机实例

POST/zstack/v1/baremetal/instances

操作 ID

CreateBaremetalInstance

起始版本

2.6.0

执行模式

同步

认证信息

需要认证

认证信息

调用该 API 时需要在请求头中携带以下认证信息。

Authorizationstring必填

Bearer 令牌

X-Tenant-IDstring

X-Tenant-ID

请求参数

application/json

请求体字段

  • params
    Object必填

    请求体参数结构

    • name
      String必填

      资源名称

    • description
      String

      资源的详细描述

    • chassisUuid
      String必填

      裸机设备UUID

    • imageUuid
      String必填

      镜像UUID

    • templateUuid
      String

      预配置模板UUID

    • username
      String

      系统用户

    • password
      String

      系统密码

    • nicCfgs
      Map

      裸机网络配置

    • bondingCfgs
      Map

      网卡绑定配置

    • customConfigurations
      Map

      自定义变量

    • strategy
      String

      裸机实例创建策略

    • resourceUuid
      String

      资源UUID。若指定,则裸机实例会以该字段值作为UUID。

  • systemTags
    List

    系统标签

  • userTags
    List

    用户标签

响应状态

200 OK
200 OK

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

  • error
    ErrorCode必填

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

    • code
      String必填

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

    • description
      String必填

      错误的概要描述

    • details
      String必填

      错误的详细信息

    • elaboration
      String必填

      保留字段,默认为null

    • opaque
      LinkedHashMap必填

      保留字段,默认为null

    • cause
      ErrorCode必填

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

  • inventory
    BaremetalInstanceInventory必填

    详情参考inventory

    • uuid
      String必填

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

    • name
      String必填

      资源名称

    • description
      String必填

      资源的详细描述

    • zoneUuid
      String必填

      区域UUID

    • clusterUuid
      String必填

      集群UUID

    • pxeServerUuid
      String必填

      pxe服务器UUID。

    • chassisUuid
      String必填

      裸机设备UUID

    • imageUuid
      String必填

      镜像UUID

    • platform
      String必填

      系统平台

    • state
      String必填

      当前状态。

    • status
      String必填

      状态信息。

    • createDate
      Timestamp必填

      创建时间

    • lastOpDate
      Timestamp必填

      最后一次修改时间

    • bmNics
      List必填

      详情参考bmNics

      • uuid
        String必填

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

      • baremetalInstanceUuid
        String必填

        裸机实例UUID

      • l3NetworkUuid
        String必填

        三层网络UUID

      • mac
        String必填

        MAC地址

      • ip
        String必填

        IP地址

      • netmask
        String必填

        子网掩码

      • gateway
        String必填

        网关

      • metadata
        String必填

        附加元数据。

      • pxe
        Boolean必填

        是否PXE启动网卡

      • createDate
        Timestamp必填

        创建时间

      • lastOpDate
        Timestamp必填

        最后一次修改时间