Document navigation

Backup Storage Operations

DeleteBackupStorage

API Request

URLs
DELETE zstack/v1/backup-storage/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 3cb9fd3d9fad4f64b62086b1aeabf42a" \
-X DELETE http://localhost:8080/zstack/v1/backup-storage/12b157dc061a46739168b6e87bf2657f?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
deleteMode String body Optional. The delete mode. Options: Permissive | Enforcing. Default mode: Permissive. 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
DeleteBackupStorageAction action = new DeleteBackupStorageAction();
action.uuid = "1c8acbc2af8445a5b631350276787580";
action.deleteMode = "Permissive";
action.sessionId = "4caf9cc241604dbca3088779d6772dbe";
DeleteBackupStorageAction.Result res = action.call();
Python SDK
DeleteBackupStorageAction action = DeleteBackupStorageAction()
action.uuid = "06473459fd474a26bb1d79e2edd004f3"
action.deleteMode = "Permissive"
action.sessionId = "a6fead8970fe45cfa6ba92e7dcf08d66"
DeleteBackupStorageAction.Result res = action.call()

QueryBackupStorage

API Request

URLs
GET zstack/v1/backup-storage
GET zstack/v1/backup-storage/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth dce9c25b65254343b0f9a568a661f348" \
-X GET http://localhost:8080/zstack/v1/backup-storage?q=uuid=435e61f882cf431bb4ae48246489a988
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth fe9a6571fc9949e7a0d31d94fae9b87c" \
-X GET http://localhost:8080/zstack/v1/backup-storage/1ab3b836a88342e1bbc1b1a17d092f0f

Queryable Fields

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

API Response

Sample Response (ImageStore)
{
    "inventories": [
        {
            "attachedZoneUuids": [
                "140ebc2fbdb74ae197323a69d432f25e"
            ],
            "availableCapacity": 4931431059456,
            "createDate": "Apr 11, 2018 2:50:54 PM",
            "description": "",
            "hostname": "172.20.1.115",
            "lastOpDate": "Dec 13, 2019 7:32:49 PM",
            "name": "image-store",
            "sshPort": 22,
            "state": "Enabled",
            "status": "Connected",
            "totalCapacity": 9992857976832,
            "type": "ImageStoreBackupStorage",
            "url": "/zstack_imagestore",
            "username": "root",
            "uuid": "1ab3b836a88342e1bbc1b1a17d092f0f"
        }
    ],
    "success": true
}
Sample Response (Ceph)
{
    "inventories": [
        {
            "attachedZoneUuids": [
                "195ae9157b9248e3889cc56cfd7d0f8d"
            ],
            "availableCapacity": 297500737536,
            "createDate": "Dec 14, 2019 9:46:05 AM",
            "description": "Test",
            "fsid": "d53902bc-ff50-4d08-8769-9d83448478d3",
            "lastOpDate": "Dec 14, 2019 11:30:40 AM",
            "mons": [
                {
                    "backupStorageUuid": "eed424abee694bcda5a5e414a61ea3d3",
                    "createDate": "Dec 14, 2019 9:46:05 AM",
                    "hostname": "172.24.249.174",
                    "lastOpDate": "Dec 14, 2019 11:21:46 AM",
                    "monAddr": "172.24.249.174",
                    "monPort": 6789,
                    "monUuid": "e6707015afc8405ba0b184ca7a318b63",
                    "sshPassword": "password",
                    "sshPort": 22,
                    "sshUsername": "root",
                    "status": "Connected"
                },
                {
                    "backupStorageUuid": "eed424abee694bcda5a5e414a61ea3d3",
                    "createDate": "Dec 14, 2019 9:46:05 AM",
                    "hostname": "172.24.252.188",
                    "lastOpDate": "Dec 14, 2019 11:21:45 AM",
                    "monAddr": "172.24.252.188",
                    "monPort": 6789,
                    "monUuid": "d5e70424ddac4c03ab06466d600ef4ae",
                    "sshPassword": "password",
                    "sshPort": 22,
                    "sshUsername": "root",
                    "status": "Connected"
                },
                {
                    "backupStorageUuid": "eed424abee694bcda5a5e414a61ea3d3",
                    "createDate": "Dec 14, 2019 9:46:05 AM",
                    "hostname": "172.24.247.108",
                    "lastOpDate": "Dec 14, 2019 11:21:16 AM",
                    "monAddr": "172.24.247.108",
                    "monPort": 6789,
                    "monUuid": "378826f5f690480983f39514e0b00f75",
                    "sshPassword": "password",
                    "sshPort": 22,
                    "sshUsername": "root",
                    "status": "Connected"
                }
            ],
            "name": "ceph-bs",
            "poolAvailableCapacity": 99166913877,
            "poolName": "bak-t-eed424abee694bcda5a5e414a61ea3d3",
            "poolReplicatedSize": 3,
            "poolUsedCapacity": 2787687082,
            "state": "Enabled",
            "status": "Connected",
            "totalCapacity": 305863802880,
            "type": "Ceph",
            "url": "not used",
            "uuid": "eed424abee694bcda5a5e414a61ea3d3"
        }
    ],
    "success": true
}
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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
QueryBackupStorageAction action = new QueryBackupStorageAction();
action.conditions = asList("uuid=b8e17834373747ae8b6555db80e74586");
action.sessionId = "f5d478c4facf42f4a3f16c8efbfd9628";
QueryBackupStorageAction.Result res = action.call();
Python SDK
QueryBackupStorageAction action = QueryBackupStorageAction()
action.conditions = ["uuid=0359113913834277bc815b446a6eff25"]
action.sessionId = "dc56b36c279f449ea2d430d2513a4cb0"
QueryBackupStorageAction.Result res = action.call()

ReconnectBackupStorage

API Request

