# Public Cloud › Analytics › Kafka › Replications API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 6 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/public-cloud/analytics/kafka/replications/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/analytics/kafka/replications.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/analytics/kafka/replications.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication` — List replication flows
- `GET /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}` — Get a replication flow
- `POST /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication` — Create a replication flow
- `DELETE /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}` — Delete a replication flow
- `PUT /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}` — Update a replication flow
- `PATCH /publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}` — Partially update a replication flow

## List replication flows

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#get-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/get`

Returns the replication flows of the service, with their source and target integrations and whether they are enabled.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "emitHeartbeats": true,
    "enabled": true,
    "id": "00000000-0000-0000-0000-000000000000",
    "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
    "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
    "syncGroupOffsetsEnabled": true,
    "syncInterval": 0,
    "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
    "topicExcludeList": [
      "string"
    ],
    "topicIncludeList": [
      "string"
    ],
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication" \
  -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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication");

print_r($result);
?>
```

## Get a replication flow

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#get-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication-replicationid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/get`

Returns the source and target integrations of the flow, its topic patterns and its sync settings.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `replicationId` | path | string (uuid) | yes | Replication ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "emitHeartbeats": true,
  "enabled": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ],
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}" \
  -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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}");

print_r($result);
?>
```

## Create a replication flow

`POST /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#post-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/create`

Creates a replication flow from a source integration to a target integration. Topics matching the include patterns are replicated, except those matching the exclude patterns.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.kafkaMirrorMaker.ReplicationCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emitHeartbeats` | boolean |  | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | yes | Whether this replication flow is enabled |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum |  | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | yes | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean |  | Whether to sync consumer group offsets |
| `syncInterval` | integer |  | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | yes | Identifier of the target integration |
| `topicExcludeList` | string[] |  | Topic patterns to exclude from replication |
| `topicIncludeList` | string[] |  | Topic patterns to include in replication |

```json
{
  "emitHeartbeats": true,
  "enabled": true,
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ]
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "emitHeartbeats": true,
  "enabled": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ],
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication" \
  -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: publicCloud.database.kafkaMirrorMaker.ReplicationCreation
result = client.post("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication",
	emitHeartbeats = None, # Whether heartbeats are emitted on the replication flow (type: boolean, nullable)
	enabled = None, # Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass = None, # Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum, nullable)
	sourceIntegrationId = None, # Identifier of the source integration (type: string)
	syncGroupOffsetsEnabled = None, # Whether to sync consumer group offsets (type: boolean, nullable)
	syncInterval = None, # Sync interval in seconds (type: integer, nullable)
	targetIntegrationId = None, # Identifier of the target integration (type: string)
	topicExcludeList = None, # Topic patterns to exclude from replication (type: array, nullable)
	topicIncludeList = None, # Topic patterns to include in replication (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: publicCloud.database.kafkaMirrorMaker.ReplicationCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication", array(
	emitHeartbeats => null, // Whether heartbeats are emitted on the replication flow (type: boolean, nullable)
	enabled => null, // Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass => null, // Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum, nullable)
	sourceIntegrationId => null, // Identifier of the source integration (type: string)
	syncGroupOffsetsEnabled => null, // Whether to sync consumer group offsets (type: boolean, nullable)
	syncInterval => null, // Sync interval in seconds (type: integer, nullable)
	targetIntegrationId => null, // Identifier of the target integration (type: string)
	topicExcludeList => null, // Topic patterns to exclude from replication (type: array, nullable)
	topicIncludeList => null, // Topic patterns to include in replication (type: array, nullable)
));

print_r($result);
?>
```

## Delete a replication flow

`DELETE /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#delete-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication-replicationid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/delete`

Deletes the replication flow and stops the replication.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `replicationId` | path | string (uuid) | yes | Replication ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "emitHeartbeats": true,
  "enabled": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ],
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}" \
  -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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}")

# 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("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}");

print_r($result);
?>
```

## Update a replication flow

`PUT /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#put-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication-replicationid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/edit`

Updates the topic patterns, sync settings and state of the flow. Every field is required. The source and target integrations cannot be changed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `replicationId` | path | string (uuid) | yes | Replication ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.kafkaMirrorMaker.ReplicationReplace`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emitHeartbeats` | boolean | yes | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | yes | Whether this replication flow is enabled |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | yes | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `syncGroupOffsetsEnabled` | boolean | yes | Whether to sync consumer group offsets |
| `syncInterval` | integer | yes | Sync interval in seconds |
| `topicExcludeList` | string[] | yes | Topic patterns to exclude |
| `topicIncludeList` | string[] | yes | Topic patterns to include |

