Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Latest commit

 

History

History
1051 lines (767 loc) · 29.6 KB

ServerApi.md

File metadata and controls

1051 lines (767 loc) · 29.6 KB

ServerApi

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

assignTag

CreateServerResponse assignTag(serverId, tagList)

Assign tag to a server

Servers can be tagged with one or more tags. The tags used must exist

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
tagList String List of tags

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

attachStorage

CreateServerResponse attachStorage(serverId, storageDevice)

Attach storage

Attaches a storage as a device to a server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
storageDevice AttachStorageDeviceRequest

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createFirewallRule

FirewallRuleCreateResponse createFirewallRule(serverId, firewallRule)

Create firewall rule

Creates a new firewall rule

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
firewallRule FirewallRuleRequest

Return type

FirewallRuleCreateResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

createServer

CreateServerResponse createServer(server)

Create server

Creates a new server instance.

Example

// 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();
}

Parameters

Name Type Description Notes
server CreateServerRequest [optional]

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteFirewallRule

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.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
firewallRuleNumber BigDecimal Denotes the index of the firewall rule in the server's firewall rule list

Return type

null (empty response body)

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteServer

deleteServer(serverId)

Delete server

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to delete

Return type

null (empty response body)

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

detachStorage

CreateServerResponse detachStorage(serverId, storageDevice)

Detach storage

Detaches a storage resource from a server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
storageDevice StorageDeviceDetachRequest

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

ejectCdrom

ejectCdrom(serverId)

Eject CD-ROM

Ejects the storage from the CD-ROM device of a server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id

Return type

null (empty response body)

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getFirewallRule

FirewallRuleCreateResponse getFirewallRule(serverId, firewallRuleNumber)

Get firewall rule details

Returns detailed information about a specific firewall rule

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
firewallRuleNumber BigDecimal Denotes the index of the firewall rule in the server's firewall rule list

Return type

FirewallRuleCreateResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listServerConfigurations

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.

Example

// 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();
}

Parameters

This endpoint does not need any parameter.

Return type

ConfigurationListResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

listServers

ServerListResponse listServers()

List of servers

Returns a list of all servers associated with the current account.

Example

// 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();
}

Parameters

This endpoint does not need any parameter.

Return type

ServerListResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

loadCdrom

CreateServerResponse loadCdrom(serverId, storageDevice)

Load CD-ROM

Loads a storage as a CD-ROM in the CD-ROM device of a server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
storageDevice StorageDeviceLoadRequest [optional]

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

modifyServer

CreateServerResponse modifyServer(serverId, server)

Modify server

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to modify
server Server [optional]

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

restartServer

CreateServerResponse restartServer(serverId, restartServer)

Restart server

Stops and starts a server. The server state must be `started`.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to restart
restartServer RestartServer

Return type

CreateServerResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

serverDetails

CreateServerResponse serverDetails(serverId)

Get server details

Returns detailed information about a specific server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to return

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

serverServerIdFirewallRuleGet

FirewallRuleListResponse serverServerIdFirewallRuleGet(serverId)

List firewall rules

Returns a list of firewall rules for a specific server.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id

Return type

FirewallRuleListResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

startServer

CreateServerResponse startServer(serverId)

Start server

Starts a stopped server. The server state must be `stopped`.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to start

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

stopServer

CreateServerResponse stopServer(serverId, stopServerRequest)

Stop server

Stops a started server. The server state must be `started`.

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Id of server to stop
stopServerRequest StopServer

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

untag

CreateServerResponse untag(serverId, tagName)

Remove tag from server

Untags tags from given server. The tag(s) must exist

Example

// 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();
}

Parameters

Name Type Description Notes
serverId UUID Server id
tagName String Tag name

Return type

CreateServerResponse

Authorization

baseAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json