Skip to content

Commit

Permalink
DOCU-2470: Updates the rate limiting section of the get-started guide
Browse files Browse the repository at this point in the history
  • Loading branch information
rspurgeon committed Aug 25, 2022
1 parent d88ef99 commit 20de778
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions src/gateway/get-started/rate-limiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ will be subject to rate limit enforcement.
1. **Enable rate limiting**

The rate limiting plugin is installed by default on {{site.base_gateway}}, and can be enabled
by sending a `POST` request to the [plugins](/gateway/latest/admin-api/#add-plugin) object of the Admin API:
by sending a `POST` request to the [plugins](/gateway/latest/admin-api/#add-plugin) object on the Admin API:

```sh
curl -i -X POST http://localhost:8001/plugins \
Expand Down Expand Up @@ -108,31 +108,27 @@ and refresh the page 6 times within 1 minute.

### Service level rate limiting

Rate limiting can be imposed on specific services by enabling the plugin on the
service URL.
The Rate Limiting plugin can be enabled for specific services. The request is the same as above,
but posted to the service URL:

1. **Enable rate limiting**

```sh
curl -X POST http://localhost:8001/services/example_service/plugins \
--data "name=rate-limiting" \
--data config.minute=5 \
--data config.policy=local
```
```sh
curl -X POST http://localhost:8001/services/example_service/plugins \
--data "name=rate-limiting" \
--data config.minute=5 \
--data config.policy=local
```

### Route level rate limiting

Rate limiting can be imposed on routes by enabling the plugin on the
route URL.
The Rate Limiting plugin can be enabled for specific routes. The request is the same as above,
but posted to the route URL:

1. **Enable rate limiting**

```sh
curl -X POST http://localhost:8001/routes/mock/plugins \
--data "name=rate-limiting" \
--data config.minute=5 \
--data config.policy=local
```
```sh
curl -X POST http://localhost:8001/routes/mock/plugins \
--data "name=rate-limiting" \
--data config.minute=5 \
--data config.policy=local
```

### Consumer level rate limiting

Expand All @@ -148,9 +144,9 @@ that defines a user of a service. Consumer-level rate limiting can be used to li
--data username=jsmith
```

1. **Enable rate limiting**
1. **Enable rate limiting for the consumer**

Using the `jsmith` consumer id, enable rate limiting for all routes and services for
Using the consumer id, enable rate limiting for all routes and services for
the `jsmith` consumer.

```sh
Expand Down

0 comments on commit 20de778

Please sign in to comment.