URLs
PUT zstack/v1/backup-storage/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"reconnectBackupStorage": {},
"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 '{"reconnectBackupStorage":{}}' \
http://localhost:8080/zstack/v1/backup-storage/37ea58b550103d40b23420e870bd616f/actions
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

Sample Response
{
"inventory": {
"name": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:21 PM",
"lastOpDate": "Jun 7, 2017 9:20:21 PM",
"attachedZoneUuids": [
"410e621653de4bab8fd44f81e74b9225"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
ReconnectBackupStorageAction action = new ReconnectBackupStorageAction();
action.uuid = "f68e2350598547198b72bd578d14b037";
action.sessionId = "dcc8725e00f4437889104fe6ce942f96";
ReconnectBackupStorageAction.Result res = action.call(); 
Python SDK
ReconnectBackupStorageAction action = ReconnectBackupStorageAction()
action.uuid = "2f2571f4864c46778544b500d006dfe7"
action.sessionId = "a1c68d6ead48410ab9fd255d4c73f843"
ReconnectBackupStorageAction.Result res = action.call()

ChangeBackupStorageState

API Request

URLs
PUT zstack/v1/backup-storage/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"changeBackupStorageState": {
"stateEvent": "Disabled"
  },
"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 '{"changeBackupStorageState":{"stateEvent":"disable"}}' \
http://localhost:8080/zstack/v1/backup-storage/7d2e0c9d7b3734f28b3a22eab93ddb63/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
stateEvent String body (contained in the changeBackupStorageState structure) The target state of the backup storage.
  • enable
  • disable
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": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Disabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:45 PM",
"lastOpDate": "Jun 7, 2017 9:20:45 PM",
"attachedZoneUuids": [
"c1b882e3dfc944348ab63b478a64f257"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
ChangeBackupStorageStateAction action = new ChangeBackupStorageStateAction();
action.uuid = "35b513d450dd484b8aae9c2a5c488a76";
action.stateEvent = "Disabled";
action.sessionId = "6235716916cc4fffbc027a3cca374c5e";
ChangeBackupStorageStateAction.Result res = action.call();
Python SDK
ChangeBackupStorageStateAction action = ChangeBackupStorageStateAction()
action.uuid = "1576b0cf06b041d99e5f615b72bb384f"
action.stateEvent = "Disabled"
action.sessionId = "4226acacae2b489c8ba81e4af682a57a"
ChangeBackupStorageStateAction.Result res = action.call()

GetBackupStorageCapacity

API Request

URLs
GET zstack/v1/backup-storage/capacities
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 4804c84fa75e442e890d3a01a5bc2882" \
-X GET http://localhost:8080/zstack/v1/backup-storage/capacities?zoneUuids=6c4a26e1ec274395977b1fd98144dd27&all=true
Request Parameters
Name Type Location Description Optional Value Starting Version
zoneUuids List query Optional. The zone UUID list. 0.6
backupStorageUuids List query Optional. The backup storage UUID list.
  • Make sure that at least one of zoneUuids and backupStorageUuids is specified.
  • Or, set all to true.
0.6
all boolean query Optional. If backupStorageUuids is null, this parameter is set true, which means that all backup storages in the system are queried. 0.6
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

Sample Response
{
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8
}
Name Type Description Starting Version
totalCapacity long The total capacity. Unit: byte. 0.6
availableCapacity long The available capacity. Unit: byte. 0.6
success boolean Whether the API succeeds. 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
ErrorCode See error. 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

SDK Sample

Java SDK
GetBackupStorageCapacityAction action = new GetBackupStorageCapacityAction();
action.zoneUuids = asList("aae3e25dc11b41f8ae41739814949cfe");
action.all = true;
action.sessionId = "fbcc6cc548a44caea69bb492ea13a4bd";
GetBackupStorageCapacityAction.Result res = action.call();
Python SDK
GetBackupStorageCapacityAction action = GetBackupStorageCapacityAction()
action.zoneUuids = [afa2a794d1244f55acc0f8d2d0e5cdc7]
action.all = true
action.sessionId = "1574e3585df94016a047e1d836978f3e"
GetBackupStorageCapacityAction.Result res = action.call()

GetBackupStorageTypes

API Request

URLs
GET zstack/v1/backup-storage/types
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 47583a9a72f84121b84135296f3af8cf" \
-X GET http://localhost:8080/zstack/v1/backup-storage/types
Request Parameters
Name Type Location Description Optional Value Starting Version
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

Sample Response
{
"backupStorageTypes": [
"Ceph",
"ImageStore"
  ]
}
Name Type Description Starting Version
types List The type list of the backup storage. 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 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

SDK Sample

Java SDK
GetBackupStorageTypesAction action = new GetBackupStorageTypesAction();
action.sessionId = "010841c1e6ea46cd9cde645ad31cc2e4";
GetBackupStorageTypesAction.Result res = action.call();
Python SDK
GetBackupStorageTypesAction action = GetBackupStorageTypesAction()
action.sessionId = "0c34591f7bcf4460ba3db2791b164f01"
GetBackupStorageTypesAction.Result res = action.call()

UpdateBackupStorage

API Request

URLs
PUT zstack/v1/backup-storage/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateBackupStorage": {
"name": "New Name"
  },
"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 '{"updateBackupStorage":{"name":"New Name"}}' \
http://localhost:8080/zstack/v1/backup-storage/72f0f262f3323515b177d148ad1efb66/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the target backup storage. 0.6
name String body (contained in the updateBackupStorage structure) Optional. The new name of the backup storage. 0.6
description String body (contained in the updateBackupStorage structure) Optional. The new description of the backup storage. 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": "New Name",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:36 PM",
"lastOpDate": "Jun 7, 2017 9:20:36 PM",
"attachedZoneUuids": [
"90b2283f6c454453923dcf2f8e188330"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
UpdateBackupStorageAction action = new UpdateBackupStorageAction();
action.uuid = "2fe89c39bc2442aba58d5666d447b7c8";
action.name = "New Name";
action.sessionId = "1c2edd7a86564567ad34b7960808654e";
UpdateBackupStorageAction.Result res = action.call();
Python SDK
UpdateBackupStorageAction action = UpdateBackupStorageAction()
action.uuid = "f85f3310a70e4e01be84364aeb2caa42"
action.name = "New Name"
action.sessionId = "4176bd78f5754872b4963e0d3ddbc529"
UpdateBackupStorageAction.Result res = action.call()

ExportImageFromBackupStorage

API Request

URLs
PUT zstack/v1/backup-storage/{backupStorageUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"exportImageFromBackupStorage": {
"imageUuid": "bd09de6529704e168923b77e5c1445c3"
  },
"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 '{"exportImageFromBackupStorage":{"imageUuid":"0538b97654be3249a962327ace7c5520"}}' \
http://localhost:8080/zstack/v1/backup-storage/03c75cf832863825b43696ea22d5d1ad/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
backupStorageUuid String url The backup storage UUID. 1.7
imageUuid String body (contained in the exportImageFromBackupStorage structure) The image UUID. 1.7
exportFormat String body (contained in the exportImageFromBackupStorage structure) Optional. The format for storing the exported image. 3.9.0
systemTags List body Optional. The system tags. 1.7
userTags List body Optional. The user tags. 1.7

API Response

Sample Response
{
"imageUrl": "http://bs-host-name/path/to/image.qcow2",
  "exportMd5Sum": "8a239d17b045dea51c4677fa90a42ed8"
}
Name Type Description Starting Version
imageUrl String The exported image URL. 1.7
exportMd5Sum String The MD5 checksum value of the exported image. 3.9.0
success boolean Whether the API succeeds. 1.7
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 1.7
#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

SDK Sample

Java SDK
ExportImageFromBackupStorageAction action = new ExportImageFromBackupStorageAction();
action.backupStorageUuid = "b95c2eef6b8d44248305bc21b58324dd";
action.imageUuid = "a8e908dd49a444d2ad37dd729a2d881f";
action.sessionId = "f58bf3e6d8294d488573fc62511a2ad0";
ExportImageFromBackupStorageAction.Result res = action.call();
Python SDK
ExportImageFromBackupStorageAction action = ExportImageFromBackupStorageAction()
action.backupStorageUuid = "dda8b4f308534e98a5fc2facdbc7936e"
action.imageUuid = "7ed5c3c65ae941dabe9ecc00b7a1b015"
action.sessionId = "f724920d165944218cd71b76e755757e"
ExportImageFromBackupStorageAction.Result res = action.call()

DeleteExportedImageFromBackupStorage

API Request

URLs
DELETE/v1/backup-storage/{backupStorageUuid}/exported-images/{imageUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth bb7d8495054d412fa8c7c16b8625222c" \
-X DELETE http://localhost:8080/zstack/v1/backup-storage/c03c38ab9d184143891718c4b3f664d1/exported-images/dce27bd0a0ae4aaa8771ac33d481ec52?
Request Parameters
Name Type Location Description Optional Value Starting Version
backupStorageUuid String url The backup storage UUID. 1.7
imageUuid String url The image UUID. 1.7
systemTags List body Optional. The system tags. 1.7
userTags List body Optional. The user tags. 1.7

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
DeleteExportedImageFromBackupStorageAction action = new DeleteExportedImageFromBackupStorageAction();
action.backupStorageUuid = "9c781fd5c7334e8492c9d3409ad0c63a";
action.imageUuid = "b9b4f79d505040eba37ad6e4581b64fd";
action.sessionId = "ecce8dd56c3a476c8dd1ac90aeb0d321";
DeleteExportedImageFromBackupStorageAction.Result res = action.call();
Python SDK
DeleteExportedImageFromBackupStorageAction action = DeleteExportedImageFromBackupStorageAction()
action.backupStorageUuid = "29e4e1a659004403bd9b3738b36dd37e"
action.imageUuid = "2ba013855b8f4c688d977b545272541f"
action.sessionId = "e2c772523e104f3da969630930e68a17"
DeleteExportedImageFromBackupStorageAction.Result res = action.call()

SyncImage

API Request

URLs
PUT zstack/v1/backup-storage/image-store/{imageStoreUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "syncImage": {},
  "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 '{"syncImage":{}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store/81f447310d194ef5a8c0f7bbdcdc8401/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
imageStoreUuid String url The UUID of the backup storage. 4.7.11
systemTags List body Optional. The system tags. 4.7.11
userTags List body Optional. The user tags. 4.7.11

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"
	}
}
#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.7.11
description String The brief description of the error. 4.7.11
details String The details about the error. 4.7.11
elaboration String The reserved field. Default value: null. 4.7.11
opaque LinkedHashMap The reserved field. Default value: null. 4.7.11
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.7.11

SDK Sample

Java SDK
SyncImageAction action = new SyncImageAction();
action.imageStoreUuid = "cff07127e2134fe28396a1aaeb70a1cf";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SyncImageAction.Result res = action.call();
Python SDK
SyncImageAction action = SyncImageAction()
action.imageStoreUuid = "8a1247ffe8354566adb6ccae56aa1db3"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SyncImageAction.Result res = action.call()

AttachBackupStorageToZone

API Request

URLs
POST zstack/v1/zones/{zoneUuid}/backup-storage/{backupStorageUuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {},
  "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":{}}' http://localhost:8080/zstack/v1/zones/5776b543bc713f6d9abca9cd605c8199/backup-storage/53ef01cbf71d3bd68206908b87e51403
Request Parameters
Name Type Location Description Optional Value Starting Version
zoneUuid String url The zone UUID. 0.6
backupStorageUuid String url The backup storage 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": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1073741824,
"availableCapacity": 968884224,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:19 PM",
"lastOpDate": "Jun 7, 2017 9:20:19 PM",
"attachedZoneUuids": [
"73799602dbf64c0d85694de34fc596c3"
    ]
  }
}
Name Type Description Starting Version
success boolean 4.7.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
AttachBackupStorageToZoneAction action = new AttachBackupStorageToZoneAction();
action.zoneUuid = "426c6d907d3546378bd0007a74fc68e4";
action.backupStorageUuid = "d60efb0b61c3420a8e2d90d30054548f";
action.sessionId = "1b44ab68b73b4336a34aa10f6dc93cf8";
AttachBackupStorageToZoneAction.Result res = action.call();
Python SDK
AttachBackupStorageToZoneAction action = AttachBackupStorageToZoneAction()
action.zoneUuid = "a590b4b45fbf441499bc0eebc23966d8"
action.backupStorageUuid = "62be70c887354bcfbec52c64e88a6718"
action.sessionId = "bf4faf33fd544650928a0d0732a2f1c1"
AttachBackupStorageToZoneAction.Result res = action.call()

DetachBackupStorageFromZone

API Request

URLs
DELETE/v1/zones/{zoneUuid}/backup-storage/{backupStorageUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth d0143df7af864c029c386e8957d218b6" \
-X DELETE http://localhost:8080/zstack/v1/zones/cb571dd2f60740de9fea4d9003a9f33f/backup-storage/8cbfbfd5b24a4d01aaa7da5a6fc96169?
Request Parameters
Name Type Location Description Optional Value Starting Version
backupStorageUuid String url The backup storage UUID. 0.6
zoneUuid String url The zone 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": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:21 PM",
"lastOpDate": "Jun 7, 2017 9:20:21 PM",
"attachedZoneUuids": [
"c57c33405b544ee580e6892a796cff96"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
DetachBackupStorageFromZoneAction action = new DetachBackupStorageFromZoneAction();
action.backupStorageUuid = "a1b0bc9a79984c43bbf04da9d3ae6a4d";
action.zoneUuid = "c2be518dc66a4f3cb513d0cda54e9e96";
action.sessionId = "6256e305d8eb4d969dc244ae0b8fc7cb";
DetachBackupStorageFromZoneAction.Result res = action.call();
Python SDK
DetachBackupStorageFromZoneAction action = DetachBackupStorageFromZoneAction()
action.backupStorageUuid = "86342d8a57fb42c19113ff5311947874"
action.zoneUuid = "c33c4fb6a91d4c13a75014262256bfbd"
action.sessionId = "0b9369db754a4e01b6ab28bc1140bebc"
DetachBackupStorageFromZoneAction.Result res = action.call()

BackupStorageMigrateImage

API Request

URLs
PUT zstack/v1/backup-storage/images/{imageUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "backupStorageMigrateImage": {
    "srcBackupStorageUuid": "94a166b9be264f1cafc6de4373117711",
    "dstBackupStorageUuid": "01e8e16d56f44880bfe00bdd22da37ed"
  },
  "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 '{"backupStorageMigrateImage":{"srcBackupStorageUuid":"dc0d29bb93a93c9b859919c42b8ea583","dstBackupStorageUuid":"1a1c9bfe9f1d328c846e829339f91184"}}' \
http://localhost:8080/zstack/v1/backup-storage/images/728c33a3e6a5319c9276fb43ae982de7/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
imageUuid String url The image UUID. 2.2
srcBackupStorageUuid String body (contained in the backupStorageMigrateImage structure) The UUID of the source backup storage. 2.2
dstBackupStorageUuid String body (contained in the backupStorageMigrateImage structure) The UUID of the destination backup storage. 2.2
systemTags List body Optional. The system tags. 2.2
userTags List body Optional. The user tags. 2.2

API Response

Sample Response
{
  "inventory": {
    "uuid": "5030c88a703e41b986d140880ad79bcd",
    "name": "TinyLinux",
    "url": "http://192.168.1.20/share/images/tinylinux.qcow2",
    "mediaType": "RootVolumeTemplate",
    "platform": "Linux",
    "format": "qcow2",
    "backupStorageRefs": [
      {
        "id": 0.0,
        "imageUuid": "5030c88a703e41b986d140880ad79bcd",
        "backupStorageUuid": "21df59afa9414a0aa405cb4c4fef2fee",
        "installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd",
        "status": "Ready"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.2
inventory ImageInventory See inventory. 2.2
#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. 2.2
description String The brief description of the error. 2.2
details String The details about the error. 2.2
elaboration String The reserved field. Default value: null. 2.2
opaque LinkedHashMap The reserved field. Default value: null. 2.2
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.2
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 2.2
name String The resource name. 2.2
description String The detailed description of the resource. 2.2
state String 2.2
status String 2.2
size Long 2.2
actualSize Long 2.2
md5Sum String 2.2
url String 2.2
mediaType String 2.2
guestOsType String 2.2
type String 2.2
platform String 2.2
format String 2.2
system Boolean 2.2
createDate Timestamp The creation date. 2.2
lastOpDate Timestamp The last operation date. 2.2
backupStorageRefs List See backupStorageRefs. 2.2
#backupStorageRefs
Name Type Description Starting Version
imageUuid String The image UUID. 2.2
backupStorageUuid String The backup storage UUID. 2.2
installPath String 2.2
exportUrl String 2.2
exportMd5Sum String 2.2
status String 2.2
createDate Timestamp The creation date. 2.2
lastOpDate Timestamp The last operation date. 2.2

SDK Sample

Java SDK
BackupStorageMigrateImageAction action = new BackupStorageMigrateImageAction();
action.imageUuid = "c128546f17ba4dfc92055232549fd335";
action.srcBackupStorageUuid = "5346ba40a0d34caeb0b93f1b1a0db365";
action.dstBackupStorageUuid = "1a2dd487461f403eb47ac8c976c129a2";
action.sessionId = "c9fd105944334cddb33c03a1b3d3f423";
BackupStorageMigrateImageAction.Result res = action.call();
Python SDK
BackupStorageMigrateImageAction action = BackupStorageMigrateImageAction()
action.imageUuid = "ecda1a5ff835474897b59aedd04bee5e"
action.srcBackupStorageUuid = "84242c5298634005b748140d01538d6a"
action.dstBackupStorageUuid = "593ed6cba5b046aeb33b77a6ac1fa927"
action.sessionId = "6a214423493146078b5a2c9b3f74b80d"
BackupStorageMigrateImageAction.Result res = action.call()

GetBackupStorageCandidatesForImageMigration

API Request

URLs
GET zstack/v1/backup-storage/{srcBackupStorageUuid}/migration-candidates
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 3de5faeefb2d404ab8794990b744538c" \
-X GET http://localhost:8080/zstack/v1/backup-storage/3c738531e0b64399a354022d59a46ebb/migration-candidates
Request Parameters
Name Type Location Description Optional Value Starting Version
srcBackupStorageUuid String url The UUID of the backup storage whose images are to be migrated. 2.2
systemTags List query Optional. The system tags. 2.2
userTags List query Optional. The user tags. 2.2

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "7ed005f5dcfd4ca7b1883b97c803f53b",
      "name": "BS-1"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.2
inventories List See inventories. 2.2
#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. 2.2
description String The brief description of the error. 2.2
details String The details about the error. 2.2
elaboration String The reserved field. Default value: null. 2.2
opaque LinkedHashMap The reserved field. Default value: null. 2.2
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.2
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 2.2
name String The resource name. 2.2
url String 2.2
description String The detailed description of the resource. 2.2
totalCapacity Long 2.2
availableCapacity Long 2.2
type String 2.2
state String 2.2
status String 2.2
createDate Timestamp The creation date. 2.2
lastOpDate Timestamp The last operation date. 2.2
attachedZoneUuids List 2.2

SDK Sample

Java SDK
GetBackupStorageCandidatesForImageMigrationAction action = new GetBackupStorageCandidatesForImageMigrationAction();
action.srcBackupStorageUuid = "cf9fb97b3045411ab5345fe678116bf8";
action.sessionId = "2887bb5380f242f8ab43ae2d8649cb73";
GetBackupStorageCandidatesForImageMigrationAction.Result res = action.call();
Python SDK
GetBackupStorageCandidatesForImageMigrationAction action = GetBackupStorageCandidatesForImageMigrationAction()
action.srcBackupStorageUuid = "962c8f5399354df591c08fc3d25b58c1"
action.sessionId = "ab7451c36d8c4c3ea85d3c7395389fda"
GetBackupStorageCandidatesForImageMigrationAction.Result res = action.call()

ImageStore Backup Storage Operations

AddImageStoreBackupStorage

API Request

URLs
POST zstack/v1/backup-storage/image-store
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"hostname": "192.168.1.8",
"username": "admin",
"password": "admin%pass",
"sshPort": 22.0,
"url": "/data/imagestore",
"name": "ImageStore",
"importImages": false
  },
"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":{"hostname":"192.168.1.8","username":"admin","password":"admin%pass","sshPort":22.0,"url":"/data/imagestore","name":"ImageStore","importImages":false}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store
Request Parameters
Name Type Location Description Optional Value Starting Version
hostname String body (contained in the params structure) The hostname of the ImageStore backup storage. 1.6
username String body (contained in the params structure) The SSH username of the backup storage. This parameter is used to deploy Ansible. 1.6
password String body (contained in the params structure) The SSH password of the ImageStore backup storage. 1.6
sshPort int body (contained in the params structure) Optional. The SSH port of the ImageStore backup storage. 1.6
url String body (contained in the params structure) The path for storing local data in the ImageStore backup storage. 1.6
name String body (contained in the params structure) The name of the ImageStore backup storage. 1.6
description String body (contained in the params structure) Optional. The description of the ImageStore backup storage. 1.6
type String body (contained in the params structure) Optional. The backup storage type: ImageStoreBackupStorage. 1.6
importImages boolean body (contained in the params structure) Optional. Whether to import images. 1.9
resourceUuid String body (contained in the params structure) Optional. The resource UUID. If specified, the ImageStore backup storage will use this field as the UUID. 1.6
systemTags List body (contained in the params structure) Optional. The system tags. 1.6
userTags List body (contained in the params structure) Optional. The user tags. 1.6
Note:
  • When you add an ImageStore backup storage in ZStack Cloud, you can specify the method to mount the storage path of the ImageStore backup storage by adding the fsInfo option to SystemTags.
    • Format of the fsInfo option: fsInfo::type::$TYPE::url::$URL::options::$OPTIONS
    • Example: fsInfo::type::nfs::url::172.32.1.119:/nas/nfs2::options::nolock,vers=3,rsize=32768,wsize=32768

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
AddImageStoreBackupStorageAction action = new AddImageStoreBackupStorageAction();
action.hostname = "192.168.1.8";
action.username = "admin";
action.password = "admin%pass";
action.sshPort = 22.0;
action.url = "/data/imagestore";
action.name = "ImageStore";
action.importImages = false;
action.sessionId = "5171f258102a43368597dedd6317622b";
AddImageStoreBackupStorageAction.Result res = action.call();
Python SDK
AddImageStoreBackupStorageAction action = AddImageStoreBackupStorageAction()
action.hostname = "192.168.1.8"
action.username = "admin"
action.password = "admin%pass"
action.sshPort = 22.0
action.url = "/data/imagestore"
action.name = "ImageStore"
action.importImages = false
action.sessionId = "7b360d3775524a9780474b07ff68ed15"
AddImageStoreBackupStorageAction.Result res = action.call()

QueryImageStoreBackupStorage

API Request

URLs
GET zstack/v1/backup-storage/image-store
GET zstack/v1/backup-storage/image-store/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth f3580612efa9402082b0b57447e3fbc9" \
-X GET http://localhost:8080/zstack/v1/backup-storage/image-store?q=uuid=5870d2edddff4ccc9f27a67e3a23391a
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 3831efab7c7a40ce88149e508f433169" \
-X GET http://localhost:8080/zstack/v1/backup-storage/image-store/3f326deb28fa4176964867d888b197a4

Queryable Fields

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

API Response

Sample Response
{
  "inventories": [
    {
      "hostname": "127.0.0.1",
      "username": "zstack",
      "sshPort": 22.0,
      "uuid": "744dc382db7b3598af79246b67e45230",
      "name": "ImageStoreBS",
      "url": "/Cloud_bs",
      "description": "My ImageStore Backup Storage.",
      "totalCapacity": 1.099511627776E12,
      "availableCapacity": 5.49755813888E11,
      "type": "ImageStoreBackupStorage",
      "state": "Enabled",
      "status": "Connected",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM",
      "attachedZoneUuids": [
        "c3affca1fde2388691216e0f7884f515"
      ]
    }
  ]
}
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
hostname String 0.6
username String 0.6
sshPort Integer 0.6
uuid String The resource UUID. 0.6
name String The resource UUID. 0.6
url String 0.6
description String The detailed description of the resource. 0.6
totalCapacity Long 0.6
availableCapacity Long 0.6
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
QueryImageStoreBackupStorageAction action = new QueryImageStoreBackupStorageAction();
action.conditions = asList("uuid=d087b11dccd94ea8933ecc37b193fd50");
action.sessionId = "3b90553d582f4ec2aebfb8a384e4e447";
QueryImageStoreBackupStorageAction.Result res = action.call();
Python SDK
QueryImageStoreBackupStorageAction action = QueryImageStoreBackupStorageAction()
action.conditions = ["uuid=0c5b7c9cb2d84636aa2bbe20ce576ff8"]
action.sessionId = "89dbffa3dab64d5693b61cacce2d2268"
QueryImageStoreBackupStorageAction.Result res = action.call()

ReconnectImageStoreBackupStorage

API Request

URLs
PUT zstack/v1/backup-storage/image-store/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"reconnectImageStoreBackupStorage": {},
"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 '{"reconnectImageStoreBackupStorage":{}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store/a6d3a3c8a24b3f669fcecbb7bc6798ca/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the ImageStore backup storage. 1.6
systemTags List body (contained in the params structure) Optional. The system tags. 1.6
userTags List body (contained in the params structure) Optional. The user tags. 1.6

API Response

Sample Response
{
"inventory": {
"name": "ImageStore",
"totalCapacity": 1.073741824E9,
"availableCapacity": 8.05306368E8,
"state": "Enabled",
"status": "Connected",
"attachedZoneUuids": [
"3b8b703c308741ec9a38411d003fdcbe"
    ]
  }
}
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 ImageStoreBackupStorageInventory 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
hostname String 0.6
username String 0.6
sshPort Integer 0.6
uuid String The resource 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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
ReconnectImageStoreBackupStorageAction action = new ReconnectImageStoreBackupStorageAction();
action.uuid = "35f288ca1e2f4f719c4f284277f78545";
action.sessionId = "af42d38e4ccc499ea5ca72ea82beae11";
ReconnectImageStoreBackupStorageAction.Result res = action.call();
Python SDK
ReconnectImageStoreBackupStorageAction action = ReconnectImageStoreBackupStorageAction()
action.uuid = "751f52d7c74140119ca865261e30cafa"
action.sessionId = "075295f4c9fe45c185d1821e6c4d0f71"
ReconnectImageStoreBackupStorageAction.Result res = action.call()

UpdateImageStoreBackupStorage

API Request

URLs
PUT zstack/v1/backup-storage/image-store/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateImageStoreBackupStorage": {
"hostname": "192.168.1.18"
  },
"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 '{"updateImageStoreBackupStorage":{"hostname":"192.168.1.18"}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store/fa603f20ce2c370a8ba9d1928c3d6173/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
username String body (contained in the updateImageStoreBackupStorage structure) Optional. The SSH username of the ImageStore backup storage. This parameter is used to deploy Ansible. 1.6
password String body (contained in the updateImageStoreBackupStorage structure) Optional. The SSH password of the ImageStore backup storage. 1.6
hostname String body (contained in the updateImageStoreBackupStorage structure) Optional. The hostname of the ImageStore backup storage. 1.6
sshPort Integer body (contained in the updateImageStoreBackupStorage structure) Optional. The SSH port of the ImageStore backup storage. 1.6
uuid String url The ImageStore backup storage UUID. 1.6
name String body (contained in the updateImageStoreBackupStorage structure) Optional. The new name of the ImageStore backup storage. 1.6
description String body (contained in the updateImageStoreBackupStorage structure) Optional. The detailed description of the ImageStore backup storage. 1.6
systemTags List body (contained in the updateImageStoreBackupStorage structure) Optional. The system tags. 1.6
userTags List body (contained in the updateImageStoreBackupStorage structure) Optional. The user tags. 1.6

API Response

Sample Response
{
"inventory": {
"name": "New Name",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:12 PM",
"lastOpDate": "Jun 7, 2017 9:20:12 PM",
"attachedZoneUuids": [
"7c99892d8d5542faae4d1dd7d17be252"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
UpdateImageStoreBackupStorageAction action = new UpdateImageStoreBackupStorageAction();
action.hostname = "192.168.1.18";
action.uuid = "b7220dfd8c604483819df54af3e2e5df";
action.sessionId = "d9f658720aa84cc190cb26f84b4a9137";
UpdateImageStoreBackupStorageAction.Result res = action.call();
Python SDK
UpdateImageStoreBackupStorageAction action = UpdateImageStoreBackupStorageAction()
action.hostname = "192.168.1.18"
action.uuid = "9cf8df2338b9497d886ccb49dfb4278c"
action.sessionId = "4b8bc0b578ca4da1bb5baf1802480de2"
UpdateImageStoreBackupStorageAction.Result res = action.call()

ReclaimSpaceFromImageStore

API Request

URLs
PUT zstack/v1/backup-storage/image-store/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"reclaimSpaceFromImageStore": {},
"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 '{"reclaimSpaceFromImageStore":{}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store/ec74c4664f52342e898fb0fa966d915e/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The ImageStore backup storage UUID. 1.10
systemTags List body (contained in the params structure) Optional. The system tags. 1.10
userTags List body (contained in the params structure) Optional. The user tags. 1.10

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
ReclaimSpaceFromImageStoreAction action = new ReclaimSpaceFromImageStoreAction();
action.uuid = "1dbdc3a4c7cd47d288f6c71116ae5b1f";
action.sessionId = "2e4a160b40b64fb4a9faa04829000d68";
ReclaimSpaceFromImageStoreAction.Result res = action.call();
Python SDK
ReclaimSpaceFromImageStoreAction action = ReclaimSpaceFromImageStoreAction()
action.uuid = "713fa4965e6f4f70aeb1c96cd9d959ef"
action.sessionId = "87839a65f127443093bc708bcdaf3b0c"
ReclaimSpaceFromImageStoreAction.Result res = action.call()

Ceph Backup Storage Operations

AddCephBackupStorage

API Request

URLs
POST zstack/v1/backup-storage/ceph
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"monUrls": [
"10.0.1.2"
    ],
"poolName": "zs-images",
"name": "My Ceph Backup Storage",
"importImages": false
  },
"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.2"],"poolName":"zs-images","name":"My Ceph Backup Storage","importImages":false}}' \
http://localhost:8080/zstack/v1/backup-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 mon (monitor daemon ). 0.6
poolName String body (contained in the params structure) Optional. The name of the Ceph pool for storing images. 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 backup storage. 0.6
description String body (contained in the params structure) Optional. The detailed description of the Ceph backup storage. 0.6
type String body (contained in the params structure) Optional. The backup storage type: Ceph. 0.6
importImages boolean body (contained in the params structure) Optional. Whether to import images 1.9
resourceUuid String body (contained in the params structure) Optional. The resource UUID. If specified, the Ceph backup 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": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:17 PM",
"lastOpDate": "Jun 7, 2017 9:20:17 PM",
"attachedZoneUuids": [
"812bb731a83847ffba9d8caa3a4633d2"
    ]
  }
}
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 BackupStorageInventory 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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
AddCephBackupStorageAction action = new AddCephBackupStorageAction();
action.monUrls = asList("10.0.1.2");
action.poolName = "zs-images";
action.name = "My Ceph Backup Storage";
action.importImages = false;
action.sessionId = "a6df67e34a4840a38f6cdb1f5fdeeaa9";
AddCephBackupStorageAction.Result res = action.call();
Python SDK
AddCephBackupStorageAction action = AddCephBackupStorageAction()
action.monUrls = [10.0.1.2]
action.poolName = "zs-images"
action.name = "My Ceph Backup Storage"
action.importImages = false
action.sessionId = "fb435a60b1a84c3e82fd9dc90d933b39"
AddCephBackupStorageAction.Result res = action.call()

QueryCephBackupStorage

API Request

URLs
GET zstack/v1/backup-storage/ceph
GET zstack/v1/backup-storage/ceph/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth d380f3382f294e7bac14527b517d0c49" \
-X GET http://localhost:8080/zstack/v1/backup-storage/ceph?q=uuid=005420eeec6c4a6292939ea7fa8a954b
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 0aab3ffc9f9c49fba1932c9f2cf38434" \\
-X GET http://localhost:8080/zstack/v1/backup-storage/ceph/3e3c2f5e4f5d476ba1ef8e5ba42be06b

Queryable Fields

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

API Response

Sample Response
{
"inventories": [
    {
"name": "My Backup Storage",
"description": "Public Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:21:12 PM",
"lastOpDate": "Jun 7, 2017 9:21:12 PM",
"attachedZoneUuids": [
"1613a61a681b4d7790ffc1d2bd2870d3"
      ]
    }
  ]
}
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
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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

SDK Sample

Java SDK
QueryCephBackupStorageAction action = new QueryCephBackupStorageAction();
action.conditions = asList("uuid=fd7807cb1d744273bf8632362f2095aa");
action.sessionId = "940c1b37499e4e3c831625717ddb1c8f";
QueryCephBackupStorageAction.Result res = action.call();
Python SDK
QueryCephBackupStorageAction action = QueryCephBackupStorageAction()
action.conditions = ["uuid=2c8474f249234365993ba771e4b495ba"]
action.sessionId = "2b7bb843955e4574b8ca8862d0223f8d"
QueryCephBackupStorageAction.Result res = action.call()

UpdateCephBackupStorageMon

API Response

URLs
PUT zstack/v1/backup-storage/ceph/mons/{monUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"updateCephBackupStorageMon": {
"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 '{"updateCephBackupStorageMon":{"hostname":"10.0.1.4"}}' \
http://localhost:8080/zstack/v1/backup-storage/ceph/mons/c239e1d3164b3383bd12828632f706d6/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 updateCephBackupStorageMon structure) Optional. The new hostname of the Ceph mon. 0.6
sshUsername String body (contained in the updateCephBackupStorageMon structure) Optional. The SSH username of the Ceph mon. 0.6
sshPassword String body (contained in the updateCephBackupStorageMon structure) Optional. The SSH password of the Ceph mon. 0.6
sshPort Integer body (contained in the updateCephBackupStorageMon structure) Optional. The SSH port of the Ceph mon. 0.6
monPort Integer body (contained in the updateCephBackupStorageMon structure) Optional. The 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": "e1fd732039e64d3bb81d779cdea2e0e1"
      }
    ],
"name": "My Ceph Backup Storage",
"description": "Public Ceph Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:08 PM",
"lastOpDate": "Jun 7, 2017 9:20:08 PM",
"attachedZoneUuids": [
"073a93204ff54164af04748a7c2697c6"
    ]
  }
}
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 CephBackupStorageInventory 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
fsid String 0.6
poolName String 0.6
uuid String The resource 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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6
poolUsedCapacity Long 2.3.2
poolReplicatedSize Integer 2.3.2

poolAvailableCapacity

Long 2.3.2
mons List See mons. 0.6
#mons
Name Type Description Starting Version
hostname String 0.6
monPort Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
backupStorageUuid String The backup storage UUID. 0.6
monAddr String 0.6
sshPort Integer 0.6
status String 0.6
sshUsername String 0.6
sshPassword String 0.6
monUuid String 0.6

SDK Sample

Java SDK
UpdateCephBackupStorageMonAction action = new UpdateCephBackupStorageMonAction();
action.monUuid = "84b6fb1a92354d7081ac68d49c2c8346";
action.hostname = "10.0.1.4";
action.sessionId = "7012077b892a4102a98bc1a6a10b1b4f";
UpdateCephBackupStorageMonAction.Result res = action.call();
Python SDK
UpdateCephBackupStorageMonAction action = UpdateCephBackupStorageMonAction()
action.monUuid = "622aa943b0204bf3a6c44e63321823f4"
action.hostname = "10.0.1.4"
action.sessionId = "5958f913a1464da58e1be33de69d470b"
UpdateCephBackupStorageMonAction.Result res = action.call()

AddMonToCephBackupStorage

API Request

URLs
DELETE zstack/v1/backup-storage/ceph/{uuid}/mons
Headers
Authorization: OAuth the-session-uuid
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/backup-storage/ceph/5229b4e9acf934e1a80337a8090d72d1/mons
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the Ceph backup storage. 0.6
monUrls List body The URLs 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": "d79571a057c94c41b0fad2ca688a6cec"
      }
    ],
"name": "My Ceph Backup Storage",
"description": "Public Ceph Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:30 PM",
"lastOpDate": "Jun 7, 2017 9:20:30 PM",
"attachedZoneUuids": [
"4fd92cde485a4225b97c86846c9f586c"
    ]
  }
}
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 CephBackupStorageInventory 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
fsid String 0.6
poolName String 0.6
uuid String The resource 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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6

