# Storage & Backup › File Storage › Enterprise File Storage › Snapshot Policies 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

> 7 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/snapshot-policies/

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

## Operations

- `GET /storage/netapp/{serviceName}/snapshotPolicy` — List snapshot policies
- `GET /storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}` — Get a snapshot policy
- `GET /storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy` — Get the share snapshot policy
- `POST /storage/netapp/{serviceName}/snapshotPolicy` — Create a snapshot policy
- `DELETE /storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}` — Delete a snapshot policy
- `PUT /storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}` — Update a snapshot policy
- `PUT /storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy` — Update the share snapshot policy

## List snapshot policies

`GET /1.0/storage/netapp/{serviceName}/snapshotPolicy`

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

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

Returns the snapshot policies, including the default one. Each item contains only the policy ID and name: get a snapshot policy to read its rules and status.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot policy creation date |
| `description` | string |  | Snapshot policy description |
| `id` | string (uuid) | read-only | Snapshot policy ID |
| `isDefault` | boolean | read-only | Is this the default snapshot policy? |
| `name` | string |  | Snapshot policy name |
| `rules` | storage.NetAppSnapshotPolicyRule[] | yes | Snapshot policy rules, 1 to 4 |
| `rules[].copies` | integer | yes | Number of snapshot copies to keep |
| `rules[].prefix` | string | yes | Prefix to use for snapshots, unique among the rules of the policy |
| `rules[].schedule` | storage.NetAppSnapshotPolicySchedule | yes | Snapshot policy schedule |
| `rules[].schedule.days` | integer[] |  | The days of the month the schedule runs (1 through 31). Empty for all. |
| `rules[].schedule.hours` | integer[] |  | The hours of the day the schedule runs (0 through 23). Empty for all. |
| `rules[].schedule.minutes` | integer[] | yes | The minutes the schedule runs (0 through 59). Required to have at least one value. |
| `rules[].schedule.months` | integer[] |  | The months of the year the schedule runs (1 through 12). Empty for all. |
| `rules[].schedule.weekdays` | integer[] |  | The days of the week the schedule runs (0 through 6, where 0 is Sunday and 6 is Saturday). Empty for all. |
| `status` | storage.NetAppSnapshotPolicyStatusEnum | read-only | Snapshot policy status — one of `available`, `creating`, `deleting`, `error`, `updating` |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "isDefault": true,
    "name": "string",
    "rules": [
      {
        "copies": 0,
        "prefix": "string",
        "schedule": {
          "days": [
            0
          ],
          "hours": [
            0
          ],
          "minutes": [
            0
          ],
          "months": [
            0
          ],
          "weekdays": [
            0
          ]
        }
      }
    ],
    "status": "available"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/snapshotPolicy" \
  -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}/snapshotPolicy")

# 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}/snapshotPolicy");

print_r($result);
?>
```

## Get a snapshot policy

`GET /1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshot-policies/#get-storage-netapp-servicename-snapshotpolicy-snapshotpolicyid

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

Returns the snapshot policy with its rules and status. A policy can be updated, deleted or assigned to a share only when its status is available.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `snapshotPolicyId` | path | string (uuid) | yes | Snapshot policy ID |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot policy creation date |
| `description` | string |  | Snapshot policy description |
| `id` | string (uuid) | read-only | Snapshot policy ID |
| `isDefault` | boolean | read-only | Is this the default snapshot policy? |
| `name` | string |  | Snapshot policy name |
| `rules` | storage.NetAppSnapshotPolicyRule[] | yes | Snapshot policy rules, 1 to 4 |
| `rules[].copies` | integer | yes | Number of snapshot copies to keep |
| `rules[].prefix` | string | yes | Prefix to use for snapshots, unique among the rules of the policy |
| `rules[].schedule` | storage.NetAppSnapshotPolicySchedule | yes | Snapshot policy schedule |
| `rules[].schedule.days` | integer[] |  | The days of the month the schedule runs (1 through 31). Empty for all. |
| `rules[].schedule.hours` | integer[] |  | The hours of the day the schedule runs (0 through 23). Empty for all. |
| `rules[].schedule.minutes` | integer[] | yes | The minutes the schedule runs (0 through 59). Required to have at least one value. |
| `rules[].schedule.months` | integer[] |  | The months of the year the schedule runs (1 through 12). Empty for all. |
| `rules[].schedule.weekdays` | integer[] |  | The days of the week the schedule runs (0 through 6, where 0 is Sunday and 6 is Saturday). Empty for all. |
| `status` | storage.NetAppSnapshotPolicyStatusEnum | read-only | Snapshot policy status — one of `available`, `creating`, `deleting`, `error`, `updating` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "isDefault": true,
  "name": "string",
  "rules": [
    {
      "copies": 0,
      "prefix": "string",
      "schedule": {
        "days": [
          0
        ],
        "hours": [
          0
        ],
        "minutes": [
          0
        ],
        "months": [
          0
        ],
        "weekdays": [
          0
        ]
      }
    }
  ],
  "status": "available"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}" \
  -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}/snapshotPolicy/{snapshotPolicyId}")

