API请求
URLs
GET zstack/v1/container/imagesGET zstack/v1/container/images/{uuid}Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/container/images?q=uuid=7be4bb00c8e13230a64309bb9debf4b4curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/container/images/0edfd31b01763a429b7c54d816bbf5d4可查询字段
运行zstack-cli命令行工具,输入QueryContainerImage并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "container-image-uuid",
"name": "image",
"endpointUuid": "endpoint-uuid",
"imageTag": "latest",
"registryUrl": "registry.example.com/project/image:latest"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| inventories | List | 容器镜像列表 | 5.3.28 |
| uuid | String | 镜像UUID | 5.3.28 |
| name | String | 镜像名称 | 5.3.28 |
| endpointUuid | String | 容器管理端点UUID | 5.3.28 |
| imageTag | String | 镜像标签 | 5.3.28 |
| registryUrl | String | 镜像仓库地址 | 5.3.28 |
SDK示例
Java
SDK
QueryContainerImageAction action = new QueryContainerImageAction();
action.conditions = asList("uuid=deb3a389c6363f0d8b53ffe882ec1109");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryContainerImageAction.Result res = action.call();Python
SDK
QueryContainerImageAction action = QueryContainerImageAction()
action.conditions = ["uuid=7c30e9d5e7f13a2baa64d064202f5540"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryContainerImageAction.Result res = action.call()