# Storage & Backup › File Storage › Enterprise File Storage › Snapshots API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Storage & Backup product's sections: https://developers.eu.ovhcloud.com/reference/storage-backup/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 9 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/storage-backup/file-storage/enterprise-file-storage/snapshots.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/storage-backup/file-storage/enterprise-file-storage/snapshots.json?format=openapi3

## Operations

- `GET /storage/netapp/{serviceName}/share/{shareId}/snapshot` — List snapshots
- `GET /storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}` — Get a snapshot
- `GET /storage/netapp/{serviceName}/share/{shareId}/snapshotReserve` — Get the snapshot reserve
- `POST /storage/netapp/{serviceName}/share/{shareId}/snapshot` — Create a snapshot
- `POST /storage/netapp/{serviceName}/share/{shareId}/revert` — Revert a share to its latest snapshot
- `POST /storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}/hold` — Hold an automatic snapshot
- `DELETE /storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}` — Delete a snapshot
- `PUT /storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}` — Update a snapshot
- `PUT /storage/netapp/{serviceName}/share/{shareId}/snapshotReserve` — Update the snapshot reserve

## List snapshots

`GET /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#get-storage-netapp-servicename-share-shareid-snapshot

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/get`

Returns the ID and name of each snapshot of the share, including the snapshots taken automatically and by the system. Set `detail` to true to get all snapshot properties, such as their type and status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `detail` | query | boolean |  | Get detailed information about each snapshot |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshot[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "path": "string",
    "status": "available",
    "type": "automatic"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/storage/netapp/{serviceName}/share/{shareId}/snapshot")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/storage/netapp/{serviceName}/share/{shareId}/snapshot");

print_r($result);
?>
```

## Get a snapshot

`GET /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#get-storage-netapp-servicename-share-shareid-snapshot-snapshotid

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/get`

Returns the snapshot properties, its status and its type: manual, automatic when taken by the snapshot policy, or system. Holding an automatic snapshot turns it into a manual snapshot with a new ID.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |
| `snapshotId` | path | string (uuid) | yes | Snapshot ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshot | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "path": "string",
  "status": "available",
  "type": "automatic"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}");

print_r($result);
?>
```

## Get the snapshot reserve

`GET /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#get-storage-netapp-servicename-share-shareid-snapshotreserve

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshotReserve/get`

Returns the percentage of the share size reserved for snapshots and the status of its last update.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshotReserve | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `percent` | integer | read-only | Share space percentage reserved for snapshots, 5 by default |
| `status` | storage.NetAppShareSnapshotReserveStatusEnum | read-only | Status — one of `active`, `error`, `updating` |

```json
{
  "percent": 0,
  "status": "active"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve");

print_r($result);
?>
```

## Create a snapshot

`POST /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#post-storage-netapp-servicename-share-shareid-snapshot

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/create`

Creates a manual snapshot of the share. Creation is asynchronous: the snapshot is returned with status creating, follow its status until available. The share must be in status available.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |

### Request body (required)

