# Manage & Operate › Logs Data Platform › Clusters API

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

> 5 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/manage-operate/logs-data-platform/clusters/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/logs-data-platform/clusters.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/logs-data-platform/clusters.json?format=openapi3

## Operations

- `GET /dbaas/logs/{serviceName}/cluster` — List clusters
- `GET /dbaas/logs/{serviceName}/cluster/{clusterId}/retention` — List cluster retentions
- `GET /dbaas/logs/{serviceName}/cluster/{clusterId}` — Get a cluster
- `GET /dbaas/logs/{serviceName}/cluster/{clusterId}/retention/{retentionId}` — Get a cluster retention
- `PUT /dbaas/logs/{serviceName}/cluster/{clusterId}` — Update a cluster

## List clusters

`GET /1.0/dbaas/logs/{serviceName}/cluster`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/clusters/#get-dbaas-logs-servicename-cluster

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:cluster/get`

Returns the clusters of the Logs Data Platform service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `namePattern` | query | string |  | Filter by name (like) |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |
| 404 | object | Error 404 response |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

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

# 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("/dbaas/logs/{serviceName}/cluster");

print_r($result);
?>
```

## List cluster retentions

`GET /1.0/dbaas/logs/{serviceName}/cluster/{clusterId}/retention`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/clusters/#get-dbaas-logs-servicename-cluster-clusterid-retention

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:cluster/retention/get`

Returns the cluster retentions of the Logs Data Platform service.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |
| 403 | object | Error 403 response |
| 404 | object | Error 404 response |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/cluster/{clusterId}/retention" \
  -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("/dbaas/logs/{serviceName}/cluster/{clusterId}/retention")

# 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("/dbaas/logs/{serviceName}/cluster/{clusterId}/retention");

print_r($result);
?>
```

## Get a cluster

`GET /1.0/dbaas/logs/{serviceName}/cluster/{clusterId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/clusters/#get-dbaas-logs-servicename-cluster-clusterid

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:cluster/get`

Returns the cluster.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dbaas.logs.Cluster | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `archiveAllowedNetworks` | ipBlock[] | read-only | Allowed networks for ARCHIVE flow type |
| `certificationLevel` | dbaas.logs.CertificationLevelEnum | read-only | Certification level of the given cluster — one of `HDS`, `PCI_DSS`, `SNC`, `SOC2`, `STANDARD`, `TRUSTED_ZONE` |
| `clusterId` | string (uuid) | read-only | Cluster ID |
| `clusterType` | dbaas.logs.ClusterClusterTypeEnum | read-only | Cluster type — one of `DEDICATED`, `SHARED` |
| `dedicatedInputPEM` | string | read-only | PEM for dedicated inputs |
| `defaultRetentionId` | string (uuid) | read-only | Retention ID used by default when none is given on new stream |
| `directInputAllowedNetworks` | ipBlock[] | read-only | Allowed networks for DIRECT_INPUT flow type |
| `directInputPEM` | string | read-only | PEM for direct inputs |
| `hostname` | string | read-only | Hostname |
| `isDefault` | boolean | read-only | All content generated by given service will be placed on this cluster |
| `isUnlocked` | boolean | read-only | Allow given service to perform advanced operations on cluster |
| `queryAllowedNetworks` | ipBlock[] | read-only | Allowed networks for QUERY flow type |
| `region` | dbaas.logs.ClusterRegionEnum | read-only | Data center localization — one of `BHS`, `GRA`, `P-19`, `RBX`, `SBG` |

```json
{
  "archiveAllowedNetworks": [
    "192.0.2.0/24"
  ],
  "certificationLevel": "HDS",
  "clusterId": "00000000-0000-0000-0000-000000000000",
  "clusterType": "DEDICATED",
  "dedicatedInputPEM": "string",
  "defaultRetentionId": "00000000-0000-0000-0000-000000000000",
  "directInputAllowedNetworks": [
    "192.0.2.0/24"
  ],
  "directInputPEM": "string",
  "hostname": "string",
  "isDefault": true,
  "isUnlocked": true,
  "queryAllowedNetworks": [
    "192.0.2.0/24"
  ],
  "region": "BHS"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/cluster/{clusterId}" \
  -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("/dbaas/logs/{serviceName}/cluster/{clusterId}")

# 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("/dbaas/logs/{serviceName}/cluster/{clusterId}");

print_r($result);
?>
```

## Get a cluster retention

`GET /1.0/dbaas/logs/{serviceName}/cluster/{clusterId}/retention/{retentionId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/clusters/#get-dbaas-logs-servicename-cluster-clusterid-retention-retentionid

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:cluster/retention/get`

