feat(api-docs): enhance /api/v3/write_lp documentation with advanced features
- Add comprehensive description of native InfluxDB 3 write endpoint capabilities - Document enhanced features: partial writes, asynchronous writes, flexible precision - Add x-codeSamples with curl examples demonstrating parameter usage - Clarify no_sync parameter behavior: faster response times vs durability trade-offs - Update both Core and Enterprise API specifications consistently - Closes #5775pull/6227/head^2
parent
9f22dd25f7
commit
58398e9478
|
@ -422,9 +422,18 @@ paths:
|
|||
summary: Write line protocol
|
||||
description: |
|
||||
Writes line protocol to the specified database.
|
||||
|
||||
This is the native InfluxDB 3 Core write endpoint that provides enhanced control
|
||||
over write behavior with advanced parameters for high-performance and fault-tolerant operations.
|
||||
|
||||
Use this endpoint to send data in [line protocol](/influxdb3/core/reference/syntax/line-protocol/) format to InfluxDB.
|
||||
Use query parameters to specify options for writing data.
|
||||
|
||||
## Features
|
||||
|
||||
- **Partial writes**: Use `accept_partial=true` to allow partial success when some lines in a batch fail
|
||||
- **Asynchronous writes**: Use `no_sync=true` to skip waiting for WAL synchronization, allowing faster response times but sacrificing durability guarantees
|
||||
- **Flexible precision**: Automatic timestamp precision detection with `precision=auto` (default)
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/dbWriteParam'
|
||||
- $ref: '#/components/parameters/accept_partial'
|
||||
|
@ -469,6 +478,38 @@ paths:
|
|||
description: Request entity too large.
|
||||
'422':
|
||||
description: Unprocessable entity.
|
||||
x-codeSamples:
|
||||
- label: cURL - Basic write
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2 1638360000000000000"
|
||||
- label: cURL - Write with millisecond precision
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&precision=ms" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2 1638360000000"
|
||||
- label: cURL - Asynchronous write with partial acceptance
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&accept_partial=true&no_sync=true&precision=auto" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2
|
||||
memory,host=server01 used=4096"
|
||||
- label: cURL - Multiple measurements with tags
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&precision=ns" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01,region=us-west usage=85.2,load=0.75 1638360000000000000
|
||||
memory,host=server01,region=us-west used=4096,free=12288 1638360000000000000
|
||||
disk,host=server01,region=us-west,device=/dev/sda1 used=50.5,free=49.5 1638360000000000000"
|
||||
tags:
|
||||
- Write data
|
||||
/api/v3/query_sql:
|
||||
|
|
|
@ -422,9 +422,18 @@ paths:
|
|||
summary: Write line protocol
|
||||
description: |
|
||||
Writes line protocol to the specified database.
|
||||
|
||||
This is the native InfluxDB 3 Enterprise write endpoint that provides enhanced control
|
||||
over write behavior with advanced parameters for high-performance and fault-tolerant operations.
|
||||
|
||||
Use this endpoint to send data in [line protocol](/influxdb3/enterprise/reference/syntax/line-protocol/) format to InfluxDB.
|
||||
Use query parameters to specify options for writing data.
|
||||
|
||||
## Features
|
||||
|
||||
- **Partial writes**: Use `accept_partial=true` to allow partial success when some lines in a batch fail
|
||||
- **Asynchronous writes**: Use `no_sync=true` to skip waiting for WAL synchronization, allowing faster response times but sacrificing durability guarantees
|
||||
- **Flexible precision**: Automatic timestamp precision detection with `precision=auto` (default)
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/dbWriteParam'
|
||||
- $ref: '#/components/parameters/accept_partial'
|
||||
|
@ -469,6 +478,38 @@ paths:
|
|||
description: Request entity too large.
|
||||
'422':
|
||||
description: Unprocessable entity.
|
||||
x-codeSamples:
|
||||
- label: cURL - Basic write
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2 1638360000000000000"
|
||||
- label: cURL - Write with millisecond precision
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&precision=ms" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2 1638360000000"
|
||||
- label: cURL - Asynchronous write with partial acceptance
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&accept_partial=true&no_sync=true&precision=auto" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01 usage=85.2
|
||||
memory,host=server01 used=4096"
|
||||
- label: cURL - Multiple measurements with tags
|
||||
lang: Shell
|
||||
source: |
|
||||
curl --request POST "http://localhost:8181/api/v3/write_lp?db=sensors&precision=ns" \
|
||||
--header "Authorization: Bearer DATABASE_TOKEN" \
|
||||
--header "Content-Type: text/plain" \
|
||||
--data-raw "cpu,host=server01,region=us-west usage=85.2,load=0.75 1638360000000000000
|
||||
memory,host=server01,region=us-west used=4096,free=12288 1638360000000000000
|
||||
disk,host=server01,region=us-west,device=/dev/sda1 used=50.5,free=49.5 1638360000000000000"
|
||||
tags:
|
||||
- Write data
|
||||
/api/v3/query_sql:
|
||||
|
|
Loading…
Reference in New Issue