Type: `storage.NetAppShareSnapshot`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
{
  "description": "string",
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshot | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "path": "string",
  "status": "available",
  "type": "automatic"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: storage.NetAppShareSnapshot
result = client.post("/storage/netapp/{serviceName}/share/{shareId}/snapshot",
	description = None, # Snapshot description (type: string, nullable)
	name = None, # Snapshot name (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: storage.NetAppShareSnapshot
$result = $ovh->post("/storage/netapp/{serviceName}/share/{shareId}/snapshot", array(
	description => null, // Snapshot description (type: string, nullable)
	name => null, // Snapshot name (type: string, nullable)
));

print_r($result);
?>
```

## Revert a share to its latest snapshot

`POST /1.0/storage/netapp/{serviceName}/share/{shareId}/revert`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#post-storage-netapp-servicename-share-shareid-revert

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:share/revertToSnapshot`

Restores the share content to the given snapshot, which must be the most recent snapshot of the share. Data written after this snapshot is permanently lost. The share and the snapshot must be available, and the revert is asynchronous: follow the share status until it is available, or reverting_error if it fails.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |

### Request body (required)

Type: `storage.NetAppShareRevertToSnapshot`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `snapshotID` | string (uuid) | yes | Latest share snapshot |

```json
{
  "snapshotID": "00000000-0000-0000-0000-000000000000"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/revert" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: storage.NetAppShareRevertToSnapshot
result = client.post("/storage/netapp/{serviceName}/share/{shareId}/revert",
	snapshotID = None, # Latest share snapshot (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: storage.NetAppShareRevertToSnapshot
$result = $ovh->post("/storage/netapp/{serviceName}/share/{shareId}/revert", array(
	snapshotID => null, // Latest share snapshot (type: string)
));

print_r($result);
?>
```

## Hold an automatic snapshot

`POST /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}/hold`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#post-storage-netapp-servicename-share-shareid-snapshot-snapshotid-hold

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/hold`

Converts an automatic snapshot into a manual snapshot with a new ID, which the snapshot policy no longer deletes. Holding is asynchronous: follow the status of the returned snapshot until it is available. A held snapshot will not be released and is kept until you delete it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |
| `snapshotId` | path | string (uuid) | yes | Snapshot ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshot | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "path": "string",
  "status": "available",
  "type": "automatic"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}/hold" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}/hold")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}/hold");

print_r($result);
?>
```

## Delete a snapshot

`DELETE /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#delete-storage-netapp-servicename-share-shareid-snapshot-snapshotid

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/delete`

Permanently deletes the snapshot. Deletion is asynchronous: follow the snapshot until it no longer exists. System snapshots cannot be deleted, and a manual snapshot must be in status available or error.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |
| `snapshotId` | path | string (uuid) | yes | Snapshot ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}");

print_r($result);
?>
```

## Update a snapshot

`PUT /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#put-storage-netapp-servicename-share-shareid-snapshot-snapshotid

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshot/edit`

Updates the snapshot name and description. Only manual snapshots can be updated: hold an automatic snapshot first.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |
| `snapshotId` | path | string (uuid) | yes | Snapshot ID |

### Request body (required)

Type: `storage.NetAppShareSnapshotUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | New snapshot description |
| `name` | string |  | New snapshot name |

```json
{
  "description": "string",
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.NetAppShareSnapshot | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot creation date |
| `description` | string |  | Snapshot description |
| `id` | string (uuid) | read-only | Snapshot ID |
| `name` | string |  | Snapshot name |
| `path` | string | read-only | Snapshot path |
| `status` | storage.NetAppSnapshotStatusEnum | read-only | Snapshot status — one of `available`, `creating`, `deleting`, `error`, `error_deleting`, `manage_error`, `manage_starting`, `restoring`, `unmanage_error`, `unmanage_starting` |
| `type` | storage.NetAppSnapshotTypeEnum | read-only | Snapshot type — one of `automatic`, `manual`, `system` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "path": "string",
  "status": "available",
  "type": "automatic"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: storage.NetAppShareSnapshotUpdate
result = client.put("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}",
	description = None, # New snapshot description (type: string, nullable)
	name = None, # New snapshot name (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: storage.NetAppShareSnapshotUpdate
$result = $ovh->put("/storage/netapp/{serviceName}/share/{shareId}/snapshot/{snapshotId}", array(
	description => null, // New snapshot description (type: string, nullable)
	name => null, // New snapshot name (type: string, nullable)
));

print_r($result);
?>
```

## Update the snapshot reserve

`PUT /1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshots/#put-storage-netapp-servicename-share-shareid-snapshotreserve

**Status:** Stable production version  
**IAM actions:** `storageNetApp:apiovh:share/snapshotReserve/edit`

Changes the percentage of the share size reserved for snapshots without changing the share size, so a higher reserve leaves less space for data. The share must be available. The update is asynchronous: follow the snapshot reserve status until it returns to active.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `shareId` | path | string (uuid) | yes | Share ID |

### Request body (required)

Type: `storage.NetAppShareSnapshotReserveUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `percent` | integer | yes | Share space percentage reserved for snapshots |

```json
{
  "percent": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: storage.NetAppShareSnapshotReserveUpdate
result = client.put("/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve",
	percent = None, # Share space percentage reserved for snapshots (type: integer)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: storage.NetAppShareSnapshotReserveUpdate
$result = $ovh->put("/storage/netapp/{serviceName}/share/{shareId}/snapshotReserve", array(
	percent => null, // Share space percentage reserved for snapshots (type: integer)
));

print_r($result);
?>
```
