nic-chen commented on issue #820:
URL: 
https://github.com/apache/apisix-dashboard/issues/820#issuecomment-744114823


   I think the APIs should be consistent with the existing, [refer 
to](https://github.com/apache/apisix/blob/master/doc/architecture-design.md#Global-Rule):
   
   **API: set global rule**
   ```
   PUT /apisix/admin/global_rules/1
   ```
   ```json
   {
           "plugins": {
               "limit-count": {
                   "time_window": 60,
                   "policy": "local",
                   "count": 2,
                   "key": "remote_addr",
                   "rejected_code": 503
               }
           }
       }
   ```
   
   **API: get global rule**
   ```
   GET /apisix/admin/global_rules/1
   ```
   ```json
   {
           "plugins": {
               "limit-count": {
                   "time_window": 60,
                   "policy": "local",
                   "count": 2,
                   "key": "remote_addr",
                   "rejected_code": 503
               }
           }
       }
   ```
   
   **API: get global rule list(new)**
   ```
   GET /apisix/admin/global_rules?page=1&page_size=10
   ```
   ```json
   {
       "code": 0,
       "message": "",
       "data": {
           "rows": [
               {
                   "id": 1,
                   "plugins": {
                       "limit-count": {
                           "time_window": 60,
                           "policy": "local",
                           "count": 2,
                           "key": "remote_addr",
                           "rejected_code": 503
                       }
                   }
               }
           ]
       }
   }
   ```
   
   
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to