Document navigation

Ceph Primary Storage Operations

AddCephPrimaryStorage

API Request

URLs
POST zstack/v1/primary-storage/ceph
Headers
Authorization: OAuth the-session-uuid
Body
{
  "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 preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
monUrls List body (contained in the params structure) The URL list of the Ceph monitor daemon (Ceph mon). 0.6
rootVolumePoolName String body (contained in the params structure) Optional. The name of the Ceph pool that is available for root volumes. 0.6
dataVolumePoolName String body (contained in the params structure) Optional. The name of the Ceph pool that is available for data volumes. 0.6
imageCachePoolName String body (contained in the params structure) Optional. The name of the Ceph pool that is available for image caches. 0.6
url String body (contained in the params structure) The reserved field. 0.6
name String body (contained in the params structure) The name of the Ceph primary storage. 0.6
description String body (contained in the params structure) Optional. The detailed description of the Ceph primary storage. 0.6
type String body (contained in the params structure) Optional. The primary storage type: Ceph. 0.6
zoneUuid String body (contained in the params structure) The zone UUID. 0.6
resourceUuid String body (contained in the params structure) Optional. The resource UUID. If specified, the Ceph primary storage will use this field as the UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6
Note:
  • When you add a Ceph primary storage to ZStack Cloud, you can specify the manufacturer option to SystemTags to identify the type of the Ceph primary staorage, for example, xsky, sandstone, or open-source.
    • Format: ceph::manufacturer::Platform
    • Example: ceph::manufacturer::xsky
  • When you add a Ceph primary storage to ZStack Cloud, you can specify the thirdPartyPlatform option to SystemTags to identify the type of the Ceph primary staorage to be xsky. Then you can use a Cloud API to call the SDK of the xsky Ceph primary storage.
    • Format: ceph::thirdPartyPlatform::TOKEN
    • Example: ceph::thirdPartyPlatform::68b329da9893e34099c7d8ad5cb9c940

API Response

Sample Response
{
  "inventory": {
    "name": "Ceph-1",
    "url": "not used",
    "type": "Ceph",
    "state": "Enabled",
    "status": "Connected",
    "attachedClusterUuids": [
      "2d8583d86bd1472e8ec0e04e26ea273f"
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory PrimaryStorageInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 0.6
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
url String The URL. 0.6
description String The 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 The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List The attached cluster UUIDs. 0.6

SDK Sample

Java SDK
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();
Python SDK
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"
res = action.call()

QueryCephPrimaryStorage

API Request

URLs
GET zstack/v1/primary-storage/ceph
GET zstack/v1/primary-storage/ceph/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 9b17423dbac84ff4ace2e0d5f4d9e0d2" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph?q=uuid=c7b3cbd9ae3e44bb9536728191761cb3
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth c0e6df86e0b34164b3e0471d7b0cdcb4" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/1ffb7b09c405477b95563abfcad506a0

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryCephPrimaryStorage, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "name": "Ceph-1",
      "url": "not used",
      "type": "Ceph",
      "state": "Enabled",
      "status": "Connected",
      "attachedClusterUuids": [
        "1b70bb2e338f4a278b9efadda42ad26f"
      ]
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 0.6
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
url String The URL. 0.6
description String The 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 The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List The attached cluster UUIDs. 0.6

SDK Sample

Java SDK
QueryCephPrimaryStorageAction action = new QueryCephPrimaryStorageAction();
action.conditions = asList("uuid=d351d433b5974116a4c9649ef5b89e64");
action.sessionId = "172c3d6b977b4cbfbd401ace20ad0442";
QueryCephPrimaryStorageAction.Result res = action.call();
Python SDK
action = QueryCephPrimaryStorageAction()
action.conditions = ["uuid=aa79df396a4943f8b9066c4d8057565d"]
action.sessionId = "0aca367c9e7946d29a63044684d5dd71"
res = action.call()

AddMonToCephPrimaryStorage

API Request

URLs
POST zstack/v1/primary-storage/ceph/{uuid}/mons
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"monUrls": [
"10.0.1.3"
    ]
  },
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the Ceph primary storage. 0.6
monUrls List body (contained in the params structure) The URL list of the Ceph mon (monitor daemon). 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes 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 Sample

Java SDK
AddMonToCephPrimaryStorageAction action = new AddMonToCephPrimaryStorageAction();
action.uuid = "d0e3946e312a40c6af85da9163ac2519";
action.monUrls = asList("10.0.1.3");
action.sessionId = "6033eea9a2514c078c7af2a709ead405";
AddMonToCephPrimaryStorageAction.Result res = action.call();
Python SDK
action = AddMonToCephPrimaryStorageAction()
action.uuid = "6b631b40a3fa434785a8b0bd49a3f199"
action.monUrls = [10.0.1.3]
action.sessionId = "c455c88362f84aa7acd07bd5f6d3a4d3"
res = action.call()

RemoveMonFromCephPrimaryStorage

API Request

URLs
DELETE/v1/primary-storage/ceph/{uuid}/mons?monHostnames={monHostnames}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -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
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the Ceph primary storage. 0.6
monHostnames List body The new hostname of the Ceph mon (monitor daemon). 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample 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
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory CephPrimaryStorageInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The short description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
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 The resource UUID. 0.6
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
url String The URL. 0.6
description String The 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 The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List The attached cluster UUIDs. 0.6
mons List See mons. 0.6
#mons
Name Type Description Starting Version
hostname String The hostname. 0.6
monPort Integer The mon port. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
primaryStorageUuid String The UUID of the Ceph primary storage. 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 Sample

Java SDK
RemoveMonFromCephPrimaryStorageAction action = new RemoveMonFromCephPrimaryStorageAction();
action.uuid = "05aa4826fdbd4021b72e4d9a5db67bbc";
action.monHostnames = asList("10.0.1.2");
action.sessionId = "2412a720a3bb4992887979298217b300";
RemoveMonFromCephPrimaryStorageAction.Result res = action.call();
Python SDK
action = RemoveMonFromCephPrimaryStorageAction()
action.uuid = "fb3dca5509154ca48698f374794f4d93"
action.monHostnames = [10.0.1.2]
action.sessionId = "9eb682deaa894cea80e1608056492948"
res = action.call()

UpdateCephPrimaryStorageMon

API Request

URLs
PUT zstack/v1/primary-storage/ceph/mons/{monUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateCephPrimaryStorageMon": {
"hostname": "10.0.1.4"
  },
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
monUuid String url The Ceph mon (monitor daemon) UUID. 0.6
hostname String body (contained in the updateCephPrimaryStorageMon structure) Optional. The new hostname of the Ceph mon. 0.6
sshUsername String body (contained in the updateCephPrimaryStorageMon structure) Optional. The SSH username of the Ceph mon. 0.6
sshPassword String body (contained in the updateCephPrimaryStorageMon structure) Optional. The SSH password of the Ceph mon. 0.6
sshPort Integer body (contained in the updateCephPrimaryStorageMon structure) Optional. The SSH port of the Ceph mon. 0.6
monPort Integer (contained in the updateCephPrimaryStorageMon structure) Optional. The new port of the Ceph mon. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample 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
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory CephPrimaryStorageInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The short description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
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 The resource UUID. 0.6
zoneUuid String The zone UUID. 0.6
name String The resource name. 0.6
url String The URL. 0.6
description String The 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 The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List The attached cluster UUIDs. 0.6
mons List See mons. 0.6
#mons
Name Type Description Starting Version
hostname String The hostname. 0.6
monPort Integer The mon port. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
primaryStorageUuid String The UUID of the Ceph primary storage. 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 Sample

Java SDK
UpdateCephPrimaryStorageMonAction action = new UpdateCephPrimaryStorageMonAction();
action.monUuid = "3341eaef160045d6b6fd085a22a3c69f";
action.hostname = "10.0.1.4";
action.sessionId = "359aceecda5e478e81d4eaea9e86bca8";
UpdateCephPrimaryStorageMonAction.Result res = action.call();
Python SDK
action = UpdateCephPrimaryStorageMonAction()
action.monUuid = "70bc5237403848f6b5b6a60079c3ab91"
action.hostname = "10.0.1.4"
action.sessionId = "b1737cdb77c4420ba72aab66c4438521"
res = action.call()

AddCephPrimaryStoragePool

API Request

URLs
POST zstack/v1/primary-storage/ceph/{primaryStorageUuid}/pools
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "poolName": "highPerformance",
    "aliasName": "alias pool name",
    "description": "for high performance data volumes",
    "isCreate": true
    "type": "ROOT
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
primaryStorageUuid String url The UUID of the Ceph primary storage. 0.6
poolName String body (contained in the params structure) The pool name. 0.6
aliasName String body (contained in the params structure) Optional. 0.6
description String body (contained in the params structure) Optional. The detailed description of the resource. 0.6
isCreate boolean body (contained in the params structure) Optional. Creates an extension pool. 0.6
type String body (contained in the params structure) The type of the Ceph primary storage pool. 3.1.1
resourceUuid String body (contained in the params structure) Optional. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample 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
success boolean Whether the operation succeeded. 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory CephPrimaryStoragePoolInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The short description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 0.6
primaryStorageUuid String The UUID of the Ceph primary storage. 0.6
poolName String The pool name. 0.6
aliasName String The alias name. 0.6
description String The detailed description of the resource. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 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 Sample

Java SDK
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();
Python SDK
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"
res = action.call()

DeleteCephPrimaryStoragePool

API Request

URLs
DELETE zstack/v1/primary-storage/ceph/pools/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/primary-storage/ceph/pools/5d9ee6f791d33de3a3aff68f7a746282?
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes 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 Sample

Java SDK
DeleteCephPrimaryStoragePoolAction action = new DeleteCephPrimaryStoragePoolAction();
action.uuid = "5d9ee6f791d33de3a3aff68f7a746282";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCephPrimaryStoragePoolAction.Result res = action.call();
Python SDK
action = DeleteCephPrimaryStoragePoolAction()
action.uuid = "5d9ee6f791d33de3a3aff68f7a746282"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

QueryCephPrimaryStoragePool

API Request

URLs
GET zstack/v1/primary-storage/ceph/pools
GET zstack/v1/primary-storage/ceph/pools/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -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=highPerformance
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/pools/d4e5d23825ff3004856e1720eff59131

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryCephPrimaryStoragePool, and pressing the Tab key.

API Response

Sample 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 The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 0.6
primaryStorageUuid String The UUID of the Ceph primary storage. 0.6
poolName String The pool name. 0.6
aliasName String The alias name. 0.6
description String The detailed description of the resource. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 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 Sample

Java SDK
QueryCephPrimaryStoragePoolAction action = new QueryCephPrimaryStoragePoolAction();
action.conditions = asList("name=highPerformance");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCephPrimaryStoragePoolAction.Result res = action.call();
Python SDK
action = QueryCephPrimaryStoragePoolAction()
action.conditions = ["name=highPerformance"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

UpdateCephPrimaryStoragePool

API Request

URLs
PUT zstack/v1/primary-storage/ceph/pools/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateCephPrimaryStoragePool": {
    "aliasName": "alias",
    "description": "description"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
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
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
aliasName String body (contained in the updateCephPrimaryStoragePool structure) Optional. The alias of the Ceph primary storage pool. 0.6
description String body (contained in the updateCephPrimaryStoragePool structure) Optional. The detailed description of the resource. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample 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 The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory CephPrimaryStoragePoolInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The short description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 0.6
primaryStorageUuid String The UUID of the Ceph primary storage. 0.6
poolName String The pool name. 0.6
aliasName String The alias name. 0.6
description String Optional. The detailed description of the resource. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 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 Sample

Java SDK
UpdateCephPrimaryStoragePoolAction action = new UpdateCephPrimaryStoragePoolAction();
action.uuid = "8b2d94a2a12332a7ace559238644472c";
action.aliasName = "alias";
action.description = "description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCephPrimaryStoragePoolAction.Result res = action.call();
Python SDK
action = UpdateCephPrimaryStoragePoolAction()
action.uuid = "8b2d94a2a12332a7ace559238644472c"
action.aliasName = "alias"
action.description = "description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

QueryCephOsdGroup

API Request

URLs
GET zstack/v1/primary-storage/ceph/osdgroups
GET zstack/v1/primary-storage/ceph/osdgroups/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -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=b2c53eee77bc3bfea5374d417babff07
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/primary-storage/ceph/osdgroups/9ee0973b0e79393e9f7d03a6e3a6f645

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryCephOsdGroup, and pressing the Tab key.

API Response

Sample 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 See inventories 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.5.0
#inventories
Name Type Description Starting Version
primaryStorageUuid String The 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 The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0
uuid String The resource UUID. 4.5.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK
QueryCephOsdGroupAction action = new QueryCephOsdGroupAction();
action.conditions = asList("uuid=3e479fc0962c3561a854d868fce5ab3e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCephOsdGroupAction.Result res = action.call();
Python SDK
action = QueryCephOsdGroupAction()
action.conditions = ["uuid=45906504e89335809e54a79897eb1357"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()
API Reference | 5.5.38 | ZStack Cloud · ZCF | ZStack Resource Center