# SnapshotsApi

## SnapshotsApi

All URIs are relative to *<https://api.ionos.com/cloudapi/v6>*

| Method                                               | HTTP request                       | Description                |
| ---------------------------------------------------- | ---------------------------------- | -------------------------- |
| [**snapshots\_delete**](#snapshots_delete)           | **DELETE** /snapshots/{snapshotId} | Delete snapshots           |
| [**snapshots\_find\_by\_id**](#snapshots_find_by_id) | **GET** /snapshots/{snapshotId}    | Retrieve snapshots by ID   |
| [**snapshots\_get**](#snapshots_get)                 | **GET** /snapshots                 | List snapshots             |
| [**snapshots\_patch**](#snapshots_patch)             | **PATCH** /snapshots/{snapshotId}  | Partially modify snapshots |
| [**snapshots\_put**](#snapshots_put)                 | **PUT** /snapshots/{snapshotId}    | Modify a Snapshot by ID    |

## **snapshots\_delete**

> snapshots\_delete(snapshot\_id, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Delete snapshots

Deletes the specified snapshot.

#### Example

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

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

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

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.SnapshotsApi(api_client)
    snapshot_id = 'snapshot_id_example' # str | The unique ID of the snapshot.
    try:
        # Delete snapshots
        api_instance.snapshots_delete(snapshot_id)
    except ApiException as e:
        print('Exception when calling SnapshotsApi.snapshots_delete: %s\n' % e)
```

#### Parameters

| Name                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshot\_id**        | **str**  | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **pretty**              | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **depth**               | **int**  | 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]    |
| **x\_contract\_number** | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

void (empty response body)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **snapshots\_find\_by\_id**

> Snapshot snapshots\_find\_by\_id(snapshot\_id, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Retrieve snapshots by ID

Retrieve the properties of the specified snapshot.

#### Example

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

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

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

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.SnapshotsApi(api_client)
    snapshot_id = 'snapshot_id_example' # str | The unique ID of the snapshot.
    try:
        # Retrieve snapshots by ID
        api_response = api_instance.snapshots_find_by_id(snapshot_id)
        print(api_response)
    except ApiException as e:
        print('Exception when calling SnapshotsApi.snapshots_find_by_id: %s\n' % e)
```

#### Parameters

| Name                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshot\_id**        | **str**  | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **pretty**              | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **depth**               | **int**  | 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]    |
| **x\_contract\_number** | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Snapshot**](/python-sdk/models/snapshot.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **snapshots\_get**

> Snapshots snapshots\_get(pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

List snapshots

List all available snapshots.

#### Example

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

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

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

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.SnapshotsApi(api_client)
    try:
        # List snapshots
        api_response = api_instance.snapshots_get()
        print(api_response)
    except ApiException as e:
        print('Exception when calling SnapshotsApi.snapshots_get: %s\n' % e)
```

#### Parameters

| Name                    | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **pretty**              | **bool** | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **depth**               | **int**  | 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]    |
| **x\_contract\_number** | **int**  | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Snapshots**](/python-sdk/models/snapshots.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **snapshots\_patch**

> Snapshot snapshots\_patch(snapshot\_id, snapshot, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Partially modify snapshots

Update the properties of the specified snapshot.

#### Example

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

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

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

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.SnapshotsApi(api_client)
    snapshot_id = 'snapshot_id_example' # str | The unique ID of the snapshot.
    snapshot = ionoscloud.SnapshotProperties() # SnapshotProperties | The properties of the snapshot to be updated.
    try:
        # Partially modify snapshots
        api_response = api_instance.snapshots_patch(snapshot_id, snapshot)
        print(api_response)
    except ApiException as e:
        print('Exception when calling SnapshotsApi.snapshots_patch: %s\n' % e)
```

#### Parameters

| Name                    | Type                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshot\_id**        | **str**                                                            | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **snapshot**            | [**SnapshotProperties**](/python-sdk/models/snapshotproperties.md) | The properties of the snapshot to be updated.                                                                                                                                                                                                                                                                                                                                                                                            |                                |
| **pretty**              | **bool**                                                           | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **depth**               | **int**                                                            | 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]    |
| **x\_contract\_number** | **int**                                                            | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Snapshot**](/python-sdk/models/snapshot.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

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

## **snapshots\_put**

> Snapshot snapshots\_put(snapshot\_id, snapshot, pretty=pretty, depth=depth, x\_contract\_number=x\_contract\_number)

Modify a Snapshot by ID

Modifies the properties of the specified snapshot.

#### Example

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

# Defining the host is optional and defaults to https://api.ionos.com/cloudapi/v6
configuration = ionoscloud.Configuration(
    host = 'https://api.ionos.com/cloudapi/v6',
)

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

with ionoscloud.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ionoscloud.SnapshotsApi(api_client)
    snapshot_id = 'snapshot_id_example' # str | The unique ID of the snapshot.
    snapshot = ionoscloud.Snapshot() # Snapshot | The modified snapshot
    try:
        # Modify a Snapshot by ID
        api_response = api_instance.snapshots_put(snapshot_id, snapshot)
        print(api_response)
    except ApiException as e:
        print('Exception when calling SnapshotsApi.snapshots_put: %s\n' % e)
```

#### Parameters

| Name                    | Type                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                              | Notes                          |
| ----------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| **snapshot\_id**        | **str**                                        | The unique ID of the snapshot.                                                                                                                                                                                                                                                                                                                                                                                                           |                                |
| **snapshot**            | [**Snapshot**](/python-sdk/models/snapshot.md) | The modified snapshot                                                                                                                                                                                                                                                                                                                                                                                                                    |                                |
| **pretty**              | **bool**                                       | Controls whether the response is pretty-printed (with indentations and new lines).                                                                                                                                                                                                                                                                                                                                                       | \[optional] \[default to True] |
| **depth**               | **int**                                        | 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]    |
| **x\_contract\_number** | **int**                                        | Users with multiple contracts must provide the contract number, for which all API requests are to be executed.                                                                                                                                                                                                                                                                                                                           | \[optional]                    |

#### Return type

[**Snapshot**](/python-sdk/models/snapshot.md)

#### Authorization

Basic Authentication, Token Authentication

#### HTTP request headers

* **Content-Type**: application/json
* **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/python-sdk/api/snapshotsapi.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.
