Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add plugin README.md and one plugin docs example #33

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
[//]: # (TODO)
# Docs
# Hango 文档

## 插件

* [插件界面配置引导](plugin/plugin-configuring-guide.md)

* [percent-limit](plugin/percent-limit.md)

## 问题定位

* [问题定位引导](troubleshooting/troubleshooting.md)

8 changes: 5 additions & 3 deletions docs/curl commands/Update Gateway.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#Update Gateway By CURL Commands
# Update Gateway By CURL Commands

### Update API-Plane and Envoy proxy address.
curl -v -H "Content-Type:aplication/json" -d '{
```shell
curl -v -H "Content-Type:application/json" -d '{
"Gwid":1,
"ApiPlaneAddr": "http://api-plane-sm.qa-ci.service.163.org",
"Description": "Hango gateway test.",
Expand All @@ -20,4 +21,5 @@ curl -v -H "Content-Type:aplication/json" -d '{
1,
3
]
}' http://apigw-gportal-envoy.qa-ci.service.163.org/gdashboard?Action=UpdateGateway&Version=2018-08-09
}' http://apigw-gportal-envoy.qa-ci.service.163.org/gdashboard?Action=UpdateGateway&Version=2018-08-09
```
Binary file added docs/plugin/img/plugin_readme_entry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugin/img/plugin_readme_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugin/img/plugin_readme_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugin/img/plugin_readme_route.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/plugin/img/plugin_readme_success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/plugin/percent-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 百分比限流

## 描述

`percent-limit`插件可以对网关流量基于百分比粒度进行限流

## 属性

| 名称 | 类型 | 必选项 | 默认值 | 描述 |
|-------|--------|-----|-----|------------|
| 限流百分比 | number | 是 | - | 允许通过流量的百分比 |


## 前置条件

以下curl命令中存在变量,使用前需要替换为真实环境数据,变量以`{{}}`符号包裹,例如`{{ 网关ID }}`需要根据网关的实际ID进行替换

## 创建

```shell
curl -XPOST -v -H "Content-Type:application/json" -d '{
"BindingObjectId": {{ 路由ID }},
"BindingObjectType": "routeRule",
"GwId": {{ 网关ID }},
"PluginConfiguration": "{\"limit_percent\":\"50\",\"kind\":\"percent-limit\"}",
"PluginType": "percent-limit"
}' http://{{ hango-portal ip:port }}/gdashboard?Action=BindingPlugin&Version=2019-09-01
```

## 测试

```shell
## 通过脚本多次调用以下curl命令,测试网关百分比限流效果
curl -v "http://{{ 网关IP }}/{{ 路由path }}" -H "host:{{ 网关关联域名 }}"
```

## 删除

```shell
curl -v -H "Content-Type:application/json" http://{{ hango-portal ip:port }}/gdashboard?PluginBindingInfoId={{ 插件ID }}&Action=UnbindingPlugin&Version=2019-09-01
```

## 界面配置方法

[插件界面配置方法引导](plugin-configuring-guide.md)
21 changes: 21 additions & 0 deletions docs/plugin/plugin-configuring-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 插件配置方法

1.通过Hango主页左侧Tab栏中的`插件管理`进入插件配置主页

![plugin_entry](img/plugin_readme_entry.png)

2.点击`+`符号添加插件,选择指定的路由为其配置某款插件

![plugin_route.png](img/plugin_readme_route.png)

3.选择路由后界面将展示可配置的插件列表

![plugin_list](img/plugin_readme_list.png)

4.选择需要配置的插件后将展示该插件的具体配置页面(案例为百分比限流插件),正确配置后点击`确认`按钮即可完成插件配置

![plugin_example.png](img/plugin_readme_example.png)

5.完成插件配置后,插件界面将展示插件信息及其相关操作,后续可以通过`操作栏`对该插件进行`更新`或`删除`

![plugin_success.png](img/plugin_readme_success.png)