diff --git a/api-docs/cloud-serverless/ref.yml b/api-docs/cloud-serverless/ref.yml index e5e139d6b..bc8f18499 100644 --- a/api-docs/cloud-serverless/ref.yml +++ b/api-docs/cloud-serverless/ref.yml @@ -13839,18 +13839,16 @@ paths: Use this endpoint to send data in [line protocol](/influxdb/cloud-serverless/reference/syntax/line-protocol/) format to InfluxDB. - InfluxDB does the following when you send a write request: + InfluxDB Cloud Serverless does the following when you send a write request: - 1. Validates the request. - 2. If successful, attempts to [ingest data](/influxdb/cloud-serverless/reference/internals/durability/#data-ingest) from the request body; otherwise, responds with an [error status](/influxdb/cloud-serverless/write-data/troubleshoot/#review-http-status-codes). - 3. Ingests or rejects the entire batch and returns one of the following HTTP status codes: + 1. Validates the request. + 2. If successful, attempts to [ingest the data](/influxdb/cloud-serverless/reference/internals/durability/#data-ingest); [error](/influxdb/cloud-serverless/write-data/troubleshoot/#review-http-status-codes) otherwise. + 3. If some or all points in the batch are written, responds with an HTTP `204 "No Content"` status code, acknowledging that data is written and queryable; error otherwise. - - `204 No Content`: all data is ingested - - `400 Bad Request`: all data is rejected + - `204 "No Content"`: Data in the batch is written and queryable. + - `400 "Bad Request"`: The entire batch is rejected. - The response body contains error details about [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. - - Writes are synchronous--the response status indicates the final status of the write and all ingested data is queryable. + If some points in the batch are rejected, the response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points). To ensure that InfluxDB handles writes in the order you request them, wait for the response before you send the next request. @@ -13864,13 +13862,14 @@ paths: #### Rate limits - `write` rate limits apply. + _Write_ rate limits apply. For more information, see [limits and adjustable quotas](/influxdb/cloud-serverless/admin/billing/limits/). #### Related guides + - [Get started writing data](/influxdb/cloud-serverless/get-started/write/) - [Write data with the InfluxDB API](/influxdb/cloud-serverless/get-started/write/) - - [Optimize writes to InfluxDB](/influxdb/cloud-serverless/write-data/best-practices/optimize-writes/) + - [Best practices for writing data](/influxdb/cloud-serverless/write-data/best-practices/) - [Troubleshoot issues writing data](/influxdb/cloud-serverless/write-data/troubleshoot/) operationId: PostWrite parameters: @@ -13993,23 +13992,45 @@ paths: responses: '204': description: | - Success. Data is written and queryable. - '400': + Success. + Data in the batch is written and queryable. + + If some points in the batch are rejected, the response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. content: application/json: examples: - measurementSchemaFieldTypeConflict: - summary: field type conflict thrown by an explicit bucket schema + partialWriteErrorWithRejectedPoints: + summary: Partial write rejects points with syntax errors value: code: invalid - message: 'failed to parse line protocol: error writing line 2: Unable to insert iox::column_type::field::integer type into column temp with type iox::column_type::field::string' + line: 2 + message: "failed to parse line protocol: + errors encountered on line(s): + error message for first rejected point + error message for second rejected point + error message for Nth rejected point (up to 100 rejected points)" + schema: + $ref: "#/components/schemas/LineProtocolError" + '400': + description: | + All data in the batch was rejected and not written. + + The response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points). + content: + application/json: + examples: + rejectedAllPoints: + summary: Rejected all points + value: + code: invalid + line: 2 + message: "failed to parse line protocol: + errors encountered on line(s): + error message for first rejected point + error message for second rejected point + error message for Nth rejected point (up to 100 rejected points)" schema: $ref: '#/components/schemas/LineProtocolError' - description: | - Bad request. The response body contains detail about the error. - - InfluxDB returns this error if the line protocol data in the request is malformed or contains a database schema conflict. - The response body contains the first malformed line in the data, and indicates what was expected. '401': $ref: '#/components/responses/AuthorizationError' '404': @@ -14043,9 +14064,7 @@ paths: The request payload is too large. InfluxDB rejected the batch and did not write any data. - #### InfluxDB Cloud: - - - Returns this error if the payload exceeds the 50MB size limit. + InfluxDB returns this error if the payload exceeds the 50MB size limit. '429': description: | Too many requests. @@ -14254,20 +14273,18 @@ paths: description: | Writes data to a bucket. - Use this endpoint for [InfluxDB v1 parameter compatibility](/influxdb/cloud-serverless/guides/api-compatibility/v1/) when sending data in [line protocol](/influxdb/cloud-serverless/reference/syntax/line-protocol/) format to InfluxDB. + Use this endpoint to send data in [line protocol](/influxdb/cloud-serverless/reference/syntax/line-protocol/) format to InfluxDB. InfluxDB Cloud Serverless does the following when you send a write request: - 1. Validates the request. - 2. If successful, attempts to [ingest data](/influxdb/cloud-serverless/reference/internals/durability/#data-ingest) from the request body; otherwise, responds with an [error status](/influxdb/cloud-serverless/write-data/troubleshoot/#review-http-status-codes). - 3. Ingests or rejects the entire batch and returns one of the following HTTP status codes: + 1. Validates the request. + 2. If successful, attempts to [ingest the data](/influxdb/cloud-serverless/reference/internals/durability/#data-ingest); [error](/influxdb/cloud-serverless/write-data/troubleshoot/#review-http-status-codes) otherwise. + 3. If some or all points in the batch are written, responds with an HTTP `204 "No Content"` status code, acknowledging that data is written and queryable; error otherwise. - - `204 No Content`: all data is ingested - - `400 Bad Request`: all data is rejected + - `204 "No Content"`: Data in the batch is written and queryable. + - `400 "Bad Request"`: The entire batch is rejected. - The response body contains error details about [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. - - Writes are synchronous--the response status indicates the final status of the write and all ingested data is queryable. + If some points in the batch are rejected, the response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points). To ensure that InfluxDB handles writes in the order you request them, wait for the response before you send the next request. @@ -14317,7 +14334,7 @@ paths: name: precision schema: type: string - - description: When present, its value indicates to the database that compression is applied to the line protocol body. + - description: When present, indicates that compression is applied to the line protocol body. in: header name: Content-Encoding schema: @@ -14335,14 +14352,47 @@ paths: description: Line protocol body required: true responses: - '204': - description: Success. Data is ingested and queryable. - '400': + "204": + description: | + Success. + Data in the batch is written and queryable. + + If some points in the batch are rejected, the response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points), up to 100 points. content: application/json: + examples: + partialWriteErrorWithRejectedPoints: + summary: Partial write rejects points with syntax errors + value: + code: invalid + line: 2 + message: "failed to parse line protocol: + errors encountered on line(s): + error message for first rejected point + error message for second rejected point + error message for Nth rejected point (up to 100 rejected points)" + schema: + $ref: "#/components/schemas/LineProtocolError" + '400': + description: | + All data in the batch is rejected and not written. + + The response body contains details about the [rejected points](/influxdb/cloud-serverless/write-data/troubleshoot/#troubleshoot-rejected-points). + content: + application/json: + examples: + rejectsAllPoints: + summary: Rejected all points + value: + code: invalid + line: 2 + message: "failed to parse line protocol: + errors encountered on line(s): + error message for first rejected point + error message for second rejected point + error message for Nth rejected point (up to 100 rejected points)" schema: $ref: '#/components/schemas/LineProtocolError' - description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written. '401': content: application/json: @@ -14385,6 +14435,7 @@ paths: description: Internal server error summary: Write data using the InfluxDB v1 API tags: + - Data I/O endpoints - Write security: - TokenAuthentication: [] @@ -14523,7 +14574,7 @@ tags: |:------------------------ |:--------------------- |:-------------------------------------------| | `Accept` | string | The content type that the client can understand. | | `Authorization` | string | The authorization scheme and credential. | - | `Content-Length` | integer | The size of the entity-body, in bytes, sent to the database. | + | `Content-Length` | integer | The size of the entity-body, in bytes. | | `Content-Type` | string | The format of the data in the request body. | name: Headers x-traitTag: true @@ -14629,8 +14680,9 @@ tags: | Code | Status | Description | |:-----------:|:------------------------ |:--------------------- | | `200` | Success | | - | `204` | No content | The request is successful and no data is returned. For example, The [`/write` and `/api/v2/write` endpoints](#tag/Write) return this status code if all data in the batch is written and queryable. | - | `400` | Bad request | InfluxDB can't parse the request due to an incorrect parameter or bad syntax. For _writes_, the error may indicate one of the following problems: