Local Model
#
Description- Standalone environment, then use the local
API
to update the apache shenyu gateway data。the yaml config:
shenyu: local: enabled: true sha512Key: 123456
- Common result:
success
Common preFix:
localhost:9095/shenyu
Common Header:
localKey: 123456
#
Plugin#
saveOrUpdatesave or update plugin data
#
Request MethodPOST
#
Path/plugin/saveOrUpdate
#
Request ParametersName | Type | Required | Default | Description |
---|---|---|---|---|
PluginData | PluginData | True | Plugin data object (pass Json object inside Body) |
PluginData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | plugin id | |
name | String | True | plugin name | |
config | String | False | plugin configuration (Json format) | |
role | String | False | plugin role | |
enabled | Boolean | False | whether to turn on |
#
ExamplePOST body
{"id":3,"name":"divide","enabled":"true"}
#
CleanAllClear all data (plugins, selectors, rules)
#
Request MethodGET
#
Path/cleanAll
#
Clean PluginClear plugin data(selector, rule)
#
Request MethodGET
#
Path/cleanPlugin?name = xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
#
Delete pluginRemove plugin data (not included, the selectors and rules data)
#
Request MethodGET
#
Path/plugin/delete?name = xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
#
Delete All PluginRemove all plugin data (not included, the selectors and rules data)
#
Request MethodGET
#
Path/plugin/deleteAll
#
Find plugin by nameFind plugin by name
#
Request MethodGET
#
Path/plugin/findByName?name=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
#
Save or Update SelectorSave or Update Selector
#
Request MethodPOST
#
Path/plugin/selector/saveOrUpdate
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
SelectorData | SelectorData | True | Selector object (pass Json object inside Body) |
SelectorData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | selector id | |
pluginName | String | True | plugin name | |
name | String | False | Selector name (default is plugin:selector+random number if not filled) | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
type | Integer | False | Traffic type(0: full traffic; 1: custom traffic) do not fill in the default generation of full traffic | |
sort | Integer | False | Sort by, not filled by default generate 10 | |
enabled | Boolean | False | Whether to turn on, not fill in the default generation true | |
logged | Boolean | False | Whether or not to print the log, do not fill in the default generated into false | |
handle | String | False | Selector handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | Condition | False | Conditional collection, custom traffic needs to be passed, full traffic does not need to be passed (Json List object) |
Condition#
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
#
ExamplePOST body
{ "pluginName": "divide", "type": 1, "handle": "[{\"upstreamUrl\":\"127.0.0.1:8089\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramName": null, "paramValue": "/**" }]}
#
ResultIs selector id
xxxxx
#
Add Selector And RulesAdd a selector with multiple rules
#
Request MethodPOST
#
Path/plugin/selectorAndRules
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
SelectorRulesData | SelectorRulesData | True | Selector rule object (Body inside pass Json object) |
SelectorRulesData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | True | plugin name | |
selectorName | String | False | Selector name (if not filled in, it is generated by default plugin:selector+random number) | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
selectorHandler | String | False | Selector handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | ConditionData | True | Selector condition collection (Json List object) | |
ruleDataList | RuleLocalData | True | Rule condition collection (Json List object) |
RuleLocalData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
ruleName | String | False | rule name | |
ruleHandler | String | True | Rule handler (different plugins pass different values)) | |
matchMode | Integer | False | Matching pattern (0:and;1:or) | |
conditionList | ConditionData | True | Rule condition collection (Json List object) |
ConditionData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
#
ExamplePOST body
{ "pluginName": "divide", "selectorHandler": "[{\"upstreamUrl\":\"127.0.0.1:8089\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/http/**" }], "ruleDataList": [{ "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/http/test/payment" }] }, { "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/http/order/save" }] }]}
#
Delete SelectorDelete selectors based on selector id and plugin name
#
Request MethodGET
#
Path/plugin/selector/delete?pluginName=xxxx&&id=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | true | plugin name | |
id | String | true | selector id |
#
Find All SelectorGet all selectors by plugin name
#
Request MethodGET
#
Path/plugin/selector/findList?pluginName=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | true | plugin name |
#
Save or Update Rule DataSave or Update Rule Data
#
Request MethodPOST
#
Path/plugin/rule/saveOrUpdate
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
RuleData | RuleData | True | Rule object (pass Json object inside Body) |
RuleData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | rule id | |
pluginName | String | True | plugin name | |
name | String | False | Rule name (default generation if not filled plugin:rule+random number) | |
selectorId | String | True | Selector id | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
sort | Integer | False | Sort by , not filled by default generate 10 | |
enabled | Boolean | False | Whether to turn on, not fill in the default generation true | |
logged | Boolean | False | Whether or not to print the log, do not fill in the default generated into false | |
handle | String | False | Rule handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | ConditionData | False | Conditional collections (Json List objects) |
conditionList#
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
#
ExamplePOST body
{ "pluginName": "divide", "selectorId": 123456, "handle": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/test" }]}
#
ResultIs rule id
xxxxx
#
Delete rule dataDelete rules based on selector id and rule id
#
Request MethodGET
#
Path/plugin/rule/delete?selectorId=xxxx&&id=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
selectorId | String | true | selector ID | |
id | String | true | rule ID |
#
Find Rule data ListGet all rules by selector ID
#
Request MethodGET
#
Path/plugin/rule/findList?selectorId=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
selectorId | String | true | selector id |
#
Meta data#
Save Or UpdateSave Or Update Meta data
#
Request MethodPOST
#
Path/meta/saveOrUpdate
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
MetaData | MetaData | True | Metadata object (pass Json object inside Body) |
MetaData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | ID | |
appName | String | True | app name | |
contextPath | String | True | contextPath | |
path | String | True | path | |
rpcType | String | True | rpc type(dubbo,sofa,tars,springCloud,motan,grpc) | |
serviceName | String | True | service name | |
methodName | String | True | method name | |
parameterTypes | String | True | parameter types | |
rpcExt | String | False | rpc extension parameters (json objects) | |
enabled | Boolean | False | Whether to turn on |
#
DeleteDelete Meta data
#
Request MethodGET
#
Path/meta/delete?rpcType=xxxx&&path=xxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
rpcType | String | true | rpc type(dubbo,sofa,tars,springCloud,motan,grpc) | |
path | String | true | path |
#
App Sign Data#
Save Or UpdateSave Or Update App Sign Data
#
Request MethodPOST
#
Path/auth/saveOrUpdate
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
AppAuthData | AppAuthData | True | Signature object (Json object passed inside the Body) |
AppAuthData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
appKey | String | True | app key | |
appSecret | String | True | app secret | |
enabled | Boolean | False | Whether to turn on | |
open | Boolean | False | is open | |
paramDataList | AuthParamData | false | Parameter set, open is true when you need to pass (Json list object) | |
AuthPathData | AuthPathData | false | Path collection, open is true when you need to pass (Json list object) |
AuthParamData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
appName | String | True | app name | |
appParam | String | True | app param |
AuthPathData#
Name | Type | Required | Default | Description |
---|---|---|---|---|
appName | String | True | app name | |
path | String | True | path | |
enabled | Boolean | False | Whether to turn on |
#
DeleteDelete App Sign Data
#
Request MethodGET
#
Path/auth/delete?appKey=xxxx
#
RequestParamName | Type | Required | Default | Description |
---|---|---|---|---|
appKey | String | true | app key |