Returns the cluster retention.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `clusterId` | path | string (uuid) | yes | Cluster ID |
| `retentionId` | path | string (uuid) | yes | Retention ID |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dbaas.logs.ClusterRetention | successful operation |
| 403 | object | Error 403 response |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `duration` | string (duration) | read-only | Indexed duration expressed in ISO-8601 format |
| `isSupported` | boolean | read-only | Indicates if a new stream can use it |
| `retentionId` | string (uuid) | read-only | Retention ID |
| `retentionType` | dbaas.logs.RetentionTypeEnum | read-only | Retention type — one of `LOGS_COLD_STORAGE`, `LOGS_INDEXING`, `METRICS_TENANT` |

```json
{
  "duration": "string",
  "isSupported": true,
  "retentionId": "00000000-0000-0000-0000-000000000000",
  "retentionType": "LOGS_COLD_STORAGE"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/cluster/{clusterId}/retention/{retentionId}" \
  -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("/dbaas/logs/{serviceName}/cluster/{clusterId}/retention/{retentionId}")

# 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("/dbaas/logs/{serviceName}/cluster/{clusterId}/retention/{retentionId}");

print_r($result);
?>
```

## Update a cluster

`PUT /1.0/dbaas/logs/{serviceName}/cluster/{clusterId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/clusters/#put-dbaas-logs-servicename-cluster-clusterid

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:cluster/edit`

Updates the cluster.

### Parameters

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

### Request body (required)

Type: `dbaas.logs.ClusterUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `archiveAllowedNetworks` | ipBlock[] |  | Allowed networks for ARCHIVE flow type |
| `directInputAllowedNetworks` | ipBlock[] |  | Allowed networks for DIRECT_INPUT flow type |
| `queryAllowedNetworks` | ipBlock[] |  | Allowed networks for QUERY flow type |

```json
{
  "archiveAllowedNetworks": [
    "192.0.2.0/24"
  ],
  "directInputAllowedNetworks": [
    "192.0.2.0/24"
  ],
  "queryAllowedNetworks": [
    "192.0.2.0/24"
  ]
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dbaas.logs.Operation | successful operation |
| 403 | object | Error 403 response |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `aliasId` | string (uuid) | read-only | Alias used |
| `createdAt` | string (date-time) | read-only | Operation creation |
| `dashboardId` | string (uuid) | read-only | Dashboard used |
| `encryptionKeyId` | string (uuid) | read-only | Encryption key used |
| `indexId` | string (uuid) | read-only | Index used |
| `inputId` | string (uuid) | read-only | Input used |
| `operationId` | string (uuid) | read-only | Operation ID |
| `osdId` | string (uuid) | read-only | OpenSearch Dashboards used |
| `roleId` | string (uuid) | read-only | Role used |
| `serviceName` | string | read-only | Service name |
| `state` | dbaas.logs.OperationStateEnum | read-only | Operation status — one of `FAILURE`, `PENDING`, `RECEIVED`, `RETRY`, `REVOKED`, `RUNNING`, `STARTED`, `SUCCESS` |
| `streamId` | string (uuid) | read-only | Stream used |
| `subscriptionId` | string (uuid) | read-only | Subscription used |
| `tenantId` | string (uuid) | read-only | Metrics tenant used |
| `tokenId` | string (uuid) | read-only | Token used |
| `updatedAt` | string (date-time) | read-only | Operation last update |

```json
{
  "aliasId": "00000000-0000-0000-0000-000000000000",
  "createdAt": "2024-01-01T12:00:00Z",
  "dashboardId": "00000000-0000-0000-0000-000000000000",
  "encryptionKeyId": "00000000-0000-0000-0000-000000000000",
  "indexId": "00000000-0000-0000-0000-000000000000",
  "inputId": "00000000-0000-0000-0000-000000000000",
  "operationId": "00000000-0000-0000-0000-000000000000",
  "osdId": "00000000-0000-0000-0000-000000000000",
  "roleId": "00000000-0000-0000-0000-000000000000",
  "serviceName": "string",
  "state": "FAILURE",
  "streamId": "00000000-0000-0000-0000-000000000000",
  "subscriptionId": "00000000-0000-0000-0000-000000000000",
  "tenantId": "00000000-0000-0000-0000-000000000000",
  "tokenId": "00000000-0000-0000-0000-000000000000",
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/cluster/{clusterId}" \
  -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: dbaas.logs.ClusterUpdate
result = client.put("/dbaas/logs/{serviceName}/cluster/{clusterId}",
	archiveAllowedNetworks = None, # Allowed networks for ARCHIVE flow type (type: array, nullable)
	directInputAllowedNetworks = None, # Allowed networks for DIRECT_INPUT flow type (type: array, nullable)
	queryAllowedNetworks = None, # Allowed networks for QUERY flow type (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: dbaas.logs.ClusterUpdate
$result = $ovh->put("/dbaas/logs/{serviceName}/cluster/{clusterId}", array(
	archiveAllowedNetworks => null, // Allowed networks for ARCHIVE flow type (type: array, nullable)
	directInputAllowedNetworks => null, // Allowed networks for DIRECT_INPUT flow type (type: array, nullable)
	queryAllowedNetworks => null, // Allowed networks for QUERY flow type (type: array, nullable)
));

print_r($result);
?>
```
