zhukexingkong opened a new issue #6397:
URL: https://github.com/apache/apisix/issues/6397


   ### Issue description
   
   My API bindings limit-count, I want get the count of redis key, the redis 
key  consists of "plugin-limit-countroute" and "modifiedIndex" and $server_addr.
   
   if I use "curl http://127.0.0.1:9080/apisix/admin/routes/10338 -H 
'X-API-KEY: admin' -i", can't get "modifiedIndex":
   {
        "count": 1,
        "node": {
                "value": {
                        "create_time": 1645082682,
                        "status": 1,
                        "name": "10338",
                        "uri": "\/resource\/mng\/group",
                        "id": "10338",
                        "plugins": {
                                "limit-count": {
                                        "rejected_code": 503,
                                        "redis_database": 0,
                                        "key_type": "var",
                                        "policy": "redis",
                                        "time_window": 86400,
                                        "redis_host": "175.27.157.12",
                                        "count": 2,
                                        "key": "$server_addr",
                                        "redis_password": "Cv!#cloud2021",
                                        "redis_port": 36379,
                                        "disable": false,
                                        "redis_timeout": 1000
                                },
                                "limit-req": {
                                        "rejected_code": 503,
                                        "burst": 0,
                                        "key": "$server_addr",
                                        "rate": 1,
                                        "allow_degradation": false,
                                        "key_type": "var",
                                        "nodelay": false
                                }
                        },
                        "upstream": {
                                "scheme": "http",
                                "pass_host": "pass",
                                "discovery_args": {
                                        "namespace_id": "test",
                                        "group_name": "test_group"
                                },
                                "timeout": {
                                        "connect": 6,
                                        "send": 6,
                                        "read": 6
                                },
                                "service_name": "resource-service",
                                "type": "roundrobin",
                                "keepalive_pool": {
                                        "idle_timeout": 60,
                                        "requests": 1000,
                                        "size": 320
                                },
                                "discovery_type": "nacos"
                        },
                        "update_time": 1645430458
                },
                "key": "\/apisix\/routes\/10338"
        },
        "action": "get"
   }
   
   if I use "curl http://localhost:9080/apisix/admin/routes?api_key=admin -i", 
infomation is too much:
   {
        "count": 3,
        "node": {
                "dir": true,
                "nodes": [{
                        "value": {
                                "create_time": 1644949847,
                                "name": "10327",
                                "id": "10327",
                                "plugins": {
                                        "limit-req": {
                                                "key": "server_addr",
                                                "burst": 0,
                                                "nodelay": false,
                                                "rate": 1,
                                                "allow_degradation": false,
                                                "key_type": "var",
                                                "rejected_code": 503
                                        },
                                        "limit-count": {
                                                "rejected_code": 503,
                                                "show_limit_quota_header": true,
                                                "redis_database": 0,
                                                "allow_degradation": false,
                                                "key_type": "var",
                                                "policy": "redis",
                                                "redis_host": "175.27.157.12",
                                                "count": 2,
                                                "time_window": 86400,
                                                "redis_password": 
"Cv!#cloud2021",
                                                "key": "server_addr",
                                                "redis_port": 36379,
                                                "redis_timeout": 1000
                                        },
                                        "ext-plugin-pre-req": {
                                                "conf": [{
                                                        "name": 
"BlackWhiteCheckPlugin",
                                                        "value": 
"{\"rejected_code\":\"401\"}"
                                                }]
                                        }
                                },
                                "update_time": 1645410962,
                                "status": 0,
                                "uri": "\/1\/1\/1",
                                "upstream": {
                                        "scheme": "http",
                                        "pass_host": "pass",
                                        "service_name": "ww",
                                        "timeout": {
                                                "read": 6,
                                                "send": 6,
                                                "connect": 6
                                        },
                                        "discovery_type": "nacos",
                                        "type": "roundrobin",
                                        "discovery_args": {
                                                "group_name": "xuwen",
                                                "namespace_id": "ww"
                                        },
                                        "hash_on": "vars"
                                },
                                "priority": 0
                        },
                        "modifiedIndex": 11481,
                        "createdIndex": 3612,
                        "key": "\/apisix\/routes\/10327"
                }, {
                        "value": {
                                "create_time": 1645082682,
                                "name": "10338",
                                "id": "10338",
                                "plugins": {
                                        "limit-count": {
                                                "rejected_code": 503,
                                                "show_limit_quota_header": true,
                                                "count": 2,
                                                "allow_degradation": false,
                                                "key_type": "var",
                                                "policy": "redis",
                                                "redis_host": "175.27.157.12",
                                                "key": "server_addr",
                                                "time_window": 86400,
                                                "redis_password": 
"Cv!#cloud2021",
                                                "redis_database": 0,
                                                "redis_port": 36379,
                                                "redis_timeout": 1000
                                        },
                                        "limit-req": {
                                                "burst": 0,
                                                "rejected_code": 503,
                                                "key": "server_addr",
                                                "rate": 1,
                                                "allow_degradation": false,
                                                "key_type": "var",
                                                "nodelay": false
                                        }
                                },
                                "update_time": 1645428888,
                                "status": 1,
                                "uri": "\/resource\/mng\/group",
                                "priority": 0,
                                "upstream": {
                                        "discovery_type": "nacos",
                                        "discovery_args": {
                                                "namespace_id": "test",
                                                "group_name": "test_group"
                                        },
                                        "service_name": "resource-service",
                                        "timeout": {
                                                "read": 6,
                                                "send": 6,
                                                "connect": 6
                                        },
                                        "scheme": "http",
                                        "pass_host": "pass",
                                        "type": "roundrobin",
                                        "hash_on": "vars"
                                }
                        },
                        "modifiedIndex": 11702,
                        "createdIndex": 5868,
                        "key": "\/apisix\/routes\/10338"
                }, 
           ...
           ],
                "key": "\/apisix\/routes"
        },
        "action": "get"
   }
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.12.1
   - OS (cmd: `uname -a`): Centos7
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to