apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

bug: when created route by adminAPI, "upstream" can not be modified by dashboard

Open idbeta opened this issue 6 years ago • 9 comments

  • Why do you submit this issue?
  • [ ] Question or discussion
  • [x] Bug
  • [ ] Requirements
  • [ ] Feature or performance improvement
  • [ ] Other __

Bug

  • Which version of Apache APISIX Dashboard, OS, and Browser? APISIX master + dashabord 2.0 rc3
  1. create a route with adminAPI
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
 {
     "name":"test_route",
     "methods":["GET","POST"],
     "uri": "/name",
     "upstream": {
         "type": "roundrobin",
         "nodes": {
             "127.0.0.1:9797": 1
         }
     }
}'

2."upstream"(127.0.0.1:9797) cannot be displayed and modified( or added ) by the dashboard image

idbeta avatar Nov 11 '20 09:11 idbeta

image

May need API to check if the response data is valid.

juzhiyuan avatar Nov 11 '20 09:11 juzhiyuan

The snapshot above is taken from the manager-api

juzhiyuan avatar Nov 11 '20 09:11 juzhiyuan

May need API to check if the response data is valid.

that is a valid format too. if we do not reformat the data in etcd, we need to compatible with this format.

membphis avatar Nov 15 '20 03:11 membphis

I mean could @idbeta please check and paste the response from that page here?

https://github.com/apache/apisix-dashboard/issues/786#issuecomment-725315724 this is valid for the frontend.

juzhiyuan avatar Nov 15 '20 04:11 juzhiyuan

@nic-chen please confirm that is a bug of Manager-API. if yes, we need to update the label

membphis avatar Nov 18 '20 05:11 membphis

I mean could @idbeta please check and paste the response from that page here?

#786 (comment) this is valid for the frontend.

sorry, I am late, I will check this today

idbeta avatar Nov 18 '20 06:11 idbeta

@juzhiyuan there two apis in this case click edit

Request URL: http://127.0.0.1:8080/apisix/admin/routes/1
{"code":0,"message":"","data":{"id":"1","create_time":0,"update_time":0,"uri":"/name","name":"test_route","methods":["GET","POST"],"upstream":{"nodes":{"127.0.0.1:9797":1},"type":"roundrobin","hash_on":"vars","pass_host":"pass"}},"request_id":"dd826fd2-5739-4f56-88a4-7659892a38c8"}

click next to upstream

Request URL: http://127.0.0.1:8080/apisix/admin/upstreams
{"code":0,"message":"","data":{"rows":[],"total_size":0},"request_id":"e0f6114b-68a4-4019-968f-54dc30f5f678"}

idbeta avatar Nov 18 '20 06:11 idbeta

@nic-chen please confirm that is a bug of Manager-API. if yes, we need to update the label

updated

nic-chen avatar Nov 18 '20 06:11 nic-chen

@juzhiyuan there two apis in this case click edit

Request URL: http://127.0.0.1:8080/apisix/admin/routes/1
{"code":0,"message":"","data":{"id":"1","create_time":0,"update_time":0,"uri":"/name","name":"test_route","methods":["GET","POST"],"upstream":{"nodes":{"127.0.0.1:9797":1},"type":"roundrobin","hash_on":"vars","pass_host":"pass"}},"request_id":"dd826fd2-5739-4f56-88a4-7659892a38c8"}

click next to upstream

Request URL: http://127.0.0.1:8080/apisix/admin/upstreams
{"code":0,"message":"","data":{"rows":[],"total_size":0},"request_id":"e0f6114b-68a4-4019-968f-54dc30f5f678"}

Ya, from the first response, we can see nodes's format is in the hash, and the frontend only supports Array.

juzhiyuan avatar Nov 18 '20 09:11 juzhiyuan