poolAvailableCapacity

Long 2.3.2
poolUsedCapacity Long 2.3.2
poolReplicatedSize Integer 2.3.2
mons List See mons. 0.6
#mons
Name Type Description Starting Version
hostname String 0.6
monPort Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
backupStorageUuid String The backup storage UUID. 0.6
monAddr String 0.6
sshPort Integer 0.6
status String 0.6
sshUsername String 0.6
sshPassword String 0.6
monUuid String 0.6

SDK Sample

Java SDK
RemoveMonFromCephBackupStorageAction action = new RemoveMonFromCephBackupStorageAction();
action.uuid = "728cc9123a694a39a9e1915d9e50ee9f";
action.monHostnames = asList("10.0.1.2");
action.sessionId = "e12938edf7634fcebba3938d07acde47";
RemoveMonFromCephBackupStorageAction.Result res = action.call();
Python SDK
RemoveMonFromCephBackupStorageAction action = RemoveMonFromCephBackupStorageAction()
action.uuid = "eede3cd9cbca4b3289e92a976619b67d"
action.monHostnames = [10.0.1.2]
action.sessionId = "fb2ddd76c26f43729fe5346e196c8532"
RemoveMonFromCephBackupStorageAction.Result res = action.call()

RemoveMonFromCephBackupStorage

