Storage representation.
A list of storages, with the most relevant information, is typically fetched from Storages API. A more detailed information about a specific storage can be fetched from Storage details API.
When creating a storage, one would typically use Builder API to define an instance of a storage, and then pass it to Resource creation API to actually create the storage.
To create a storage, the only required properties are size, title, and zone.
import static fi.linuxbox.upcloud.resource.Builder.*
def staticFiles = storage {
size = '10'
title = 'frontend server 1 static files'
zone = 'fi-hel1'
}
There are a few optional properties that can be set.
import static fi.linuxbox.upcloud.resource.Builder.*
def staticFiles = storage {
// skipping mandatory properties and showing only
// optional properties with their default values:
tier = 'hdd'
backupRule = null
}
There are a few properties that can not be set when creating a storage: access, backups, licence, servers, state, type, and uuid. Most of these can not be manipulated from client side at all.
Fields inherited from class | Fields |
---|---|
class Resource |
__$stMC |
Type | Name and description |
---|---|
String |
access Storage access type: public or private . |
BackupRule |
backupRule Storage backup rule. |
List<String> |
backups Storage UUIDs of the backups for this storage. |
Integer |
licence Amount of credits per hour per CPU required by this storage license. |
List<String> |
servers Server UUIDs of servers where this storage is attached. |
Integer |
size Size of this storage in gigabytes. |
String |
state Storage state: online , maintenance , cloning , backuping , or error . |
String |
tier Storage tier: hdd , or maxiops . |
String |
title Title of this storage. |
String |
type Storage type: disk , cdrom , template , or backup . |
String |
uuid Unique identifier of this storage. |
String |
zone Zone ID where this storage is located. |
Methods inherited from class | Name |
---|---|
class Resource |
setProperty, getProperty, toString, asType, getMetaClass, setMetaClass, wrapper, propertyMissing, propertyMissing, methodMissing, proj, invokeMethod, this$dist$invoke$1, this$dist$set$1, this$dist$get$1, super$1$toString, getHTTP, getSESSION, getMETA, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Storage access type: public
or private
.
This is available in the storage list and details responses. This can not be specified when creating, modifying, or cloning a storage, since all user created storages are private.
Storage backup rule.
This is available in the storage details response. This can optionally be specified when creating or
modifying a storage. When creating a storage, this defaults to null
(no backup rule). When
modifying a storage, leaving this unspecified means that any existing backup rule will stay unaffected.
This can not be specified when cloning a storage.
Storage UUIDs of the backups for this storage.
This is available in the storage details response. This can not be specified when creating, modifying, or cloning a storage.
Amount of credits per hour per CPU required by this storage license.
This is available in the storage list and details responses. This can not be specified when creating, modifying, or cloning a storage.
Server UUIDs of servers where this storage is attached.
This is available in the storage details response. This can not be specified when creating, modifying, or cloning a storage.
A storage can be attached to a server, or detached from a server, via Server.attach or Server.detach APIs. Also, certain kinds of storages can be loaded as CD-ROMs via Server.insert API.
Size of this storage in gigabytes.
This is available in the storage list and details responses. This must be specified when creating a storage. This can optionally be specified when modifying a storage, but must be larger than the current size. Note also, that partition table and filesystem sizes are not updated automatically when resizing a storage via this property. This can not be specified when cloning a storage.
Storage state: online
, maintenance
, cloning
, backuping
, or error
.
This is available in the storage list and details responses. This can not be specified when creating, modifying, or cloning a storage.
Storage tier: hdd
, or maxiops
.
This is available in the storage list and details responses. This can optionally be specified when
creating or cloning a storage, where this defaults to hdd
. This can not be modified.
Title of this storage.
This is available in the storage list and details responses. This must be specified when creating or cloning a storage, and can optionally be specified when modifying a storage.
Storage type: disk
, cdrom
, template
, or backup
.
This is available in the storage list and details responses. This can not be specified when creating, modifying, or cloning a storage.
When creating or cloning a storage, its type becomes disk
. Templates can be created via
Storage.templatize API, and backups
can be created via
Storage.backup API.
Unique identifier of this storage.
This is available in the storage list and details responses. This can not be specified when creating, modifying, or cloning a storage.
Zone ID where this storage is located.
This is available in the storage list and details responses. This must be specified when creating or cloning a storage. This can not be specified when modifying a storage. See UpCloud.zones.
Transferring a storage between zones is possible via Storage.clone API.