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

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 0.6
description String The detailed description of the resource. 0.6
totalCapacity Long 0.6
availableCapacity Long 0.6
totalPhysicalCapacity Long 0.6
availablePhysicalCapacity Long 0.6
systemUsedCapacity Long 0.6
type String 0.6
state String 0.6
status String 0.6
mountPath String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedClusterUuids List 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
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()