Links
Comment on page

LabelsApi

All URIs are relative to https://api.ionos.com/cloudapi/v6
Method
HTTP request
Description
​datacentersLabelsDelete​
DELETE /datacenters/{datacenterId}/labels/{key}
Delete data center labels
GET /datacenters/{datacenterId}/labels/{key}
Retrieve data center labels
​datacentersLabelsGet​
GET /datacenters/{datacenterId}/labels
List data center labels
​datacentersLabelsPost​
POST /datacenters/{datacenterId}/labels
Create a Data Center Label
​datacentersLabelsPut​
PUT /datacenters/{datacenterId}/labels/{key}
Modify a Data Center Label by Key
DELETE /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Delete server labels
GET /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Retrieve server labels
GET /datacenters/{datacenterId}/servers/{serverId}/labels
List server labels
POST /datacenters/{datacenterId}/servers/{serverId}/labels
Create a Server Label
PUT /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Modify a Server Label
DELETE /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Delete volume labels
GET /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Retrieve volume labels
GET /datacenters/{datacenterId}/volumes/{volumeId}/labels
List volume labels
POST /datacenters/{datacenterId}/volumes/{volumeId}/labels
Create a Volume Label
PUT /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Modify a Volume Label
​ipblocksLabelsDelete​
DELETE /ipblocks/{ipblockId}/labels/{key}
Delete IP block labels
​ipblocksLabelsFindByKey​
GET /ipblocks/{ipblockId}/labels/{key}
Retrieve IP block labels
​ipblocksLabelsGet​
GET /ipblocks/{ipblockId}/labels
List IP block labels
​ipblocksLabelsPost​
POST /ipblocks/{ipblockId}/labels
Create IP block labels
​ipblocksLabelsPut​
PUT /ipblocks/{ipblockId}/labels/{key}
Modify a IP Block Label by ID
​labelsFindByUrn​
GET /labels/{labelurn}
Retrieve labels by URN
​labelsGet​
GET /labels
List labels
​snapshotsLabelsDelete​
DELETE /snapshots/{snapshotId}/labels/{key}
Delete snapshot labels
​snapshotsLabelsFindByKey​
GET /snapshots/{snapshotId}/labels/{key}
Retrieve snapshot labels
​snapshotsLabelsGet​
GET /snapshots/{snapshotId}/labels
List snapshot labels
​snapshotsLabelsPost​
POST /snapshots/{snapshotId}/labels
Create a Snapshot Label
​snapshotsLabelsPut​
PUT /snapshots/{snapshotId}/labels/{key}
Modify a Snapshot Label by ID

datacentersLabelsDelete

datacentersLabelsDelete(datacenterId, key, opts)
Delete data center labels
Delete the specified data center label.

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.LabelsApi(config);
// Delete data center labels
api_instance
.datacentersLabelsDelete({
datacenterId: datacenterId_example,
key: key_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 data center.
[default to undefined]
key
string
The label key
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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 with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

nil (empty response body)

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersLabelsFindByKey

datacentersLabelsFindByKey(datacenterId, key, opts)
Retrieve data center labels
Retrieve the properties of the specified data center label.

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.LabelsApi(config);
// Retrieve data center labels
api_instance
.datacentersLabelsFindByKey({
datacenterId: datacenterId_example,
key: key_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 data center.
[default to undefined]
key
string
The label key
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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 with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

​LabelResource​

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersLabelsGet

datacentersLabelsGet(datacenterId, opts)
List data center labels
List all the the labels for the specified data center.

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.LabelsApi(config);
var filterMap = new Map()
filterMap.set("<property_name>", "<property_value>")
// List data center labels
api_instance
.datacentersLabelsGet({
datacenterId: datacenterId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
orderBy: "<property_name>"
maxResults: 2,
filters: filterMap
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 data center.
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

​LabelResources​

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersLabelsPost

datacentersLabelsPost(datacenterId, label, opts)
Create a Data Center Label
Adds a new label to the specified data center.

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.LabelsApi(config);
// Create a Data Center Label
api_instance
.datacentersLabelsPost({
datacenterId: datacenterId_example,
label: label_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 data center.
[default to undefined]
label
​LabelResource​
The label to create.
​
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

​LabelResource​

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersLabelsPut

datacentersLabelsPut(datacenterId, key, label, opts)
Modify a Data Center Label by Key
Modifies the specified data center label.

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.LabelsApi(config);
// Modify a Data Center Label by Key
api_instance
.datacentersLabelsPut({
datacenterId: datacenterId_example,
key: key_example,
label: label_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 data center.
[default to undefined]
key
string
The label key
[default to undefined]
label
​LabelResource​
The modified label
​
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

​LabelResource​

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersLabelsDelete

datacentersServersLabelsDelete(datacenterId, serverId, key, opts)
Delete server labels
Delete the specified server label.

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.LabelsApi(config);
// Delete server labels
api_instance
.datacentersServersLabelsDelete({
datacenterId: datacenterId_example,
serverId: serverId_example,
key: key_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 data center.
[default to undefined]
serverId
string
The unique ID of the server.
[default to undefined]
key
string
The label key
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

nil (empty response body)

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersLabelsFindByKey

datacentersServersLabelsFindByKey(datacenterId, serverId, key, opts)
Retrieve server labels
Retrieve the properties of the specified server label.

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.LabelsApi(config);
// Retrieve server labels
api_instance
.datacentersServersLabelsFindByKey({
datacenterId: datacenterId_example,
serverId: serverId_example,
key: key_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 data center.
[default to undefined]
serverId
string
The unique ID of the server.
[default to undefined]
key
string
The label key
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber
number
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
[optional][default to undefined]

Return type

​LabelResource​

Authorization

Basic Authentication, Token Authentication

HTTP request headers

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

datacentersServersLabelsGet

datacentersServersLabelsGet(datacenterId, serverId, opts)
List server labels
List all the the labels for the specified 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.LabelsApi(config);
var filterMap = new Map()
filterMap.set("<property_name>", "<property_value>")
// List server labels
api_instance
.datacentersServersLabelsGet({
datacenterId: datacenterId_example,
serverId: serverId_example,
pretty: true,
depth: 56,
xContractNumber: 56,
orderBy: "<property_name>"
maxResults: 2,
filters: filterMap
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 data center.
[default to undefined]
serverId
string
The unique ID of the server.
[default to undefined]
pretty
boolean
Controls whether the response is pretty-printed (with indentations and new lines).
[optional][default to true]
depth
number
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) 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&#39;s children are included. - depth=... and so on
[optional][default to 0]
xContractNumber