Image Storage Related Interfaces

DeleteBackupStorage

API Request

URLs
DELETE zstack/v1/backup-storage/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource, uniquely identifies the resource 0.6
deleteMode (Optional) String body Delete mode (Permissive or Enforcing, default is Permissive) 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

On success, this API returns an empty JSON structure {}. On error, the returned JSON structure contains an error field, for example:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Examples

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 Example
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

Run the CLI command tool, enter QueryBackupStorage and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Response Example (Standalone Image Storage)
{
    "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
}
Response Example (Distributed Image Storage)
{
    "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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventories List See inventories 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url Resource UUID, uniquely identifies the resource 0.6
stateEvent String body (contained in changeBackupStorageState structure) Target state of the backup storage
  • enable
  • disable
0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
zoneUuids (Optional) List query Data Center UUID list 0.6
backupStorageUuids (Optional) List query Backup Storage UUID list
  • At least one of zoneUuids or backupStorageUuids must not be empty
  • If both zoneUuids and backupStorageUuids are empty, all is true
0.6
all (Optional) boolean query When the backup storage UUID list is empty, this field being true queries all backup storage in the system. 0.6
systemTags (Optional) List query System tags 0.6
userTags (Optional) List query User tags 0.6

API Response

Response Example
{
"totalCapacity": 1.073741824E9,
"availableCapacity": 9.68884224E8
}
Name Type Description Starting Version
totalCapacity long Total capacity (in bytes) 0.6
availableCapacity long Available capacity (in bytes) 0.6
success boolean Success or failure flag 0.6
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
ErrorCode See error 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6

SDK Examples

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 Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 47583a9a72f84121b84135296f3af8cf" \
-X GET http://localhost:8080/zstack/v1/backup-storage/types
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (Optional) List query System tags 0.6
userTags (Optional) List query User tags 0.6

API Response

Response Example
{
"backupStorageTypes": [
"Ceph",
"ImageStore"
  ]
}
Name Type Description Starting Version
types List Backup storage type list 0.6
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the target backup storage 0.6
name (Optional) String body (contained in updateBackupStorage structure) New name of the backup storage 0.6
description (Optional) String body (contained in updateBackupStorage structure) New detailed description of the backup storage 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
backupStorageUuid String url Backup Storage UUID 1.7
imageUuid String body (contained in exportImageFromBackupStorage structure) Image UUID 1.7
exportFormat (Optional) String body (contained in exportImageFromBackupStorage structure) Export format of the image 3.9.0
systemTags (Optional) List body System tags 1.7
userTags (Optional) List body User tags 1.7

API Response

Response Example
{"imageUrl": "http://bs-host-name/path/to/image.qcow2",
  "exportMd5Sum": "8a239d17b045dea51c4677fa90a42ed8"
}
Name Type Description Starting Version
imageUrl String Access URL of the exported image 1.7
exportMd5Sum String MD5 value of the exported image 3.9.0
success boolean Export success or failure flag 1.7
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 1.7
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6

SDK Examples

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()

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
imageStoreUuid String url Image Storage UUID 4.7.11
systemTags (Optional) List body System tags 4.7.11
userTags (Optional) List body User tags 4.7.11

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 4.7.11
description String Brief description of the error 4.7.11
details String Detailed error information 4.7.11
elaboration String Reserved field, defaults to null 4.7.11
opaque LinkedHashMap Reserved field, defaults to null 4.7.11
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 4.7.11

SDK Examples

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()

DeleteExportedImageFromBackupStorage

API Request

URLs
DELETE/v1/backup-storage/{backupStorageUuid}/exported-images/{imageUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
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?
Parameter List
Name Type Location Description Allowed Values Starting Version
backupStorageUuid String url Backup Storage UUID 1.7
imageUuid String url Image UUID 1.7
systemTags (Optional) List body System tags 1.7
userTags (Optional) List body User tags 1.7

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Examples

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()

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
zoneUuid String url Data Center UUID 0.6
backupStorageUuid String url Backup Storage UUID 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Whether the operation succeeded. 4.7.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 Example
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?
Parameter List
Name Type Location Description Allowed Values Starting Version
backupStorageUuid String url Backup Storage UUID 0.6
zoneUuid String url Data Center UUID 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
imageUuid String url Image UUID 2.2
srcBackupStorageUuid String body (contained in backupStorageMigrateImage structure) Source Backup Storage UUID 2.2
dstBackupStorageUuid String body (contained in backupStorageMigrateImage structure) Destination Backup Storage UUID 2.2
systemTags (Optional) List body System tags 2.2
userTags (Optional) List body User tags 2.2

API Response

Response Example
{
  "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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 2.2
inventory ImageInventory See inventory 2.2
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 2.2
description String Brief description of the error 2.2
details String Detailed error information 2.2
elaboration String Reserved field, defaults to null 2.2
opaque LinkedHashMap Reserved field, defaults to null 2.2
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 2.2
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.2
name String Resource name 2.2
description String Detailed description of the resource 2.2
state String The resource state. 2.2
status String The resource status. 2.2
size Long The size. 2.2
actualSize Long The actual size. 2.2
md5Sum String The MD5 sum. 2.2
url String The URL. 2.2
mediaType String The media type. 2.2
guestOsType String The guest OS type. 2.2
type String The resource type. 2.2
platform String The platform. 2.2
format String The format. 2.2
system Boolean The system. 2.2
createDate Timestamp Creation time 2.2
lastOpDate Timestamp Last modification time 2.2
backupStorageRefs List See backupStorageRefs 2.2
#backupStorageRefs
Name Type Description Starting Version
imageUuid String Image UUID 2.2
backupStorageUuid String Backup Storage UUID 2.2
installPath String The installation path. 2.2
exportUrl String The export URL. 2.2
exportMd5Sum String The export MD5 sum. 2.2
status String The resource status. 2.2
createDate Timestamp Creation time 2.2
lastOpDate Timestamp Last modification time 2.2

SDK Examples

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

Get the candidate list of target backup storage for image migration.

API Request

URLs
GET zstack/v1/backup-storage/{srcBackupStorageUuid}/migration-candidates
Headers
Authorization: OAuth the-session-uuid
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
srcBackupStorageUuid String url UUID of the backup storage where the image to be migrated is located 2.2
systemTags (Optional) List query System tags 2.2
userTags (Optional) List query User tags 2.2

API Response

Response Example
{
  "inventories": [
    {
      "uuid": "7ed005f5dcfd4ca7b1883b97c803f53b",
      "name": "BS-1"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 2.2
inventories List See inventories 2.2
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 2.2
description String Brief description of the error 2.2
details String Detailed error information 2.2
elaboration String Reserved field, defaults to null 2.2
opaque LinkedHashMap Reserved field, defaults to null 2.2
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 2.2
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 2.2
name String Resource name 2.2
url String The URL. 2.2
description String Detailed description of the resource 2.2
totalCapacity Long The total capacity. 2.2
availableCapacity Long The available capacity. 2.2
type String The resource type. 2.2
state String The resource state. 2.2
status String The resource status. 2.2
createDate Timestamp Creation time 2.2
lastOpDate Timestamp Last modification time 2.2
attachedZoneUuids List The attached zone UUIDs. 2.2

SDK Examples

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()

Standalone Image Storage Related Interfaces

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
hostname String body (contained in params structure) Server host address 1.6
username String body (contained in params structure) Server SSH username (for Ansible deployment) 1.6
password String body (contained in params structure) Server SSH user password 1.6
sshPort (Optional) int body (contained in params structure) Server SSH port 1.6
url String body (contained in params structure) Local data storage path for the image storage 1.6
name String body (contained in params structure) Standalone image storage name 1.6
description (Optional) String body (contained in params structure) Detailed description of the image storage 1.6
type (Optional) String body (contained in params structure) This is ImageStoreBackupStorage 1.6
importImages (Optional) boolean body (contained in params structure) Whether to import images 1.9
resourceUuid (Optional) String body (contained in params structure) Resource UUID. If specified, the image storage will use this value as its UUID 1.6
systemTags (Optional) List body (contained in params structure) System tags 1.6
userTags (Optional) List body (contained in params structure) User tags 1.6
Note:
  • When adding an image storage server with ZStack ZSphere, you can specify the mount type for the image storage path. Add fsInfo option to SystemTags.
    • Option format: 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

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Examples

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 Example
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

Run the CLI command tool, enter QueryImageStoreBackupStorage and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Response Example
{
  "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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventories List See inventories 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventories
Name Type Description Starting Version
hostname String The hostname. 0.6
username String The username. 0.6
sshPort Integer The SSH port. 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the standalone image storage 1.6
systemTags (Optional) List body (contained in params structure) System tags 1.6
userTags (Optional) List body (contained in params structure) User tags 1.6

API Response

Response Example
{
"inventory": {
"name": "ImageStore",
"totalCapacity": 1.073741824E9,
"availableCapacity": 8.05306368E8,
"state": "Enabled",
"status": "Connected",
"attachedZoneUuids": [
"3b8b703c308741ec9a38411d003fdcbe"
    ]
  }
}
Name Type Description Starting Version
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory ImageStoreBackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
hostname String The hostname. 0.6
username String The username. 0.6
sshPort Integer The SSH port. 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
username (Optional) String body (contained in updateImageStoreBackupStorage structure) SSH username (for Ansible deployment) 1.6
password (Optional) String body (contained in updateImageStoreBackupStorage structure) SSH user password 1.6
hostname (Optional) String body (contained in updateImageStoreBackupStorage structure) Image storage hostname 1.6
sshPort (Optional) Integer body (contained in updateImageStoreBackupStorage structure) SSH port number 1.6
uuid String url UUID of the image storage 1.6
name (Optional) String body (contained in updateImageStoreBackupStorage structure) New name of the image storage 1.6
description (Optional) String body (contained in updateImageStoreBackupStorage structure) Updated description of the image storage 1.6
systemTags (Optional) List body (contained in updateImageStoreBackupStorage structure) System tags 1.6
userTags (Optional) List body (contained in updateImageStoreBackupStorage structure) User tags 1.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the image storage, uniquely identifies the resource 1.10
systemTags (Optional) List body (contained in params structure) System tags 1.10
userTags (Optional) List body (contained in params structure) User tags 1.10

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Examples

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()

SetImageStoreBackupStorageQuota

API Request

URLs
PUT zstack/v1/backup-storage/image-store/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "setImageStoreBackupStorageQuota": {
    "uuids": [
      "ff0e1223a4983a10b94369dc6b93ce00"
    ],
    "maxCapacity": 1099511627776
  },
  "systemTags": [],
  "userTags": []
}
Note: In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setImageStoreBackupStorageQuota":{"uuids":["ff0e1223a4983a10b94369dc6b93ce00"],"maxCapacity":1099511627776}}' \
http://localhost:8080/zstack/v1/backup-storage/image-store/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
uuids (Optional) List body (contained in setImageStoreBackupStorageQuota structure) Optional. The resource UUIDs. 0.6
maxCapacity long body (contained in setImageStoreBackupStorageQuota structure) The max capacity. 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

This API returns an empty JSON structure {} on success. On error, the returned JSON structure contains an error field, for example:
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Examples

Java SDK
SetImageStoreBackupStorageQuotaAction action = new SetImageStoreBackupStorageQuotaAction();
action.uuids = asList("ff0e1223a4983a10b94369dc6b93ce00");
action.maxCapacity = 1099511627776;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetImageStoreBackupStorageQuotaAction.Result res = action.call();
Python SDK
SetImageStoreBackupStorageQuotaAction action = SetImageStoreBackupStorageQuotaAction()
action.uuids = [ff0e1223a4983a10b94369dc6b93ce00]
action.maxCapacity = 1099511627776
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetImageStoreBackupStorageQuotaAction.Result res = action.call()

Distributed Image Storage Related Interfaces

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
monUrls List body (contained in params structure) List of mon addresses for the distributed image storage 0.6
poolName (Optional) String body (contained in params structure) Name of the distributed image storage pool used to store images 0.6
url String body (contained in params structure) Not used 0.6
name String body (contained in params structure) Image storage name 0.6
description (Optional) String body (contained in params structure) Detailed description of the image storage 0.6
type (Optional) String body (contained in params structure) Type of the image storage, here it is distributed image storage 0.6
importImages (Optional) boolean body (contained in params structure) Whether to import images after adding 1.9
resourceUuid (Optional) String body (contained in params structure) Resource UUID. If specified, the image storage will use this value as its UUID. 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory BackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 Example
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

Run the CLI command tool, enter QueryCephBackupStorage and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventories List See inventories 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

SDK Examples

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 Request

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 example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
monUuid String url Monitor node UUID 0.6
hostname (Optional) String body (contained in updateCephBackupStorageMon structure) New host IP address for the monitor node 0.6
sshUsername (Optional) String body (contained in updateCephBackupStorageMon structure) SSH username for the monitor node host 0.6
sshPassword (Optional) String body (contained in updateCephBackupStorageMon structure) SSH password for the monitor node host 0.6
sshPort (Optional) Integer body (contained in updateCephBackupStorageMon structure) SSH port for the monitor node host 0.6
monPort (Optional) Integer body (contained in updateCephBackupStorageMon structure) Port of the monitor node 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory CephBackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
fsid String The fsid. 0.6
poolName String The pool name. 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6
poolUsedCapacity Long The pool used capacity. 2.3.2
poolReplicatedSize Integer The pool replicated size. 2.3.2

poolAvailableCapacity

Long The pool available capacity. 2.3.2
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 Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
backupStorageUuid String Image storage UUID 0.6
monAddr String The mon addr. 0.6
sshPort Integer The SSH port. 0.6
status String The resource status. 0.6
sshUsername String The SSH username. 0.6
sshPassword String The SSH password. 0.6
monUuid String The mon UUID. 0.6

SDK Examples

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 Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the distributed image storage 0.6
monUrls List body List of monitor node names 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory CephBackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
fsid String The fsid. 0.6
poolName String The pool name. 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6

poolAvailableCapacity

Long The pool available capacity. 2.3.2
poolUsedCapacity Long The pool used capacity. 2.3.2
poolReplicatedSize Integer The pool replicated size. 2.3.2
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 Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
backupStorageUuid String Image storage UUID 0.6
monAddr String The mon addr. 0.6
sshPort Integer The SSH port. 0.6
status String The resource status. 0.6
sshUsername String The SSH username. 0.6
sshPassword String The SSH password. 0.6
monUuid String The mon UUID. 0.6

SDK Examples

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 Request

URLs
DELETE zstack/v1/backup-storage/ceph/{uuid}/mons?monHostnames={monHostnames}
Headers
Authorization: OAuth the-session-uuid
Curl Example
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
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the distributed image storage 0.6
monHostnames List body List of monitor node names 0.6
systemTags (Optional) List body System tags 0.6
userTags (Optional) List body User tags 0.6

API Response

Response Example
{
"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 Error code. If not null, the operation failed. This field is null when the operation succeeds. See error 0.6
inventory CephBackupStorageInventory See inventory 0.6
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier, for example SYS.1000, HOST.1001 0.6
description String Brief description of the error 0.6
details String Detailed error information 0.6
elaboration String Reserved field, defaults to null 0.6
opaque LinkedHashMap Reserved field, defaults to null 0.6
cause ErrorCode Root cause. The source error that triggered the current error. This field is null if there is no original error 0.6
#inventory
Name Type Description Starting Version
fsid String The fsid. 0.6
poolName String The pool name. 0.6
uuid String Resource UUID, uniquely identifies the resource 0.6
name String Resource name 0.6
url String The URL. 0.6
description String Detailed description of the resource 0.6
totalCapacity Long The total capacity. 0.6
availableCapacity Long The available capacity. 0.6
type String The resource type. 0.6
state String The resource state. 0.6
status String The resource status. 0.6
createDate Timestamp Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
attachedZoneUuids List The attached zone UUIDs. 0.6
poolUsedCapacity Long The pool used capacity. 2.3.2
poolReplicatedSize Integer The pool replicated size. 2.3.2

poolAvailableCapacity

Long The pool available capacity. 2.3.2
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 Creation time 0.6
lastOpDate Timestamp Last modification time 0.6
backupStorageUuid String Image storage UUID 0.6
monAddr String The mon addr. 0.6
sshPort Integer The SSH port. 0.6
status String The resource status. 0.6
sshUsername String The SSH username. 0.6
sshPassword String The SSH password. 0.6
monUuid String The mon UUID. 0.6

SDK Examples

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 | ZStack ZSphere · ZVF | ZStack Resource Center