集群相关接口

新建集群(CreateCluster)

API请求

URLs
POST zstack/v1/clusters
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"zoneUuid": "d5629a75f0a24280ac669d93d38a7dcd",
"name": "cluster1",
"description": "test",
"hypervisorType": "KVM"
  },
"systemTags": [],
"userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"zoneUuid":"e1fb7d87073b397c857eaeeb16243103","name":"cluster1","description":"test","hypervisorType":"KVM"}}' \
http://localhost:8080/zstack/v1/clusters
参数列表
名字 类型 位置 描述 可选值 起始版本
zoneUuid String body(包含在params结构中) 数据中心UUID 0.6
name String body(包含在params结构中) 资源名称 0.6
description (可选) String body(包含在params结构中) 资源的详细描述 0.6
hypervisorType String body(包含在params结构中) 虚拟机管理程序类型
  • KVM
  • Simulator
4.0.0
type (可选) String body(包含在params结构中) 保留域, 请不要使用
  • zstack
0.6
resourceUuid (可选) String body(包含在params结构中)
  • 当reourceUuid不等于null, 虚拟化平台使用这个值作为被创建资源的UUID;
  • 否则虚拟化平台会自动生成一个UUID
0.6
architecture (可选) String body(包含在params结构中)
  • x86_64
  • aarch64
  • mips64el
4.0.0
tagUuids (可选) List body(包含在params结构中) 4.0.0
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

返回示例
{
"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"
  }
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventory ClusterInventory 详情参考inventory 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventory
名字 类型 描述 起始版本
name String 资源名称 0.6
uuid String 资源的UUID,唯一标示该资源 0.6
description String 资源的详细描述 0.6
state String 集群状态 0.6
hypervisorType String 虚拟机管理程序类型 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
zoneUuid String 数据中心UUID 0.6
type String 保留域 0.6

SDK示例

Java SDK
CreateClusterAction action = new CreateClusterAction();
action.zoneUuid = "70fd596da027478eb22ac9357aed23f4";
action.name = "cluster1";
action.description = "test";
action.hypervisorType = "KVM";
action.sessionId = "894477861bcc45488978b584908e4ee3";
CreateClusterAction.Result res = action.call();
Python SDK
CreateClusterAction action = CreateClusterAction()
action.zoneUuid = "cfe698802c87486986878daa2da7e02f"
action.name = "cluster1"
action.description = "test"
action.hypervisorType = "KVM"
action.sessionId = "0664130c5d36414bbb3a7a59ef87ea5a"
CreateClusterAction.Result res = action.call()

删除集群(DeleteCluster)

API请求

URLs
DELETE zstack/v1/clusters/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth d55b1a48ad2348ceb3bea95b407a8bde" \
-X DELETE http://localhost:8080/zstack/v1/clusters/a5bb7e5ca83f41748538d953709ba3c3?deleteMode=Permissive
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 0.6
deleteMode (可选) String body 删除模式 0.6
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

该API成功时返回一个空的JSON结构{},出错时返回的JSON结构包含一个error字段,例如:

