Skip to content

Docs/5625 v1 get query endpoint #6274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cbdaaa0
feat: Add complete GET /query endpoint
MeelahMe Jul 30, 2025
9117e7a
feat: Add complete GET /query endpoint to cluster, dedicated, and ser…
MeelahMe Jul 30, 2025
dbcd8dd
docs(api): enhance POST /query with JSON chunk parameter support
MeelahMe Jul 30, 2025
105a06b
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 1, 2025
ed7fa90
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 1, 2025
aa766ed
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 1, 2025
e9bbdf1
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 1, 2025
e772317
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
33ace56
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
36085a8
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
7cc0c38
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
6ba77d4
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
6efb013
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 1, 2025
6a20bb0
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 1, 2025
3b738ec
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 1, 2025
a038d07
Merge branch 'master' into docs/5625-v1-get-query-endpoint
MeelahMe Aug 1, 2025
76af766
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 1, 2025
2604774
Merge branch 'master' into docs/5625-v1-get-query-endpoint
MeelahMe Aug 1, 2025
b8f9f94
Merge branch 'master' into docs/5625-v1-get-query-endpoint
MeelahMe Aug 4, 2025
7436f0f
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 4, 2025
c6a11db
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 4, 2025
8d4a02c
Merge branch 'master' into docs/5625-v1-get-query-endpoint
MeelahMe Aug 5, 2025
3b60c7f
docs: updating swaggerVwith rp, operationID, and bucket changed to da…
MeelahMe Aug 5, 2025
3c2f475
dox: fixing wrong indentation
MeelahMe Aug 5, 2025
4a6cbb3
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 5, 2025
7f17176
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 5, 2025
5ef4d2e
docs: updating rp for cluster and serverless
MeelahMe Aug 5, 2025
78ecb89
Merge branch 'docs/5625-v1-get-query-endpoint' of github.com:influxda…
MeelahMe Aug 5, 2025
ae96f01
docs: updates to clous-serveless rp
MeelahMe Aug 5, 2025
a215776
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 5, 2025
65e80ca
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 5, 2025
9ee11d3
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 5, 2025
6fb6454
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 6, 2025
ce5d929
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 6, 2025
89db6cd
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 6, 2025
bc890e4
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 6, 2025
a69fea8
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 6, 2025
c6bd7bb
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 6, 2025
4d77cde
Update api-docs/influxdb3/cloud-dedicated/v1-compatibility/swaggerV1C…
MeelahMe Aug 6, 2025
33cae0b
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 6, 2025
4f0a718
Update api-docs/influxdb3/clustered/v1-compatibility/swaggerV1Compat.yml
MeelahMe Aug 6, 2025
fe1dd29
Merge branch 'master' into docs/5625-v1-get-query-endpoint
MeelahMe Aug 7, 2025
beb7bb2
Update api-docs/influxdb3/cloud-serverless/v1-compatibility/swaggerV1…
MeelahMe Aug 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,22 @@ paths:
schema:
type: string
required: true
description: Bucket to write to. If none exists, InfluxDB creates a bucket with a default 3-day retention policy.
description: |
The database to write to.

**Database targeting:** In Cloud Dedicated, databases can be named using the `database_name/retention_policy_name` convention for InfluxQL compatibility. Cloud Dedicated does not use DBRP mappings. The db and rp parameters are used to construct the target database name following this naming convention.

**Auto-creation behavior:** Cloud Dedicated requires databases to be created before writing data. The v1 `/write` API does not automatically create databases. If the specified
database does not exist, the write request will fail.

Authentication: Requires a valid API token with _write_ permissions for the target database.

### Related

