# Storage & Backup › File Storage › Enterprise File Storage › Share Replication 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/share-replication/

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

## Operations

- `GET /storage/netapp/{serviceName}/shareReplication` — List share replications
- `GET /storage/netapp/{serviceName}/shareReplication/{shareReplicationId}` — Get a share replication
- `GET /storage/netapp/{serviceName}/shareReplicationServicesCompatibility` — List compatible replication destinations
- `POST /storage/netapp/{serviceName}/shareReplication` — Create a share replication
- `POST /storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/accept` — Accept a share replication
- `POST /storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/cutover` — Cut over a share replication
- `DELETE /storage/netapp/{serviceName}/shareReplication/{shareReplicationId}` — Delete a share replication

## List share replications

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

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

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/get`

Returns the share replications of the service, whether this service is the source or the destination.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share replication creation date |
| `description` | string | read-only | Share replication description |
| `destination` | storage.NetAppShareReplicationDestination | read-only | Share replication destination information |
| `destination.serviceID` | string (uuid) | read-only | Service ID |
| `destination.shareID` | string (uuid) | read-only | Share ID |
| `id` | string (uuid) | read-only | Share replication ID |
| `progress` | integer | read-only | Percentage of the source share’s data that has been successfully replicated to the destination share |
| `replicaState` | storage.NetAppShareReplicaStateEnum | read-only | Share replica state — one of `active`, `error`, `in_sync`, `out_of_sync` |
| `source` | storage.NetAppShareReplicationSource | read-only | Share replication source information |
| `source.serviceID` | string (uuid) | read-only | Service ID |
| `source.shareID` | string (uuid) | read-only | Share ID |
| `status` | storage.NetAppShareReplicationStatusEnum | read-only | Share replication status — one of `accepted`, `completed`, `cutover`, `cutting_over`, `deleted`, `deleting`, `error`, `pending` |

```json
[
  {
    "createdAt": "2024-01-01T12:00:00Z",
    "description": "string",
    "destination": {
      "serviceID": "00000000-0000-0000-0000-000000000000",
      "shareID": "00000000-0000-0000-0000-000000000000"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "progress": 0,
    "replicaState": "active",
    "source": {
      "serviceID": "00000000-0000-0000-0000-000000000000",
      "shareID": "00000000-0000-0000-0000-000000000000"
    },
    "status": "accepted"
  }
]
```

### Example

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

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

print_r($result);
?>
```

## Get a share replication

`GET /1.0/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/share-replication/#get-storage-netapp-servicename-sharereplication-sharereplicationid

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/get`

Returns the source, destination, status and progress of the replication, in percent.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share replication creation date |
| `description` | string | read-only | Share replication description |
| `destination` | storage.NetAppShareReplicationDestination | read-only | Share replication destination information |
| `destination.serviceID` | string (uuid) | read-only | Service ID |
| `destination.shareID` | string (uuid) | read-only | Share ID |
| `id` | string (uuid) | read-only | Share replication ID |
| `progress` | integer | read-only | Percentage of the source share’s data that has been successfully replicated to the destination share |
| `replicaState` | storage.NetAppShareReplicaStateEnum | read-only | Share replica state — one of `active`, `error`, `in_sync`, `out_of_sync` |
| `source` | storage.NetAppShareReplicationSource | read-only | Share replication source information |
| `source.serviceID` | string (uuid) | read-only | Service ID |
| `source.shareID` | string (uuid) | read-only | Share ID |
| `status` | storage.NetAppShareReplicationStatusEnum | read-only | Share replication status — one of `accepted`, `completed`, `cutover`, `cutting_over`, `deleted`, `deleting`, `error`, `pending` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "destination": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "progress": 0,
  "replicaState": "active",
  "source": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "status": "accepted"
}
```

### Example

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

# 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}/shareReplication/{shareReplicationId}");

print_r($result);
?>
```