{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK示例

Java SDK
DeleteClusterAction action = new DeleteClusterAction();
action.uuid = "51b6e91ce692487ea582418f52835061";
action.deleteMode = "Permissive";
action.sessionId = "41695ae924854a3abfc1e681e092f744";
DeleteClusterAction.Result res = action.call();
Python SDK
DeleteClusterAction action = DeleteClusterAction()
action.uuid = "2e9d94bbe3d240d3a660e86a7cd6aff8"
action.deleteMode = "Permissive"
action.sessionId = "386fba061d404eeb830a772e31fd4faf"
DeleteClusterAction.Result res = action.call()

查询集群(QueryCluster)

API请求

URLs
GET zstack/v1/clusters
GET zstack/v1/clusters/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 815c808ecfb5461b953544d4bcefea31" \
-X GET http://localhost:8080/zstack/v1/clusters?q=hypervisorType=KVM
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 663eef55906d4b6e9750f9b4ed65f5f9" \
-X GET http://localhost:8080/zstack/v1/clusters/a8d5ea1ceda34616a26bec2fce3b4d8a

可查询字段

运行CLI命令行工具,输入QueryCluster并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例
{
"inventories": [
    {
"name": "cluster1",
"uuid": "41f3a4eb130347a2af6d7f2e0d21fab0",
"description": "test",
"state": "Enabled",
"hypervisorType": "KVM",
"createDate": "Jun 7, 2017 9:20:13 PM",
"lastOpDate": "Jun 7, 2017 9:20:13 PM",
"zoneUuid": "aad01c8b25774796b2e341ec51a7c9c1",
"type": "zstack"
    }
  ]
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventories List 详情参考inventories 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventories
名字 类型 描述 起始版本
name String 资源名称 0.6
uuid String 资源的UUID,唯一标示该资源 0.6
description String 资源的详细描述 0.6
state String 集群状态 0.6
hypervisorType String 虚拟机管理程序类型 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
zoneUuid String 数据中心UUID 0.6
type String 保留域 0.6

SDK示例

Java SDK
QueryClusterAction action = new QueryClusterAction();
action.conditions = asList("hypervisorType=KVM");
action.sessionId = "3e214b652cc947ea9e1aa256d05752ea";
QueryClusterAction.Result res = action.call();
Python SDK
QueryClusterAction action = QueryClusterAction()
action.conditions = ["hypervisorType=KVM"]
action.sessionId = "ad8f3cd4b5bc4da0a3a91dc8bcbdd18c"
QueryClusterAction.Result res = action.call()

更新集群(UpdateCluster)

API请求

URLs
PUT zstack/v1/clusters/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateCluster": {
"name": "cluster1",
"description": "test"
  },
"systemTags": [],
"userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateCluster":{"name":"cluster1","description":"test"}}' \
http://localhost:8080/zstack/v1/clusters/851a3783e1503de2a1b9222014c843c4/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 0.6
name (可选) String body(包含在updateCluster结构中) 资源名称 0.6
description (可选) String body(包含在updateCluster结构中) 资源的详细描述 0.6
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