# 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}/snapshotPolicy/{snapshotPolicyId}");

print_r($result);
?>
```

## Get the share snapshot policy

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

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

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

Returns the snapshot policy applied to the share and the status of its assignment. A share that was never assigned a policy uses the default snapshot policy of the service.

### 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.NetAppShareSnapshotPolicy | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | read-only | Snapshot policy ID |
| `status` | storage.NetAppShareSnapshotPolicyStatusEnum | read-only | Association status between the share and the snapshot policy — one of `active`, `error`, `updating` |

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "status": "active"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy" \
  -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}/snapshotPolicy")

# 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}/snapshotPolicy");

print_r($result);
?>
```

## Create a snapshot policy

`POST /1.0/storage/netapp/{serviceName}/snapshotPolicy`

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

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

Creates a policy made of rules, each with a schedule, a snapshot name prefix and a number of copies to keep. Creation is asynchronous: follow the snapshot policy status until it is available. The policy takes effect only once it is assigned to a share.

### Parameters

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

### Request body (required)

Type: `storage.NetAppSnapshotPolicy`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot policy creation date |
| `description` | string |  | Snapshot policy description |
| `id` | string (uuid) | read-only | Snapshot policy ID |
| `isDefault` | boolean | read-only | Is this the default snapshot policy? |
| `name` | string |  | Snapshot policy name |
| `rules` | storage.NetAppSnapshotPolicyRule[] | yes | Snapshot policy rules, 1 to 4 |
| `rules[].copies` | integer | yes | Number of snapshot copies to keep |
| `rules[].prefix` | string | yes | Prefix to use for snapshots, unique among the rules of the policy |
| `rules[].schedule` | storage.NetAppSnapshotPolicySchedule | yes | Snapshot policy schedule |
| `rules[].schedule.days` | integer[] |  | The days of the month the schedule runs (1 through 31). Empty for all. |
| `rules[].schedule.hours` | integer[] |  | The hours of the day the schedule runs (0 through 23). Empty for all. |
| `rules[].schedule.minutes` | integer[] | yes | The minutes the schedule runs (0 through 59). Required to have at least one value. |
| `rules[].schedule.months` | integer[] |  | The months of the year the schedule runs (1 through 12). Empty for all. |
| `rules[].schedule.weekdays` | integer[] |  | The days of the week the schedule runs (0 through 6, where 0 is Sunday and 6 is Saturday). Empty for all. |
| `status` | storage.NetAppSnapshotPolicyStatusEnum | read-only | Snapshot policy status — one of `available`, `creating`, `deleting`, `error`, `updating` |

