DataCenterApi

All URIs are relative to https://api.ionos.com/cloudapi/v5

MethodHTTP requestDescription

DELETE /datacenters/{datacenterId}

Delete a Data Center

GET /datacenters/{datacenterId}

Retrieve a Data Center

GET /datacenters

List Data Centers under your account

PATCH /datacenters/{datacenterId}

Partially modify a Data Center

POST /datacenters

Create a Data Center

PUT /datacenters/{datacenterId}

Modify a Data Center

datacentersDelete

object datacentersDelete(datacenterId, opts)

Delete a Data Center

Will remove all objects within the datacenter and remove the datacenter object itself, too. This is a highly destructive method which should be used with caution

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.DataCenterApi(config);
// Delete a Data Center
api_instance
  .datacentersDelete({
    datacenterId: datacenterId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

NameTypeDescriptionNotes

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]

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

datacentersFindById

datacentersFindById(datacenterId, opts)

Retrieve a Data Center

You can retrieve a data center by using the resource's ID. This value can be found in the response body when a datacenter is created or when you GET a list of datacenters.

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.DataCenterApi(config);
// Retrieve a Data Center
api_instance
  .datacentersFindById({
    datacenterId: datacenterId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

NameTypeDescriptionNotes

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]

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

Datacenter

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

datacentersGet

datacentersGet(opts)

List Data Centers under your account

You can retrieve a complete list of data centers provisioned under your account

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.DataCenterApi(config);
// List Data Centers under your account
api_instance
  .datacentersGet({
    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

NameTypeDescriptionNotes

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

Datacenters

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

datacentersPatch

datacentersPatch(datacenterId, datacenter, opts)

Partially modify a Data Center

You can use update datacenter to re-name the datacenter or update its description

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.DataCenterApi(config);
// Partially modify a Data Center
api_instance
  .datacentersPatch({
    datacenterId: datacenterId_example,
    datacenter: datacenter_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

NameTypeDescriptionNotes

datacenterId

string

The unique ID of the datacenter

[default to undefined]

datacenter

Modified properties of Data Center

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

Datacenter

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

datacentersPost

datacentersPost(datacenter, opts)

Create a Data Center

Virtual data centers are the foundation of the platform. They act as logical containers for all other objects you will be creating, e.g. servers. You can provision as many data centers as you want. Datacenters have their own private network and are logically segmented from each other to create isolation. You can use this POST method to create a simple datacenter or to create a datacenter with multiple objects under it such as servers and storage volumes.

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.DataCenterApi(config);
// Create a Data Center
api_instance
  .datacentersPost({
    datacenter: datacenter_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

NameTypeDescriptionNotes

datacenter

Datacenter 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

Datacenter

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

datacentersPut

datacentersPut(datacenterId, datacenter, opts)

Modify a Data Center

You can use update datacenter to re-name the datacenter or update its description

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.DataCenterApi(config);
// Modify a Data Center
api_instance
  .datacentersPut({
    datacenterId: datacenterId_example,
    datacenter: datacenter_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

NameTypeDescriptionNotes

datacenterId

string

The unique ID of the datacenter

[default to undefined]

datacenter

Modified Data Center

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

Datacenter

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

Last updated