openapi: 3.0.1 info: contact: email: support@aiven.io name: Aiven support team url: https://aiven.io/support-services title: Aiven API Documentation Account Service:_ClickHouse API version: v1 x-logo: altText: Aiven logo backgroundColor: '#fafafa' href: https://api.aiven.io/doc url: https://aiven.io/assets/img/aiven-logo.png description: "# Introduction\n\n[Direct link to openapi.json](https://api.aiven.io/doc/openapi.json) for use with external tools\n\n[Aiven](https://aiven.io) is a modern fully-managed open source data platform for streaming, storing, and analyzing data on any public cloud. On Aiven Platform, you can operate your data infrastructure with a few devops tools: [Aiven Console](https://console.aiven.io/), [Aiven Terraform Provider](https://aiven.io/docs/tools/terraform), [Aiven CLI](https://github.com/aiven/aiven-client), and [Aiven Operator for Kubernetes](https://github.com/aiven/aiven-operator). All of them are built on an open secure powerful REST API for integration with custom tooling.\n\nThe Aiven [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) API\nprovides programmatic access to Aiven.io services. To call the Aiven API, you can use either CLI tools (for example, `cURL` or [Aiven CLI client](https://aiven.io/docs/tools/cli)) or GUI tools, such as the [Aiven public API Postman collection](https://www.postman.com/aiven-apis).\n\nThis Aiven API documentation will help you operate your Aiven organization, projects, or services programmatically by integrating your applications and processes with Aiven.\n\n# Description\n\nAiven's APIs ([Application Programming Interfaces](https://en.wikipedia.org/wiki/API)) power its platform for data management. Aiven has a number of REST APIs that can help you build strong and robust data infrastructure for your applications.\n\nThe Aiven API is organized around core resources. Each core resource has multiple endpoints, which can be interacted with using different HTTP methods.\n\n## Core resources\n\n### Platform APIs\n\n
Returns a list of active queries on a cluster.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseCurrentQueriesResponse' security: - tokenAuth: [] oauth2: - services:read post: summary: Execute an SQL query tags: - Service:_ClickHouse operationId: ServiceClickHouseQuery description:Executes an SQL query.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseQueryRequestBody' example: database: defaultdb query: SELECT 1 responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseQueryResponse' security: - tokenAuth: [] oauth2: - services:write /project/{project}/service/{service_name}/clickhouse/db: post: summary: Create a database tags: - Service:_ClickHouse operationId: ServiceClickHouseDatabaseCreate parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseDatabaseCreateRequestBody' example: database: testdb responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseDatabaseCreateResponse' security: - tokenAuth: [] oauth2: - services:write get: summary: List all databases tags: - Service:_ClickHouse operationId: ServiceClickHouseDatabaseList parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseDatabaseListResponse' security: - tokenAuth: [] oauth2: - services:read /project/{project}/service/{service_name}/clickhouse/db/{database}: delete: summary: Delete a database tags: - Service:_ClickHouse operationId: ServiceClickHouseDatabaseDelete parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' - $ref: '#/components/parameters/database' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseDatabaseDeleteResponse' security: - tokenAuth: [] oauth2: - services:write /project/{project}/service/{service_name}/clickhouse/user/{user_uuid}/password: put: summary: Reset a user's password tags: - Service:_ClickHouse operationId: ServiceClickHousePasswordReset description:Resets the password for a ClickHouse user.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' - $ref: '#/components/parameters/user_uuid' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceClickHousePasswordResetRequestBody' example: password: '!@$password12345' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHousePasswordResetResponse' security: - tokenAuth: [] oauth2: - services:write /project/{project}/service/{service_name}/clickhouse/query/stats: get: summary: Return statistics on recent queries tags: - Service:_ClickHouse operationId: ServiceClickHouseQueryStats parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' - $ref: '#/components/parameters/serviceclickhousequerystats_limit' - $ref: '#/components/parameters/serviceclickhousequerystats_offset' - $ref: '#/components/parameters/serviceclickhousequerystats_order_by' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseQueryStatsResponse' security: - tokenAuth: [] oauth2: - services:read /project/{project}/service/{service_name}/clickhouse/tiered-storage/summary: get: summary: Get the ClickHouse tiered storage summary tags: - Service:_ClickHouse operationId: ServiceClickHouseTieredStorageSummary parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseTieredStorageSummaryResponse' security: - tokenAuth: [] oauth2: - services:read /project/{project}/service/{service_name}/clickhouse/user: post: summary: Create a ClickHouse user tags: - Service:_ClickHouse operationId: ServiceClickHouseUserCreate description:Creates a new user in ClickHouse.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseUserCreateRequestBody' example: name: alice password: '!@$password12345' roles: - uuid: 12345678-1234-1234-1234-12345678abcd responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseUserCreateResponse' security: - tokenAuth: [] oauth2: - services:write get: summary: List all users tags: - Service:_ClickHouse operationId: ServiceClickHouseUserList description:Lists all users in ClickHouse.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseUserListResponse' security: - tokenAuth: [] oauth2: - services:read /project/{project}/service/{service_name}/clickhouse/user/{user_uuid}: delete: summary: Delete a user tags: - Service:_ClickHouse operationId: ServiceClickHouseUserDelete description:Deletes a user from ClickHouse.
parameters: - $ref: '#/components/parameters/project' - $ref: '#/components/parameters/service_name' - $ref: '#/components/parameters/user_uuid' responses: '200': description: Response content: application/json: schema: $ref: '#/components/schemas/ServiceClickHouseUserDeleteResponse' security: - tokenAuth: [] oauth2: - services:write components: parameters: serviceclickhousequerystats_order_by: in: query name: order_by description: Order in which to sort retrieved results schema: type: string default: total_time:desc enum: - calls:asc - calls:desc - min_time:asc - min_time:desc - max_time:asc - max_time:desc - mean_time:asc - mean_time:desc - p95_time:asc - p95_time:desc - stddev_time:asc - stddev_time:desc - total_time:asc - total_time:desc required: false serviceclickhousequerystats_offset: in: query name: offset description: Offset for retrieved results based on sort order schema: type: integer minimum: 0 default: 0 required: false service_name: in: path name: service_name description: Service name schema: type: string required: true database: in: path name: database description: Database name schema: type: string required: true serviceclickhousequerystats_limit: in: query name: limit description: Limit for number of results schema: type: integer minimum: 1 maximum: 1000 default: 100 required: false user_uuid: in: path name: user_uuid description: User identifier schema: type: string required: true project: in: path name: project description: Project name schema: type: string required: true schemas: ServiceClickHousePasswordResetResponse: type: object description: ServiceClickHousePasswordResetResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request password: type: string description: User password required: - password ServiceClickHouseQueryResponse: type: object description: ServiceClickHouseQueryResponse properties: data: type: array description: Data items: type: array properties: {} errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request meta: type: array description: Meta items: type: object properties: name: type: string description: Column name type: type: string description: Column type required: - name - type summary: type: object description: Summary properties: elapsed_ns: type: integer description: Elapsed time in nanoseconds read_bytes: type: integer description: Number of bytes read read_rows: type: integer description: Number of rows read result_bytes: type: integer description: Number of bytes in the result result_rows: type: integer description: Number of rows in the result written_bytes: type: integer description: Number of bytes written written_rows: type: integer description: Number of rows written required: - data - meta - summary ServiceClickHouseQueryRequestBody: type: object description: ServiceClickHouseQueryRequestBody properties: database: type: string maxLength: 250 description: Service database name query: type: string maxLength: 20000 description: Query required: - database - query ServiceClickHouseCurrentQueriesResponse: type: object description: ServiceClickHouseCurrentQueriesResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request queries: type: array description: List of currently running queries items: type: object properties: client_name: type: string description: Client name, if set database: type: string description: Database elapsed: type: number description: The time in seconds since request execution started query: type: string description: The query text user: type: string description: The user who made the query required: - queries ServiceClickHouseDatabaseCreateRequestBody: type: object description: ServiceClickHouseDatabaseCreateRequestBody properties: database: type: string maxLength: 40 description: Service database name required: - database ServiceClickHouseUserCreateResponse: type: object description: ServiceClickHouseUserCreateResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request user: type: object description: User details properties: name: type: string description: User name password: type: string description: User password privileges: type: array description: User privileges items: type: object properties: access_type: type: string description: Access type column: type: string description: Column name database: type: string description: Database name grant_option: type: boolean description: With grant option is_partial_revoke: type: boolean description: Is partial revoke table: type: string description: Table name required: - access_type - column - database - grant_option - is_partial_revoke - table required: type: boolean description: Required user roles: type: array description: User roles items: type: object properties: is_default: type: boolean description: Is default name: type: string description: Role name uuid: type: string description: Role uuid with_admin_option: type: boolean description: With admin option required: - is_default - name - uuid - with_admin_option uuid: type: string description: User uuid required: - name - privileges - required - roles - uuid required: - user ServiceClickHouseUserCreateRequestBody: type: object description: ServiceClickHouseUserCreateRequestBody properties: name: type: string maxLength: 64 description: User name password: type: string maxLength: 256 description: User password roles: type: array maxItems: 50 description: User roles items: type: object properties: uuid: type: string maxLength: 36 description: Role uuid required: - uuid required: - name ServiceClickHouseTieredStorageSummaryResponse: type: object description: ServiceClickHouseTieredStorageSummaryResponse properties: current_cost: type: string description: The current cost in USD of tiered storage since the beginning of the billing period errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status forecasted_cost: type: string description: The forecasted cost in USD of tiered storage in the billing period forecasted_rate: type: string description: The rate on GBs/hour used to calculate the forecasted cost message: type: string description: Printable result of the request storage_usage_history: type: object description: History of usage and cumulative costs in the billing period properties: hourly: type: array description: History by hour items: type: object properties: estimated_cost: type: string description: The estimated cost in USD of tiered storage for this hour hour_start: type: string maxLength: 36 description: Timestamp in ISO 8601 format, always in UTC peak_stored_bytes: type: integer minimum: 0 description: Peak bytes stored on object storage at this hour required: - hour_start - peak_stored_bytes required: - hourly total_storage_usage: type: integer minimum: 0 description: Total storage usage by tiered storage, in bytes required: - current_cost - forecasted_cost - storage_usage_history - total_storage_usage ServiceClickHouseDatabaseListResponse: type: object description: ServiceClickHouseDatabaseListResponse properties: databases: type: array description: List of databases items: type: object properties: engine: type: string description: Database engine name: type: string description: Database name required: type: boolean description: Required database state: type: string description: Database state enum: - ok - pending_creation - pending_removal required: - engine - name - required errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request required: - databases ServiceClickHouseUserDeleteResponse: type: object description: ServiceClickHouseUserDeleteResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request ServiceClickHouseDatabaseCreateResponse: type: object description: ServiceClickHouseDatabaseCreateResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request ServiceClickHousePasswordResetRequestBody: type: object description: ServiceClickHousePasswordResetRequestBody properties: password: type: string maxLength: 256 description: User password required: - password ServiceClickHouseUserListResponse: type: object description: ServiceClickHouseUserListResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request users: type: array description: List of users items: type: object properties: name: type: string description: User name password: type: string description: User password privileges: type: array description: User privileges items: type: object properties: access_type: type: string description: Access type column: type: string description: Column name database: type: string description: Database name grant_option: type: boolean description: With grant option is_partial_revoke: type: boolean description: Is partial revoke table: type: string description: Table name required: - access_type - column - database - grant_option - is_partial_revoke - table required: type: boolean description: Required user roles: type: array description: User roles items: type: object properties: is_default: type: boolean description: Is default name: type: string description: Role name uuid: type: string description: Role uuid with_admin_option: type: boolean description: With admin option required: - is_default - name - uuid - with_admin_option uuid: type: string description: User uuid required: - name - privileges - required - roles - uuid required: - users ServiceClickHouseDatabaseDeleteResponse: type: object description: ServiceClickHouseDatabaseDeleteResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request ServiceClickHouseQueryStatsResponse: type: object description: ServiceClickHouseQueryStatsResponse properties: errors: type: array description: List of errors occurred during request processing items: type: object properties: message: type: string description: Printable error message more_info: type: string description: URL to the documentation of the error status: type: integer description: HTTP error status code required: - message - status message: type: string description: Printable result of the request queries: type: array description: List of query statistics items: type: object properties: calls: type: integer description: Number of calls database: type: string description: Database max_time: type: integer description: Maximum query duration in milliseconds mean_time: type: integer description: Average query duration in milliseconds min_time: type: integer description: Minimum query duration in milliseconds p95_time: type: integer description: Query duration 95th percentile in milliseconds query: type: string description: Normalized query rows: type: number description: Average number of rows per call stddev_time: type: integer description: Query duration standard deviation in milliseconds total_time: type: integer description: Total duration of all calls in milliseconds required: - queries securitySchemes: tokenAuth: description: 'Header should be of the format `authorization: aivenv1