All URIs are relative to https://api.ionos.com/cloudapi/v6
Method | HTTP request | Description |
---|---|---|
SnapshotsDelete | Delete /snapshots/{snapshotId} | Delete snapshots |
SnapshotsFindById | Get /snapshots/{snapshotId} | Retrieve snapshots by ID |
SnapshotsGet | Get /snapshots | List snapshots |
SnapshotsPatch | Patch /snapshots/{snapshotId} | Partially modify snapshots |
SnapshotsPut | Put /snapshots/{snapshotId} | Modify a Snapshot by ID |
var result = SnapshotsDelete(ctx, snapshotId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Delete snapshots
package main
import (
"context"
"fmt"
"os"
compute "github.com/ionos-cloud/sdk-go-bundle/products/compute"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
snapshotId := "snapshotId_example" // string | The unique ID of the snapshot.
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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := compute.NewAPIClient(configuration)
resp, err := apiClient.SnapshotsApi.SnapshotsDelete(context.Background(), snapshotId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.SnapshotsDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
snapshotId | string | The unique ID of the snapshot. |
Other parameters are passed through a pointer to an apiSnapshotsDeleteRequest 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 Snapshot = SnapshotsFindById(ctx, snapshotId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Retrieve snapshots by ID
package main
import (
"context"
"fmt"
"os"
compute "github.com/ionos-cloud/sdk-go-bundle/products/compute"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
snapshotId := "snapshotId_example" // string | The unique ID of the snapshot.
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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := compute.NewAPIClient(configuration)
resource, resp, err := apiClient.SnapshotsApi.SnapshotsFindById(context.Background(), snapshotId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.SnapshotsFindById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `SnapshotsFindById`: Snapshot
fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.SnapshotsFindById`: %v\n", resource)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
snapshotId | string | The unique ID of the snapshot. |
Other parameters are passed through a pointer to an apiSnapshotsFindByIdRequest 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 Snapshots = SnapshotsGet(ctx)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
List snapshots
package main
import (
"context"
"fmt"
"os"
compute "github.com/ionos-cloud/sdk-go-bundle/products/compute"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := compute.NewAPIClient(configuration)
resource, resp, err := apiClient.SnapshotsApi.SnapshotsGet(context.Background()).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.SnapshotsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `SnapshotsGet`: Snapshots
fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.SnapshotsGet`: %v\n", resource)
}
Other parameters are passed through a pointer to an apiSnapshotsGetRequest 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 Snapshot = SnapshotsPatch(ctx, snapshotId)
.Snapshot(snapshot)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Partially modify snapshots
package main
import (
"context"
"fmt"
"os"
compute "github.com/ionos-cloud/sdk-go-bundle/products/compute"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
snapshotId := "snapshotId_example" // string | The unique ID of the snapshot.
snapshot := *openapiclient.NewSnapshotProperties() // SnapshotProperties | The properties of the snapshot 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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := compute.NewAPIClient(configuration)
resource, resp, err := apiClient.SnapshotsApi.SnapshotsPatch(context.Background(), snapshotId).Snapshot(snapshot).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.SnapshotsPatch``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `SnapshotsPatch`: Snapshot
fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.SnapshotsPatch`: %v\n", resource)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
snapshotId | string | The unique ID of the snapshot. |
Other parameters are passed through a pointer to an apiSnapshotsPatchRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
snapshot | SnapshotProperties | The properties of the snapshot 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 Snapshot = SnapshotsPut(ctx, snapshotId)
.Snapshot(snapshot)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Modify a Snapshot by ID
package main
import (
"context"
"fmt"
"os"
compute "github.com/ionos-cloud/sdk-go-bundle/products/compute"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
snapshotId := "snapshotId_example" // string | The unique ID of the snapshot.
snapshot := *openapiclient.NewSnapshot(*openapiclient.NewSnapshotProperties()) // Snapshot | The modified snapshot
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 := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := compute.NewAPIClient(configuration)
resource, resp, err := apiClient.SnapshotsApi.SnapshotsPut(context.Background(), snapshotId).Snapshot(snapshot).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.SnapshotsPut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `SnapshotsPut`: Snapshot
fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.SnapshotsPut`: %v\n", resource)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
snapshotId | string | The unique ID of the snapshot. |
Other parameters are passed through a pointer to an apiSnapshotsPutRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
snapshot | Snapshot | The modified snapshot | |
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