All URIs are relative to https://api.upcloud.com/1.2
Method | HTTP request | Description |
---|---|---|
assignTag | POST /server/{serverId}/tag/{tagList} | Assign tag to a server |
attachStorage | POST /server/{serverId}/storage/attach | Attach storage |
createFirewallRule | POST /server/{serverId}/firewall_rule | Create firewall rule |
createServer | POST /server | Create server |
deleteFirewallRule | DELETE /server/{serverId}/firewall_rule/{firewallRuleNumber} | Remove firewall rule |
deleteServer | DELETE /server/{serverId} | Delete server |
detachStorage | POST /server/{serverId}/storage/detach | Detach storage |
ejectCdrom | POST /server/{serverId}/cdrom/eject | Eject CD-ROM |
getFirewallRule | GET /server/{serverId}/firewall_rule/{firewallRuleNumber} | Get firewall rule details |
listServerConfigurations | GET /server_size | List server configurations |
listServers | GET /server | List of servers |
loadCdrom | POST /server/{serverId}/storage/cdrom/load | Load CD-ROM |
modifyServer | PUT /server/{serverId} | Modify server |
restartServer | POST /server/{serverId}/restart | Restart server |
serverDetails | GET /server/{serverId} | Get server details |
serverServerIdFirewallRuleGet | GET /server/{serverId}/firewall_rule | List firewall rules |
startServer | POST /server/{serverId}/start | Start server |
stopServer | POST /server/{serverId}/stop | Stop server |
untag | POST /server/{serverId}/untag/{tagName} | Remove tag from server |
CreateServerResponse assignTag(serverId, tagList)
Assign tag to a server
Servers can be tagged with one or more tags. The tags used must exist
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
String tagList = "tagList_example"; // String | List of tags
try {
CreateServerResponse result = apiInstance.assignTag(serverId, tagList);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#assignTag");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
tagList | String | List of tags |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse attachStorage(serverId, storageDevice)
Attach storage
Attaches a storage as a device to a server.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
AttachStorageDeviceRequest storageDevice = new AttachStorageDeviceRequest(); // AttachStorageDeviceRequest |
try {
CreateServerResponse result = apiInstance.attachStorage(serverId, storageDevice);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#attachStorage");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
storageDevice | AttachStorageDeviceRequest |
- Content-Type: application/json
- Accept: application/json
FirewallRuleCreateResponse createFirewallRule(serverId, firewallRule)
Create firewall rule
Creates a new firewall rule
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
FirewallRuleRequest firewallRule = new FirewallRuleRequest(); // FirewallRuleRequest |
try {
FirewallRuleCreateResponse result = apiInstance.createFirewallRule(serverId, firewallRule);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#createFirewallRule");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
firewallRule | FirewallRuleRequest |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse createServer(server)
Create server
Creates a new server instance.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
CreateServerRequest server = new CreateServerRequest(); // CreateServerRequest |
try {
CreateServerResponse result = apiInstance.createServer(server);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#createServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
server | CreateServerRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
deleteFirewallRule(serverId, firewallRuleNumber)
Remove firewall rule
Removes a firewall rule from a server. Firewall rules must be removed individually. The positions of remaining firewall rules will be adjusted after a rule is removed.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
BigDecimal firewallRuleNumber = new BigDecimal(); // BigDecimal | Denotes the index of the firewall rule in the server's firewall rule list
try {
apiInstance.deleteFirewallRule(serverId, firewallRuleNumber);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#deleteFirewallRule");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
firewallRuleNumber | BigDecimal | Denotes the index of the firewall rule in the server's firewall rule list |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
deleteServer(serverId)
Delete server
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to delete
try {
apiInstance.deleteServer(serverId);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#deleteServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to delete |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
CreateServerResponse detachStorage(serverId, storageDevice)
Detach storage
Detaches a storage resource from a server.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
StorageDeviceDetachRequest storageDevice = new StorageDeviceDetachRequest(); // StorageDeviceDetachRequest |
try {
CreateServerResponse result = apiInstance.detachStorage(serverId, storageDevice);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#detachStorage");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | 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.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
try {
apiInstance.ejectCdrom(serverId);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#ejectCdrom");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
FirewallRuleCreateResponse getFirewallRule(serverId, firewallRuleNumber)
Get firewall rule details
Returns detailed information about a specific firewall rule
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
BigDecimal firewallRuleNumber = new BigDecimal(); // BigDecimal | Denotes the index of the firewall rule in the server's firewall rule list
try {
FirewallRuleCreateResponse result = apiInstance.getFirewallRule(serverId, firewallRuleNumber);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#getFirewallRule");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
firewallRuleNumber | BigDecimal | Denotes the index of the firewall rule in the server's firewall rule list |
- Content-Type: application/json
- Accept: application/json
ConfigurationListResponse listServerConfigurations()
List server configurations
Returns a list of available server configurations. A server configuration consists of a combination of CPU core count and main memory amount. All servers are created using these configurations.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
try {
ConfigurationListResponse result = apiInstance.listServerConfigurations();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#listServerConfigurations");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
ServerListResponse listServers()
List of servers
Returns a list of all servers associated with the current account.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
try {
ServerListResponse result = apiInstance.listServers();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#listServers");
e.printStackTrace();
}
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
CreateServerResponse loadCdrom(serverId, storageDevice)
Load CD-ROM
Loads a storage as a CD-ROM in the CD-ROM device of a server.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
StorageDeviceLoadRequest storageDevice = new StorageDeviceLoadRequest(); // StorageDeviceLoadRequest |
try {
CreateServerResponse result = apiInstance.loadCdrom(serverId, storageDevice);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#loadCdrom");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
storageDevice | StorageDeviceLoadRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse modifyServer(serverId, server)
Modify server
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to modify
Server server = new Server(); // Server |
try {
CreateServerResponse result = apiInstance.modifyServer(serverId, server);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#modifyServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to modify | |
server | Server | [optional] |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse restartServer(serverId, restartServer)
Restart server
Stops and starts a server. The server state must be `started`.
// Import classes:
//import com.upcloud.client.ApiException;
//import com.upcloud.client.api.ServerApi;
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to restart
RestartServer restartServer = new RestartServer(); // RestartServer |
try {
CreateServerResponse result = apiInstance.restartServer(serverId, restartServer);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#restartServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to restart | |
restartServer | RestartServer |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateServerResponse serverDetails(serverId)
Get server details
Returns detailed information about a specific server.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to return
try {
CreateServerResponse result = apiInstance.serverDetails(serverId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#serverDetails");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to return |
- Content-Type: application/json
- Accept: application/json
FirewallRuleListResponse serverServerIdFirewallRuleGet(serverId)
List firewall rules
Returns a list of firewall rules for a specific server.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
try {
FirewallRuleListResponse result = apiInstance.serverServerIdFirewallRuleGet(serverId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#serverServerIdFirewallRuleGet");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse startServer(serverId)
Start server
Starts a stopped server. The server state must be `stopped`.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to start
try {
CreateServerResponse result = apiInstance.startServer(serverId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#startServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to start |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse stopServer(serverId, stopServerRequest)
Stop server
Stops a started server. The server state must be `started`.
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Id of server to stop
StopServer stopServerRequest = new StopServer(); // StopServer |
try {
CreateServerResponse result = apiInstance.stopServer(serverId, stopServerRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#stopServer");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Id of server to stop | |
stopServerRequest | StopServer |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse untag(serverId, tagName)
Remove tag from server
Untags tags from given server. The tag(s) must exist
// Import classes:
//import com.upcloud.client.ApiClient;
//import com.upcloud.client.ApiException;
//import com.upcloud.client.Configuration;
//import com.upcloud.client.auth.*;
//import com.upcloud.client.api.ServerApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: baseAuth
HttpBasicAuth baseAuth = (HttpBasicAuth) defaultClient.getAuthentication("baseAuth");
baseAuth.setUsername("YOUR USERNAME");
baseAuth.setPassword("YOUR PASSWORD");
ServerApi apiInstance = new ServerApi();
UUID serverId = new UUID(); // UUID | Server id
String tagName = "tagName_example"; // String | Tag name
try {
CreateServerResponse result = apiInstance.untag(serverId, tagName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ServerApi#untag");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
serverId | UUID | Server id | |
tagName | String | Tag name |
- Content-Type: application/json
- Accept: application/json