vincentwc commented on issue #4226:
URL: https://github.com/apache/apisix/issues/4226#issuecomment-839559711


   > @vincentwc You can leverate the labels feature, see 
http://apisix.apache.org/docs/dashboard/api/api for details.
   
   thinks for your reply, so there're any demo for labels use,  I send http 
request likew this,demo2 is my label-key
   {{ip_addr}}:9080/apisix/admin/routes?label=demo,
    but the response is all routes which include no this lable's route  ,show 
as below:
   `{
       "action": "get",
       "node": {
           "key": "/apisix/routes",
           "dir": true,
           "nodes": [
               {
                   "modifiedIndex": 17329,
                   "key": "/apisix/routes/82",
                   "createdIndex": 16979,
                   "value": {
                       "create_time": 1620785633,
                       "status": 1,
                       "name": "my-user-demo",
                       "upstream": {
                           "type": "roundrobin",
                           "pass_host": "pass",
                           "nodes": [
                               {
                                   "host": "10.255.249.3",
                                   "weight": 1,
                                   "priority": 0,
                                   "port": 8082
                               }
                           ],
                           "timeout": {
                               "read": 5,
                               "connect": 5,
                               "send": 5
                           },
                           "hash_on": "vars",
                           "scheme": "http"
                       },
                       "priority": 0,
                       "uris": [
                           "/user/hello"
                       ],
                       "plugins": {
                           "key-auth": {}
                       },
                       "methods": [
                           "GET"
                       ],
                       "id": "82",
                       "labels": {
                           "demo": "user",
                           "API_VERSION": "v1"
                       },
                       "update_time": 1620804633,
                       "desc": "my-user-demo-82"
                   }
               },
               {
                   "modifiedIndex": 17366,
                   "key": "/apisix/routes/85",
                   "createdIndex": 16989,
                   "value": {
                       "id": "85",
                       "status": 1,
                       "name": "my-demo-product",
                       "upstream": {
                           "nodes": [
                               {
                                   "weight": 1,
                                   "host": "10.255.249.3",
                                   "port": 8085
                               }
                           ],
                           "timeout": {
                               "read": 5,
                               "connect": 5,
                               "send": 5
                           },
                           "pass_host": "pass",
                           "type": "roundrobin"
                       },
                       "uris": [
                           "/product/hello"
                       ],
                       "desc": "my-product-demo-85",
                       "labels": {
                           "demo2": "product"
                       },
                       "update_time": 1620806525,
                       "create_time": 1620786071
                   }
               }
           ]
       },
       "count": "3"
   }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to