# Storage & Backup › File Storage › NAS-HA › Share Management 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

> 3 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/nas-ha/share-management/

OpenAPI v1: https://api.eu.ovhcloud.com/v1/__schemas/developer-hub-navigation/storage-backup/file-storage/nas-ha/share-management.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/storage-backup/file-storage/nas-ha/share-management.json?format=openapi3

## Operations

- `GET /storage/nasha/{serviceName}/share` — List shares
- `GET /storage/nasha/{serviceName}/share/{shareId}` — Get a share
- `PUT /storage/nasha/{serviceName}/share/{shareId}` — Update a share

## List shares

`GET /v1/storage/nasha/{serviceName}/share`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/nas-ha/share-management/#getAllStorageNashaShares

**Status:** Beta version  
**IAM actions:** `nasHA:apiovh:share/get`

Returns the shares of the service. Filter by name or status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | query | string |  | Filter by share name |
| `serviceName` | path | string | yes | Service name |
| `status` | query | string |  | Filter by share status |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share creation date |
| `description` | string | read-only | Share description |
| `id` | string (uuid) | read-only | Share ID |
| `name` | string | read-only | Share name |
| `protocol` | storage.ProtocolEnum | read-only | Share protocol — one of `NFS` |
| `size` | integer | read-only | Share size in GiB |
| `snapshotId` | string | read-only | Source snapshot ID used to create the share |
| `status` | storage.NetAppShareStatusEnum | read-only | Share status — one of `available`, `awaiting_replication`, `creating`, `creating_from_snapshot`, `deleted`, `deleting`, `error`, `error_deleting`, `extending`, `extending_error`, `inactive`, `manage_error`, … |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "description": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "protocol": "NFS",
    "size": 0,
    "snapshotId": "string",
    "status": "available"
  }
]
```

### Example

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

# 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/nasha/{serviceName}/share");

print_r($result);
?>
```

## Get a share

`GET /v1/storage/nasha/{serviceName}/share/{shareId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/nas-ha/share-management/#getStorageNashaShare

**Status:** Beta version  
**IAM actions:** `nasHA:apiovh:share/get`

Returns the share, including its size, protocol and status.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.nasha.Share | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share creation date |
| `description` | string | read-only | Share description |
| `id` | string (uuid) | read-only | Share ID |
| `name` | string | read-only | Share name |
| `protocol` | storage.ProtocolEnum | read-only | Share protocol — one of `NFS` |
| `size` | integer | read-only | Share size in GiB |
| `snapshotId` | string | read-only | Source snapshot ID used to create the share |
| `status` | storage.NetAppShareStatusEnum | read-only | Share status — one of `available`, `awaiting_replication`, `creating`, `creating_from_snapshot`, `deleted`, `deleting`, `error`, `error_deleting`, `extending`, `extending_error`, `inactive`, `manage_error`, … |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "protocol": "NFS",
  "size": 0,
  "snapshotId": "string",
  "status": "available"
}
```

### Example

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

# 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/nasha/{serviceName}/share/{shareId}");

print_r($result);
?>
```

## Update a share

`PUT /v1/storage/nasha/{serviceName}/share/{shareId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/nas-ha/share-management/#editStorageNashaShare

**Status:** Beta version  
**IAM actions:** `nasHA:apiovh:share/edit`

Updates the share name and description, the only fields that can be changed.

### Parameters

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

### Request body (required)

Type: `storage.nasha.ShareUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | Share description |
| `name` | string |  | Share name |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | storage.nasha.Share | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share creation date |
| `description` | string | read-only | Share description |
| `id` | string (uuid) | read-only | Share ID |
| `name` | string | read-only | Share name |
| `protocol` | storage.ProtocolEnum | read-only | Share protocol — one of `NFS` |
| `size` | integer | read-only | Share size in GiB |
| `snapshotId` | string | read-only | Source snapshot ID used to create the share |
| `status` | storage.NetAppShareStatusEnum | read-only | Share status — one of `available`, `awaiting_replication`, `creating`, `creating_from_snapshot`, `deleted`, `deleting`, `error`, `error_deleting`, `extending`, `extending_error`, `inactive`, `manage_error`, … |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "protocol": "NFS",
  "size": 0,
  "snapshotId": "string",
  "status": "available"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v1/storage/nasha/{serviceName}/share/{shareId}" \
  -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.nasha.ShareUpdate
result = client.put("/storage/nasha/{serviceName}/share/{shareId}",
	description = None, # Share description (type: string)
	name = None, # Share name (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.nasha.ShareUpdate
$result = $ovh->put("/storage/nasha/{serviceName}/share/{shareId}", array(
	description => null, // Share description (type: string)
	name => null, // Share name (type: string)
));

print_r($result);
?>
```