## List compatible replication destinations

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

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

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplicationServicesCompatibility/get`, `storageNetApp:apiovh:shareReplication/accept`

Returns, for each service on which you are allowed to accept share replications, whether it can be a destination for share replications from this service, and the reason when it cannot. A destination is compatible when it is in the same region as the source service, and when the source service uses a public network while the destination uses a vRack network. Set `compatibleOnly` to true to return only compatible destinations.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `compatibleOnly` | query | boolean |  | If set to true, only services compatible as share replication destinations for the given source are returned |
| `serviceName` | path | string (uuid) | yes | Service name |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `compatible` | boolean | read-only | Whether service can be used as destination |
| `reason` | string | read-only | Indicates why service can't be used as destination if applicable |
| `service` | storage.NetAppServiceSummary | read-only | Summarized properties of the checked service |
| `service.id` | string (uuid) | read-only | Service ID |
| `service.name` | string | read-only | Service name |

```json
[
  {
    "compatible": true,
    "reason": "string",
    "service": {
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "string"
    }
  }
]
```

### Example

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

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

print_r($result);
?>
```

## Create a share replication

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

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

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/create`, `storageNetApp:apiovh:shareReplication/accept`

Creates a share replication from a share of this service to the service given in `destinationServiceId`. It is returned with status pending, and the replication only starts after it is accepted on the destination service. To find a compatible destination, use *List compatible replication destinations*.

### Parameters

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

### Request body (required)

Type: `storage.NetAppShareReplicationCreate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string |  | Share replication description |
| `destinationServiceId` | string (uuid) |  | Replication service ID (destination) |
| `sourceShareId` | string (uuid) |  | Replication share ID (source) |

```json
{
  "description": "string",
  "destinationServiceId": "00000000-0000-0000-0000-000000000000",
  "sourceShareId": "00000000-0000-0000-0000-000000000000"
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share replication creation date |
| `description` | string | read-only | Share replication description |
| `destination` | storage.NetAppShareReplicationDestination | read-only | Share replication destination information |
| `destination.serviceID` | string (uuid) | read-only | Service ID |
| `destination.shareID` | string (uuid) | read-only | Share ID |
| `id` | string (uuid) | read-only | Share replication ID |
| `progress` | integer | read-only | Percentage of the source share’s data that has been successfully replicated to the destination share |
| `replicaState` | storage.NetAppShareReplicaStateEnum | read-only | Share replica state — one of `active`, `error`, `in_sync`, `out_of_sync` |
| `source` | storage.NetAppShareReplicationSource | read-only | Share replication source information |
| `source.serviceID` | string (uuid) | read-only | Service ID |
| `source.shareID` | string (uuid) | read-only | Share ID |
| `status` | storage.NetAppShareReplicationStatusEnum | read-only | Share replication status — one of `accepted`, `completed`, `cutover`, `cutting_over`, `deleted`, `deleting`, `error`, `pending` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "destination": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "progress": 0,
  "replicaState": "active",
  "source": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "status": "accepted"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/shareReplication" \
  -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.NetAppShareReplicationCreate
result = client.post("/storage/netapp/{serviceName}/shareReplication",
	description = None, # Share replication description (type: string, nullable)
	destinationServiceId = None, # Replication service ID (destination) (type: string)
	sourceShareId = None, # Replication share ID (source) (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.NetAppShareReplicationCreate
$result = $ovh->post("/storage/netapp/{serviceName}/shareReplication", array(
	description => null, // Share replication description (type: string, nullable)
	destinationServiceId => null, // Replication service ID (destination) (type: string)
	sourceShareId => null, // Replication share ID (source) (type: string)
));

print_r($result);
?>
```

## Accept a share replication

