tzssangglass commented on a change in pull request #5019: URL: https://github.com/apache/apisix/pull/5019#discussion_r705913552
########## File path: docs/zh/latest/control-api.md ########## @@ -0,0 +1,202 @@ +--- +title: Control API +--- + +<!-- +# +# 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. +# +--> + +control API 可以被用来: + +* 暴露 APISIX 内部状态信息 +* 控制单个 APISIX 的数据平面的行为 + +默认情况下,control API 是启用的,监听 `127.0.0.1:9090`。你可以通过修改 `apisix/conf/config.yaml` 中的 control 部分来更改设置,如下: + +```yaml +apisix: + ... + enable_control: true + control: + ip: "127.0.0.1" + port: 9090 +``` + +注意: control API server 不应该被配置成监听公共流量(public traffic)。 + +## 通过插件添加的 control API + +插件被启用时可以添加自己的 control API。如果你对他们感兴趣,请参阅对应插件的文档。 + +## 独立于插件的 control API + +以下是支持的 API: + +### GET /v1/schema + +引入自 2.2 版本 + +使用以下格式返回被该 APISIX 实例使用的 json schema: + +```json +{ + "main": { + "route": { + "properties": {...} + }, + "upstream": { + "properties": {...} + }, + ... + }, + "plugins": { + "example-plugin": { + "consumer_schema": {...}, + "metadata_schema": {...}, + "schema": {...}, + "type": ..., + "priority": 0, + "version": 0.1 + }, + ... + }, + "stream-plugins": { + "mqtt-proxy": { + ... + }, + ... + } +} +``` + +只有启用了的插件才会被包含在返回结果中 `plugins` 部分。(返回结果中的)一些插件可能会缺失如 `consumer_schema` 或者 `type` 字段,这取决于插件的定义 Review comment: ```suggestion 只有启用了的插件才会被包含在返回结果中 `plugins` 部分。(返回结果中的)一些插件可能会缺失如 `consumer_schema` 或者 `type` 字段,这取决于插件的定义。 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
