---
title: "HA-NAS - Managing snapshots via API"
description: "Find out how to manage HA-NAS snapshots using the OVHcloud API"
url: https://docs.ovhcloud.com/en/guides/storage-and-backup/file-storage/ha-nas/nas-snapshots-api
lang: en
lastUpdated: 2022-07-20
---
# HA-NAS - Managing snapshots via API

## Objective

OVHcloud HA-NAS allows you to create and manage file volumes that can be accessed over a network.

**This guide explains how to manage the snapshots of a HA-NAS partition via the OVHcloud API.**

## Requirements

- An OVHcloud [HA-NAS service](https://www.ovhcloud.com/en-gb/storage-solutions/nas-ha/)
- Consulting the [OVHcloud API first steps guide](/en/guides/manage-and-operate/api/first-steps.md) to familiarise yourself with the OVHcloud APIv6

## Instructions

:::info
Please visit the [HA-NAS FAQ page](/en/guides/storage-and-backup/file-storage/ha-nas/nas-faq.md) for detailed information on the snapshot function.
:::

All API routes in this guide are available in the section _/dedicated/nasha_: [https://api.ovh.com/console/#/dedicated/nasha](https://api.ovh.com/console/#/dedicated/nasha).

:::info
When using the API, all fields marked with an asterisk (\*) are required.
:::

### Retrieving information about your service

All your active services can be retrieved by using the following route:


🇪🇺EU▾

[GET/dedicated/nasha](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha)

By default, a snapshot of your data takes place every hour and is saved on your HA-NAS. You can activate additional snapshot policies which will create snapshots at preset frequencies.

### Retrieving the automatic snapshot schedule

To view the active automatic snapshot schedule, use the following route:


🇪🇺EU▾

[GET/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha/-serviceName-/partition/-partitionName-/snapshot)

| Parameter       | Required | Description                              |
| --------------- | -------- | ---------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service |
| `partitionName` | Yes      | Name of the partition                    |

### Adding an automatic snapshot interval

To create additional automatic snapshots at a selected frequency, use the following route:


🇪🇺EU▾

[POST/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#post-/dedicated/nasha/-serviceName-/partition/-partitionName-/snapshot)

| Parameter       | Required | Description                                                                             |
| --------------- | -------- | --------------------------------------------------------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service                                                |
| `partitionName` | Yes      | Name of the partition                                                                   |
| `snapshotType`  | Yes      | A frequency for the snapshot: _day-1_, _day-2_, _day-3_, _day-7_, _hour-1_, or _hour-6_ |

### Retrieving information about automatic snapshots

To retrieve the details of an automatic snapshot, use the following route:


🇪🇺EU▾

[GET/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot/{snapshotType}](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha/-serviceName-/partition/-partitionName-/snapshot/-snapshotType-)

| Parameter       | Required | Description                                                                                 |
| --------------- | -------- | ------------------------------------------------------------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service                                                    |
| `partitionName` | Yes      | Name of the partition                                                                       |
| `snapshotType`  | Yes      | The snapshot frequency concerned: _day-1_, _day-2_, _day-3_, _day-7_, _hour-1_, or _hour-6_ |

### Removing an automatic snapshot interval

Use the following route to delete an automatic snapshot frequency:


🇪🇺EU▾

[DELETE/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot/{snapshotType}](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#delete-/dedicated/nasha/-serviceName-/partition/-partitionName-/snapshot/-snapshotType-)

| Parameter       | Required | Description                                                                                 |
| --------------- | -------- | ------------------------------------------------------------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service                                                    |
| `partitionName` | Yes      | Name of the partition                                                                       |
| `snapshotType`  | Yes      | The snapshot frequency concerned: _day-1_, _day-2_, _day-3_, _day-7_, _hour-1_, or _hour-6_ |

You can also utilise instant snapshots with your HA-NAS (custom snapshots) via the following endpoints.

### Listing custom snapshots

Use the following route to retrieve existing custom snapshots:


🇪🇺EU▾

[GET/dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha/-serviceName-/partition/-partitionName-/customSnapshot)

| Parameter       | Required | Description                              |
| --------------- | -------- | ---------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service |
| `partitionName` | Yes      | Name of the partition                    |

### Creating a custom snapshot

To add a manual snapshot, use the following route:


🇪🇺EU▾

[POST/dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#post-/dedicated/nasha/-serviceName-/partition/-partitionName-/customSnapshot)

| Parameter       | Required | Description                                                     |
| --------------- | -------- | --------------------------------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service                        |
| `partitionName` | Yes      | Name of the partition                                           |
| `expiration`    |          | An optional expiration date, for example: 2022-06-24 (ISO 8601) |
| `name`          | Yes      | A name for the snapshot                                         |

### Retrieving information about a custom snapshot

To view the details of a custom snapshot, use the following route:


🇪🇺EU▾

[GET/dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot/{name}](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha/-serviceName-/partition/-partitionName-/customSnapshot/-name-)

| Parameter       | Required | Description                              |
| --------------- | -------- | ---------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service |
| `partitionName` | Yes      | Name of the partition                    |
| `name`          | Yes      | The name of the snapshot                 |

### Removing a custom snapshot

Use the following route to delete a custom snapshot:


🇪🇺EU▾

[GET/dedicated/nasha/{serviceName}/partition/{partitionName}/customSnapshot/{name}](https://eu.api.ovh.com/console/?section=/dedicated/nasha&branch=v1#get-/dedicated/nasha/-serviceName-/partition/-partitionName-/customSnapshot/-name-)

| Parameter       | Required | Description                              |
| --------------- | -------- | ---------------------------------------- |
| `serviceName`   | Yes      | The internal name of your HA-NAS service |
| `partitionName` | Yes      | Name of the partition                    |
| `name`          | Yes      | The name of the snapshot                 |

##### **Restoring snapshots**

The API functions do not include accessing and restoring your snapshots. They are stored as read-only on the partition.

To access snapshots from your mount point, you need to navigate to the directory `.zfs/snapshot` of your partition.

For example, on your service with the ID `zpool-123456`, a partition named `partition1` exists of which you have created a snapshot named `snap-snapshot01`. You can find the snapshot with this command:

```bash
ls -al /zpool-123456/partition1/.zfs/snapshot/snap-snapshot01/
```

To restore your snapshot, copy it from the `.zfs` file path to the new directory where you want to restore the snapshot. You can use a tool like "rsync" that allows you to perform restores.

You can find more information in the [Go further](#gofurther) section of this guide.

## Go further

[Mount your NAS via NFS share](/en/guides/storage-and-backup/file-storage/ha-nas/nas-nfs.md)

[Mount your NAS on Windows Server via CIFS](/en/guides/storage-and-backup/file-storage/ha-nas/nas-cifs.md)

If you need training or technical assistance to implement our solutions, contact your sales representative or click on [this link](https://www.ovhcloud.com/en-gb/professional-services/) to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.

Join our [community of users](https://community.ovhcloud.com/).
