# BackupsApi

## BackupsApi

All URIs are relative to *<https://api.ionos.com/databases/postgresql>*

| Method                                                              | HTTP request                          | Description             |
| ------------------------------------------------------------------- | ------------------------------------- | ----------------------- |
| [**cluster\_backups\_get**](#cluster_backups_get)                   | **GET** /clusters/{clusterId}/backups | List backups of cluster |
| [**clusters\_backups\_find\_by\_id**](#clusters_backups_find_by_id) | **GET** /clusters/backups/{backupId}  | Fetch a cluster backup  |
| [**clusters\_backups\_get**](#clusters_backups_get)                 | **GET** /clusters/backups             | List cluster backups    |

## **cluster\_backups\_get**

> ClusterBackupList cluster\_backups\_get(cluster\_id, limit=limit, offset=offset)

List backups of cluster

Retrieves a list of all backups of the given PostgreSQL cluster.

#### Example

```python
from __future__ import print_function
import time
import ionoscloud_dbaas_postgres
from ionoscloud_dbaas_postgres.rest import ApiException

# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresql
configuration = ionoscloud_dbaas_postgres.Configuration(
    host = 'https://api.ionos.com/databases/postgresql',
)

# Example of configuring HTTP Basic Authorization
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

with ionoscloud_dbaas_postgres.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud_dbaas_postgres.BackupsApi(api_client)
    cluster_id = '498ae72f-411f-11eb-9d07-046c59cc737e' # str | The unique ID of the cluster.
    try:
        # List backups of cluster
        api_response = api_instance.cluster_backups_get(cluster_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling BackupsApi.cluster_backups_get: %s\n' % e)
```

#### Parameters

| Name            | Type    | Description                                                                          | Notes                         |
| --------------- | ------- | ------------------------------------------------------------------------------------ | ----------------------------- |
| **cluster\_id** | **str** | The unique ID of the cluster.                                                        |                               |
| **limit**       | **int** | The maximum number of elements to return. Use together with 'offset' for pagination. | \[optional] \[default to 100] |
| **offset**      | **int** | The first element to return. Use together with 'limit' for pagination.               | \[optional] \[default to 0]   |

#### Return type

[**ClusterBackupList**](/postgres-sdk-python/models/clusterbackuplist.md)

#### Authorization

basicAuth, tokenAuth

#### HTTP request headers

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

## **clusters\_backups\_find\_by\_id**

> BackupResponse clusters\_backups\_find\_by\_id(backup\_id)

Fetch a cluster backup

Retrieve a PostgreSQL cluster backup by using its ID. This value can be found when you GET a list of PostgreSQL cluster backups.

#### Example

```python
from __future__ import print_function
import time
import ionoscloud_dbaas_postgres
from ionoscloud_dbaas_postgres.rest import ApiException

# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresql
configuration = ionoscloud_dbaas_postgres.Configuration(
    host = 'https://api.ionos.com/databases/postgresql',
)

# Example of configuring HTTP Basic Authorization
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

with ionoscloud_dbaas_postgres.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud_dbaas_postgres.BackupsApi(api_client)
    backup_id = '498ae72f-411f-11eb-9d07-046c59cc737e-4oymiqu-12' # str | The unique ID of the backup.
    try:
        # Fetch a cluster backup
        api_response = api_instance.clusters_backups_find_by_id(backup_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling BackupsApi.clusters_backups_find_by_id: %s\n' % e)
```

#### Parameters

| Name           | Type    | Description                  | Notes |
| -------------- | ------- | ---------------------------- | ----- |
| **backup\_id** | **str** | The unique ID of the backup. |       |

#### Return type

[**BackupResponse**](/postgres-sdk-python/models/backupresponse.md)

#### Authorization

basicAuth, tokenAuth

#### HTTP request headers

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

## **clusters\_backups\_get**

> ClusterBackupList clusters\_backups\_get(limit=limit, offset=offset)

List cluster backups

Retrieves a list of all PostgreSQL cluster backups.

#### Example

```python
from __future__ import print_function
import time
import ionoscloud_dbaas_postgres
from ionoscloud_dbaas_postgres.rest import ApiException

# Defining the host is optional and defaults to https://api.ionos.com/databases/postgresql
configuration = ionoscloud_dbaas_postgres.Configuration(
    host = 'https://api.ionos.com/databases/postgresql',
)

# Example of configuring HTTP Basic Authorization
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

with ionoscloud_dbaas_postgres.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud_dbaas_postgres.BackupsApi(api_client)
    try:
        # List cluster backups
        api_response = api_instance.clusters_backups_get()
        print(api_response)
    except ApiException as e:
        print('Exception when calling BackupsApi.clusters_backups_get: %s\n' % e)
```

#### Parameters

| Name       | Type    | Description                                                                          | Notes                         |
| ---------- | ------- | ------------------------------------------------------------------------------------ | ----------------------------- |
| **limit**  | **int** | The maximum number of elements to return. Use together with 'offset' for pagination. | \[optional] \[default to 100] |
| **offset** | **int** | The first element to return. Use together with 'limit' for pagination.               | \[optional] \[default to 0]   |

#### Return type

[**ClusterBackupList**](/postgres-sdk-python/models/clusterbackuplist.md)

#### Authorization

basicAuth, tokenAuth

#### HTTP request headers

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


---

# Agent Instructions: 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/postgres-sdk-python/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.
