Skip to content

Commit

Permalink
apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui committed Nov 29, 2024
1 parent c46a989 commit c34378c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/user-guide/protocols/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -479,7 +479,7 @@ The result format is the same as `/sql` interface described in [Post SQL stateme
curl -X POST \
-H 'Authorization: token <username>:<password>' \
-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}}
```

</TabItem>
Expand All @@ -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}}
```

</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/query-data/promql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ http://localhost:4000/v1/sql

### 请求超时设置

GreptimeDB 支持在 HTTP 请求中使用 `X-Greptime-Timeout` 请求头,用于指定当前 SQL 查询的超时时间
GreptimeDB 支持在 HTTP 请求中使用 `X-Greptime-Timeout` 请求头,用于指定数据库服务器中运行的请求超时时间

例如,以下请求为查询设置了 `120s` 的超时时间:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -507,7 +507,7 @@ curl -X GET \
curl -X POST \
-H 'Authorization: token <username>:<password>' \
-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}}
```

</TabItem>
Expand All @@ -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}}
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 完全兼容:

Expand Down

0 comments on commit c34378c

Please sign in to comment.