VolumeApi

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

datacentersVolumesCreateSnapshotPost

datacentersVolumesCreateSnapshotPost(datacenterId, volumeId, opts)

Create Volume Snapshot

Creates a snapshot of a volume within the datacenter. You can use a snapshot to create a new storage volume or to restore a storage volume.

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.VolumeApi(config);
// Create Volume Snapshot
api_instance
  .datacentersVolumesCreateSnapshotPost({
    datacenterId: datacenterId_example,
    volumeId: volumeId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56,
    name: name_example,
    description: description_example,
    secAuthProtection: true,
    licenceType: licenceType_example, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

Return type

Snapshot

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded

  • Accept: application/json

datacentersVolumesDelete

object datacentersVolumesDelete(datacenterId, volumeId, opts)

Delete a Volume

Deletes the specified volume. This will result in the volume being removed from your datacenter. Use this 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.VolumeApi(config);
// Delete a Volume
api_instance
  .datacentersVolumesDelete({
    datacenterId: datacenterId_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

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

datacentersVolumesFindById

datacentersVolumesFindById(datacenterId, volumeId, opts)

Retrieve a Volume

Retrieves the attributes of a given Volume

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.VolumeApi(config);
// Retrieve a Volume
api_instance
  .datacentersVolumesFindById({
    datacenterId: datacenterId_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

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

datacentersVolumesGet

datacentersVolumesGet(datacenterId, opts)

List Volumes

Retrieves a list of 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.VolumeApi(config);
// List Volumes 
api_instance
  .datacentersVolumesGet({
    datacenterId: datacenterId_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

Volumes

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

datacentersVolumesPatch

datacentersVolumesPatch(datacenterId, volumeId, volume, opts)

Partially modify a Volume

You can use update attributes of a Volume

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.VolumeApi(config);
// Partially modify a Volume
api_instance
  .datacentersVolumesPatch({
    datacenterId: datacenterId_example,
    volumeId: volumeId_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, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

datacentersVolumesPost

datacentersVolumesPost(datacenterId, volume, opts)

Create a Volume

Creates a volume within the datacenter. This will not attach the volume to a server. Please see the Servers section for details on how to attach 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.VolumeApi(config);
// Create a Volume
api_instance
  .datacentersVolumesPost({
    datacenterId: datacenterId_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, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

datacentersVolumesPut

datacentersVolumesPut(datacenterId, volumeId, volume, opts)

Modify a Volume

You can use update attributes of a Volume

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.VolumeApi(config);
// Modify a Volume
api_instance
  .datacentersVolumesPut({
    datacenterId: datacenterId_example,
    volumeId: volumeId_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, Token Authentication

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

datacentersVolumesRestoreSnapshotPost

object datacentersVolumesRestoreSnapshotPost(datacenterId, volumeId, opts)

Restore Volume Snapshot

This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create subsequent volumes if you want or to restore an existing volume.

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.VolumeApi(config);
// Restore Volume Snapshot
api_instance
  .datacentersVolumesRestoreSnapshotPost({
    datacenterId: datacenterId_example,
    volumeId: volumeId_example,
    pretty: true,
    depth: 56,
    xContractNumber: 56,
    snapshotId: snapshotId_example, 
    options: {}
  })
  .then((response) => console.log(response.data))
  .catch((error) => console.log(error.response.data));

Parameters

Return type

object

Authorization

Basic Authentication, Token Authentication

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded

  • Accept: application/json

Last updated