网关插件管理

功能概述

此功能主要提供对网关插件维护功能

操作说明

  1. 系统管理员进入控制台页面,打开【系统设置】-【网关插件管理】功能
  2. 列表中名称可以对已有插件进行编辑修改
  3. 点击【添加插件】可添加新的插件
  4. 添加完成后,在租户的应用服务管理中即可使用该插件

补充说明

下面以日志插件为例,对其参数定义格式如下

{
    "type": "object",
    "properties": {
        "url_to_post": {
            "default": "http://entry.newdao-tenant-xxxx/logging/fangwenrz/jieshousj",
            "title": "日志接收服务地址",
            "type": "string"
        },
        "allowed_method": {
            "default": "GET,POST,PUT,DELETE",
            "title": "允许的请求方法",
            "type": "string"
        },
        "cares": {
            "title": "用户特别关心的接口设置",
            "type": "array",
            "default": [],
            "widget": "cardList",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "title": "配置名称",
                        "type": "string"
                    },
                    "value": {
                        "title": "配置内容",
                        "type": "object",
                        "properties": {
                            "allowed_method": {
                                "default": "GET,POST,PUT,DELETE",
                                "title": "允许的请求方法",
                                "type": "string"
                            },
                            "log_type": {
                                "title": "日志类型",
                                "type": "string"
                            },
                            "api_uri": {
                                "title": "API访问路径",
                                "type": "string"
                            },
                            "sample_ratio": {
                                "title": "日志接收概率(大于0,小于等于1)",
                                "type": "number"
                            },
                            "label": {
                                "title": "标签",
                                "type": "string"
                            },
                            "expire_seconds": {
                                "title": "超时模式的超时时间(秒)",
                                "type": "number"
                            },
                            "use_sample_type": {
                                "default": true,
                                "title": "使用概率模式",
                                "type": "boolean"
                            }
                        }
                    }
                }
            }
        },
        "log_group": {
            "default": "default",
            "title": "log_group",
            "type": "string"
        },
        "black_list": {
            "default": "",
            "title": "忽略的请求",
            "type": "string"
        },
        "max_resp_body_size": {
            "default": 10240,
            "title": "最大返回体大小",
            "type": "number"
        },
        "include_query": {
            "default": [
                "^/wf/"
            ],
            "title": "需要包含请求查询的地址(用逗号分隔)的数组",
            "type": "string"
        },
        "max_req_body_size": {
            "default": 10240,
            "title": "最大请求体大小",
            "type": "number"
        },
        "ignore_with_query": {
            "default": "",
            "title": "忽略带指定参数的请求",
            "type": "string"
        },
        "record_resp_body": {
            "default": false,
            "title": "是否记录返回体",
            "type": "boolean"
        },
        "log_type": {
            "default": "default",
            "title": "log_type",
            "type": "string"
        },
        "ignore_ext": {
            "default": [
                "/pcapp/",
                "%.js$",
                "%.htm.?$",
                "%.png$",
                "%.jp.?g$",
                "%.svg$",
                "%.css$",
                "%.ico$",
                "%.json$",
                "%.w$"
            ],
            "title": "忽略的文件类型",
            "type": "string"
        },
        "sample_ratio": {
            "default": 0.2,
            "title": "日志接收概率(大于0,小于等于1)",
            "type": "number"
        },
        "record_req_body": {
            "default": false,
            "title": "是否记录请求体",
            "type": "boolean"
        },
        "expire_seconds": {
            "default": 120,
            "title": "超时模式的超时时间(秒)",
            "type": "number"
        },
        "use_sample_type": {
            "default": true,
            "title": "使用概率模式",
            "type": "boolean"
        }
    },
    "labelWidth": 180
}

在应用配置日志网关插件时,日志插件参数配置内容如图所示

results matching ""

    No results matching ""