Links

ServerApi

All URIs are relative to https://api.ionos.com/cloudapi/v5
Method
HTTP request
Description
DELETE /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}
Detach a CD-ROM
GET /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}
Retrieve an attached CD-ROM
GET /datacenters/{datacenterId}/servers/{serverId}/cdroms
List attached CD-ROMs
POST /datacenters/{datacenterId}/servers/{serverId}/cdroms
Attach a CD-ROM
DELETE /datacenters/{datacenterId}/servers/{serverId}
Delete a Server
GET /datacenters/{datacenterId}/servers/{serverId}
Retrieve a Server
GET /datacenters/{datacenterId}/servers
List Servers
PATCH /datacenters/{datacenterId}/servers/{serverId}
Partially modify a Server
POST /datacenters/{datacenterId}/servers
Create a Server
PUT /datacenters/{datacenterId}/servers/{serverId}
Modify a Server
POST /datacenters/{datacenterId}/servers/{serverId}/reboot
Reboot a Server
POST /datacenters/{datacenterId}/servers/{serverId}/start
Start a Server
POST /datacenters/{datacenterId}/servers/{serverId}/stop
Stop a Server
POST /datacenters/{datacenterId}/servers/{serverId}/upgrade
Upgrade a Server
DELETE /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}
Detach a volume
GET /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}
Retrieve an attached volume
GET /datacenters/{datacenterId}/servers/{serverId}/volumes
List Attached Volumes
POST /datacenters/{datacenterId}/servers/{serverId}/volumes
Attach a volume

datacentersServersCdromsDelete

object datacentersServersCdromsDelete(datacenterId, serverId, cdromId, opts)
Detach a CD-ROM
This will detach a CD-ROM from the server

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Detach a CD-ROM
api_instance
.datacentersServersCdromsDelete({
datacenterId: datacenterId_example,
serverId: serverId_example,
cdromId: cdromId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the Datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
cdromId
string
The unique ID of the CD-ROM
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

object

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersCdromsFindById

datacentersServersCdromsFindById(datacenterId, serverId, cdromId, opts)
Retrieve an attached CD-ROM
You can retrieve a specific CD-ROM attached to the server

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Retrieve an attached CD-ROM
api_instance
.datacentersServersCdromsFindById({
datacenterId: datacenterId_example,
serverId: serverId_example,
cdromId: cdromId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the Datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
cdromId
string
The unique ID of the CD-ROM
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

Image

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersCdromsGet

datacentersServersCdromsGet(datacenterId, serverId, opts)
List attached CD-ROMs
You can retrieve a list of CD-ROMs attached to the server.

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// List attached CD-ROMs
api_instance
.datacentersServersCdromsGet({
datacenterId: datacenterId_example,
serverId: serverId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
offset: 56,
limit: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the Datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]
offset
number
the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
[optional][default to 0]
limit
number
the maximum number of elements to return (use together with <code>offset</code> for pagination)
[optional][default to 1000]

Return type

Cdroms

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersCdromsPost

datacentersServersCdromsPost(datacenterId, serverId, cdrom, opts)
Attach a CD-ROM
You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server.

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Attach a CD-ROM
api_instance
.datacentersServersCdromsPost({
datacenterId: datacenterId_example,
serverId: serverId_example,
cdrom: cdrom_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the Datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
cdrom
Image
CD-ROM to be attached
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

Image

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersDelete

object datacentersServersDelete(datacenterId, serverId, opts)
Delete a Server
This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Delete a Server
api_instance
.datacentersServersDelete({
datacenterId: datacenterId_example,
serverId: serverId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

object

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersFindById

datacentersServersFindById(datacenterId, serverId, opts)
Retrieve a Server
Returns information about a server such as its configuration, provisioning status, etc.

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Retrieve a Server
api_instance
.datacentersServersFindById({
datacenterId: datacenterId_example,
serverId: serverId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the datacenter
[default to undefined]
serverId
string
The unique ID of the Server
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

Server

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersGet

datacentersServersGet(datacenterId, opts)
List Servers
You can retrieve a list of servers within a datacenter

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// List Servers
api_instance
.datacentersServersGet({
datacenterId: datacenterId_example,
pretty: true,
depth: 56,
upgradeNeeded: true,
xContractNumber: 56,
offset: 56,
limit: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the datacenter
[default to undefined]
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
upgradeNeeded
boolean
It can be used to filter which servers can be upgraded which can not be upgraded.
[optional][default to undefined]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]
offset
number
the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
[optional][default to 0]
limit
number
the maximum number of elements to return (use together with <code>offset</code> for pagination)
[optional][default to 1000]

Return type

Servers

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersPatch

datacentersServersPatch(datacenterId, serverId, server, opts)
Partially modify a Server
You can use update attributes of a server

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Partially modify a Server
api_instance
.datacentersServersPatch({
datacenterId: datacenterId_example,
serverId: serverId_example,
server: server_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the datacenter
[default to undefined]
serverId
string
The unique ID of the server
[default to undefined]
server
Modified properties of Server
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

Server

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersPost

datacentersServersPost(datacenterId, server, opts)
Create a Server
Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN.

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Create a Server
api_instance
.datacentersServersPost({
datacenterId: datacenterId_example,
server: server_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId
string
The unique ID of the datacenter
[default to undefined]
server
Server
Server to be created
pretty
boolean
Controls whether response is pretty-printed (with indentation and new lines)
[optional][default to true]
depth
number
Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children\'s children are included - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users having more than 1 contract need to provide contract number, against which all API requests should be executed
[optional][default to undefined]

Return type

Server

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersPut

datacentersServersPut(datacenterId, serverId, server, opts)
Modify a Server
Allows to modify the attributes of a Server. From v5 onwards \'allowReboot\' attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the \'allowReboot\' property was required to be set to true which will no longer be the case and the server will be rebooted automatically

Examples

const ionoscloud = require('@ionos-cloud/sdk-nodejs');
// setup authorization
const config = new ionoscloud.Configuration({
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD',
apiKey: 'YOUR_API_KEY'
});
const api_instance = new ionoscloud.ServerApi(config);
// Modify a Server
api_instance
.datacentersServersPut({
datacenterId: datacenterId_example,
serverId: serverId_example,
server: server_example,
pretty: true,
depth: 56,
xContractNumber: 56,
options: {}
})
.then((response) => console.log(response.data))
.catch((error) => console.log(error.response.data));

Parameters

Name
Type
Description
Notes
datacenterId