API Response

URLs
DELETE zstack/v1/backup-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 861c8d1f7c6c483fbde2a23f8e846e4a" \
-X DELETE http://localhost:8080/zstack/v1/backup-storage/ceph/3a6bd95933784fc49717392356cb67f3/mons?monHostnames=10.0.1.2
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The UUID of the Ceph backup storage. 0.6
monHostnames List body The hostnames 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": "d79571a057c94c41b0fad2ca688a6cec"
      }
    ],
"name": "My Ceph Backup Storage",
"description": "Public Ceph Backup Storage",
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8,
"type": "Ceph",
"state": "Enabled",
"status": "Connected",
"createDate": "Jun 7, 2017 9:20:30 PM",
"lastOpDate": "Jun 7, 2017 9:20:30 PM",
"attachedZoneUuids": [
"4fd92cde485a4225b97c86846c9f586c"
    ]
  }
}
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 CephBackupStorageInventory 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
fsid String 0.6
poolName String 0.6
uuid String The resource 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
type String 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
attachedZoneUuids List 0.6
poolUsedCapacity Long 2.3.2
poolReplicatedSize Integer 2.3.2

poolAvailableCapacity

Long 2.3.2
mons List See mons. 0.6
#mons
Name Type Description Starting Version
hostname String 0.6
monPort Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
backupStorageUuid String The backup storage UUID. 0.6
monAddr String 0.6
sshPort Integer 0.6
status String 0.6
sshUsername String 0.6
sshPassword String 0.6
monUuid String 0.6

SDK Sample

Java SDK
RemoveMonFromCephBackupStorageAction action = new RemoveMonFromCephBackupStorageAction();
action.uuid = "728cc9123a694a39a9e1915d9e50ee9f";
action.monHostnames = asList("10.0.1.2");
action.sessionId = "e12938edf7634fcebba3938d07acde47";
RemoveMonFromCephBackupStorageAction.Result res = action.call();
Python SDK
RemoveMonFromCephBackupStorageAction action = RemoveMonFromCephBackupStorageAction()
action.uuid = "eede3cd9cbca4b3289e92a976619b67d"
action.monHostnames = [10.0.1.2]
action.sessionId = "fb2ddd76c26f43729fe5346e196c8532"
RemoveMonFromCephBackupStorageAction.Result res = action.call()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center