iGeeky opened a new issue #1496: URL: https://github.com/apache/incubator-apisix/issues/1496
For PUT operations, the implementation is usually to update the data in the database directly, which is very suitable when operating via Dashboard. However, it can be cumbersome to do it via command line or other programs, which requires 3 steps: 1. query the data. 2. merge the data manually for command line operation or merge it for program for program operation. 3. use the PUT to update the data. For example in the following, if I want to add a new plugin to the plugins, do I have to bring the limit-count parameter at all times? The same is true for upstream.nodes. ```` curl http://127.0.0.1:9080/apisix/admin/services/201 -X PUT -i -d ' { "plugins": { "limit-count": { "count": 2, "time_window": 60, "projected_code": 503, "key": "remote_addr" } }, "upstream": { "type": "roundrobin", "nodes": { "39.97.63.215:80": 1 } } }' ```` Is it possible to make the PUT operation, by adding new parameters, to be able to perform a merge operation, such as ``` curl http://127.0.0.1:9080/apisix/admin/services/201 -X PUT -i -d ' { "merge": true, "plugins": { "key-auth": { "key": "auth-one" } }, "upstream": { "type": "roundrobin", "nodes": { "39.97.63.215:80": 1 } } }' ``` After merging and updating the plugins, there are actually two plugins, namely key-auth and limit-count. Objects can be merged by key, arrays can be merged by value Of course, the level to which you want to merge needs to be discussed. Like the above, is it a level below the plugins, or is it a level deeper? ---------------------------------------------------------------- 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]