```json
{
  "description": "string",
  "name": "string",
  "rules": [
    {
      "copies": 0,
      "prefix": "string",
      "schedule": {
        "days": [
          0
        ],
        "hours": [
          0
        ],
        "minutes": [
          0
        ],
        "months": [
          0
        ],
        "weekdays": [
          0
        ]
      }
    }
  ]
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Snapshot policy creation date |
| `description` | string |  | Snapshot policy description |
| `id` | string (uuid) | read-only | Snapshot policy ID |
| `isDefault` | boolean | read-only | Is this the default snapshot policy? |
| `name` | string |  | Snapshot policy name |
| `rules` | storage.NetAppSnapshotPolicyRule[] | yes | Snapshot policy rules, 1 to 4 |
| `rules[].copies` | integer | yes | Number of snapshot copies to keep |
| `rules[].prefix` | string | yes | Prefix to use for snapshots, unique among the rules of the policy |
| `rules[].schedule` | storage.NetAppSnapshotPolicySchedule | yes | Snapshot policy schedule |
| `rules[].schedule.days` | integer[] |  | The days of the month the schedule runs (1 through 31). Empty for all. |
| `rules[].schedule.hours` | integer[] |  | The hours of the day the schedule runs (0 through 23). Empty for all. |
| `rules[].schedule.minutes` | integer[] | yes | The minutes the schedule runs (0 through 59). Required to have at least one value. |
| `rules[].schedule.months` | integer[] |  | The months of the year the schedule runs (1 through 12). Empty for all. |
| `rules[].schedule.weekdays` | integer[] |  | The days of the week the schedule runs (0 through 6, where 0 is Sunday and 6 is Saturday). Empty for all. |
| `status` | storage.NetAppSnapshotPolicyStatusEnum | read-only | Snapshot policy status — one of `available`, `creating`, `deleting`, `error`, `updating` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "isDefault": true,
  "name": "string",
  "rules": [
    {
      "copies": 0,
      "prefix": "string",
      "schedule": {
        "days": [
          0
        ],
        "hours": [
          0
        ],
        "minutes": [
          0
        ],
        "months": [
          0
        ],
        "weekdays": [
          0
        ]
      }
    }
  ],
  "status": "available"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/snapshotPolicy" \
  -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.NetAppSnapshotPolicy
result = client.post("/storage/netapp/{serviceName}/snapshotPolicy",
	description = None, # Snapshot policy description (type: string, nullable)
	name = None, # Snapshot policy name (type: string, nullable)
	rules = None, # Snapshot policy rules, 1 to 4 (type: array, 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.NetAppSnapshotPolicy
$result = $ovh->post("/storage/netapp/{serviceName}/snapshotPolicy", array(
	description => null, // Snapshot policy description (type: string, nullable)
	name => null, // Snapshot policy name (type: string, nullable)
	rules => null, // Snapshot policy rules, 1 to 4 (type: array, nullable)
));

print_r($result);
?>
```

## Delete a snapshot policy

`DELETE /1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshot-policies/#delete-storage-netapp-servicename-snapshotpolicy-snapshotpolicyid

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

Deletes the snapshot policy and its schedules. A policy applied to a share cannot be deleted: apply another non-default policy to the share first. The default policy cannot be deleted, and deletion is asynchronous: follow the snapshot policy status until the policy is no longer found.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `snapshotPolicyId` | path | string (uuid) | yes | Snapshot policy ID |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}" \
  -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}/snapshotPolicy/{snapshotPolicyId}")

# 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}/snapshotPolicy/{snapshotPolicyId}");

print_r($result);
?>
```

## Update a snapshot policy

`PUT /1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/snapshot-policies/#put-storage-netapp-servicename-snapshotpolicy-snapshotpolicyid

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

Updates the policy name and description. Rules cannot be changed: create a new policy instead. The policy must be available, and the default policy cannot be updated.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string (uuid) | yes | Service name |
| `snapshotPolicyId` | path | string (uuid) | yes | Snapshot policy ID |

### Request body (required)

Type: `storage.NetAppSnapshotPolicyUpdate`

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

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

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}" \
  -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.NetAppSnapshotPolicyUpdate
result = client.put("/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}",
	description = None, # New snapshot policy description (type: string, nullable)
	name = None, # New snapshot policy 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.NetAppSnapshotPolicyUpdate
$result = $ovh->put("/storage/netapp/{serviceName}/snapshotPolicy/{snapshotPolicyId}", array(
	description => null, // New snapshot policy description (type: string, nullable)
	name => null, // New snapshot policy name (type: string, nullable)
));

print_r($result);
?>
```

## Update the share snapshot policy

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

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

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

Applies one of the snapshot policies of the service to the share. The share and the policy must be available, and the default policy cannot be assigned, so a share cannot be moved back to it. The update is asynchronous: follow the snapshot policy status of the share until 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.NetAppShareSnapshotPolicyUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `snapshotPolicyID` | string (uuid) | yes | Snapshot policy ID |

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

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy" \
  -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.NetAppShareSnapshotPolicyUpdate
result = client.put("/storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy",
	snapshotPolicyID = None, # Snapshot policy ID (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.NetAppShareSnapshotPolicyUpdate
$result = $ovh->put("/storage/netapp/{serviceName}/share/{shareId}/snapshotPolicy", array(
	snapshotPolicyID => null, // Snapshot policy ID (type: string)
));

print_r($result);
?>
```
