From c34378c964e7a6f6cc0d015f7cbe5b870d932f86 Mon Sep 17 00:00:00 2001 From: Yiran Date: Fri, 29 Nov 2024 11:56:28 +0800 Subject: [PATCH] apply review suggestions --- docs/user-guide/protocols/http.md | 8 ++++---- docs/user-guide/query-data/promql.md | 2 +- .../current/user-guide/protocols/http.md | 8 ++++---- .../current/user-guide/query-data/promql.md | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/user-guide/protocols/http.md b/docs/user-guide/protocols/http.md index 62c353c4d..a75a7ffce 100644 --- a/docs/user-guide/protocols/http.md +++ b/docs/user-guide/protocols/http.md @@ -44,7 +44,7 @@ InfluxDB uses its own authentication format, see [InfluxDB](./influxdb-line-prot ### Timeout GreptimeDB supports the `X-Greptime-Timeout` header in HTTP requests. -It is used to specify the timeout for the request. +It is used to specify the timeout for the request running in the database server. For example, the following request set `120s` timeout for the request: @@ -139,7 +139,7 @@ curl -X POST \ -H 'X-Greptime-Timeout: {{time precision}}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'sql={{SQL-statement}}' \ -http://{{API-host}}/v1/sql?db={{db-name}} +http://{{API-host}}/v1/sql ``` ### Headers @@ -479,7 +479,7 @@ The result format is the same as `/sql` interface described in [Post SQL stateme curl -X POST \ -H 'Authorization: token :' \ -d '{{Influxdb-line-protocol-data}}' \ - http://{{API-host}}/v1/influxdb/api/v2/write?db={{db-name}}&precision={{time-precision}} + http://{{API-host}}/v1/influxdb/api/v2/write?precision={{time-precision}} ``` @@ -489,7 +489,7 @@ curl -X POST \ ```shell curl -X POST \ -d '{{Influxdb-line-protocol-data}}' \ - http://{{API-host}}/v1/influxdb/api/v1/write?u={{username}}&p={{password}}&db={{db-name}}&precision={{time-precision}} + http://{{API-host}}/v1/influxdb/api/v1/write?u={{username}}&p={{password}}&precision={{time-precision}} ``` diff --git a/docs/user-guide/query-data/promql.md b/docs/user-guide/query-data/promql.md index 35f24347b..5ec41f6ae 100644 --- a/docs/user-guide/query-data/promql.md +++ b/docs/user-guide/query-data/promql.md @@ -40,7 +40,7 @@ curl -X POST \ ``` If authentication is enabled in GreptimeDB, the authentication header is required. Refer to the [authentication documentation](/user-guide/protocols/http.md#authentication) for more details. -The query string parameters for the API are identical to those of the original Prometheus API, with the exception of the additional `db` parameter, which specifies the GreptimeDB database name. +The query string parameters for the API are identical to those of the original [Prometheus API](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries), with the exception of the additional `db` parameter, which specifies the GreptimeDB database name. The output format is compatible with the Prometheus API: diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/http.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/http.md index 0fe70fd3e..5cb7f0ab5 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/http.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/http.md @@ -82,7 +82,7 @@ http://localhost:4000/v1/sql ### 请求超时设置 -GreptimeDB 支持在 HTTP 请求中使用 `X-Greptime-Timeout` 请求头,用于指定当前 SQL 查询的超时时间。 +GreptimeDB 支持在 HTTP 请求中使用 `X-Greptime-Timeout` 请求头,用于指定数据库服务器中运行的请求超时时间。 例如,以下请求为查询设置了 `120s` 的超时时间: @@ -174,7 +174,7 @@ curl -X POST \ -H 'X-Greptime-Timeout: {{time precision}}' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'sql={{SQL-statement}}' \ -http://{{API-host}}/v1/sql?db={{db-name}} +http://{{API-host}}/v1/sql ``` ### Headers @@ -507,7 +507,7 @@ curl -X GET \ curl -X POST \ -H 'Authorization: token :' \ -d '{{Influxdb-line-protocol-data}}' \ - http://{{API-host}}/v1/influxdb/api/v2/write?db={{db-name}}&precision={{time-precision}} + http://{{API-host}}/v1/influxdb/api/v2/write?precision={{time-precision}} ``` @@ -517,7 +517,7 @@ curl -X POST \ ```shell curl -X POST \ -d '{{Influxdb-line-protocol-data}}' \ - http://{{API-host}}/v1/influxdb/api/v1/write?u={{username}}&p={{password}}&db={{db-name}}&precision={{time-precision}} + http://{{API-host}}/v1/influxdb/api/v1/write?u={{username}}&p={{password}}&precision={{time-precision}} ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md index 1f356a91b..1adf2247e 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/promql.md @@ -39,7 +39,7 @@ curl -X POST \ ``` 如果你使用启用了身份验证的 GreptimeDB,则需要 Authorization header,请参阅[鉴权](/user-guide/protocols/http.md#鉴权)。 -该 API 的查询字符串参数与原始 Prometheus API 的查询字符串参数相同,但额外的 `db` 参数除外,该参数指定了 GreptimeDB 数据库名称。 +该 API 的查询字符串参数与原始 [Prometheus API](https://prometheus.io/docs/prometheus/latest/querying/api/#range-queries) 的查询字符串参数相同,但额外的 `db` 参数除外,该参数指定了 GreptimeDB 数据库名称。 输出格式与 Prometheus API 完全兼容: