Skip to content

Commit

Permalink
Merge pull request #8449 from ashera96/master
Browse files Browse the repository at this point in the history
Fix throttle policy export/import related doc issues
  • Loading branch information
ashera96 authored Oct 4, 2024
2 parents 2d6d986 + 347b015 commit f1cdcc7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Run the following apictl command to export a rate limiting policy.
- **Command**

```bash
apictl export policy rate-limiting -e <environment name> -n <policy name> -- type <policy type> -- format
apictl export policy rate-limiting -e <environment name> -n <policy name> --type <policy type>
```

!!! Info
**Flags**

`-- type` - Here the type is optional and when the type is not given, the first rate limiting policy found with the name is exported. If the user wants to specify a certain policy, then the type can be used.
`--type` - Here the type is optional and when the type is not given, the first rate limiting policy found with the name is exported. If the user wants to specify a certain policy, then the type can be used.

| Parameter | Description |
|-------------- |------------------------------------------------- |
Expand All @@ -41,12 +41,12 @@ Run the following apictl command to export a rate limiting policy.
| subscription | to export only subscription rate limiting policies |
| application | to export only application rate limiting policies |

`-- format` - File format of exported file(json or yaml) (default "YAML")
`--format` - File format of exported file(json or yaml) (default "YAML")

!!! example

```bash
apictl export policy rate-limiting -n Silver -e prod -- type subscription
apictl export policy rate-limiting -n Silver -e prod --type subscription
```

!!! info "Exported File"
Expand Down Expand Up @@ -92,12 +92,12 @@ Run the following apictl command to import a rate limiting policy.
- **Command**

```bash
apictl import policy rate-limiting -f <file path> -e <environment name> -- update
apictl import policy rate-limiting -f <file path> -e <environment name> --update
```

!!! example
```bash
apictl import policy rate-limiting -f ~/Application-Gold -e prod -- update
apictl import policy rate-limiting -f ~/Application-Gold -e prod --update
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,27 @@ Follow the instructions below to display a list of rate limiting API Policies in

- **Command**
```bash
apictl get policies rate-limiting -e <environment-name> -q <query>
apictl get policies rate-limiting -e <environment-name> -q <query>
```

``` bash
apictl get policies rate-limiting --environment <environment> -q <query>
```

``` bash
apictl get policies rate-limiting --environment <environment> -q <query> --all
```

!!! Info
**Flags**
`-q, --query` - This allows the user to filter out rate limiting policies by type
`-e, --environment string` - Environment to be searched
`--format string` - Pretty-print rate limiting policies using Go Templates. Use `{% raw %}"{{ jsonPretty . }}"{% endraw %}` to list all fields
`-h, --help` - Help for rate-limiting
**Flags:**

- `-q` or `--query` - This allows the user to filter out rate limiting policies by type
- `-e` or `--environment` - Environment to be searched
- `--format` - Pretty-print rate limiting policies using Go Templates. Use `{% raw %}"{{ jsonPretty . }}"{% endraw %}` to list all fields
- `-h` or `--help` - Help for rate-limiting

!!! example
```bash
apictl get policies rate-limiting -e prod -q type:sub
apictl get policies rate-limiting -e prod -q type:sub
```

## Delete a rate limiting policies from an environment
## Delete rate limiting policies from an environment

Follow the instructions below to delete a rate limiting policy in an environment using apictl:

Expand All @@ -54,41 +51,37 @@ For more information, see [Download and Initialize the apictl]({{base_path}}/ins

- **Command**
``` bash
apictl delete policy rate-limiting -n <rate limiting policy name> -v <rate limiting policy version> -e <environment>
apictl delete policy rate-limiting -n <rate limiting policy name> -e <environment> -t <type of rate limiting policy>
```
``` bash
apictl delete policy rate-limiting --name <rate limiting name> --version <rate limiting policy version> --environment <environment>
apictl delete policy rate-limiting --name <rate limiting name> --environment <environment> --type <type of rate limiting policy>
```

!!! info
**Flags:**

- Required :
`-e, --environment string` - Environment from which the Throttling Policy should be deleted
`-h, --help` - Help for rate-limiting
`-n, --name string` - Name of the Throttling Policy to be deleted
`-t, --type string` - Type of the Throttling Policies to be exported (sub,app,custom,advanced)

!!! example
```bash
apictl delete policy rate-limiting -n Gold -e dev --type sub
```

```bash
apictl delete policy rate-limiting -n AppPolicy -e prod --type app
```
`-e, --environment string` - Environment from which the Throttling Policy should be deleted
`-h, --help` - Help for rate-limiting
`-n, --name string` - Name of the Throttling Policy to be deleted
`-t, --type string` - Type of the Throttling Policies to be exported (sub, app, custom, advanced)

```bash
apictl delete policy rate-limiting -n TestPolicy -e dev --type advanced
```

```bash
apictl delete policy rate-limiting -n CustomPolicy -e prod --type custom
```

!!! Note
All the 2 flags (--name (-n) and --environment (-e)) are mandatory.
!!! example
```bash
apictl delete policy rate-limiting -n Gold -e dev --type sub
```

```bash
apictl delete policy rate-limiting -n AppPolicy -e prod --type app
```

```bash
apictl delete policy rate-limiting -n TestPolicy -e dev --type advanced
```

```bash
apictl delete policy rate-limiting -n CustomPolicy -e prod --type custom
```

## Export/Import rate limiting policies

Expand Down

0 comments on commit f1cdcc7

Please sign in to comment.