All URIs are relative to https://api.upcloud.com/1.2
Method | HTTP request | Description |
---|---|---|
attachStorage | POST /server/{serverId}/storage/attach | Attach storage |
backupStorage | POST /storage/{storageId}/backup | Create backup |
cancelOperation | POST /storage/{storageId}/cancel | Cancel storage operation |
cloneStorage | POST /storage/{storageId}/clone | Clone storage |
createStorage | POST /storage | Create storage |
deleteStorage | DELETE /storage/{storageId} | Delete storage |
detachStorage | POST /server/{serverId}/storage/detach | Detach storage |
ejectCdrom | POST /server/{serverId}/cdrom/eject | Eject CD-ROM |
favoriteStorage | POST /storage/{storageId}/favorite | Add storage to favorites |
getStorageDetails | GET /storage/{storageId} | Get storage details |
listStorageTypes | GET /storage/{type}/ | List of storages by type |
listStorages | GET /storage | List of storages |
loadCdrom | POST /server/{serverId}/storage/cdrom/load | Load CD-ROM |
modifyStorage | PUT /storage/{storageId} | Modify storage |
restoreStorage | POST /storage/{storageId}/restore | Restore backup |
templatizeStorage | POST /storage/{storageId}/templatize | Templatize storage |
unfavoriteStorage | DELETE /storage/{storageId}/favorite | Remove storage from favorites |
CreateServerResponse attachStorage(serverId, storageDevice)
Attach storage
Attaches a storage as a device to a server.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var serverId = "serverId_example"; // String | Server id
var storageDevice = new upcloud.AttachStorageDeviceRequest(); // AttachStorageDeviceRequest |
apiInstance.attachStorage(serverId, storageDevice).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
storageDevice | AttachStorageDeviceRequest |
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse backupStorage(storageId, storage)
Create backup
Creates a point-in-time backup of a storage resource. For automatic, scheduled backups, see `backup_rule` in Create storage or Modify storage.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
var storage = new upcloud.CreateBackupStorageRequest(); // CreateBackupStorageRequest |
apiInstance.backupStorage(storageId, storage).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id | |
storage | CreateBackupStorageRequest |
- Content-Type: application/json
- Accept: application/json
cancelOperation(storageId)
Cancel storage operation
Cancels a running cloning operation and deletes the incomplete copy.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Strage id
apiInstance.cancelOperation(storageId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Strage id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse cloneStorage(storageId, storage)
Clone storage
Creates an exact copy of an existing storage resource.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
var storage = new upcloud.CloneStorageRequest(); // CloneStorageRequest |
apiInstance.cloneStorage(storageId, storage).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id | |
storage | CloneStorageRequest |
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse createStorage(storage)
Create storage
Creates a new storage resource.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storage = new upcloud.CreateStorageRequest(); // CreateStorageRequest |
apiInstance.createStorage(storage).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storage | CreateStorageRequest |
- Content-Type: application/json
- Accept: application/json
deleteStorage(storageId)
Delete storage
Deleted an existing storage resource.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String |
apiInstance.deleteStorage(storageId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateServerResponse detachStorage(serverId, storageDevice)
Detach storage
Detaches a storage resource from a server.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var serverId = "serverId_example"; // String | Server id
var storageDevice = new upcloud.StorageDeviceDetachRequest(); // StorageDeviceDetachRequest |
apiInstance.detachStorage(serverId, storageDevice).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
storageDevice | StorageDeviceDetachRequest |
- Content-Type: application/json
- Accept: application/json
ejectCdrom(serverId)
Eject CD-ROM
Ejects the storage from the CD-ROM device of a server.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var serverId = "serverId_example"; // String | Server id
apiInstance.ejectCdrom(serverId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
favoriteStorage(storageId)
Add storage to favorites
Adds a storage to the list of favorite storages. To list favorite storages, see List storages. This operations succeeds even if the storage is already on the list of favorites.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
apiInstance.favoriteStorage(storageId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse getStorageDetails(storageId)
Get storage details
Returns detailed information about a specific storage resource.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String |
apiInstance.getStorageDetails(storageId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String |
- Content-Type: application/json
- Accept: application/json
SuccessStoragesResponse listStorageTypes(type)
List of storages by type
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var type = "type_example"; // String | Storage's access type (`public` or `private`) or storage type (`normal`, `backup`, `cdrom` or `template`) or `favorite` status
apiInstance.listStorageTypes(type).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
type | String | Storage's access type (`public` or `private`) or storage type (`normal`, `backup`, `cdrom` or `template`) or `favorite` status |
- Content-Type: application/json
- Accept: application/json
SuccessStoragesResponse listStorages()
List of storages
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
apiInstance.listStorages().then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
CreateServerResponse loadCdrom(serverId, opts)
Load CD-ROM
Loads a storage as a CD-ROM in the CD-ROM device of a server.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var serverId = "serverId_example"; // String | Server id
var opts = {
'storageDevice': new upcloud.StorageDeviceLoadRequest() // StorageDeviceLoadRequest |
};
apiInstance.loadCdrom(serverId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
storageDevice | StorageDeviceLoadRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse modifyStorage(storageIdstorage)
Modify storage
Modifies an existing storage resource. This operation is used to rename or resize the storage.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String |
var storage = new upcloud.ModifyStorageRequest(); // ModifyStorageRequest |
apiInstance.modifyStorage(storageIdstorage).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | ||
storage | ModifyStorageRequest |
- Content-Type: application/json
- Accept: application/json
restoreStorage(storageId)
Restore backup
Restores the origin storage with data from the specified backup storage.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
apiInstance.restoreStorage(storageId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateStorageResponse templatizeStorage(storageId, opts)
Templatize storage
Creates an exact copy of an existing storage resource which can be used as a template for creating new servers.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
var opts = {
'storage': new upcloud.TemplitizeStorageRequest() // TemplitizeStorageRequest |
};
apiInstance.templatizeStorage(storageId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id | |
storage | TemplitizeStorageRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
unfavoriteStorage(storageId)
Remove storage from favorites
Delete a storage from the list of favorite storages. To list favorite storages, see List storages. This operations succeeds even if the storage is already on the list of favorites.
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.StorageApi();
var storageId = "storageId_example"; // String | Storage id
apiInstance.unfavoriteStorage(storageId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
storageId | String | Storage id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json