# 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**](https://docs.ionos.com/sections-test/python-sdk/dbaas-postgres-python-sdk/models/clusterbackuplist)

#### 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**](https://docs.ionos.com/sections-test/python-sdk/dbaas-postgres-python-sdk/models/backupresponse)

#### 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**](https://docs.ionos.com/sections-test/python-sdk/dbaas-postgres-python-sdk/models/clusterbackuplist)

#### Authorization

basicAuth, tokenAuth

#### HTTP request headers

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