Storage related APIs.
This class provides the following APIs:
This trait can be implemented by any class that has
Type Params | Return Type | Name and description |
---|---|---|
|
def |
backup(Resource resource, def... args) Creates a backup of an existing storage resource. |
|
def |
cancel(def... args) Cancels an incomplete cloning operation. |
|
def |
clone(Resource resource, def... args) Creates an exact copy of an existing storage resource. |
|
def |
delete(def... args) Delete an existing storage resource. |
|
def |
favor(def... args) Adds the storage to the favorites. |
|
AbstractSession<?> |
getHTTP() |
|
String |
getUuid() |
|
def |
load(def... args) Fetch detailed information about a specific Storage. |
|
def |
restore(def... args) Restores the origin storage from this backup. |
|
def |
templatize(Resource resource, def... args) Creates an exact copy of an existing storage resource. |
|
def |
unfavor(def... args) Removes the storage from the favorites. |
|
def |
update(Resource resource, def... args) Modifies the configuration of an existing storage. |
Creates a backup of an existing storage resource.
A 201 Created
response will include an instance of Storage
in the storage
property.
import static fi.linuxbox.upcloud.resource.Builder.*
def myBackup = storage {
title = 'Manually created backup'
}
storageApi.backup myBackup { resp, err ->
assert resp?.storage instanceof Storage
}
resource
- Specification of the backupargs
- Request callbacks for the POST /storage/${storage.uuid}/backup
call.Cancels an incomplete cloning operation.
Cancelling the cloning will stop the cloning operation, remove the incomplete new storage and return the source storage back to online state.
A 204 No Content
response signifies success.
args
- Request callbacks for the POST /storage/${storage.uuid}/cancel
call.Creates an exact copy of an existing storage resource.
A 201 Created
response will include an instance of Storage
in the storage
property.
import static fi.linuxbox.upcloud.resource.Builder.*
def cloneOfOsDisk = storage {
zone = 'fi-hel1'
tier = 'maxiops'
title = 'Clone of operating system disk'
}
storageApi.clone cloneOfOsDisk { resp, err ->
assert resp?.storage instanceof Storage
}
resource
- Specification of the cloneargs
- Request callbacks for the POST /storage/${storage.uuid}/clone
call.Delete an existing storage resource.
The storage can not be attached to any server.
Any backups, clones, or templates created from this storage are not deleted. Restoring a backup will recreate this storage.
A 204 No Content
response signifies success.
args
- Request callbacks for the DELETE /storage/${storage.uuid}
call.Adds the storage to the favorites.
This operation succeeds even if the storage already is a favorite.
Favorite storages can be listed with Storages API,
by specifying a keyword argument type: "favorite"
.
A 204 No Content
response signifies success.
args
- Request callbacks for the POST /storage/${storage.uuid}/favorite
call.Fetch detailed information about a specific Storage.
A 200 OK
response will include an instance of Storage
in the storage
property.
storageApi.load { resp, err ->
assert resp?.storage instanceof Storage
}
While this operation returns details of a single storage, a less details list of all storages can be requested with the UpCloud.storages API.
args
- Request callbacks for the GET /storage/${storage.uuid}
call.Restores the origin storage from this backup.
If the origin storage is attached to a server, the server must first be stopped or the storage has to be detached.
A 204 No Content
response signifies success.
args
- Request callbacks for the POST /storage/${storage.uuid}/restore
call.Creates an exact copy of an existing storage resource.
Only storage resources on the maxiops
Storage.tier can be
templatized.
The differences between cloning and templatizing a resource are that any storage tier can be cloned and cloning can happen across zones, but only templates can be used when creating a server OS disk from a template.
A 201 Created
response will include an instance of Storage
in the storage
property.
import static fi.linuxbox.upcloud.resource.Builder.*
def myTemplate = storage {
title = 'My server template'
}
storageApi.templatize myTemplate { resp, err ->
assert resp?.storage instanceof Storage
}
resource
- Specification of the templateargs
- Request callbacks for the POST /storage/${storage.uuid}/templatize
call.Removes the storage from the favorites.
This operation succeeds even if the storage is not a favorite.
Favorite storages can be listed with Storages API,
by specifying a keyword argument type: "favorite"
.
A 204 No Content
response signifies success.
args
- Request callbacks for the DELETE /storage/${storage.uuid}/favorite
call.Modifies the configuration of an existing storage.
A 202 Accepted
response will include an instance of Storage
in the storage
property.
import static fi.linuxbox.upcloud.resource.Builder.*
def staticFiles = storage {
size = 20
title = 'A larger storage'
}
storageApi.update staticFiles { resp, err ->
assert resp?.storage instanceof Storage
}
resource
- Updated storage resource.args
- Request callbacks for the PUT /storage/${storage.uuid}
call.