All URIs are relative to https://api.ionos.com/databases/postgresql
Method
HTTP request
Description
Get /clusters/{clusterId}/backups
Get /clusters/backups/{backupId}
ClusterBackupsGet
var result ClusterBackupList = ClusterBackupsGet(ctx, clusterId)
.Execute()
List backups of cluster
Example
package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
clusterId := "clusterId_example" // string | The unique ID of the cluster.
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := psql.NewAPIClient(configuration)
resource, resp, err := apiClient.BackupsApi.ClusterBackupsGet(context.Background(), clusterId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BackupsApi.ClusterBackupsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClusterBackupsGet`: ClusterBackupList
fmt.Fprintf(os.Stdout, "Response from `BackupsApi.ClusterBackupsGet`: %v\n", resource)
}
Path Parameters
context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the cluster.
Other Parameters
Other parameters are passed through a pointer to an apiClusterBackupsGetRequest struct via the builder pattern
Return type
ClusterBackupList
Content-Type: Not defined
ClustersBackupsFindById
var result BackupResponse = ClustersBackupsFindById(ctx, backupId)
.Execute()
Fetch a cluster backup
Example
package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
backupId := "backupId_example" // string | The unique ID of the backup.
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := psql.NewAPIClient(configuration)
resource, resp, err := apiClient.BackupsApi.ClustersBackupsFindById(context.Background(), backupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BackupsApi.ClustersBackupsFindById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersBackupsFindById`: BackupResponse
fmt.Fprintf(os.Stdout, "Response from `BackupsApi.ClustersBackupsFindById`: %v\n", resource)
}
Path Parameters
context for authentication, logging, cancellation, deadlines, tracing, etc.
The unique ID of the backup.
Other Parameters
Other parameters are passed through a pointer to an apiClustersBackupsFindByIdRequest struct via the builder pattern
Return type
BackupResponse
Content-Type: Not defined
ClustersBackupsGet
var result ClusterBackupList = ClustersBackupsGet(ctx)
.Execute()
List cluster backups
Example
package main
import (
"context"
"fmt"
"os"
psql "github.com/ionos-cloud/sdk-go-bundle/products/dbaas/psql"
"github.com/ionos-cloud/sdk-go-bundle/shared"
)
func main() {
configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
apiClient := psql.NewAPIClient(configuration)
resource, resp, err := apiClient.BackupsApi.ClustersBackupsGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BackupsApi.ClustersBackupsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
}
// response from `ClustersBackupsGet`: ClusterBackupList
fmt.Fprintf(os.Stdout, "Response from `BackupsApi.ClustersBackupsGet`: %v\n", resource)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to an apiClustersBackupsGetRequest struct via the builder pattern
Return type
ClusterBackupList
Content-Type: Not defined