Distributed Storage Related Interfaces
AddCephPrimaryStorage
API Request
POST zstack/v1/primary-storage/cephAuthorization: OAuth the-session-uuid{
"params": {
"monUrls": [
"root:password@localhost/?monPort\u003d7777"
],
"rootVolumePoolName": "zs-images",
"dataVolumePoolName": "zs-data-volume",
"imageCachePoolName": "zs-image-cache",
"name": "My Ceph Primary Storage",
"zoneUuid": "d42197a462c34a44989bdf38d5aa2424"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"monUrls":["root:password@localhost/?monPort=7777"],"rootVolumePoolName":"zs-images","dataVolumePoolName":"zs-data-volume","imageCachePoolName":"zs-image-cache","name":"My Ceph Primary Storage","zoneUuid":"251a3dffccaf39fc8d190eedcf4395bf"}}' \
http://localhost:8080/zstack/v1/primary-storage/ceph| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| monUrls | List | body (nested in params structure) | List of distributed storage mon addresses | 0.6 | |
| rootVolumePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Root Volume | 0.6 | |
| dataVolumePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Data Volume | 0.6 | |
| imageCachePoolName (optional) | String | body (nested in params structure) | Name of the distributed storage pool for Image Cache | 0.6 | |
| url | String | body (nested in params structure) | Not used | 0.6 | |
| name | String | body (nested in params structure) | Name of the distributed storage | 0.6 | |
| description (optional) | String | body (nested in params structure) | Detailed description of the distributed storage | 0.6 | |
| type (optional) | String | body (nested in params structure) | Type of distributed storage, which is Ceph | 0.6 | |
| zoneUuid | String | body (nested in params structure) | Data Center UUID | 0.6 | |
| resourceUuid (optional) | String | body (nested in params structure) | Resource UUID. If specified, the distributed storage will use this value as its UUID. | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
Note:
- ZStack ZSphere
When adding distributed storage, you can identify the type as xsky, sandstone, or open-source by adding the manufacturer option to SystemTags.
- Option format:
ceph::manufacturer::Platform - For example:
ceph::manufacturer::xsky
- Option format:
- ZStack ZSphere
When adding distributed storage, you can identify the type as xsky and support the SDK for xsky type distributed storage by adding the thirdPartyPlatform option to SystemTags.
- Option format:
ceph::thirdPartyPlatform::TOKEN - For example:
ceph::thirdPartyPlatform::68b329da9893e34099c7d8ad5cb9c940
- Option format:
API Response
{
"inventory": {
"name": "Ceph-1",
"url": "not used",
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"2d8583d86bd1472e8ec0e04e26ea273f"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | The URL. | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | The total capacity. | 0.6 |
| availableCapacity | Long | The available capacity. | 0.6 |
| totalPhysicalCapacity | Long | The total physical capacity. | 0.6 |
| availablePhysicalCapacity | Long | The available physical capacity. | 0.6 |
| systemUsedCapacity | Long | The system used capacity. | 0.6 |
| type | String | The resource type. | 0.6 |
| state | String | The resource state. | 0.6 |
| status | String | The resource status. | 0.6 |
| mountPath | String | The mount path. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | The attached cluster UUIDs. | 0.6 |
SDK Examples
AddCephPrimaryStorageAction action = new AddCephPrimaryStorageAction();
action.monUrls = asList("root:password@localhost/?monPort=7777");
action.rootVolumePoolName = "zs-images";
action.dataVolumePoolName = "zs-data-volume";
action.imageCachePoolName = "zs-image-cache";
action.name = "My Ceph Primary Storage";
action.zoneUuid = "88b49879acd34e11afa5bb3ea9164d5a";
action.sessionId = "33a01ee65ac64450940359dc3181f9b1";
AddCephPrimaryStorageAction.Result res = action.call();AddCephPrimaryStorageAction action = AddCephPrimaryStorageAction()
action.monUrls = [root:password@localhost/?monPort=7777]
action.rootVolumePoolName = "zs-images"
action.dataVolumePoolName = "zs-data-volume"
action.imageCachePoolName = "zs-image-cache"
action.name = "My Ceph Primary Storage"
action.zoneUuid = "0f05052514554462b437f9cfa272f57f"
action.sessionId = "cb3d5ecb63634ca093ea223c55e6a30a"
AddCephPrimaryStorageAction.Result res = action.call()QueryCephPrimaryStorage
API Request
GET zstack/v1/primary-storage/ceph
GET zstack/v1/primary-storage/ceph/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 9b17423dbac84ff4ace2e0d5f4d9e0d2" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph?q=uuid=c7b3cbd9ae3e44bb9536728191761cb3curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth c0e6df86e0b34164b3e0471d7b0cdcb4" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/1ffb7b09c405477b95563abfcad506a0Queryable Fields
Run the CLI command tool, enter QueryCephPrimaryStorage and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
{
"inventories": [
{
"name": "Ceph-1",
"url": "not used",
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"attachedClusterUuids": [
"1b70bb2e338f4a278b9efadda42ad26f"
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventories | List | For details, see inventories | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | The URL. | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | The total capacity. | 0.6 |
| availableCapacity | Long | The available capacity. | 0.6 |
| totalPhysicalCapacity | Long | The total physical capacity. | 0.6 |
| availablePhysicalCapacity | Long | The available physical capacity. | 0.6 |
| systemUsedCapacity | Long | The system used capacity. | 0.6 |
| type | String | The resource type. | 0.6 |
| state | String | The resource state. | 0.6 |
| status | String | The resource status. | 0.6 |
| mountPath | String | The mount path. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | The attached cluster UUIDs. | 0.6 |
SDK Examples
QueryCephPrimaryStorageAction action = new QueryCephPrimaryStorageAction();
action.conditions = asList("uuid=d351d433b5974116a4c9649ef5b89e64");
action.sessionId = "172c3d6b977b4cbfbd401ace20ad0442";
QueryCephPrimaryStorageAction.Result res = action.call();QueryCephPrimaryStorageAction action = QueryCephPrimaryStorageAction()
action.conditions = ["uuid=aa79df396a4943f8b9066c4d8057565d"]
action.sessionId = "0aca367c9e7946d29a63044684d5dd71"
QueryCephPrimaryStorageAction.Result res = action.call()AddMonToCephPrimaryStorage
API Request
POST zstack/v1/primary-storage/ceph/{uuid}/monsAuthorization: OAuth the-session-uuid{
"params": {
"monUrls": [
"10.0.1.3"
]
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"monUrls":["10.0.1.3"]}}' \
http://localhost:8080/zstack/v1/primary-storage/ceph/6496e4b29793368dbacf388d83446acc/mons| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the distributed storage | 0.6 | |
| monUrls | List | body (nested in params structure) | List of mon node addresses | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
AddMonToCephPrimaryStorageAction action = new AddMonToCephPrimaryStorageAction();
action.uuid = "d0e3946e312a40c6af85da9163ac2519";
action.monUrls = asList("10.0.1.3");
action.sessionId = "6033eea9a2514c078c7af2a709ead405";
AddMonToCephPrimaryStorageAction.Result res = action.call();AddMonToCephPrimaryStorageAction action = AddMonToCephPrimaryStorageAction()
action.uuid = "6b631b40a3fa434785a8b0bd49a3f199"
action.monUrls = [10.0.1.3]
action.sessionId = "c455c88362f84aa7acd07bd5f6d3a4d3"
AddMonToCephPrimaryStorageAction.Result res = action.call()RemoveMonFromCephPrimaryStorage
API Request
DELETE/v1/primary-storage/ceph/{uuid}/mons?monHostnames={monHostnames}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b57c6816e9b64ae881a356f9308bb6c7" \
-X DELETE http://localhost:8080/zstack/v1/primary-storage/ceph/31db2011f3944c85ae24a7ca607302e5/mons?monHostnames=10.0.1.2| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | UUID of the distributed storage | 0.6 | |
| monHostnames | List | body | List of mon node hostnames | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
API Response
{
"inventory": {
"mons": [
{
"monAddr": "10.0.1.2",
"monUuid": "c72a3fc6e06649de811bf90ba8c9c574"
}
],
"name": "My Ceph Primary Storage",
"description": "Public Ceph Primary Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:21:07 PM",
"lastOpDate": "Jun 7, 2017 9:21:07 PM",
"attachedClusterUuids": [
"c0f667d99bfc41c1a133528a2089a9a7"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| fsid | String | The fsid. | 0.6 |
| rootVolumePoolName | String | The root volume pool name. | 0.6 |
| dataVolumePoolName | String | The data volume pool name. | 0.6 |
| imageCachePoolName | String | The image cache pool name. | 0.6 |
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | The URL. | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | The total capacity. | 0.6 |
| availableCapacity | Long | The available capacity. | 0.6 |
| totalPhysicalCapacity | Long | The total physical capacity. | 0.6 |
| availablePhysicalCapacity | Long | The available physical capacity. | 0.6 |
| systemUsedCapacity | Long | The system used capacity. | 0.6 |
| type | String | The resource type. | 0.6 |
| state | String | The resource state. | 0.6 |
| status | String | The resource status. | 0.6 |
| mountPath | String | The mount path. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | The attached cluster UUIDs. | 0.6 |
| mons | List | For details, see mons | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostname | String | The hostname. | 0.6 |
| monPort | Integer | The mon port. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| primaryStorageUuid | String | Data Storage UUID | 0.6 |
| monAddr | String | The mon addr. | 0.6 |
| sshUsername | String | The SSH username. | 0.6 |
| sshPassword | String | The SSH password. | 0.6 |
| sshPort | Integer | The SSH port. | 0.6 |
| status | String | The resource status. | 0.6 |
| monUuid | String | The mon UUID. | 0.6 |
SDK Examples
RemoveMonFromCephPrimaryStorageAction action = new RemoveMonFromCephPrimaryStorageAction();
action.uuid = "05aa4826fdbd4021b72e4d9a5db67bbc";
action.monHostnames = asList("10.0.1.2");
action.sessionId = "2412a720a3bb4992887979298217b300";
RemoveMonFromCephPrimaryStorageAction.Result res = action.call();RemoveMonFromCephPrimaryStorageAction action = RemoveMonFromCephPrimaryStorageAction()
action.uuid = "fb3dca5509154ca48698f374794f4d93"
action.monHostnames = [10.0.1.2]
action.sessionId = "9eb682deaa894cea80e1608056492948"
RemoveMonFromCephPrimaryStorageAction.Result res = action.call()UpdateCephPrimaryStorageMon
API Request
PUT zstack/v1/primary-storage/ceph/mons/{monUuid}/actionsAuthorization: OAuth the-session-uuid{
"updateCephPrimaryStorageMon": {
"hostname": "10.0.1.4"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateCephPrimaryStorageMon":{"hostname":"10.0.1.4"}}' \
http://localhost:8080/zstack/v1/primary-storage/ceph/mons/cda8b731b2e23b8eb1081dec0f7a0a60/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| monUuid | String | url | Monitoring node UUID | 0.6 | |
| hostname (optional) | String | body (nested in updateCephPrimaryStorageMon structure) | New host IP address of the monitoring node | 0.6 | |
| sshUsername (optional) | String | body (nested in updateCephPrimaryStorageMon structure) | SSH username of the monitoring node host | 0.6 | |
| sshPassword (optional) | String | body (nested in updateCephPrimaryStorageMon structure) | SSH password of the monitoring node host | 0.6 | |
| sshPort (optional) | Integer | body (nested in updateCephPrimaryStorageMon structure) | SSH port of the monitoring node host | 0.6 | |
| monPort (optional) | Integer | body (nested in updateCephPrimaryStorageMon structure) | New port of the mon | 0.6 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 |
API Response
{
"inventory": {
"mons": [
{
"monAddr": "10.0.1.4",
"monUuid": "d557e48870b04ef699509d2998084bdb"
}
],
"name": "My Ceph Primary Storage",
"description": "Public Ceph Primary Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:21:22 PM",
"lastOpDate": "Jun 7, 2017 9:21:22 PM",
"attachedClusterUuids": [
"3fa1f7c2bbb544e1a04ba9f9da935abe"
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| fsid | String | The fsid. | 0.6 |
| rootVolumePoolName | String | The root volume pool name. | 0.6 |
| dataVolumePoolName | String | The data volume pool name. | 0.6 |
| imageCachePoolName | String | The image cache pool name. | 0.6 |
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| zoneUuid | String | Data Center UUID | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | The URL. | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| totalCapacity | Long | The total capacity. | 0.6 |
| availableCapacity | Long | The available capacity. | 0.6 |
| totalPhysicalCapacity | Long | The total physical capacity. | 0.6 |
| availablePhysicalCapacity | Long | The available physical capacity. | 0.6 |
| systemUsedCapacity | Long | The system used capacity. | 0.6 |
| type | String | The resource type. | 0.6 |
| state | String | The resource state. | 0.6 |
| status | String | The resource status. | 0.6 |
| mountPath | String | The mount path. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| attachedClusterUuids | List | The attached cluster UUIDs. | 0.6 |
| mons | List | For details, see mons | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| hostname | String | The hostname. | 0.6 |
| monPort | Integer | The mon port. | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| primaryStorageUuid | String | Data Storage UUID | 0.6 |
| monAddr | String | The mon addr. | 0.6 |
| sshUsername | String | The SSH username. | 0.6 |
| sshPassword | String | The SSH password. | 0.6 |
| sshPort | Integer | The SSH port. | 0.6 |
| status | String | The resource status. | 0.6 |
| monUuid | String | The mon UUID. | 0.6 |
SDK Examples
UpdateCephPrimaryStorageMonAction action = new UpdateCephPrimaryStorageMonAction();
action.monUuid = "3341eaef160045d6b6fd085a22a3c69f";
action.hostname = "10.0.1.4";
action.sessionId = "359aceecda5e478e81d4eaea9e86bca8";
UpdateCephPrimaryStorageMonAction.Result res = action.call();
UpdateCephPrimaryStorageMonAction action = UpdateCephPrimaryStorageMonAction()
action.monUuid = "70bc5237403848f6b5b6a60079c3ab91"
action.hostname = "10.0.1.4"
action.sessionId = "b1737cdb77c4420ba72aab66c4438521"
UpdateCephPrimaryStorageMonAction.Result res = action.call()AddCephPrimaryStoragePool
API Request
POST zstack/v1/primary-storage/ceph/{primaryStorageUuid}/poolsAuthorization: OAuth the-session-uuid{
"params": {
"poolName": "highPerformance",
"aliasName": "alias pool name",
"description": "for high performance data volumes",
"isCreate": true
"type": "ROOT
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"poolName":"highPerformance","aliasName":"alias pool name","description":"for high performance data volumes","isCreate":true,"type":"Root"}}' http://localhost:8080/zstack/v1/primary-storage/ceph/fe5adfa6042b33cd8ee7b5bcd994245f/pools| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| primaryStorageUuid | String | url | Primary Storage UUID | 0.6 | |
| poolName | String | body (nested in params structure) | The pool name. | 0.6 | |
| aliasName (optional) | String | body (nested in params structure) | Optional. The alias name. | 0.6 | |
| description (optional) | String | body (nested in params structure) | Resource description | 0.6 | |
| isCreate (optional) | boolean | body (nested in params structure) | Optional. Whether the resource is create. | 0.6 | |
| type | String | body (nested in params structure) | Storage pool type | 3.1.1 | |
| resourceUuid (optional) | String | body (nested in params structure) | Optional. The resource UUID. | 0.6 | |
| systemTags (optional) | List | body | Optional. The system tags. | 0.6 | |
| userTags (optional) | List | body | Optional. The user tags. | 0.6 |
API Response
{
"inventory": {
"uuid": "97ac9dc5fc223f80918747a8a398478b",
"primaryStorageUuid": "82b127a3f6cc3ec7bd7ff01069310099",
"poolName": "pool name",
"aliasName": "alias name",
"description": "description",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"type": "Data"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| primaryStorageUuid | String | Primary Storage UUID | 0.6 |
| poolName | String | The pool name. | 0.6 |
| aliasName | String | The alias name. | 0.6 |
| description | String | Resource description | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| type | String | The resource type. | 0.6 |
|
availableCapacity |
Long | The available capacity. | 2.3.2 |
| usedCapacity | Long | The used capacity. | 2.3.2 |
| replicatedSize | Integer | The replicated size. | 2.3.2 |
SDK Examples
AddCephPrimaryStoragePoolAction action = new AddCephPrimaryStoragePoolAction();
action.primaryStorageUuid = "fe5adfa6042b33cd8ee7b5bcd994245f";
action.poolName = "highPerformance";
action.aliasName = "alias pool name";
action.description = "for high performance data volumes";
action.isCreate = true;
action.type = "Root"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddCephPrimaryStoragePoolAction.Result res = action.call();AddCephPrimaryStoragePoolAction action = AddCephPrimaryStoragePoolAction()
action.primaryStorageUuid = "fe5adfa6042b33cd8ee7b5bcd994245f"
action.poolName = "highPerformance"
action.aliasName = "alias pool name"
action.type = "Root"
action.description = "for high performance data volumes"
action.isCreate = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddCephPrimaryStoragePoolAction.Result res = action.call()DeleteCephPrimaryStoragePool
API Request
DELETE zstack/v1/primary-storage/ceph/pools/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/primary-storage/ceph/pools/5d9ee6f791d33de3a3aff68f7a746282?| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 0.6 | |
| systemTags (optional) | List | body | Optional. The system tags. | 0.6 | |
| userTags (optional) | List | body | Optional. The user tags. | 0.6 |
API Response
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
DeleteCephPrimaryStoragePoolAction action = new DeleteCephPrimaryStoragePoolAction();
action.uuid = "5d9ee6f791d33de3a3aff68f7a746282";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCephPrimaryStoragePoolAction.Result res = action.call();DeleteCephPrimaryStoragePoolAction action = DeleteCephPrimaryStoragePoolAction()
action.uuid = "5d9ee6f791d33de3a3aff68f7a746282"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteCephPrimaryStoragePoolAction.Result res = action.call()QueryCephPrimaryStoragePool
API Request
GET zstack/v1/primary-storage/ceph/pools
GET zstack/v1/primary-storage/ceph/pools/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/pools?q=name=highPerformancecurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/pools/d4e5d23825ff3004856e1720eff59131Queryable Fields
Run the CLI command tool, enter QueryCephPrimaryStoragePool and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
{
"inventories": [
{
"primaryStorageUuid": "d0e638ede3263a9080c41ce860106043",
"poolName": "test pool",
"aliasName": "alias test pool",
"description": "high performance",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"type": "Data"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventories | List | For details, see inventories | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| primaryStorageUuid | String | Primary Storage UUID | 0.6 |
| poolName | String | The pool name. | 0.6 |
| aliasName | String | The alias name. | 0.6 |
| description | String | Resource description | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| type | String | The resource type. | 0.6 |
| usedCapacity | Long | The used capacity. | 2.3.2 |
| replicatedSize | Integer | The replicated size. | 2.3.2 |
|
availableCapacity |
Long | The available capacity. | 2.3.2 |
SDK Examples
QueryCephPrimaryStoragePoolAction action = new QueryCephPrimaryStoragePoolAction();
action.conditions = asList("name=highPerformance");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCephPrimaryStoragePoolAction.Result res = action.call();QueryCephPrimaryStoragePoolAction action = QueryCephPrimaryStoragePoolAction()
action.conditions = ["name=highPerformance"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryCephPrimaryStoragePoolAction.Result res = action.call()UpdateCephPrimaryStoragePool
API Request
PUT zstack/v1/primary-storage/ceph/pools/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateCephPrimaryStoragePool": {
"aliasName": "alias",
"description": "description"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateCephPrimaryStoragePool":{"aliasName":"alias","description":"description"}}' \
http://localhost:8080/zstack/v1/primary-storage/ceph/pools/8b2d94a2a12332a7ace559238644472c/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 0.6 | |
| aliasName (optional) | String | body (nested in updateCephPrimaryStoragePool structure) | Optional. The alias name. | 0.6 | |
| description (optional) | String | body (nested in updateCephPrimaryStoragePool structure) | Resource description | 0.6 | |
| systemTags (optional) | List | body | Optional. The system tags. | 0.6 | |
| userTags (optional) | List | body | Optional. The user tags. | 0.6 |
API Response
{
"inventory": {
"uuid": "7f0e174e86e739d695b0e5b9674e3638",
"primaryStorageUuid": "6b247ebee1e4326998f10e03a5f8c230",
"poolName": "pool name",
"aliasName": "alias name",
"description": "description",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"type": "Data"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | CephPrimaryStoragePoolInventory | For details, see inventory | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| primaryStorageUuid | String | Primary Storage UUID | 0.6 |
| poolName | String | The pool name. | 0.6 |
| aliasName | String | The alias name. | 0.6 |
| description | String | Resource description | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| type | String | The resource type. | 0.6 |
| usedCapacity | Long | The used capacity. | 2.3.2 |
| replicatedSize | Integer | The replicated size. | 2.3.2 |
|
availableCapacity |
Long | The available capacity. | 2.3.2 |
SDK Examples
UpdateCephPrimaryStoragePoolAction action = new UpdateCephPrimaryStoragePoolAction();
action.uuid = "8b2d94a2a12332a7ace559238644472c";
action.aliasName = "alias";
action.description = "description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCephPrimaryStoragePoolAction.Result res = action.call();UpdateCephPrimaryStoragePoolAction action = UpdateCephPrimaryStoragePoolAction()
action.uuid = "8b2d94a2a12332a7ace559238644472c"
action.aliasName = "alias"
action.description = "description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateCephPrimaryStoragePoolAction.Result res = action.call()QueryCephOsdGroup
API Request
GET zstack/v1/primary-storage/ceph/osdgroups
GET zstack/v1/primary-storage/ceph/osdgroups/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/osdgroups\
q=uuid=b2c53eee77bc3bfea5374d417babff07curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/osdgroups/9ee0973b0e79393e9f7d03a6e3a6f645Queryable Fields
Run the CLI command tool, enter QueryCephOsdGroup and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
{
"inventories": [
{
"osds": "osd.1",
"availableCapacity": 0.0,
"availablePhysicalCapacity": 1024.0,
"totalPhysicalCapacity": 1024.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 4.5.0 |
| inventories | List | For details, see inventories | 4.5.0 |
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 4.5.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| primaryStorageUuid | String | Primary Storage UUID | 4.5.0 |
| osds | String | The osds. | 4.5.0 |
| availableCapacity | long | The available capacity. | 4.5.0 |
| availablePhysicalCapacity | long | The available physical capacity. | 4.5.0 |
| totalPhysicalCapacity | long | The total physical capacity. | 4.5.0 |
| createDate | Timestamp | Creation time | 4.5.0 |
| lastOpDate | Timestamp | Last modification time | 4.5.0 |
| uuid | String | Resource UUID, uniquely identifies the resource | 4.5.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 4.5.0 |
| description | String | Brief description of the error | 4.5.0 |
| details | String | Detailed error information | 4.5 |
| elaboration | String | Reserved field, defaults to null | 4.5.0 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 4.5.0 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 4.5.0 |
SDK Examples
QueryCephOsdGroupAction action = new QueryCephOsdGroupAction();
action.conditions = asList("uuid=3e479fc0962c3561a854d868fce5ab3e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCephOsdGroupAction.Result res = action.call();QueryCephOsdGroupAction action = QueryCephOsdGroupAction()
action.conditions = ["uuid=45906504e89335809e54a79897eb1357"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryCephOsdGroupAction.Result res = action.call()CreateBlockVolume
API Request
POST zstack/v1/block-volumesAuthorization: OAuth the-session-uuid{
"params": {
"name": "example",
"description": "block volume test"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"example","description":"block volume test"}}' \
http://localhost:8080/zstack/v1/block-volumes| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| name | String | body (nested in params structure) |
Resource name | 4.7.11 | |
| description (optional) | String | body (nested in params structure) |
Resource description | 4.7.11 | |
| size | Long | body (nested in params structure) |
Capacity | 4.7.11 | |
| primaryStorageUuid | String | body (nested in params structure) |
Primary Storage UUID | 4.7.11 | |
| accessPathId | Integer | body (nested in params structure) |
Access path ID | 4.7.11 | |
| accessPathIqn | String | body (nested in params structure) |
Access path IQN | 4.7.11 | |
| burstTotalBw (optional) | Long | body (nested in params structure) |
Burst bandwidth | 4.7.11 | |
| burstTotalIops (optional) | Long | body (nested in params structure) |
Burst IOPS | 4.7.11 | |
| maxTotalBw (optional) | Long | body (nested in params structure) |
Maximum bandwidth | 4.7.11 | |
| maxTotalIops (optional) | Long | body (nested in params structure) |
Maximum IOPS | 4.7.11 | |
| resourceUuid (optional) | String | body (nested in params structure) |
Resource UUID | 4.7.11 | |
| tagUuids (optional) | List | body (nested in params structure) |
Tag UUID list | 4.7.11 | |
| systemTags (optional) | List | body | System tags | 4.7.11 | |
| userTags (optional) | List | body | User tags | 4.7.11 |
API Response
{
"inventory": {}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the operation succeeded. | 4.7.11 |
| inventory | BlockVolumeInventory | For details, see inventory | 4.7.11 |
| error | ErrorCode | Error code. If not null, indicates the operation failed. This field is null when the operation succeeds. For details, see error | 4.7.11 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| iscsiPath | String | The iscsi path. | 4.7.11 |
| vendor | String | The vendor. | 4.7.11 |
| uuid | String | Resource UUID, uniquely identifies the resource | 4.7.11 |
| name | String | Resource name | 4.7.11 |
| description | String | Resource description | 4.7.11 |
| primaryStorageUuid | String | Primary Storage UUID | 4.7.11 |
| vmInstanceUuid | String | virtual machine UUID | 4.7.11 |
| diskOfferingUuid | String | Disk offering UUID | 4.7.11 |
| rootImageUuid | String | The root image UUID. | 4.7.11 |
| installPath | String | The installation path. | 4.7.11 |
| type | String | The resource type. | 4.7.11 |
| format | String | The format. | 4.7.11 |
| size | Long | The size. | 4.7.11 |
| actualSize | Long | The actual size. | 4.7.11 |
| deviceId | Integer | The device ID. | 4.7.11 |
| state | String | The resource state. | 4.7.11 |
| status | String | The resource status. | 4.7.11 |
| createDate | Timestamp | Creation time | 4.7.11 |
| lastOpDate | Timestamp | Last modification time | 4.7.11 |
| isShareable | Boolean | Whether the resource is shareable. | 4.7.11 |
| volumeQos | String | The volume QoS. | 4.7.11 |
| lastDetachDate | Timestamp | The last detach date. | 4.7.11 |
| lastVmInstanceUuid | String | The last VM instance UUID. | 4.7.11 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
SDK Examples
CreateBlockVolumeAction action = new CreateBlockVolumeAction();
action.name = "example";
action.description = "block volume test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBlockVolumeAction.Result res = action.call();CreateBlockVolumeAction action = CreateBlockVolumeAction()
action.name = "example"
action.description = "block volume test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateBlockVolumeAction.Result res = action.call()GetAccessPath
API Request
GET zstack/v1/block-volumes/access/pathAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/block-volumes/access/path?primaryStorageUuid=56963d0046b330839488e795b5109e44| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (optional) | List | query | System tags | 4.7.11 | |
| userTags (optional) | List | query | User tags | 4.7.11 | |
| primaryStorageUuid | String | query | Primary Storage UUID | 4.7.11 |
API Response
{
"pathInfos": [
{
"accessPathId": 1,
"accessPathIqn": "iqn",
"targetCount": 1
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 4.7.11 |
| accessPathId | String | Access path ID | 4.7.11 |
| accessPathIqn | String | Access path IQN | 4.7.11 |
| targetCount | Integer | Number of associated targets | 4.7.11 |
| gatewayIps | List | Gateway IP | 4.7.11 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, globally unique identifier for the error, such as SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause. The source error that triggered the current error. If there is no original error, this field is null | 0.6 |
SDK Examples
GetAccessPathAction action = new GetAccessPathAction();
action.primaryStorageUuid = "56963d0046b330839488e795b5109e44";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAccessPathAction.Result res = action.call();GetAccessPathAction action = GetAccessPathAction()
action.primaryStorageUuid = "56963d0046b330839488e795b5109e44"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetAccessPathAction.Result res = action.call()QueryBlockVolume
API Request
GET zstack/v1/block-volumes
GET zstack/v1/block-volumes/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/block-volumes?q=uuid=xxx&q=name=xxxcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/block-volumes/188cd27b3e053a16977a0f2ad1b3bd91Queryable Fields
Run the CLI command tool, enter QueryBlockVolume and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
{}. When an error occurs, the returned JSON structure contains an error field, for example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
QueryBlockVolumeAction action = new QueryBlockVolumeAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBlockVolumeAction.Result res = action.call();QueryBlockVolumeAction action = QueryBlockVolumeAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryBlockVolumeAction.Result res = action.call()QueryXskyBlockVolume
API Request
GET zstack/v1/xksy/block-volumes
GET zstack/v1/xsky/block-volumes/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/xksy/block-volumes?q=uuid=xxx&q=name=xxxcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/xsky/block-volumes/54e1b033658b3aa28536d0064c07c536Queryable Fields
Run the CLI command tool, enter QueryXskyBlockVolume and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
{}. When an error occurs, the returned JSON structure contains an error field, for example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
QueryXskyBlockVolumeAction action = new QueryXskyBlockVolumeAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryXskyBlockVolumeAction.Result res = action.call();QueryXskyBlockVolumeAction action = QueryXskyBlockVolumeAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryXskyBlockVolumeAction.Result res = action.call()UpdateBlockVolume
API Request
PUT zstack/v1/block-volumes/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateBlockVolume": {
"name": "example"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateBlockVolume":{"name":"example"}}' \
http://localhost:8080/zstack/v1/block-volumes/09c2f52fe02030019306d55b1ac7e849/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 4.7.11 | |
| name (optional) | String | body (nested in updateBlockVolume structure) |
Resource name | 4.7.11 | |
| description (optional) | String | body (nested in updateBlockVolume structure) |
Resource description | 4.7.11 | |
| burstTotalBw (optional) | Long | body (nested in updateBlockVolume structure) |
Burst bandwidth | 4.7.11 | |
| burstTotalIops (optional) | Long | body (nested in updateBlockVolume structure) |
Burst IOPS | 4.7.11 | |
| maxTotalBw (optional) | Long | body (nested in updateBlockVolume structure) |
Maximum bandwidth | 4.7.11 | |
| maxTotalIops (optional) | Long | body (nested in updateBlockVolume structure) |
Maximum IOPS | 4.7.11 | |
| systemTags (optional) | List | body | System tags | 4.7.11 | |
| userTags (optional) | List | body | User tags | 4.7.11 |
API Response
{}. When an error occurs, the returned JSON structure contains an error field, for example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
UpdateBlockVolumeAction action = new UpdateBlockVolumeAction();
action.uuid = "09c2f52fe02030019306d55b1ac7e849";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBlockVolumeAction.Result res = action.call();UpdateBlockVolumeAction action = UpdateBlockVolumeAction()
action.uuid = "09c2f52fe02030019306d55b1ac7e849"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateBlockVolumeAction.Result res = action.call()UpdateXskyBlockVolume
API Request
PUT zstack/v1/xsky/block-volumes/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateXskyBlockVolume": {
"name": "example"
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateXskyBlockVolume":{"name":"example"}}' \
http://localhost:8080/zstack/v1/xsky/block-volumes/eeb07fe1a24833959f75c38b9c7e4132/actions| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | Resource UUID, uniquely identifies the resource | 4.7.11 | |
| name (可选) | String | body(包含在updateXskyBlockVolume结构中) |
Resource name | 4.7.11 | |
| description (可选) | String | body(包含在updateXskyBlockVolume结构中) |
Detailed description of the resource | 4.7.11 | |
| burstTotalBw (可选) | Long | body(包含在updateXskyBlockVolume结构中) |
Optional. The burst total bw. | 4.7.11 | |
| burstTotalIops (可选) | Long | body(包含在updateXskyBlockVolume结构中) |
Optional. The burst total iops. | 4.7.11 | |
| maxTotalBw (可选) | Long | body(包含在updateXskyBlockVolume结构中) |
Optional. The max total bw. | 4.7.11 | |
| maxTotalIops (可选) | Long | body(包含在updateXskyBlockVolume结构中) |
Optional. The max total iops. | 4.7.11 | |
| systemTags (可选) | List | body | System tag | 4.7.11 | |
| userTags (可选) | List | body | User tag | 4.7.11 |
API Response
{} on success, and returns a JSON structure containing an error field on failure. For example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
UpdateXskyBlockVolumeAction action = new UpdateXskyBlockVolumeAction();
action.uuid = "eeb07fe1a24833959f75c38b9c7e4132";
action.name = "example";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateXskyBlockVolumeAction.Result res = action.call();UpdateXskyBlockVolumeAction action = UpdateXskyBlockVolumeAction()
action.uuid = "eeb07fe1a24833959f75c38b9c7e4132"
action.name = "example"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateXskyBlockVolumeAction.Result res = action.call()CheckCephHealthStatus
API Request
POST zstack/v1/zops/check-ceph-healthAuthorization: OAuth the-session-uuid{
"params": {},
"systemTags": [],
"userTags": []
}
Note: 上述示例中systemTags、userTags字段可以省略。列出是为了表示body中可以包含这两个字段。curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/zops/check-ceph-health| Name | Type | Location | Description | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| systemTags (optional) | List | body | System tag | 4.10.10 | |
| userTags (optional) | List | body | User tag | 4.10.10 |
API Response
{} on success, and returns a JSON structure containing an error field on failure. For example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
CheckCephHealthStatusAction action = new CheckCephHealthStatusAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckCephHealthStatusAction.Result res = action.call();CheckCephHealthStatusAction action = CheckCephHealthStatusAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckCephHealthStatusAction.Result res = action.call()QueryExponBlockVolume
API Request
GET zstack/v1/expon/block-volumes
GET zstack/v1/expon/block-volumes/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/expon/block-volumes?q=uuid=xxx&q=name=xxxcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/expon/block-volumes/57dcd9124665304191c221331ee95e6bQueryable Fields
Run the CLI command, enter QueryExponBlockVolume and press Tab to view all queryable fields and resources that support cross-table queries.
API Response
{} on success, and returns a JSON structure containing an error field on failure. For example:{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Examples
QueryExponBlockVolumeAction action = new QueryExponBlockVolumeAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryExponBlockVolumeAction.Result res = action.call();action = QueryExponBlockVolumeAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()CheckCephPlugin
API Request
PUT zstack/v1/ceph-plugin/checkAuthorization: OAuth the-session-uuid{
"checkCephPlugin": {
"managementNode": true
},
"systemTags": [],
"userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"checkCephPlugin":{"managementNode":true}}' \
http://localhost:8080/zstack/v1/ceph-plugin/check| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| managementNode (optional) | boolean | body (included in the checkCephPlugin structure) |
Whether to check all management nodes | 4.10.7 | |
| hostUuidList (optional) | List | body (included in the checkCephPlugin structure) |
List of hosts to add for checking | 4.10.7 | |
| ipList (optional) | List | body (included in the checkCephPlugin structure) |
List of hosts corresponding to the specified IPs to add for checking | 4.10.7 | |
| externalHosts (optional) | List | body (included in the checkCephPlugin structure) |
List of SSH connection parameters for external hosts used for checking | 4.10.20 | |
| systemTags (optional) | List | body | System tag | 4.10.7 | |
| userTags (optional) | List | body | User tag | 4.10.7 |
SDK Examples
CheckCephPluginAction action = new CheckCephPluginAction();
action.managementNode = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckCephPluginAction.Result res = action.call();action = CheckCephPluginAction()
action.managementNode = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()