All URIs are relative to https://api.ionos.com/cloudapi/v5
Method HTTP request Description
object datacentersServersCdromsDelete(datacenterId, serverId, cdromId, opts)
Detach a CD-ROM
This will detach a CD-ROM from the server
Examples
Copy 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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersCdromsFindById(datacenterId, serverId, cdromId, opts)
Retrieve an attached CD-ROM
You can retrieve a specific CD-ROM attached to the server
Examples
Copy 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
Return type
Image
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersCdromsGet(datacenterId, serverId, opts)
List attached CD-ROMs
You can retrieve a list of CD-ROMs attached to the server.
Examples
Copy 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
Return type
Cdroms
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
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
Copy 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
Return type
Image
Authorization
Basic Authentication, Token Authentication
Content-Type : application/json
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
Copy 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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersFindById(datacenterId, serverId, opts)
Retrieve a Server
Returns information about a server such as its configuration, provisioning status, etc.
Examples
Copy 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
Return type
Server
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersGet(datacenterId, opts)
List Servers
You can retrieve a list of servers within a datacenter
Examples
Copy 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
Return type
Servers
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersPatch(datacenterId, serverId, server, opts)
Partially modify a Server
You can use update attributes of a server
Examples
Copy 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
Return type
Server
Authorization
Basic Authentication, Token Authentication
Content-Type : application/json
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
Copy 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
Return type
Server
Authorization
Basic Authentication, Token Authentication
Content-Type : application/json
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
Copy 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
Return type
Server
Authorization
Basic Authentication, Token Authentication
Content-Type : application/json
object datacentersServersRebootPost(datacenterId, serverId, opts)
Reboot a Server
This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on.
Examples
Copy 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);
// Reboot a Server
api_instance
.datacentersServersRebootPost ({
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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
object datacentersServersStartPost(datacenterId, serverId, opts)
Start a Server
This will start a server. If the server's public IP was deallocated then a new IP will be assigned
Examples
Copy 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);
// Start a Server
api_instance
.datacentersServersStartPost ({
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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
object datacentersServersStopPost(datacenterId, serverId, opts)
Stop a Server
This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for Cube servers.
Examples
Copy 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);
// Stop a Server
api_instance
.datacentersServersStopPost ({
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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
object datacentersServersUpgradePost(datacenterId, serverId, opts)
Upgrade a Server
This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call '/datacenters/{datacenterId}/servers?upgradeNeeded=true'
Examples
Copy 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);
// Upgrade a Server
api_instance
.datacentersServersUpgradePost ({
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
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
object datacentersServersVolumesDelete(datacenterId, serverId, volumeId, opts)
Detach a volume
This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion
Examples
Copy 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 volume
api_instance
.datacentersServersVolumesDelete ({
datacenterId : datacenterId_example ,
serverId : serverId_example ,
volumeId : volumeId_example ,
pretty : true ,
depth : 56 ,
xContractNumber : 56 ,
options : {}
})
.then ((response) => console .log ( response .data))
.catch ((error) => console .log ( error . response .data));
Parameters
Return type
object
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersVolumesFindById(datacenterId, serverId, volumeId, opts)
Retrieve an attached volume
This will retrieve the properties of an attached volume.
Examples
Copy 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 volume
api_instance
.datacentersServersVolumesFindById ({
datacenterId : datacenterId_example ,
serverId : serverId_example ,
volumeId : volumeId_example ,
pretty : true ,
depth : 56 ,
xContractNumber : 56 ,
options : {}
})
.then ((response) => console .log ( response .data))
.catch ((error) => console .log ( error . response .data));
Parameters
Return type
Volume
Authorization
Basic Authentication, Token Authentication
Content-Type : Not defined
datacentersServersVolumesGet(datacenterId, serverId, opts)
List Attached Volumes
You can retrieve a list of volumes attached to the server
Examples
Copy 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 Volumes
api_instance
.datacentersServersVolumesGet ({
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
Return type
AttachedVolumes
Authorization
Basic Authentication
Content-Type : Not defined
datacentersServersVolumesPost(datacenterId, serverId, volume, opts)
Attach a volume
This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics and volumes attached to the server should not exceed size 24.
Examples
Copy 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 volume
api_instance
.datacentersServersVolumesPost ({
datacenterId : datacenterId_example ,
serverId : serverId_example ,
volume : volume_example ,
pretty : true ,
depth : 56 ,
xContractNumber : 56 ,
options : {}
})
.then ((response) => console .log ( response .data))
.catch ((error) => console .log ( error . response .data));
Parameters
Return type
Volume
Authorization
Basic Authentication
Content-Type : application/json