Creating a block-storage client is straight-forward:
var oneandone = pkgcloud.blockstorage.createClient({
provider: 'oneandone', // required
token: 'apikey', // required
});
More options for creating clients
A Snapshot for BlockStorage has the following properties:
{
id: '12345678-1111-2222-3333-123456789012', // id of the snapshot
}
Returns a list of the server's snapshots.
Callback returns f(err, snapshots)
where snapshots
is an Array
. options
is an optional boolean
which will return the full snapshot details if true.
Creates a snapshot with the details specified
Options are as follows:
{
server: '81504C620D98BCEBAA5202D145203B4B',//Server or Server id to create the snapshot from
}
Returns the new snapshot in the callback f(err, snapshot)
Removes a snapshot
Takes snapshot or snapshotId as an argument and returns an error if unsuccessful f(err)
Restores a snapshot into the server.
Returns callback with a confirmation