Open beginnerWJC opened 1 year ago
apisix-dashboard-3.0.0的导入功能,导入后缺少上游和插件部分
导出的路由json文件导入后可以直接使用,之前apisix-dashboard-2.13.0可以直接导出导入,3.0.0版本会缺少上游和插件部分
1.新建一个路由,json结构如下: { "uri": "/security/v2/security/*", "name": "security-local", "methods": [ "GET", "POST", "PUT", "DELETE" ], "plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [ { "name": "DefaultValidator", "value": "" } ] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": [ "OR", [ "status", "==", 400 ], [ "status", "==", 401 ], [ "status", "==", 406 ] ] } }, "upstream": { "nodes": [ { "host": "192.168.2.14", "port": 50003, "weight": 1 } ], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }, "status": 1 } 2.导出该路由,导出的json结构为: { "components": {}, "info": { "title": "RoutesExport", "version": "3.0.0" }, "openapi": "3.0.0", "paths": { "/security/v2/security/{params}": { "delete": { "operationId": "security-localDELETE", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "get": { "operationId": "security-localGET", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "post": { "operationId": "security-localPOST", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "put": { "operationId": "security-localPUT", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } } } } } 3.使用导入功能导入后配置缺失:
{ "uri": "/security/v2/security/*", "name": "security-local", "methods": [ "GET", "POST", "PUT", "DELETE" ], "plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [ { "name": "DefaultValidator", "value": "" } ] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": [ "OR", [ "status", "==", 400 ], [ "status", "==", 401 ], [ "status", "==", 406 ] ] } }, "upstream": { "nodes": [ { "host": "192.168.2.14", "port": 50003, "weight": 1 } ], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }, "status": 1 }
{ "components": {}, "info": { "title": "RoutesExport", "version": "3.0.0" }, "openapi": "3.0.0", "paths": { "/security/v2/security/{params}": { "delete": { "operationId": "security-localDELETE", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "get": { "operationId": "security-localGET", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "post": { "operationId": "security-localPOST", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "put": { "operationId": "security-localPUT", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } } } } }
No response
apisix version
uname -a
nginx -V
openresty -V
etcd --version
when can solve this problem
Issue description
apisix-dashboard-3.0.0的导入功能,导入后缺少上游和插件部分
Expected behavior
导出的路由json文件导入后可以直接使用,之前apisix-dashboard-2.13.0可以直接导出导入,3.0.0版本会缺少上游和插件部分
How to Reproduce
1.新建一个路由,json结构如下:
{ "uri": "/security/v2/security/*", "name": "security-local", "methods": [ "GET", "POST", "PUT", "DELETE" ], "plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [ { "name": "DefaultValidator", "value": "" } ] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": [ "OR", [ "status", "==", 400 ], [ "status", "==", 401 ], [ "status", "==", 406 ] ] } }, "upstream": { "nodes": [ { "host": "192.168.2.14", "port": 50003, "weight": 1 } ], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } }, "status": 1 }
2.导出该路由,导出的json结构为:{ "components": {}, "info": { "title": "RoutesExport", "version": "3.0.0" }, "openapi": "3.0.0", "paths": { "/security/v2/security/{params}": { "delete": { "operationId": "security-localDELETE", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "get": { "operationId": "security-localGET", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "post": { "operationId": "security-localPOST", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } }, "put": { "operationId": "security-localPUT", "parameters": [{ "description": "params in path", "in": "path", "name": "params", "required": true, "schema": { "type": "string" } }], "requestBody": {}, "responses": { "default": { "description": "" } }, "security": [], "x-apisix-enable_websocket": false, "x-apisix-id": "456091058716017577", "x-apisix-plugins": { "ext-plugin-pre-req": { "_meta": { "disable": false }, "conf": [{ "name": "DefaultValidator", "value": "" }] }, "response-rewrite": { "_meta": { "disable": false }, "status_code": 200, "vars": ["OR", ["status", "==", 400], ["status", "==", 401], ["status", "==", 406] ] } }, "x-apisix-priority": 0, "x-apisix-status": 1, "x-apisix-upstream": { "nodes": [{ "host": "192.168.2.14", "port": 50003, "weight": 1 }], "timeout": { "connect": 6, "send": 6, "read": 6 }, "type": "roundrobin", "scheme": "http", "pass_host": "pass", "keepalive_pool": { "idle_timeout": 60, "requests": 1000, "size": 320 } } } } } }
3.使用导入功能导入后配置缺失:Screenshots
No response
Environment
apisix version
):3.2.0uname -a
):nginx -V
oropenresty -V
):etcd --version
):3.4.0Additional context
No response