You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sy...@apache.org on 2022/09/15 06:15:14 UTC
[apisix] branch master updated: docs: add apisix-variable Chinese doc & update directory (#7871)
This is an automated email from the ASF dual-hosted git repository.
sylviasu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 67cb1a89e docs: add apisix-variable Chinese doc & update directory (#7871)
67cb1a89e is described below
commit 67cb1a89ecee4cc5def0c062fc7c1970041e18a5
Author: Fei Han <97...@users.noreply.github.com>
AuthorDate: Thu Sep 15 14:15:06 2022 +0800
docs: add apisix-variable Chinese doc & update directory (#7871)
* docs: add apisix-variable Chinese doc and update directory
docs: fix typo
---
docs/en/latest/apisix-variable.md | 43 +++++++++-------
docs/en/latest/config.json | 50 +++++++++---------
docs/zh/latest/apisix-variable.md | 51 ++++++++++++++++++
docs/zh/latest/config.json | 60 ++++++++++++----------
.../latest/{architecture-design => }/debug-mode.md | 0
.../plugin-config.md | 0
6 files changed, 133 insertions(+), 71 deletions(-)
diff --git a/docs/en/latest/apisix-variable.md b/docs/en/latest/apisix-variable.md
index 3da45f213..9c0f01b5e 100644
--- a/docs/en/latest/apisix-variable.md
+++ b/docs/en/latest/apisix-variable.md
@@ -1,5 +1,10 @@
---
title: APISIX variable
+keywords:
+ - Apache APISIX
+ - API Gateway
+ - APISIX variable
+description: This article describes the variables supported by Apache APISIX.
---
<!--
@@ -21,25 +26,27 @@ title: APISIX variable
#
-->
-Besides [Nginx variable](http://nginx.org/en/docs/varindex.html), APISIX also provides
+## Description
+
+Besides [NGINX variable](http://nginx.org/en/docs/varindex.html), APISIX also provides
additional variables.
-List in alphabetical order:
+## List of variables
-| Variable Name | Origin | Description | Example |
-|------------------|---------|--------------------| --------- |
-| balancer_ip | core | the IP of picked upstream server | 1.1.1.1 |
-| balancer_port | core | the port of picked upstream server | 80 |
-| consumer_name | core | username of `consumer` | |
-| graphql_name | core | the [operation name](https://graphql.org/learn/queries/#operation-name) of GraphQL | HeroComparison |
-| graphql_operation | core | the operation type of GraphQL | mutation |
-| graphql_root_fields | core | the top level fields of GraphQL | ["hero"] |
-| mqtt_client_id | mqtt-proxy | the client id in MQTT protocol | |
-| route_id | core | id of `route` | |
-| route_name | core | name of `route` | |
-| service_id | core | id of `service` | |
-| service_name | core | name of `service` | |
-| redis_cmd_line | Redis | the content of Redis command | |
-| rpc_time | xRPC | time spent at the rpc request level | |
+| Variable Name | Origin | Description | Example |
+|-------------------- | ---------- | ----------------------------------------------------------------------------------- | ------------- |
+| balancer_ip | core | The IP of picked upstream server. | 192.168.1.2 |
+| balancer_port | core | The port of picked upstream server. | 80 |
+| consumer_name | core | Username of Consumer. | |
+| graphql_name | core | The [operation name](https://graphql.org/learn/queries/#operation-name) of GraphQL. | HeroComparison |
+| graphql_operation | core | The operation type of GraphQL. | mutation |
+| graphql_root_fields | core | The top level fields of GraphQL. | ["hero"] |
+| mqtt_client_id | mqtt-proxy | The client id in MQTT protocol. | |
+| route_id | core | Id of Route. | |
+| route_name | core | Name of Route. | |
+| service_id | core | Id of Service. | |
+| service_name | core | Name of Service. | |
+| redis_cmd_line | Redis | The content of Redis command. | |
+| rpc_time | xRPC | Time spent at the rpc request level. | |
-You can also [register your own variable](./plugin-develop.md#register-custom-variable).
+You can also register your own [variable](./plugin-develop.md#register-custom-variable).
diff --git a/docs/en/latest/config.json b/docs/en/latest/config.json
index 3214b61fc..73a13c23f 100644
--- a/docs/en/latest/config.json
+++ b/docs/en/latest/config.json
@@ -201,6 +201,31 @@
"type": "doc",
"id": "building-apisix"
},
+ {
+ "type": "doc",
+ "id": "external-plugin"
+ },
+ {
+ "type": "doc",
+ "id": "wasm"
+ },
+ {
+ "type": "link",
+ "label": "CODE_STYLE",
+ "href": "https://github.com/apache/apisix/blob/master/CODE_STYLE.md"
+ },
+ {
+ "type": "category",
+ "label": "internal",
+ "items": [
+ "internal/plugin-runner",
+ "internal/testing-framework"
+ ]
+ },
+ {
+ "type": "doc",
+ "id": "plugin-develop"
+ },
{
"type": "doc",
"id": "debug-mode"
@@ -288,27 +313,10 @@
"type": "doc",
"id": "install-dependencies"
},
- {
- "type": "doc",
- "id": "plugin-develop"
- },
{
"type": "doc",
"id": "apisix-variable"
},
- {
- "type": "doc",
- "id": "external-plugin"
- },
- {
- "type": "doc",
- "id": "wasm"
- },
- {
- "type": "link",
- "label": "CODE_STYLE",
- "href": "https://github.com/apache/apisix/blob/master/CODE_STYLE.md"
- },
{
"type": "doc",
"id": "aws"
@@ -321,14 +329,6 @@
"type": "doc",
"id": "debug-function"
},
- {
- "type": "category",
- "label": "internal",
- "items": [
- "internal/plugin-runner",
- "internal/testing-framework"
- ]
- },
{
"type": "doc",
"id": "profile"
diff --git a/docs/zh/latest/apisix-variable.md b/docs/zh/latest/apisix-variable.md
new file mode 100644
index 000000000..194d0d567
--- /dev/null
+++ b/docs/zh/latest/apisix-variable.md
@@ -0,0 +1,51 @@
+---
+title: APISIX 变量
+keywords:
+ - Apache APISIX
+ - API 网关
+ - APISIX variable
+description: 本文介绍了 Apache APISIX 支持的变量。
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## 描述
+
+APISIX 除了支持 [NGINX 变量](http://nginx.org/en/docs/varindex.html)外,自身也提供了一些变量。
+
+## 变量列表
+
+| 变量名称 | 来源 | 描述 | 示例 |
+|---------------------|----------- |--------------------------------------------------------------------------------- | ---------------- |
+| balancer_ip | core | 上游服务器的 IP 地址。 | 192.168.1.2 |
+| balancer_port | core | 上游服务器的端口。 | 80 |
+| consumer_name | core | 消费者的名称。 | |
+| graphql_name | core | GraphQL 的 [operation name](https://graphql.org/learn/queries/#operation-name)。 | HeroComparison |
+| graphql_operation | core | GraphQL 的操作类型。 | mutation |
+| graphql_root_fields | core | GraphQL 最高级别的字段。 | ["hero"] |
+| mqtt_client_id | mqtt-proxy | MQTT 协议中的客户端 ID。 | |
+| route_id | core | APISIX 路由的 ID。 | |
+| route_name | core | APISIX 路由的名称。 | |
+| service_id | core | APISIX 服务的 ID。 | |
+| service_name | core | APISIX 服务的名称。 | |
+| redis_cmd_line | Redis | Redis 命令的内容。 | |
+| rpc_time | xRPC | 在 RPC 请求级别所花费的时间。 | |
+
+当然,除上述变量外,你也可以创建自定义[变量](./plugin-develop.md#register-custom-variable)。
diff --git a/docs/zh/latest/config.json b/docs/zh/latest/config.json
index 743e647e8..778da9f65 100644
--- a/docs/zh/latest/config.json
+++ b/docs/zh/latest/config.json
@@ -2,13 +2,16 @@
"version": "2.15.0",
"sidebar": [
{
- "type": "category",
- "label": "Architecture Design",
- "items": [
- "architecture-design/apisix",
- "architecture-design/plugin-config",
- "architecture-design/debug-mode"
- ]
+ "type": "doc",
+ "id": "getting-started"
+ },
+ {
+ "type": "doc",
+ "id": "installation-guide"
+ },
+ {
+ "type": "doc",
+ "id": "architecture-design/apisix"
},
{
"type": "category",
@@ -18,6 +21,7 @@
"terminology/consumer",
"terminology/global-rule",
"terminology/plugin",
+ "terminology/plugin-config",
"terminology/route",
"terminology/router",
"terminology/script",
@@ -25,14 +29,6 @@
"terminology/upstream"
]
},
- {
- "type": "doc",
- "id": "getting-started"
- },
- {
- "type": "doc",
- "id": "installation-guide"
- },
{
"type": "category",
"label": "Plugins",
@@ -174,7 +170,7 @@
},
{
"type": "category",
- "label": "其它",
+ "label": "Other protocols",
"items": [
"plugins/dubbo-proxy",
"plugins/mqtt-proxy"
@@ -203,6 +199,22 @@
{
"type": "doc",
"id": "building-apisix"
+ },
+ {
+ "type": "doc",
+ "id": "external-plugin"
+ },
+ {
+ "type": "doc",
+ "id": "CODE_STYLE"
+ },
+ {
+ "type": "doc",
+ "id": "plugin-develop"
+ },
+ {
+ "type": "doc",
+ "id": "debug-mode"
}
]
},
@@ -226,10 +238,6 @@
"discovery/kubernetes"
]
},
- {
- "type": "doc",
- "id": "external-plugin"
- },
{
"type": "doc",
"id": "health-check"
@@ -260,23 +268,19 @@
},
{
"type": "doc",
- "id": "batch-processor"
- },
- {
- "type": "doc",
- "id": "benchmark"
+ "id": "apisix-variable"
},
{
"type": "doc",
- "id": "install-dependencies"
+ "id": "batch-processor"
},
{
"type": "doc",
- "id": "plugin-develop"
+ "id": "benchmark"
},
{
"type": "doc",
- "id": "CODE_STYLE"
+ "id": "install-dependencies"
},
{
"type": "doc",
diff --git a/docs/zh/latest/architecture-design/debug-mode.md b/docs/zh/latest/debug-mode.md
similarity index 100%
rename from docs/zh/latest/architecture-design/debug-mode.md
rename to docs/zh/latest/debug-mode.md
diff --git a/docs/zh/latest/architecture-design/plugin-config.md b/docs/zh/latest/terminology/plugin-config.md
similarity index 100%
rename from docs/zh/latest/architecture-design/plugin-config.md
rename to docs/zh/latest/terminology/plugin-config.md