`POST /1.0/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/accept`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/share-replication/#post-storage-netapp-servicename-sharereplication-sharereplicationid-accept

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/accept`

Accepts the share replication and creates the destination share on this service, with the name, size and protocol given in the body. The replication must be in status pending. Acceptance is asynchronous: the replication is returned with status accepted, follow its progress until the replica state is in_sync.

### Parameters

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

### Request body (required)

Type: `storage.NetAppShareReplicationAccept`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `share` | storage.NetAppShareForShareReplication |  | Replication share |
| `share.description` | string |  | Share description |
| `share.mountPointName` | string |  | User-defined name used to generate human readable access path for the share |
| `share.name` | string |  | Share name |
| `share.protocol` | storage.ProtocolEnum | yes | Share protocol — one of `NFS` |
| `share.size` | integer | yes | Share size in GiB |

```json
{
  "share": {
    "description": "string",
    "mountPointName": "string",
    "name": "string",
    "protocol": "NFS",
    "size": 0
  }
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share replication creation date |
| `description` | string | read-only | Share replication description |
| `destination` | storage.NetAppShareReplicationDestination | read-only | Share replication destination information |
| `destination.serviceID` | string (uuid) | read-only | Service ID |
| `destination.shareID` | string (uuid) | read-only | Share ID |
| `id` | string (uuid) | read-only | Share replication ID |
| `progress` | integer | read-only | Percentage of the source share’s data that has been successfully replicated to the destination share |
| `replicaState` | storage.NetAppShareReplicaStateEnum | read-only | Share replica state — one of `active`, `error`, `in_sync`, `out_of_sync` |
| `source` | storage.NetAppShareReplicationSource | read-only | Share replication source information |
| `source.serviceID` | string (uuid) | read-only | Service ID |
| `source.shareID` | string (uuid) | read-only | Share ID |
| `status` | storage.NetAppShareReplicationStatusEnum | read-only | Share replication status — one of `accepted`, `completed`, `cutover`, `cutting_over`, `deleted`, `deleting`, `error`, `pending` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "destination": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "progress": 0,
  "replicaState": "active",
  "source": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "status": "accepted"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/accept" \
  -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.NetAppShareReplicationAccept
result = client.post("/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/accept",
	share = None, # Replication share (type: storage.NetAppShareForShareReplication)
)

# 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.NetAppShareReplicationAccept
$result = $ovh->post("/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/accept", array(
	share => null, // Replication share (type: storage.NetAppShareForShareReplication)
));

print_r($result);
?>
```

## Cut over a share replication

`POST /1.0/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}/cutover`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/share-replication/#post-storage-netapp-servicename-sharereplication-sharereplicationid-cutover

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/cutover`

Cuts over the share replication: the destination share becomes the primary, the replication stops, and the source and destination data diverge after it, so the operation cannot be undone. The call must be made on the destination service, and the replication must be in status accepted. The cutover is asynchronous: follow the status of the share replication until it is completed.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdAt` | string (date-time) | read-only | Share replication creation date |
| `description` | string | read-only | Share replication description |
| `destination` | storage.NetAppShareReplicationDestination | read-only | Share replication destination information |
| `destination.serviceID` | string (uuid) | read-only | Service ID |
| `destination.shareID` | string (uuid) | read-only | Share ID |
| `id` | string (uuid) | read-only | Share replication ID |
| `progress` | integer | read-only | Percentage of the source share’s data that has been successfully replicated to the destination share |
| `replicaState` | storage.NetAppShareReplicaStateEnum | read-only | Share replica state — one of `active`, `error`, `in_sync`, `out_of_sync` |
| `source` | storage.NetAppShareReplicationSource | read-only | Share replication source information |
| `source.serviceID` | string (uuid) | read-only | Service ID |
| `source.shareID` | string (uuid) | read-only | Share ID |
| `status` | storage.NetAppShareReplicationStatusEnum | read-only | Share replication status — one of `accepted`, `completed`, `cutover`, `cutting_over`, `deleted`, `deleting`, `error`, `pending` |

```json
{
  "createdAt": "2024-01-01T12:00:00Z",
  "description": "string",
  "destination": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "progress": 0,
  "replicaState": "active",
  "source": {
    "serviceID": "00000000-0000-0000-0000-000000000000",
    "shareID": "00000000-0000-0000-0000-000000000000"
  },
  "status": "accepted"
}
```

### Example

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

# 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}/shareReplication/{shareReplicationId}/cutover");

print_r($result);
?>
```

## Delete a share replication

`DELETE /1.0/storage/netapp/{serviceName}/shareReplication/{shareReplicationId}`

Link: https://developers.eu.ovhcloud.com/reference/storage-backup/file-storage/enterprise-file-storage/share-replication/#delete-storage-netapp-servicename-sharereplication-sharereplicationid

**Status:** Beta version  
**IAM actions:** `storageNetApp:apiovh:shareReplication/delete`

Deletes the share replication. Deletion is asynchronous and blocked while the replication is in status cutting_over, deleting or error. If the replication was accepted, the destination share is deleted with it.

### Parameters

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

### Responses

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

### Example

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

# 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}/shareReplication/{shareReplicationId}");

print_r($result);
?>
```