- [Write data to InfluxDB Cloud Dedicated](/influxdb3/cloud-dedicated/write-data/)
- [Manage databases in InfluxDB Cloud Dedicated](/influxdb3/cloud-dedicated/admin/databases/)
- [InfluxQL DBRP naming convention](/influxdb3/cloud-dedicated/admin/databases/create/#influxql-dbrp-naming-convention)
- [InfluxQL data retention policy mapping differences](/influxdb3/cloud-serverless/guides/prototype-evaluation/#influxql-data-retention-policy-mapping-differences)
- in: query
name: rp
schema:
Expand Down Expand Up @@ -137,6 +152,160 @@ paths:
schema:
$ref: '#/components/schemas/Error'
/query:
get:
operationId: GetQueryV1
tags:
- Query
summary: Query using the InfluxDB v1 HTTP API
parameters:
- $ref: '#/components/parameters/TraceSpan'
- $ref: '#/components/parameters/AuthUserV1'
- $ref: '#/components/parameters/AuthPassV1'
- in: header
name: Accept
schema:
type: string
description: Specifies how query results should be encoded in the response. **Note:** With `application/csv`, query results include epoch timestamps instead of RFC3339 timestamps.
default: application/json
enum:
- application/json
- application/csv
- text/csv
- application/x-msgpack
- in: header
name: Accept-Encoding
description: The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand.
schema:
type: string
description: Specifies that the query response in the body should be encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
- in: query
name: chunked
description: |
If true, the response is divided into chunks of size `chunk_size`.
schema:
type: boolean
default: false
- in: query
name: chunk_size
description: |
The number of records that will go into a chunk.
This parameter is only used if `chunked=true`.
schema:
type: integer
default: 10000
- in: query
name: db
schema:
type: string
required: true
description: The database to query from.
- in: query
name: pretty
description: |
If true, the JSON response is formatted in a human-readable format.
schema:
type: boolean
default: false
- in: query
name: q
description: Defines the InfluxQL query to run.
required: true
schema:
type: string
- in: query
name: rp
schema:
type: string
description: |
The retention policy name for InfluxQL compatibility

Optional parameter that, when combined with the db parameter, forms the complete database name to query. In InfluxDB Cloud Dedicated, databases can be named using the
database_name/retention_policy_name convention for InfluxQL compatibility.

When a request specifies both `db` and `rp`, Cloud Dedicated combines them as `db/rp` to target the database--for example:

- If `db=mydb` and `rp=autogen`, the query targets the database named `mydb/autogen`
- If only `db=mydb` is provided (no `rp`), the query targets the database named `mydb`

Unlike InfluxDB v1 and Cloud Serverless, Cloud Dedicated does not use DBRP mappings or separate retention policy objects. This parameter exists solely for v1 API
compatibility and database naming conventions.

_Note: The retention policy name does not control data retention in Cloud Dedicated. Data retention is determined by the database's **retention period** setting._

### Related

- [InfluxQL DBRP naming convention](/influxdb3/cloud-dedicated/admin/databases/create/#influxql-dbrp-naming-convention)
- [InfluxQL data retention policy mapping differences](/influxdb3/cloud-serverless/guides/prototype-evaluation/#influxql-data-retention-policy-mapping-differences)
- name: epoch
description: |
Formats timestamps as unix (epoch) timestamps with the specified precision
instead of RFC3339 timestamps with nanosecond precision.
in: query
schema:
type: string
enum:
- h
- m
- s
- ms
- u
- µ
- ns
responses:
'200':
description: Query results
headers:
Content-Encoding:
description: The Content-Encoding entity header is used to compress the media-type. When present, its value indicates which encodings were applied to the entity-body
schema:
type: string
description: Specifies that the response in the body is encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
Trace-Id:
description: The Trace-Id header reports the request's trace ID, if one was generated.
schema:
type: string
description: Specifies the request's trace ID.
content:
application/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
text/csv:
schema:
$ref: '#/components/schemas/InfluxQLCSVResponse'
application/json:
schema:
$ref: '#/components/schemas/InfluxQLResponse'
examples:
influxql-chunk_size_2:
value: |
{"results":[{"statement_id":0,"series":[{"name":"mymeas","columns":["time","myfield","mytag"],"values":[["2016-05-19T18:37:55Z",90,"1"],["2016-05-19T18:37:56Z",90,"1"]],"partial":true}],"partial":true}]}
{"results":[{"statement_id":0,"series":[{"name":"mymeas","columns":["time","myfield","mytag"],"values":[["2016-05-19T18:37:57Z",90,"1"],["2016-05-19T18:37:58Z",90,"1"]]}]}]}
Comment on lines +288 to +290
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For strict validation, this might need to be an object instead of string.

application/x-msgpack:
schema:
type: string
format: binary
'429':
description: Token is temporarily over quota. The Retry-After header describes when to try the read again.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Error processing query
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
operationId: PostQueryV1
tags:
Expand All @@ -148,6 +317,83 @@ paths:
text/plain:
schema:
type: string
application/json:
schema:
type: object
properties:
db:
type: string
description: |
The database name for InfluxQL queries.

Required parameter that specifies the database to query.
In InfluxDB Cloud Dedicated, this can be either:
- A simple database name (for example, `mydb`)
- The database portion of a `database_name/retention_policy_name` naming convention (used together with the `rp` parameter)

When used alone, `db` specifies the complete database name to query. When used with the `rp` parameter, they combine to form the full database name as `db/rp`--for example, if `db=mydb` and `rp=autogen`, the query targets the database named `mydb/autogen`.

Unlike InfluxDB Cloud Serverless, Cloud Dedicated does not use DBRP mappings. The database name directly corresponds to an existing database in your Cloud Dedicated cluster.

Examples:
- `db=mydb` - queries the database named `mydb`
- `db=mydb` with `rp=autogen` - queries the database named `mydb/autogen`

_Note: The specified database must exist in your Cloud Dedicated cluster. Queries will fail if the database does not exist._

### Related

- [InfluxQL DBRP naming convention](/influxdb3/cloud-dedicated/admin/databases/create/#influxql-dbrp-naming-convention)
- [Migrate data from InfluxDB 1.x to Cloud Dedicated](/influxdb3/cloud-dedicated/guides/migrate-data/migrate-1x-to-cloud-dedicated/)
- [InfluxQL data retention policy mapping differences between InfluxDB Cloud Dedicated and Cloud Serverless](/influxdb3/cloud-serverless/guides/prototype-evaluation/#influxql-data-retention-policy-mapping-differences)
rp:
description: |
The retention policy name for InfluxQL compatibility

Optional parameter that, when combined with the db parameter, forms the complete database name to query. In InfluxDB Cloud Dedicated, databases can be named using the
database_name/retention_policy_name convention for InfluxQL compatibility.

When a request specifies both `db` and `rp`, Cloud Dedicated combines them as `db/rp` to target the database--for example:

- If `db=mydb` and `rp=autogen`, the query targets the database named `mydb/autogen`
- If only `db=mydb` is provided (no `rp`), the query targets the database named `mydb`

Unlike InfluxDB v1 and Cloud Serverless, Cloud Dedicated does not use DBRP mappings or separate retention policy objects. This parameter exists solely for v1 API
compatibility and database naming conventions.

_Note: The retention policy name does not control data retention in Cloud Dedicated. Data retention is determined by the database's **retention period** setting._

### Related

- [InfluxQL DBRP naming convention](/influxdb3/cloud-dedicated/admin/databases/create/#influxql-dbrp-naming-convention)
- [Migrate data from InfluxDB 1.x to Cloud Dedicated](/influxdb3/cloud-dedicated/guides/migrate-data/migrate-1x-to-cloud-dedicated/)
- [InfluxQL data retention policy mapping differences](/influxdb3/cloud-serverless/guides/prototype-evaluation/#influxql-data-retention-policy-mapping-differences)
type: string
q:
description: Defines the InfluxQL query to run.
type: string
chunked:
description: |
If true, the response is divided into chunks of size `chunk_size`.
type: boolean
chunk_size:
description: |
The number of records that will go into a chunk.
This parameter is only used if `chunked=true`.
type: integer
default: 10000
epoch:
description: |
A unix timestamp precision.
type: string
enum:
- h
- m
- s
- ms
- u
- µ
- ns
parameters:
- $ref: '#/components/parameters/TraceSpan'
- $ref: '#/components/parameters/AuthUserV1'
Expand Down Expand Up @@ -184,7 +430,7 @@ paths:
schema:
type: string
required: true
description: Bucket to query.
description: Database to query.
- in: query
name: rp
schema:
Expand Down
Loading