# DBaaS Thanos


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

Thanos is a large-scale metrics management system.

[Read more](https://community.exoscale.com/product/dbaas/service-specific/thanos/)

## <span data-label="POST" class="pill-POST"></span>create-dbaas-service-thanos

Create a DBaaS Thanos service

```
POST /dbaas-thanos/{name}
```

Create a DBaaS Thanos service

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | **yes** | Subscription plan<br/><br/>Min length: `1`. Max length: `128`. |
| `ip-filter` | array[string] | no | Allowed CIDR address blocks for incoming connections |
| `maintenance` | [Maintenance](#maintenance) | no | Automatic maintenance settings |
| `termination-protection` | boolean | no | Service is protected against termination and powering off |
| `thanos-settings` | [Thanos settings](/reference/api/_schemas/json-schema-thanos/) | no | Thanos specific settings |

<details>
<summary>Example</summary>

```json
{
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string"
  },
  "plan": "string",
  "termination-protection": true,
  "thanos-settings": {
    "compactor": {
      "retention.days": 0
    },
    "query": {
      "query.default-evaluation-interval": "1m",
      "query.lookback-delta": "5m",
      "query.metadata.default-time-range": "0s",
      "query.timeout": "2m",
      "store.limits.request-samples": 0,
      "store.limits.request-series": 0
    },
    "query-frontend": {
      "query-range.align-range-with-step": true
    }
  }
}
```
</details>


### Maintenance {#maintenance}

Automatic maintenance settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `dow` | string | **yes** | Day of week for installing updates<br/><br/>Allowed values: `saturday`, `tuesday`, `never`, `wednesday`, `sunday`, `friday`, `monday`, `thursday`. |
| `time` | string | **yes** | Time for installing updates, UTC<br/><br/>Min length: `8`. Max length: `8`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-dbaas-service-thanos`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateDBAASServiceThanos) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_dbaas_service_thanos) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createDbaasServiceThanos(java.lang.String,com.exoscale.sdk.model.CreateDbaasServiceThanosRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-dbaas-service-thanos`

## <span data-label="GET" class="pill-GET"></span>get-dbaas-service-thanos

```
GET /dbaas-thanos/{name}
```

Get a DBaaS Thanos service

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `backups` | array of [List of backups for the service](/reference/api/_schemas/dbaas-service-backup/) | List of backups for the service |
| `components` | array of [Components](/reference/api/_schemas/dbaas-service-thanos/#components) | Service component information objects |
| `connection-info` | [Connection Info](/reference/api/_schemas/dbaas-service-thanos/#connection-info) | Thanos connection information properties |
| `created-at` | string | Service creation timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `disk-size` | integer | TODO UNIT disk space for data storage<br/><br/>Min: `0`. |
| `integrations` | array of [DBaaS Integration](/reference/api/_schemas/dbaas-integration/) | Service integrations |
| `ip-filter` | array[string] | Allowed CIDR address blocks for incoming connections |
| `maintenance` | [Automatic maintenance settings](/reference/api/_schemas/dbaas-service-maintenance/) | Automatic maintenance settings |
| `name` | string | Service name<br/><br/>Min length: `0`. Max length: `63`. |
| `node-count` | integer | Number of service nodes in the active plan<br/><br/>Min: `0`. |
| `node-cpu-count` | integer | Number of CPUs for each node<br/><br/>Min: `0`. |
| `node-memory` | integer | TODO UNIT of memory for each node<br/><br/>Min: `0`. |
| `node-states` | array of [Automatic maintenance settings](/reference/api/_schemas/dbaas-node-state/) | State of individual service nodes |
| `notifications` | array of [Service notifications](/reference/api/_schemas/dbaas-service-notification/) | Service notifications |
| `plan` | string | Subscription plan |
| `prometheus-uri` | [Prometheus URI](/reference/api/_schemas/dbaas-service-thanos/#prometheus-uri) | Prometheus integration URI |
| `state` | string | State of the service<br/><br/>Allowed values: `running`, `rebuilding`, `rebalancing`, `poweroff`. |
| `termination-protection` | boolean | Service is protected against termination and powering off |
| `thanos-settings` | [Thanos settings](/reference/api/_schemas/json-schema-thanos/) | Thanos specific settings |
| `type` | string | Service type code<br/><br/>Min length: `0`. Max length: `64`. |
| `updated-at` | string | Service last update timestamp (ISO 8601)<br/><br/>ISO 8601 date-time. |
| `uri` | string | URI for connecting to the service (may be absent) |
| `uri-params` | object | service_uri parameterized into key-value pairs |
| `users` | array of [Users](/reference/api/_schemas/dbaas-service-thanos/#users) | List of service users |
| `zone` | string | The zone where the service is running |

<details>
<summary>Example output</summary>

```json
{
  "backups": [
    {
      "backup-name": "string",
      "backup-time": "2024-01-01T12:00:00Z",
      "data-size": 0
    }
  ],
  "components": [
    {
      "component": "string",
      "host": "string",
      "port": 0,
      "route": "dynamic",
      "ssl": true,
      "usage": "primary"
    }
  ],
  "connection-info": {
    "query-frontend-uri": "string",
    "query-uri": "string",
    "receiver-remote-write-uri": "string",
    "ruler-uri": "string"
  },
  "created-at": "2024-01-01T12:00:00Z",
  "disk-size": 0,
  "integrations": [
    {
      "description": "string",
      "dest": "string",
      "id": "string",
      "is-active": true,
      "is-enabled": true,
      "settings": {},
      "source": "string",
      "status": "string",
      "type": "string"
    }
  ],
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string",
    "updates": [
      {
        "deadline": "2024-01-01T12:00:00Z",
        "description": "string",
        "start-after": "2024-01-01T12:00:00Z",
        "start-at": "2024-01-01T12:00:00Z"
      }
    ]
  },
  "name": "string",
  "node-count": 0,
  "node-cpu-count": 0,
  "node-memory": 0,
  "node-states": [
    {
      "name": "string",
      "progress-updates": [
        {
          "completed": true,
          "current": 0,
          "max": 0,
          "min": 0,
          "phase": "stream",
          "unit": "string"
        }
      ],
      "role": "standby",
      "state": "leaving"
    }
  ],
  "notifications": [
    {
      "level": "warning",
      "message": "string",
      "metadata": {},
      "type": "service_powered_off_removal"
    }
  ],
  "plan": "string",
  "prometheus-uri": {
    "host": "string",
    "port": 0
  },
  "state": "running",
  "termination-protection": true,
  "thanos-settings": {
    "compactor": {
      "retention.days": 0
    },
    "query": {
      "query.default-evaluation-interval": "1m",
      "query.lookback-delta": "5m",
      "query.metadata.default-time-range": "0s",
      "query.timeout": "2m",
      "store.limits.request-samples": 0,
      "store.limits.request-series": 0
    },
    "query-frontend": {
      "query-range.align-range-with-step": true
    }
  },
  "type": "string",
  "updated-at": "2024-01-01T12:00:00Z",
  "uri": "string",
  "uri-params": {},
  "users": [
    {
      "password": "string",
      "type": "string",
      "username": "string"
    }
  ],
  "zone": "string"
}
```
</details>


SDK reference for `get-dbaas-service-thanos`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetDBAASServiceThanos) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_dbaas_service_thanos) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getDbaasServiceThanos(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-dbaas-service-thanos`

## <span data-label="PUT" class="pill-PUT"></span>update-dbaas-service-thanos

```
PUT /dbaas-thanos/{name}
```

Update a DBaaS Thanos service

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `ip-filter` | array[string] | no | Allowed CIDR address blocks for incoming connections |
| `maintenance` | [Maintenance](#maintenance) | no | Automatic maintenance settings |
| `plan` | string | no | Subscription plan<br/><br/>Min length: `1`. Max length: `128`. |
| `termination-protection` | boolean | no | Service is protected against termination and powering off |
| `thanos-settings` | [Thanos settings](/reference/api/_schemas/json-schema-thanos/) | no | Thanos specific settings |

<details>
<summary>Example</summary>

```json
{
  "ip-filter": [
    "string"
  ],
  "maintenance": {
    "dow": "saturday",
    "time": "string"
  },
  "plan": "string",
  "termination-protection": true,
  "thanos-settings": {
    "compactor": {
      "retention.days": 0
    },
    "query": {
      "query.default-evaluation-interval": "1m",
      "query.lookback-delta": "5m",
      "query.metadata.default-time-range": "0s",
      "query.timeout": "2m",
      "store.limits.request-samples": 0,
      "store.limits.request-series": 0
    },
    "query-frontend": {
      "query-range.align-range-with-step": true
    }
  }
}
```
</details>


### Maintenance {#maintenance}

Automatic maintenance settings

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `dow` | string | **yes** | Day of week for installing updates<br/><br/>Allowed values: `saturday`, `tuesday`, `never`, `wednesday`, `sunday`, `friday`, `monday`, `thursday`. |
| `time` | string | **yes** | Time for installing updates, UTC<br/><br/>Min length: `8`. Max length: `8`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-dbaas-service-thanos`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateDBAASServiceThanos) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_dbaas_service_thanos) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateDbaasServiceThanos(java.lang.String,com.exoscale.sdk.model.UpdateDbaasServiceThanosRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-dbaas-service-thanos`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-dbaas-service-thanos

Delete a Thanos service

```
DELETE /dbaas-thanos/{name}
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` |  |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-dbaas-service-thanos`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteDBAASServiceThanos) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_dbaas_service_thanos) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteDbaasServiceThanos(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-dbaas-service-thanos`


---

## Other Operations

## <span data-label="GET" class="pill-GET"></span>get-dbaas-settings-thanos

Get DBaaS Thanos settings

```
GET /dbaas-settings-thanos
```

Get DBaaS Thanos settings

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `settings` | [Settings](#settings) |  |

<details>
<summary>Example output</summary>

```json
{
  "settings": {
    "thanos": {
      "additionalProperties": true,
      "properties": {},
      "title": "string",
      "type": "string"
    }
  }
}
```
</details>


### Settings {#settings}

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `thanos` | [Thanos](#thanos) | no | Thanos configuration values |

### Thanos {#thanos}

Thanos configuration values

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `additionalProperties` | boolean | no |  |
| `properties` | object | no |  |
| `title` | string | no |  |
| `type` | string | no |  |

SDK reference for `get-dbaas-settings-thanos`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetDBAASSettingsThanos) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_dbaas_settings_thanos) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getDbaasSettingsThanos())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-dbaas-settings-thanos`

## <span data-label="PUT" class="pill-PUT"></span>start-dbaas-thanos-maintenance

Initiate Thanos maintenance update

```
PUT /dbaas-thanos/{name}/maintenance/start
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `name` | `path` | Min length: `0`. Max length: `63`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `start-dbaas-thanos-maintenance`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.StartDBAASThanosMaintenance) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.start_dbaas_thanos_maintenance) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#startDbaasThanosMaintenance(java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api start-dbaas-thanos-maintenance`

## <span data-label="GET" class="pill-GET"></span>reveal-dbaas-thanos-user-password

Reveal the secrets of a DBaaS Thanos user

```
GET /dbaas-thanos/{service-name}/user/{username}/password/reveal
```

null

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `service-name` | `path` | Min length: `0`. Max length: `63`. |
| `username` | `path` | Min length: `1`. Max length: `64`. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `password` | string | Thanos password |
| `username` | string | Thanos username |

<details>
<summary>Example output</summary>

```json
{
  "password": "string",
  "username": "string"
}
```
</details>


SDK reference for `reveal-dbaas-thanos-user-password`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.RevealDBAASThanosUserPassword) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reveal_dbaas_thanos_user_password) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#revealDbaasThanosUserPassword(java.lang.String,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reveal-dbaas-thanos-user-password`