```json
{
  "emitHeartbeats": true,
  "enabled": true,
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ]
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "emitHeartbeats": true,
  "enabled": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ],
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}" \
  -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: publicCloud.database.kafkaMirrorMaker.ReplicationReplace
result = client.put("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}",
	emitHeartbeats = None, # Whether heartbeats are emitted on the replication flow (type: boolean)
	enabled = None, # Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass = None, # Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum)
	syncGroupOffsetsEnabled = None, # Whether to sync consumer group offsets (type: boolean)
	syncInterval = None, # Sync interval in seconds (type: integer)
	topicExcludeList = None, # Topic patterns to exclude (type: array)
	topicIncludeList = None, # Topic patterns to include (type: array)
)

# 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: publicCloud.database.kafkaMirrorMaker.ReplicationReplace
$result = $ovh->put("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}", array(
	emitHeartbeats => null, // Whether heartbeats are emitted on the replication flow (type: boolean)
	enabled => null, // Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass => null, // Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum)
	syncGroupOffsetsEnabled => null, // Whether to sync consumer group offsets (type: boolean)
	syncInterval => null, // Sync interval in seconds (type: integer)
	topicExcludeList => null, // Topic patterns to exclude (type: array)
	topicIncludeList => null, // Topic patterns to include (type: array)
));

print_r($result);
?>
```

## Partially update a replication flow

`PATCH /v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/kafka/replications/#patch-publiccloud-project-projectid-managedanalytics-kafkamirrormaker-serviceid-replication-replicationid

**Status:** Beta version  
**IAM actions:** `publicCloudProject:apiovh:analytics/kafkaMirrorMaker/replication/edit`

Partially updates the topic patterns, sync settings or state of the flow. The source and target integrations cannot be changed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |
| `replicationId` | path | string (uuid) | yes | Replication ID |
| `serviceId` | path | string (uuid) | yes | Service ID |

### Request body (required)

Type: `publicCloud.database.kafkaMirrorMaker.ReplicationUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emitHeartbeats` | boolean |  | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean |  | Whether this replication flow is enabled |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum |  | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `syncGroupOffsetsEnabled` | boolean |  | Whether to sync consumer group offsets |
| `syncInterval` | integer |  | Sync interval in seconds |
| `topicExcludeList` | string[] |  | Topic patterns to exclude |
| `topicIncludeList` | string[] |  | Topic patterns to include |

```json
{
  "emitHeartbeats": true,
  "enabled": true,
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ]
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.kafkaMirrorMaker.Replication | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Hash of the resource used for concurrency control |
| `createdAt` | string (date-time) | read-only | Date at which the resource was created |
| `emitHeartbeats` | boolean | read-only | Whether heartbeats are emitted on the replication flow |
| `enabled` | boolean | read-only | Whether this replication flow is enabled |
| `id` | string (uuid) | read-only | Unique identifier of the replication flow |
| `replicationPolicyClass` | publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum | read-only | Replication policy class used for this replication flow — one of `org.apache.kafka.connect.mirror.DefaultReplicationPolicy`, `org.apache.kafka.connect.mirror.IdentityReplicationPolicy` |
| `sourceIntegrationId` | string (uuid) | read-only | Identifier of the source integration |
| `syncGroupOffsetsEnabled` | boolean | read-only | Whether consumer group offsets are synced |
| `syncInterval` | integer | read-only | Sync interval in seconds |
| `targetIntegrationId` | string (uuid) | read-only | Identifier of the target integration |
| `topicExcludeList` | string[] | read-only | List of topic patterns to exclude from replication |
| `topicIncludeList` | string[] | read-only | List of topic patterns to include in replication |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the resource |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "emitHeartbeats": true,
  "enabled": true,
  "id": "00000000-0000-0000-0000-000000000000",
  "replicationPolicyClass": "org.apache.kafka.connect.mirror.DefaultReplicationPolicy",
  "sourceIntegrationId": "00000000-0000-0000-0000-000000000000",
  "syncGroupOffsetsEnabled": true,
  "syncInterval": 0,
  "targetIntegrationId": "00000000-0000-0000-0000-000000000000",
  "topicExcludeList": [
    "string"
  ],
  "topicIncludeList": [
    "string"
  ],
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PATCH \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}" \
  -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: publicCloud.database.kafkaMirrorMaker.ReplicationUpdate
result = client.patch("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}",
	emitHeartbeats = None, # Whether heartbeats are emitted on the replication flow (type: boolean, nullable)
	enabled = None, # Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass = None, # Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum, nullable)
	syncGroupOffsetsEnabled = None, # Whether to sync consumer group offsets (type: boolean, nullable)
	syncInterval = None, # Sync interval in seconds (type: integer, nullable)
	topicExcludeList = None, # Topic patterns to exclude (type: array, nullable)
	topicIncludeList = None, # Topic patterns to include (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: publicCloud.database.kafkaMirrorMaker.ReplicationUpdate
$result = $ovh->patch("/v2/publicCloud/project/{projectId}/managedAnalytics/kafkaMirrorMaker/{serviceId}/replication/{replicationId}", array(
	emitHeartbeats => null, // Whether heartbeats are emitted on the replication flow (type: boolean, nullable)
	enabled => null, // Whether this replication flow is enabled (type: boolean)
	replicationPolicyClass => null, // Replication policy class used for this replication flow (type: publicCloud.database.kafkaMirrorMaker.ReplicationPolicyClassEnum, nullable)
	syncGroupOffsetsEnabled => null, // Whether to sync consumer group offsets (type: boolean, nullable)
	syncInterval => null, // Sync interval in seconds (type: integer, nullable)
	topicExcludeList => null, // Topic patterns to exclude (type: array, nullable)
	topicIncludeList => null, // Topic patterns to include (type: array, nullable)
));

print_r($result);
?>
```
