# Public Cloud › Analytics › OpenSearch 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/opensearch/

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

## Operations

- `GET /publicCloud/project/{projectId}/managedAnalytics/opensearch` — List OpenSearch services
- `GET /publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}` — Get an OpenSearch service
- `POST /publicCloud/project/{projectId}/managedAnalytics/opensearch` — Create an OpenSearch service
- `DELETE /publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}` — Delete an OpenSearch service
- `PUT /publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}` — Update an OpenSearch service
- `PATCH /publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}` — Partially update an OpenSearch service

## List OpenSearch services

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/opensearch/#get-publiccloud-project-projectid-managedanalytics-opensearch

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

Returns the OpenSearch services of the project.

### 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 |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service[] | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "advancedConfiguration": {
        "key": "string"
      },
      "backup": {
        "pitr": "2024-01-01T12:00:00Z",
        "regions": [
          "af-north-lz-rba"
        ],
        "retentionDays": 0,
        "time": "string"
      },
      "capabilities": {
        "key": {
          "create": "DISABLED",
          "delete": "DISABLED",
          "read": "DISABLED",
          "update": "DISABLED"
        }
      },
      "deletionProtected": true,
      "description": "string",
      "endpoints": [
        {
          "component": "CLICKHOUSE",
          "domain": "string",
          "path": "string",
          "port": 0,
          "public": true,
          "scheme": "string",
          "ssl": true,
          "sslMode": "REQUIRE",
          "uri": "string"
        }
      ],
      "engineCapabilities": {
        "advancedConfigurationProperties": [
          {
            "default": "string",
            "description": "string",
            "maximum": 0,
            "minimum": 0,
            "name": "string",
            "requiresRestart": true,
            "type": "BOOLEAN",
            "values": [
              null
            ]
          }
        ],
        "backupRegions": [
          "string"
        ],
        "categories": [
          "string"
        ],
        "commands": [
          "string"
        ],
        "connectors": [
          {
            "author": "string",
            "configuration": [
              null
            ],
  …
```

### Example

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

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

print_r($result);
?>
```

## Get an OpenSearch service

`GET /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}`

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

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

Returns the target specification of the service, its current state and its running tasks.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "pitr": "2024-01-01T12:00:00Z",
      "regions": [
        "af-north-lz-rba"
      ],
      "retentionDays": 0,
      "time": "string"
    },
    "capabilities": {
      "key": {
        "create": "DISABLED",
        "delete": "DISABLED",
        "read": "DISABLED",
        "update": "DISABLED"
      }
    },
    "deletionProtected": true,
    "description": "string",
    "endpoints": [
      {
        "component": "CLICKHOUSE",
        "domain": "string",
        "path": "string",
        "port": 0,
        "public": true,
        "scheme": "string",
        "ssl": true,
        "sslMode": "REQUIRE",
        "uri": "string"
      }
    ],
    "engineCapabilities": {
      "advancedConfigurationProperties": [
        {
          "default": "string",
          "description": "string",
          "maximum": 0,
          "minimum": 0,
          "name": "string",
          "requiresRestart": true,
          "type": "BOOLEAN",
          "values": [
            "string"
          ]
        }
      ],
      "backupRegions": [
        "string"
      ],
      "categories": [
        "string"
      ],
      "commands": [
        "string"
      ],
      "connectors": [
        {
          "author": "string",
          "configuration": [
            {
              "defaultValue": null,
              "description": null,
              "displayName": null,
              "group": null,
              "importance": null,
  …
```

### Example

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

# 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/opensearch/{serviceId}");

print_r($result);
?>
```

## Create an OpenSearch service

`POST /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/opensearch/#post-publiccloud-project-projectid-managedanalytics-opensearch

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

Creates an OpenSearch service from a plan, a flavor and an engine version. Creation is asynchronous: follow resourceStatus until READY. Set forkSourceServiceId to create it from a backup of another service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.database.ServiceCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.database.ServiceCreationTargetSpec | yes | Desired configuration of the new service |
| `targetSpec.backup` | publicCloud.database.BackupSpec |  | Backup configuration for the new service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean |  | Whether to protect this service from accidental deletion. Defaults to false. |
| `targetSpec.description` | string |  | Human-readable description of the service |
| `targetSpec.flavor` | string | yes | Compute flavor for the nodes of the cluster. All the nodes of a cluster share the same flavor. Available flavors can be retrieved from the capabilities endpoint. |
| `targetSpec.forkSourceBackupId` | string (uuid) |  | Identifier of the backup to restore from when forking. Mutually exclusive with forkSourcePointInTime. When both are null and forkSourceServiceId is set, the latest backup is used. |
| `targetSpec.forkSourcePointInTime` | string (date-time) |  | Point-in-time to restore from when forking. Mutually exclusive with forkSourceBackupId. Requires the source service to have PITR enabled. |
| `targetSpec.forkSourceServiceId` | string (uuid) |  | Identifier of an existing service to fork from. When set, the new service is created from a backup of the source service. |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec |  | Maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkSpec |  | Network configuration for the new service |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.networkId` | string (uuid) |  | Private network identifier to attach the service to. Immutable after creation. |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address once it is created: a public IP address in front of the service, and a public domain name with TLS. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the service private. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.network.subnetId` | string (uuid) |  | Subnet identifier within the private network. Immutable after creation. |
| `targetSpec.nodesCount` | integer |  | Number of nodes composing the cluster. When null, the minimum node count of the plan is applied. The accepted range for a given plan is exposed as specifications.nodes.minimum and specifications.nodes.maximum on the availability endpoint. |
| `targetSpec.plan` | string | yes | Service plan. Available plans can be retrieved from the capabilities endpoint. |
| `targetSpec.prometheusEnabled` | boolean |  | Whether to enable Prometheus monitoring on this service |
| `targetSpec.region` | common.RegionEnum | yes | Region in which the nodes of the cluster are deployed. All the nodes of a cluster share the same region. Immutable after creation. Available regions can be retrieved from the availability endpoint. — one of `af-north-lz-rba`, `ap-south-mum`, `ap-southeast-sgp`, `ap-southeast-syd`, `ca-east-bhs`, `ca-east-tor`, `eu-central-lz-buh`, `eu-central-lz-prg`, `eu-central-lz-sof`, `eu-central-waw`, `eu-north-lz-cph`, `eu-north-lz-hel`, … |
| `targetSpec.storage` | publicCloud.database.Storage |  | Storage configuration for the service. Applies only to engines using block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `targetSpec.version` | string | yes | Engine version to deploy on the cluster. Available versions can be retrieved from the capabilities endpoint. |

```json
{
  "targetSpec": {
    "backup": {
      "regions": [
        "af-north-lz-rba"
      ],
      "time": "string"
    },
    "deletionProtected": true,
    "description": "string",
    "flavor": "string",
    "forkSourceBackupId": "00000000-0000-0000-0000-000000000000",
    "forkSourcePointInTime": "2024-01-01T12:00:00Z",
    "forkSourceServiceId": "00000000-0000-0000-0000-000000000000",
    "maintenanceWindow": {
      "startTimeUtc": "string"
    },
    "network": {
      "authorizedIps": {
        "rules": [
          {
            "cidr": "192.0.2.0/24",
            "description": "string"
          }
        ]
      },
      "networkId": "00000000-0000-0000-0000-000000000000",
      "public": true,
      "subnetId": "00000000-0000-0000-0000-000000000000"
    },
    "nodesCount": 0,
    "plan": "string",
    "prometheusEnabled": true,
    "region": "af-north-lz-rba",
    "storage": {
      "size": {
        "unit": "GB",
        "value": 0
      }
    },
    "version": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "pitr": "2024-01-01T12:00:00Z",
      "regions": [
        "af-north-lz-rba"
      ],
      "retentionDays": 0,
      "time": "string"
    },
    "capabilities": {
      "key": {
        "create": "DISABLED",
        "delete": "DISABLED",
        "read": "DISABLED",
        "update": "DISABLED"
      }
    },
    "deletionProtected": true,
    "description": "string",
    "endpoints": [
      {
        "component": "CLICKHOUSE",
        "domain": "string",
        "path": "string",
        "port": 0,
        "public": true,
        "scheme": "string",
        "ssl": true,
        "sslMode": "REQUIRE",
        "uri": "string"
      }
    ],
    "engineCapabilities": {
      "advancedConfigurationProperties": [
        {
          "default": "string",
          "description": "string",
          "maximum": 0,
          "minimum": 0,
          "name": "string",
          "requiresRestart": true,
          "type": "BOOLEAN",
          "values": [
            "string"
          ]
        }
      ],
      "backupRegions": [
        "string"
      ],
      "categories": [
        "string"
      ],
      "commands": [
        "string"
      ],
      "connectors": [
        {
          "author": "string",
          "configuration": [
            {
              "defaultValue": null,
              "description": null,
              "displayName": null,
              "group": null,
              "importance": null,
  …
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch" \
  -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.ServiceCreation
result = client.post("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch",
	targetSpec = None, # Desired configuration of the new service (type: publicCloud.database.ServiceCreationTargetSpec)
)

# 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.ServiceCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch", array(
	targetSpec => null, // Desired configuration of the new service (type: publicCloud.database.ServiceCreationTargetSpec)
));

print_r($result);
?>
```

## Delete an OpenSearch service

`DELETE /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/opensearch/#delete-publiccloud-project-projectid-managedanalytics-opensearch-serviceid

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

Deletes the service. A service with deletion protection enabled cannot be deleted.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "pitr": "2024-01-01T12:00:00Z",
      "regions": [
        "af-north-lz-rba"
      ],
      "retentionDays": 0,
      "time": "string"
    },
    "capabilities": {
      "key": {
        "create": "DISABLED",
        "delete": "DISABLED",
        "read": "DISABLED",
        "update": "DISABLED"
      }
    },
    "deletionProtected": true,
    "description": "string",
    "endpoints": [
      {
        "component": "CLICKHOUSE",
        "domain": "string",
        "path": "string",
        "port": 0,
        "public": true,
        "scheme": "string",
        "ssl": true,
        "sslMode": "REQUIRE",
        "uri": "string"
      }
    ],
    "engineCapabilities": {
      "advancedConfigurationProperties": [
        {
          "default": "string",
          "description": "string",
          "maximum": 0,
          "minimum": 0,
          "name": "string",
          "requiresRestart": true,
          "type": "BOOLEAN",
          "values": [
            "string"
          ]
        }
      ],
      "backupRegions": [
        "string"
      ],
      "categories": [
        "string"
      ],
      "commands": [
        "string"
      ],
      "connectors": [
        {
          "author": "string",
          "configuration": [
            {
              "defaultValue": null,
              "description": null,
              "displayName": null,
              "group": null,
              "importance": null,
  …
```

### Example

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

# 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/opensearch/{serviceId}");

print_r($result);
?>
```

## Update an OpenSearch service

`PUT /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/opensearch/#put-publiccloud-project-projectid-managedanalytics-opensearch-serviceid

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

Updates the target specification of the service, for example its plan, flavor, version or number of nodes. Every field is required: the request describes the whole configuration. A new target specification is accepted only in READY status.

### 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.ServiceReplace`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.database.ServiceReplaceTargetSpec | yes | Desired configuration of the service |
| `targetSpec.advancedConfiguration` | object | yes | Advanced configuration key-value pairs to apply to the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupReplaceSpec | yes | Backup configuration for the service. Null for engines that do not support backups. |
| `targetSpec.backup.regions` | common.RegionEnum[] | yes | Regions where backups should be stored. Supported values depend on the engine and plan. Null for engines that do not support cross-region backups. |
| `targetSpec.backup.time` | string | yes | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | yes | Whether to protect this service from accidental deletion |
| `targetSpec.description` | string | yes | Human-readable description of the service. Null removes the description. |
| `targetSpec.flavor` | string | yes | Desired compute flavor for the nodes. Available flavors can be retrieved from the capabilities endpoint. |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceReplaceSpec | yes | Maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string | yes | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkReplaceSpec | yes | Updatable network configuration for the service. Only IP restrictions can be modified after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIpsReplace | yes | IP authorization configuration to apply to the service |
| `targetSpec.nodesCount` | integer | yes | Desired number of nodes composing the cluster. Increasing or decreasing this value scales the cluster. The value must stay within the range accepted by the plan, exposed as specifications.nodes.minimum and specifications.nodes.maximum on the availability endpoint. |
| `targetSpec.plan` | string | yes | Desired service plan. Available plans can be retrieved from the capabilities endpoint. |
| `targetSpec.prometheusEnabled` | boolean | yes | Whether to enable Prometheus monitoring on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageReplaceSpec | yes | Updatable storage configuration. Only size can be modified after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValueReplace | yes | Storage size allocated to the service |
| `targetSpec.version` | string | yes | Desired engine version. Available versions can be retrieved from the capabilities endpoint. |

```json
{
  "targetSpec": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "regions": [
        "af-north-lz-rba"
      ],
      "time": "string"
    },
    "deletionProtected": true,
    "description": "string",
    "flavor": "string",
    "maintenanceWindow": {
      "startTimeUtc": "string"
    },
    "network": {
      "authorizedIps": {
        "rules": [
          {
            "cidr": "192.0.2.0/24",
            "description": "string"
          }
        ]
      }
    },
    "nodesCount": 0,
    "plan": "string",
    "prometheusEnabled": true,
    "storage": {
      "size": {
        "unit": "GB",
        "value": 0
      }
    },
    "version": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "pitr": "2024-01-01T12:00:00Z",
      "regions": [
        "af-north-lz-rba"
      ],
      "retentionDays": 0,
      "time": "string"
    },
    "capabilities": {
      "key": {
        "create": "DISABLED",
        "delete": "DISABLED",
        "read": "DISABLED",
        "update": "DISABLED"
      }
    },
    "deletionProtected": true,
    "description": "string",
    "endpoints": [
      {
        "component": "CLICKHOUSE",
        "domain": "string",
        "path": "string",
        "port": 0,
        "public": true,
        "scheme": "string",
        "ssl": true,
        "sslMode": "REQUIRE",
        "uri": "string"
      }
    ],
    "engineCapabilities": {
      "advancedConfigurationProperties": [
        {
          "default": "string",
          "description": "string",
          "maximum": 0,
          "minimum": 0,
          "name": "string",
          "requiresRestart": true,
          "type": "BOOLEAN",
          "values": [
            "string"
          ]
        }
      ],
      "backupRegions": [
        "string"
      ],
      "categories": [
        "string"
      ],
      "commands": [
        "string"
      ],
      "connectors": [
        {
          "author": "string",
          "configuration": [
            {
              "defaultValue": null,
              "description": null,
              "displayName": null,
              "group": null,
              "importance": null,
  …
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}" \
  -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.ServiceReplace
result = client.put("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}",
	targetSpec = None, # Desired configuration of the service (type: publicCloud.database.ServiceReplaceTargetSpec)
)

# 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.ServiceReplace
$result = $ovh->put("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}", array(
	targetSpec => null, // Desired configuration of the service (type: publicCloud.database.ServiceReplaceTargetSpec)
));

print_r($result);
?>
```

## Partially update an OpenSearch service

`PATCH /v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/analytics/opensearch/#patch-publiccloud-project-projectid-managedanalytics-opensearch-serviceid

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

Partially updates the target specification of the service, for example its plan, flavor, version or number of nodes. Omitted fields keep their current value. A new target specification is accepted only in READY status.

### 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.ServiceUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.database.ServiceUpdateTargetSpec | yes | Desired configuration of the service |
| `targetSpec.advancedConfiguration` | object |  | Advanced configuration key-value pairs to apply to the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec |  | Backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean |  | Whether to protect this service from accidental deletion. Omit or set to null to leave the current setting unchanged. |
| `targetSpec.description` | string |  | Human-readable description of the service |
| `targetSpec.flavor` | string |  | Desired compute flavor for the nodes. Available flavors can be retrieved from the capabilities endpoint. |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec |  | Maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec |  | Updatable network configuration for the service. Only IP restrictions can be modified after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer |  | Desired number of nodes composing the cluster. Increasing or decreasing this value scales the cluster. The value must stay within the range accepted by the plan, exposed as specifications.nodes.minimum and specifications.nodes.maximum on the availability endpoint. |
| `targetSpec.plan` | string |  | Desired service plan. Available plans can be retrieved from the capabilities endpoint. |
| `targetSpec.prometheusEnabled` | boolean |  | Whether to enable Prometheus monitoring on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec |  | Updatable storage configuration. Only size can be modified after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string |  | Desired engine version. Available versions can be retrieved from the capabilities endpoint. |

```json
{
  "targetSpec": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "regions": [
        "af-north-lz-rba"
      ],
      "time": "string"
    },
    "deletionProtected": true,
    "description": "string",
    "flavor": "string",
    "maintenanceWindow": {
      "startTimeUtc": "string"
    },
    "network": {
      "authorizedIps": {
        "rules": [
          {
            "cidr": "192.0.2.0/24",
            "description": "string"
          }
        ]
      },
      "public": true
    },
    "nodesCount": 0,
    "plan": "string",
    "prometheusEnabled": true,
    "storage": {
      "size": {
        "unit": "GB",
        "value": 0
      }
    },
    "version": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.database.Service | 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 service was created |
| `currentState` | publicCloud.database.ServiceCurrentState | read-only | Current configuration deployed on the service |
| `currentState.advancedConfiguration` | object | read-only | Current advanced configuration key-value pairs. Null for engines that do not support advanced configuration. |
| `currentState.backup` | publicCloud.database.BackupCurrentState | read-only | Current backup configuration of the service |
| `currentState.backup.pitr` | string (date-time) | read-only | Date until which point-in-time recovery is available for this service |
| `currentState.backup.regions` | common.RegionEnum[] | read-only | Regions where backups of this service are stored |
| `currentState.backup.retentionDays` | integer | read-only | Number of days backups are retained for this service |
| `currentState.backup.time` | string | read-only | Time of day at which automatic backups are scheduled, in HH:MM UTC format |
| `currentState.capabilities` | object | read-only | Map of capabilities available for this service, keyed by capability name. Each entry describes which CRUD actions are enabled or disabled. |
| `currentState.deletionProtected` | boolean | read-only | Whether deletion of this service is protected. A protected service cannot be deleted until this flag is set to false. |
| `currentState.description` | string | read-only | Human-readable description of the service |
| `currentState.endpoints` | publicCloud.database.Endpoint[] | read-only | Connection endpoints exposed by this service |
| `currentState.endpoints[].component` | publicCloud.database.EndpointComponentEnum | read-only | Component accessible through this endpoint — one of `CLICKHOUSE`, `GRAFANA`, `KAFKA`, `KAFKA_CONNECT`, `KAFKA_REST`, `KAFKA_SCHEMA_REGISTRY`, `MONGODB`, `MYSQL`, `OPENSEARCH`, `OPENSEARCH_DASHBOARDS`, `POSTGRESQL`, `VALKEY` |
| `currentState.endpoints[].domain` | string | read-only | Fully qualified domain name of the endpoint |
| `currentState.endpoints[].path` | string | read-only | URL path appended to the domain when applicable |
| `currentState.endpoints[].port` | integer | read-only | TCP port of the endpoint |
| `currentState.endpoints[].public` | boolean | read-only | True on the endpoints that use the public domain name of the service, false on the private ones. Null for an engine or a service that does not support public exposure. |
| `currentState.endpoints[].scheme` | string | read-only | URI scheme of the endpoint, for example kafka, postgresql, https |
| `currentState.endpoints[].ssl` | boolean | read-only | Whether TLS is enabled on this endpoint |
| `currentState.endpoints[].sslMode` | publicCloud.database.SSLModeEnum | read-only | TLS verification mode of the endpoint — one of `REQUIRE` |
| `currentState.endpoints[].uri` | string | read-only | Full connection URI combining scheme, domain, port, and path |
| `currentState.engineCapabilities` | publicCloud.database.ServiceEngineCapabilities | read-only | Engine-specific capabilities of this service |
| `currentState.engineCapabilities.advancedConfigurationProperties` | publicCloud.database.capabilities.AdvancedConfigurationProperty[] | read-only | Available advanced configuration properties and their constraints. Null for engines that do not support advanced configuration. |
| `currentState.engineCapabilities.backupRegions` | string[] | read-only | Available regions for backup storage. Null for engines that do not support cross-region backups. |
| `currentState.engineCapabilities.categories` | string[] | read-only | Available command categories. Only applicable to Valkey services. |
| `currentState.engineCapabilities.commands` | string[] | read-only | Available commands. Only applicable to Valkey services. |
| `currentState.engineCapabilities.connectors` | publicCloud.database.kafkaConnect.capabilities.ConnectorCapability[] | read-only | Available connector types. Only applicable to Kafka Connect services. |
| `currentState.engineCapabilities.integrations` | publicCloud.database.capabilities.IntegrationCapability[] | read-only | Available integration types and their parameters |
| `currentState.flavor` | string | read-only | Compute flavor used by the nodes of this service. Null when flavor is determined by the plan. |
| `currentState.maintenanceWindow` | publicCloud.database.MaintenanceCurrentState | read-only | Current maintenance window configuration of the service |
| `currentState.maintenanceWindow.startTimeUtc` | string | read-only | Preferred start time for maintenance windows, in HH:MM UTC format |
| `currentState.network` | publicCloud.database.NetworkCurrentState | read-only | Current network configuration of the service |
| `currentState.network.authorizedIps` | publicCloud.database.AuthorizedIps | read-only | Current IP authorization configuration of the service |
| `currentState.network.networkId` | string (uuid) | read-only | Private network identifier this service is attached to |
| `currentState.network.public` | boolean | read-only | True while the service is published on a public address, false while it is not. Null for an engine or a service that does not support public exposure. |
| `currentState.network.subnetId` | string (uuid) | read-only | Subnet identifier within the private network |
| `currentState.nodes` | publicCloud.database.Node[] | read-only | Nodes composing this service cluster |
| `currentState.nodes[].createdAt` | string (date-time) | read-only | Date at which the node was created |
| `currentState.nodes[].flavor` | string | read-only | Compute flavor of the node |
| `currentState.nodes[].id` | string (uuid) | read-only | Unique identifier of the node |
| `currentState.nodes[].location` | publicCloud.common.Location | read-only | Location of this node |
| `currentState.nodes[].name` | string | read-only | Name of the node |
| `currentState.nodes[].port` | integer | read-only | TCP port on which the node listens |
| `currentState.nodes[].role` | publicCloud.database.NodeRoleEnum | read-only | Role of this node within the cluster — one of `ANALYTICS`, `PRIMARY`, `SECONDARY`, `STANDBY` |
| `currentState.nodes[].status` | common.ResourceStatusEnum | read-only | Current readiness status of the node — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `currentState.nodesCount` | integer | read-only | Number of nodes currently composing the cluster. While the cluster is being created or scaled, this reflects the number of nodes requested rather than the number already deployed in nodes. |
| `currentState.plan` | string | read-only | Service plan currently applied |
| `currentState.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is enabled on this service |
| `currentState.status` | publicCloud.database.service.StatusEnum | read-only | Operational status of the service as reported by the database engine — one of `CREATING`, `DELETING`, `DRAINED`, `ERROR`, `LOCKED`, `LOCKED_PENDING`, `LOCKED_UPDATING`, `PENDING`, `READY`, `SHELVED`, `TO_DRAIN`, `UPDATING` |
| `currentState.storage` | publicCloud.database.Storage | read-only | Storage configuration of the service. Null for engines that do not use block storage. |
| `currentState.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `currentState.storage.type` | publicCloud.database.StorageTypeEnum | read-only | Type of storage used by the service. Immutable after creation. — one of `HIGH_SPEED`, `HIGH_SPEED_GEN2` |
| `currentState.version` | string | read-only | Engine version currently running |
| `currentTasks` | common.CurrentTask[] | read-only | Asynchronous operations currently running on the service |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the service |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Readiness status of the service. A new target specification is accepted only in READY status. — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.database.ServiceTargetSpec | read-only | Last requested target specification for the service |
| `targetSpec.advancedConfiguration` | object | read-only | Advanced configuration key-value pairs requested for the service. Null for engines that do not support advanced configuration. |
| `targetSpec.backup` | publicCloud.database.BackupSpec | read-only | Requested backup configuration for the service |
| `targetSpec.backup.regions` | common.RegionEnum[] |  | Regions where backups should be stored. Supported values depend on the engine and plan. |
| `targetSpec.backup.time` | string |  | Preferred time of day for automatic backups, in HH:MM UTC format |
| `targetSpec.deletionProtected` | boolean | read-only | Whether deletion protection is requested on this service |
| `targetSpec.description` | string | read-only | Human-readable description of the service |
| `targetSpec.flavor` | string | read-only | Requested compute flavor for the nodes |
| `targetSpec.maintenanceWindow` | publicCloud.database.MaintenanceSpec | read-only | Requested maintenance window configuration for the service |
| `targetSpec.maintenanceWindow.startTimeUtc` | string |  | Preferred start time for maintenance windows, in HH:MM UTC format |
| `targetSpec.network` | publicCloud.database.NetworkUpdateSpec | read-only | Requested network configuration for the service. Only IP restrictions can change after creation. |
| `targetSpec.network.authorizedIps` | publicCloud.database.AuthorizedIps |  | IP authorization configuration to apply to the service |
| `targetSpec.network.public` | boolean |  | Set to true to publish the service on a public address: a public IP address in front of the service, and a public domain name with TLS. Set to false to take it off that address. The authorized IPs apply to the public address as they do to the private one. Null or absent keeps the current exposure. Engines and services that do not support public exposure ignore this field. |
| `targetSpec.nodesCount` | integer | read-only | Requested number of nodes composing the cluster |
| `targetSpec.plan` | string | read-only | Requested service plan |
| `targetSpec.prometheusEnabled` | boolean | read-only | Whether Prometheus monitoring is requested on this service. Null for engines that do not expose a Prometheus endpoint. |
| `targetSpec.storage` | publicCloud.database.StorageUpdateSpec | read-only | Requested storage configuration. Only size can change after creation. Null for engines that do not use block storage. |
| `targetSpec.storage.size` | publicCloud.database.UnitAndValue |  | Storage size allocated to the service |
| `targetSpec.version` | string | read-only | Requested engine version |
| `updatedAt` | string (date-time) | read-only | Date of the last update to the service |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "advancedConfiguration": {
      "key": "string"
    },
    "backup": {
      "pitr": "2024-01-01T12:00:00Z",
      "regions": [
        "af-north-lz-rba"
      ],
      "retentionDays": 0,
      "time": "string"
    },
    "capabilities": {
      "key": {
        "create": "DISABLED",
        "delete": "DISABLED",
        "read": "DISABLED",
        "update": "DISABLED"
      }
    },
    "deletionProtected": true,
    "description": "string",
    "endpoints": [
      {
        "component": "CLICKHOUSE",
        "domain": "string",
        "path": "string",
        "port": 0,
        "public": true,
        "scheme": "string",
        "ssl": true,
        "sslMode": "REQUIRE",
        "uri": "string"
      }
    ],
    "engineCapabilities": {
      "advancedConfigurationProperties": [
        {
          "default": "string",
          "description": "string",
          "maximum": 0,
          "minimum": 0,
          "name": "string",
          "requiresRestart": true,
          "type": "BOOLEAN",
          "values": [
            "string"
          ]
        }
      ],
      "backupRegions": [
        "string"
      ],
      "categories": [
        "string"
      ],
      "commands": [
        "string"
      ],
      "connectors": [
        {
          "author": "string",
          "configuration": [
            {
              "defaultValue": null,
              "description": null,
              "displayName": null,
              "group": null,
              "importance": null,
  …
```

### Example

```bash
curl -X PATCH \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}" \
  -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.ServiceUpdate
result = client.patch("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}",
	targetSpec = None, # Desired configuration of the service (type: publicCloud.database.ServiceUpdateTargetSpec)
)

# 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.ServiceUpdate
$result = $ovh->patch("/v2/publicCloud/project/{projectId}/managedAnalytics/opensearch/{serviceId}", array(
	targetSpec => null, // Desired configuration of the service (type: publicCloud.database.ServiceUpdateTargetSpec)
));

print_r($result);
?>
```
