# BackupsApi

All URIs are relative to *<https://postgresql.de-txl.ionos.com>*

| Method                                  | HTTP request                | Description          |
| --------------------------------------- | --------------------------- | -------------------- |
| [**BackupsFindById**](#BackupsFindById) | **Get** /backups/{backupId} | Retrieve Backup      |
| [**BackupsGet**](#BackupsGet)           | **Get** /backups            | Retrieve all Backups |

## BackupsFindById

```go
var result BackupRead = BackupsFindById(ctx, backupId)
                      .Execute()
```

Retrieve Backup

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    psql "github.com/ionos-cloud/sdk-go-bundle/products/psql"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    backupId := "45ca67fb-8b07-5783-9c97-2d35acceb084" // string | The ID (UUID) of the Backup.

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := psql.NewAPIClient(configuration)
    resource, resp, err := apiClient.BackupsApi.BackupsFindById(context.Background(), backupId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BackupsApi.BackupsFindById``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `BackupsFindById`: BackupRead
    fmt.Fprintf(os.Stdout, "Response from `BackupsApi.BackupsFindById`: %v\n", resource)
}
```

### Path Parameters

| Name         | Type                | Description                                                                 | Notes |
| ------------ | ------------------- | --------------------------------------------------------------------------- | ----- |
| **ctx**      | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. |       |
| **backupId** | **string**          | The ID (UUID) of the Backup.                                                |       |

### Other Parameters

Other parameters are passed through a pointer to an apiBackupsFindByIdRequest struct via the builder pattern

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

### Return type

[**BackupRead**](/sdk-go-bundle/sdks/psql/models/backupread.md)

### HTTP request headers

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

## BackupsGet

```go
var result BackupReadList = BackupsGet(ctx)
                      .Offset(offset)
                      .Limit(limit)
                      .FilterClusterId(filterClusterId)
                      .Execute()
```

Retrieve all Backups

### Example

```go
package main

import (
    "context"
    "fmt"
    "os"

    psql "github.com/ionos-cloud/sdk-go-bundle/products/psql"
    "github.com/ionos-cloud/sdk-go-bundle/shared"
)

func main() {
    offset := int32(0) // int32 | The first element (of the total list of elements) to include in the response. Use this parameter together with the limit for pagination. (optional) (default to 0)
    limit := int32(100) // int32 | The maximum number of elements to return. Use this parameter together with the offset for pagination. (optional) (default to 100)
    filterClusterId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Filter backups by cluster Id. (optional)

    configuration := shared.NewConfiguration("USERNAME", "PASSWORD", "TOKEN", "HOST_URL")
    apiClient := psql.NewAPIClient(configuration)
    resource, resp, err := apiClient.BackupsApi.BackupsGet(context.Background()).Offset(offset).Limit(limit).FilterClusterId(filterClusterId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `BackupsApi.BackupsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", resp)
    }
    // response from `BackupsGet`: BackupReadList
    fmt.Fprintf(os.Stdout, "Response from `BackupsApi.BackupsGet`: %v\n", resource)
}
```

### Path Parameters

### Other Parameters

Other parameters are passed through a pointer to an apiBackupsGetRequest struct via the builder pattern

| Name                | Type       | Description                                                                                                                              | Notes             |
| ------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
| **offset**          | **int32**  | The first element (of the total list of elements) to include in the response. Use this parameter together with the limit for pagination. | \[default to 0]   |
| **limit**           | **int32**  | The maximum number of elements to return. Use this parameter together with the offset for pagination.                                    | \[default to 100] |
| **filterClusterId** | **string** | Filter backups by cluster Id.                                                                                                            |                   |

### Return type

[**BackupReadList**](/sdk-go-bundle/sdks/psql/models/backupreadlist.md)

### HTTP request headers

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/sdk-go-bundle/sdks/psql/api/backupsapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
