查询软件包

GET/zstack/v1/software-package
GET/zstack/v1/software-package/{uuid}

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/software-package?q=uuid=ff04e1736ec6391f9a1f023b524d0a00
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/software-package/dbe8d717b4f7335580774fabc403cc78

可查询字段

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

API返回

返回示例

{
  "inventories": [
    {
      "uuid": "53c0433a817349f89f66532addeb8b6c",
      "name": "SoftwarePackage",
      "hostUuid": "53c0433a817349f89f66532addeb8b61",
      "managementNodeUuid": "53c0433a817349f89f66532addeb8b62",
      "installPath": "/root/file/ZStone-common-installer-5.4.18-1932.tar.gz",
      "unzipInstallPath": "/root/file/ZStone-common-installer-5.4.18-1932.tar.gz_2c1571fab770b5bab7f411d48aad5029_1762415407323/zstone-installer",
      "type": "zstone",
      "md5sum": "53c0433a817349f89f66532addeb8b63",
      "status": "Uploaded",
      "size": 1024,
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
名字类型描述起始版本
successboolean 4.10.20
inventoriesList详情参考inventories4.10.20
errorErrorCode详情参考error4.10.20

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源4.10.20
nameString资源名称4.10.20
hostUuidString主机UUID4.10.20
managementNodeUuidString上传到管理节点UUID4.10.20
installPathString安装路径4.10.20
unzipInstallPathString解压安装路径4.10.20
typeString安装包类型4.10.20
md5sumString安装包MD5校验值4.10.20
statusString安装包状态4.10.20
sizelong安装包大小4.10.20
createDateTimestamp创建时间4.10.20
lastOpDateTimestamp最后一次修改时间4.10.20

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

SDK示例

Java SDK

QuerySoftwarePackageAction action = new QuerySoftwarePackageAction();
action.conditions = asList("uuid=ff04e1736ec6391f9a1f023b524d0a00");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySoftwarePackageAction.Result res = action.call();

Python SDK

action = QuerySoftwarePackageAction()
action.conditions = ["uuid=ff04e1736ec6391f9a1f023b524d0a00"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()