返回示例
{
"inventory": {
"name": "cluster1",
"uuid": "9dd0fbecb0e04260ad161c66d1da9f96",
"description": "test",
"state": "Enabled",
"hypervisorType": "KVM",
"createDate": "Jun 7, 2017 9:20:29 PM",
"lastOpDate": "Jun 7, 2017 9:20:29 PM",
"zoneUuid": "25b7ddce968f4cbbb58aa5a205e116ee",
"type": "zstack"
  }
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventory ClusterInventory 详情参考inventory 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventory
名字 类型 描述 起始版本
name String 资源名称 0.6
uuid String 资源的UUID,唯一标示该资源 0.6
description String 资源的详细描述 0.6
state String 集群状态 0.6
hypervisorType String 虚拟机管理程序类型 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
zoneUuid String 数据中心UUID 0.6
type String 保留域 0.6

SDK示例

Java SDK
UpdateClusterAction action = new UpdateClusterAction();
action.uuid = "ce185b26a4f14153941a868435d94498";
action.name = "cluster1";
action.description = "test";
action.sessionId = "5abfadbc97d64b4687ba6281de117d2d";
UpdateClusterAction.Result res = action.call();
Python SDK
UpdateClusterAction action = UpdateClusterAction()
action.uuid = "a643ba1b98524c60acced530ce2ded1b"
action.name = "cluster1"
action.description = "test"
action.sessionId = "cc779e5d5344493d9bd1cb1ced887321"
UpdateClusterAction.Result res = action.call()

更改集群可用状态(ChangeClusterState)

API请求

URLs
PUT zstack/v1/clusters/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid
Body
{
"changeClusterState": {
"stateEvent": "disable"
  },
"systemTags": [],
"userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeClusterState":{"stateEvent":"disable"}}' \
http://localhost:8080/zstack/v1/clusters/652ee5e996203bfbb5eb75e750720093/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 0.6
stateEvent String body(包含在changeClusterState结构中) 可用状态触发事件
  • enable
  • disable
0.6
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

返回示例
{
"inventory": {
"name": "cluster1",
"uuid": "2cebd4274c7c4550add1ee3620b52a81",
"description": "test",
"state": "Enabled",
"hypervisorType": "KVM",
"createDate": "Jun 7, 2017 9:20:25 PM",
"lastOpDate": "Jun 7, 2017 9:20:25 PM",
"zoneUuid": "90eb72b73e144650990db2aa1ddee7c1",
"type": "zstack"
  }
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 0.6
inventory ClusterInventory 详情参考inventory 0.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventory
名字 类型 描述 起始版本
name String 资源名称 0.6
uuid String 资源的UUID,唯一标示该资源 0.6
description String 资源的详细描述 0.6
state String 集群状态 0.6
hypervisorType String 虚拟机管理程序类型 0.6
createDate Timestamp 创建时间 0.6
lastOpDate Timestamp 最后一次修改时间 0.6
zoneUuid String 数据中心UUID 0.6
type String 保留域 0.6

SDK示例

Java SDK
ChangeClusterStateAction action = new ChangeClusterStateAction();
action.uuid = "b97eb5ab5e264edbad128090b0ac28c2";
action.stateEvent = "disable";
action.sessionId = "79368b716c6a4d5db37fc7c601bf14cc";
ChangeClusterStateAction.Result res = action.call();
Python SDK
ChangeClusterStateAction action = ChangeClusterStateAction()
action.uuid = "24f520e8991d464eaf2ed9b1e55996a3"
action.stateEvent = "disable"
action.sessionId = "11db5049d24342e7af8b1a3992484184"
ChangeClusterStateAction.Result res = action.call()

升级集群内主机的操作系统(UpdateClusterOS)

API请求

URLs
PUT zstack/v1/clusters/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateClusterOS": {
    "excludePackages": [
      "kernel",
      "systemd*"
    ],
    "updatePackages": [
      "zstack-release"
    ],
    "releaseVersion": "c74"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateClusterOS":{"excludePackages":["kernel","systemd*"],"updatePackages":["zstack-release"],"releaseVersion":"c74"}}' http://localhost:8080/zstack/v1/clusters/31c4951f39ae38969802e833448369ae/actions
参数列表
名字 类型 位置 描述 可选值 起始版本
uuid String url 资源的UUID,唯一标示该资源 2.3
excludePackages (可选) List body(包含在updateClusterOS结构中) 不升级的包列表 3.7.0
updatePackages (可选) List body(包含在updateClusterOS结构中) 要升级的包列表 3.7.0
releaseVersion (可选) String body(包含在updateClusterOS结构中) 升级所用源的版本 3.7.0
resourceUuid (可选) String body(包含在updateClusterOS结构中) 3.7.0
tagUuids (可选) List body(包含在updateClusterOS结构中) 标签UUID列表 3.7.0
systemTags (可选) List body 系统标签 2.3
userTags (可选) List body 用户标签 2.3

API返回

返回示例
{
  "inventory": {
    "uuid": "932696598b64375ea4ae6226cc0c1407"
  }
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 2.3
inventory LongJobInventory 详情参考inventory 2.2
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#inventory
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 2.2.4
name String 资源名称 2.2.4
description String 资源的详细描述 2.2.4
apiId String 用于关联TaskProgress的APIID 2.2.4
jobName String 任务名称 2.2.4
jobData String 任务数据 2.2.4
jobResult String 任务结果 2.2.4
targetResourceUuid String 目标资源UUID 2.2.4
managementNodeUuid String 管理节点UUID 2.2.4
createDate Timestamp 创建时间 2.2.4
lastOpDate Timestamp 最后一次修改时间 2.2.4
executeTime Long 3.7.0
state LongJobState 详情参考state 2.2.4
#state
名字 类型 描述 起始版本
Waiting LongJobState 3.7.0
Suspended LongJobState 3.7.0
Running LongJobState 3.7.0
Succeeded LongJobState 3.7.0
Canceling LongJobState 3.7.0
Canceled LongJobState 3.7.0
Failed LongJobState 3.7.0

SDK示例

Java SDK
UpdateClusterOSAction action = new UpdateClusterOSAction();
action.uuid = "31c4951f39ae38969802e833448369ae";
action.excludePackages = asList("kernel","systemd*");
action.updatePackages = asList("zstack-release");
action.releaseVersion = "c74";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateClusterOSAction.Result res = action.call();
Python SDK
UpdateClusterOSAction action = UpdateClusterOSAction()
action.uuid = "31c4951f39ae38969802e833448369ae"
action.excludePackages = [kernel, systemd*]
action.updatePackages = [zstack-release]
action.releaseVersion = "c74"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateClusterOSAction.Result res = action.call()

获取集群主机物理网络信息(GetClusterHostNetworkFacts)

API请求

URLs
GET zstack/v1/cluster/hosts-network-facts/{clusterUuid}?hostUuid={hostUuid}
Headers
Authorization: OAuth the-session-uuid
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/cluster/hosts-network-facts/811d04aa12e3390cb29cb7664862e1f2?limit=1000&start=0
参数列表
名字 类型 位置 描述 可选值 起始版本
hostUuid String url 集群UUID 4.3.6
limit (可选) Integer query 4.3.6
start (可选) Integer query 4.3.6
systemTags (可选) List query 4.3.6
userTags (可选) List query 4.3.6

API返回

返回示例
{
  "bondings": [
    {
      "uuid": "23d8ef3080f3379887097e816463d1cf",
      "hostUuid": "46ee6624a6a8307295c583884340d5c2",
      "bondingName": "bond0",
      "mode": "active-backup 1",
      "xmitHashPolicy": "layer2 0",
      "miiStatus": "up",
      "mac": "ac:1f:6b:93:6c:8c",
      "ipAddresses": [
        "172.20.0.116/16"
      ],
      "miimon": 100,
      "allSlavesActive": true,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM",
      "slaves": [
        {
          "uuid": "79bae81259b83a5989d9f7664ea033ba",
          "hostUuid": "46ee6624a6a8307295c583884340d5c2",
          "bondingUuid": "23d8ef3080f3379887097e816463d1cf",
          "interfaceName": "eno1",
          "interfaceType": "bondingSlave",
          "speed": 1000,
          "slaveActive": true,
          "carrierActive": true,
          "mac": "ac:1f:6b:93:6c:8c",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        },
        {
          "uuid": "197768d887cf3f2a985f58d0e10a48b4",
          "hostUuid": "46ee6624a6a8307295c583884340d5c2",
          "bondingUuid": "23d8ef3080f3379887097e816463d1cf",
          "interfaceName": "eno2",
          "interfaceType": "bondingSlave",
          "speed": 1000,
          "slaveActive": false,
          "carrierActive": false,
          "mac": "ac:1f:6b:93:6c:8c",
          "createDate": "Nov 14, 2017 2:20:57 PM",
          "lastOpDate": "Nov 14, 2017 2:20:57 PM"
        }
      ]
    }
  ],
  "nics": [
    {
      "uuid": "79bae81259b83a5989d9f7664ea033ba",
      "hostUuid": "46ee6624a6a8307295c583884340d5c2",
      "bondingUuid": "23d8ef3080f3379887097e816463d1cf",
      "interfaceName": "eno1",
      "interfaceType": "bondingSlave",
      "speed": 1000,
      "slaveActive": true,
      "carrierActive": true,
      "mac": "ac:1f:6b:93:6c:8c",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {
      "uuid": "197768d887cf3f2a985f58d0e10a48b4",
      "hostUuid": "46ee6624a6a8307295c583884340d5c2",
      "bondingUuid": "23d8ef3080f3379887097e816463d1cf",
      "interfaceName": "eno2",
      "interfaceType": "bondingSlave",
      "speed": 1000,
      "slaveActive": false,
      "carrierActive": false,
      "mac": "ac:1f:6b:93:6c:8c",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {
      "uuid": "2b43c44d63b03009a52cd95dbceccc21",
      "hostUuid": "46ee6624a6a8307295c583884340d5c2",
      "interfaceName": "ens2f0",
      "interfaceType": "noMaster",
      "speed": 1000,
      "slaveActive": true,
      "carrierActive": true,
      "ipAddresses": [
        "169.254.0.115/24"
      ],
      "mac": "98:03:9b:00:ea:f2",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    },
    {
      "uuid": "3071fef136fa3102b7289c3e3c461da1",
      "hostUuid": "46ee6624a6a8307295c583884340d5c2",
      "interfaceName": "ens2f1",
      "interfaceType": "bridgeSlave",
      "speed": 1000,
      "slaveActive": false,
      "carrierActive": false,
      "mac": "98:03:9b:00:ea:f3",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
名字 类型 描述 起始版本
success boolean 4.3.6
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 4.3.6
bondings List 详情参考bondings 4.3.6
nics List 详情参考nics 4.3.6
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 0.6
description String 错误的概要描述 0.6
details String 错误的详细信息 0.6
elaboration String 保留字段,默认为null 0.6
opaque LinkedHashMap 保留字段,默认为null 0.6
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 0.6
#bondings
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.5.0
hostUuid String 主机UUID 3.5.0
bondingName String Bond名称 3.5.0
bondingType String Bond应用状态,有noBridge、bridgeSlave 4.7.0
speed Long Bond速率 4.7.0
mode String Bond模式 3.5.0
xmitHashPolicy String 哈希策略 3.5.0
miiStatus String mii状态 3.5.0
mac String MAC地址 3.5.0
ipAddresses List IP地址 3.5.0
gateway String 网关地址 4.7.0
callBackIp String 回调地址 4.7.0
miimon Long mii监控间隔 3.5.0
type String Bond类型 4.7.0
allSlavesActive Boolean 3.5.0
description String 资源的详细描述 4.7.0
createDate Timestamp 创建时间 3.5.0
lastOpDate Timestamp 最后一次修改时间 3.5.0
slaves List 详情参考slaves 3.5.0
#slaves
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.5.0
hostUuid String 主机UUID 3.5.0
bondingUuid String Bond UUID 3.5.0
interfaceModel String 网卡型号 4.7.11
vendorId String 产商Id 4.7.11
deviceId String 设备Id 4.7.11
subvendorId String 子产商Id 4.7.11
subdeviceId String 子设备Id 4.7.11
interfaceName String 网卡名称 3.5.0
interfaceType String 网卡应用状态,有nomaster、bridgeSlave、bondSlave 3.5.0
speed Long 网卡速率 3.5.0
slaveActive Boolean Bond链路状态 3.5.0
carrierActive Boolean 物理链路状态 3.5.0
ipAddresses List IP地址 3.5.0
gateway String 网关地址 4.7.0
mac String MAC地址 3.5.0
callBackIp String 回调地址 4.7.0
pciDeviceAddress String 网卡PCI地址 3.5.0
offloadStatus String 4.7.0
description String 资源的详细描述 4.7.0
createDate Timestamp 创建时间 3.5.0
lastOpDate Timestamp 最后一次修改时间 3.5.0
#nics
名字 类型 描述 起始版本
uuid String 资源的UUID,唯一标示该资源 3.5.0
hostUuid String 主机UUID 3.5.0
bondingUuid String Bond UUID 3.5.0
interfaceModel String 网卡型号 4.7.11
vendorId String 产商Id 4.7.11
deviceId String 设备Id 4.7.11
subvendorId String 子产商Id 4.7.11
subdeviceId String 子设备Id 4.7.11
interfaceName String 网卡名称 3.5.0
interfaceType String 网卡应用状态,有nomaster、bridgeSlave、bondSlave 3.5.0
speed Long 网卡速率 3.5.0
slaveActive Boolean Bond链路状态 3.5.0
carrierActive Boolean 物理链路状态 3.5.0
ipAddresses List IP地址 3.5.0
gateway String 网关地址 4.7.0
mac String MAC地址 3.5.0
callBackIp String 回调地址 4.7.0
pciDeviceAddress String 网卡PCI地址 3.5.0
offloadStatus String 4.7.0
description String 资源的详细描述 4.7.0
createDate Timestamp 创建时间 3.5.0
lastOpDate Timestamp 最后一次修改时间 3.5.0

SDK示例

Java SDK
GetClusterHostNetworkFactsAction action = new GetClusterHostNetworkFactsAction();
action.clusterUuid = "811d04aa12e3390cb29cb7664862e1f2";
action.limit = 1000;
action.start = 0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetClusterHostNetworkFactsAction.Result res = action.call();
Python SDK
GetClusterHostNetworkFactsAction action = GetClusterHostNetworkFactsAction()
action.clusterUuid = "811d04aa12e3390cb29cb7664862e1f2"
action.limit = 1000
action.start = 0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetClusterHostNetworkFactsAction.Result res = action.call()
开发手册 | ZStack ZSphere · ZVF | ZStack 资源中心