All URIs are relative to https://api.ionos.com/cloudapi/v6
Method | HTTP request | Description |
---|---|---|
DatacentersVolumesCreateSnapshotPost | Post /datacenters/{datacenterId}/volumes/{volumeId}/create-snapshot | Create volume snapshots |
DatacentersVolumesDelete | Delete /datacenters/{datacenterId}/volumes/{volumeId} | Delete volumes |
DatacentersVolumesFindById | Get /datacenters/{datacenterId}/volumes/{volumeId} | Retrieve volumes |
DatacentersVolumesGet | Get /datacenters/{datacenterId}/volumes | List volumes |
DatacentersVolumesPatch | Patch /datacenters/{datacenterId}/volumes/{volumeId} | Partially modify volumes |
DatacentersVolumesPost | Post /datacenters/{datacenterId}/volumes | Create a Volume |
DatacentersVolumesPut | Put /datacenters/{datacenterId}/volumes/{volumeId} | Modify a Volume by ID |
DatacentersVolumesRestoreSnapshotPost | Post /datacenters/{datacenterId}/volumes/{volumeId}/restore-snapshot | Restore volume snapshots |
var result Snapshot = DatacentersVolumesCreateSnapshotPost(ctx, datacenterId, volumeId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Snapshot(snapshot)
.Execute()
Create volume snapshots
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
snapshot := *openapiclient.NewCreateSnapshot() // CreateSnapshot | The payload of the snapshot. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesCreateSnapshotPost(context.Background(), datacenterId, volumeId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Snapshot(snapshot).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesCreateSnapshotPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesCreateSnapshotPost`: Snapshot
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesCreateSnapshotPost`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesCreateSnapshotPostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. | |
snapshot | CreateSnapshot | The payload of the snapshot. |
- Content-Type: application/json
- Accept: application/json
var result = DatacentersVolumesDelete(ctx, datacenterId, volumeId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Delete volumes
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resp, err := apiClient.VolumesApi.DatacentersVolumesDelete(context.Background(), datacenterId, volumeId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesDeleteRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
var result Volume = DatacentersVolumesFindById(ctx, datacenterId, volumeId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Retrieve volumes
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesFindById(context.Background(), datacenterId, volumeId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesFindById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesFindById`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesFindById`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesFindByIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |
- Content-Type: Not defined
- Accept: application/json
var result Volumes = DatacentersVolumesGet(ctx, datacenterId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Offset(offset)
.Limit(limit)
.Execute()
List volumes
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination). (optional) (default to 0)
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesGet(context.Background(), datacenterId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesGet`: Volumes
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesGet`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. |
Other parameters are passed through a pointer to a apiDatacentersVolumesGetRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. | |
offset | int32 | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination). | [default to 0] |
limit | int32 | The maximum number of elements to return (use together with offset for pagination). | [default to 1000] |
- Content-Type: Not defined
- Accept: application/json
var result Volume = DatacentersVolumesPatch(ctx, datacenterId, volumeId)
.Volume(volume)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Partially modify volumes
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
volume := *openapiclient.NewVolumeProperties(float32(100)) // VolumeProperties | The properties of the volume to be updated.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesPatch(context.Background(), datacenterId, volumeId).Volume(volume).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesPatch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesPatch`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesPatch`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesPatchRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
volume | VolumeProperties | The properties of the volume to be updated. | |
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |
- Content-Type: application/json
- Accept: application/json
var result Volume = DatacentersVolumesPost(ctx, datacenterId)
.Volume(volume)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Create a Volume
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volume := *openapiclient.NewVolume(*openapiclient.NewVolumeProperties(float32(100))) // Volume | The volume to create.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesPost(context.Background(), datacenterId).Volume(volume).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesPost`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesPost`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. |
Other parameters are passed through a pointer to a apiDatacentersVolumesPostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
volume | Volume | The volume to create. | |
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |
- Content-Type: application/json
- Accept: application/json
var result Volume = DatacentersVolumesPut(ctx, datacenterId, volumeId)
.Volume(volume)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Modify a Volume by ID
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
volume := *openapiclient.NewVolume(*openapiclient.NewVolumeProperties(float32(100))) // Volume | The modified volume
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesPut(context.Background(), datacenterId, volumeId).Volume(volume).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesPut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersVolumesPut`: Volume
fmt.Fprintf(os.Stdout, "Response from `VolumesApi.DatacentersVolumesPut`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesPutRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
volume | Volume | The modified volume | |
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. |
- Content-Type: application/json
- Accept: application/json
var result = DatacentersVolumesRestoreSnapshotPost(ctx, datacenterId, volumeId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.RestoreSnapshot(restoreSnapshot)
.Execute()
Restore volume snapshots
package main
import (
"context"
"fmt"
"os"
ionoscloud "github.com/ionos-cloud/sdk-go/v6"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
volumeId := "volumeId_example" // string | The unique ID of the volume.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | 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 := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
restoreSnapshot := *openapiclient.NewRestoreSnapshot() // RestoreSnapshot | The payload used to restore a snapshot. (optional)
configuration := ionoscloud.NewConfiguration()
apiClient := ionoscloud.NewAPIClient(configuration)
resource, resp, err := apiClient.VolumesApi.DatacentersVolumesRestoreSnapshotPost(context.Background(), datacenterId, volumeId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).RestoreSnapshot(restoreSnapshot).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `VolumesApi.DatacentersVolumesRestoreSnapshotPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
datacenterId | string | The unique ID of the data center. | |
volumeId | string | The unique ID of the volume. |
Other parameters are passed through a pointer to a apiDatacentersVolumesRestoreSnapshotPostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pretty | bool | Controls whether the response is pretty-printed (with indentations and new lines). | [default to true] |
depth | int32 | 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 | [default to 0] |
xContractNumber | int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. | |
restoreSnapshot | RestoreSnapshot | The payload used to restore a snapshot. |
(empty response body)
- Content-Type: application/json
- Accept: application/json