fastly 5.2.2 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/docs/AutomationTokenCreateResponse.md +3 -3
- data/docs/AutomationTokenCreateResponseAllOf.md +3 -3
- data/docs/AutomationTokenResponse.md +2 -2
- data/docs/AutomationTokenResponseAllOf.md +2 -2
- data/docs/AutomationTokensApi.md +4 -3
- data/docs/ErrorResponse.md +13 -0
- data/docs/HistoricalFieldResultsAttributes.md +1 -1
- data/docs/HistoricalFieldResultsAttributesAllOf.md +1 -1
- data/docs/RateLimiter.md +1 -1
- data/docs/RateLimiterApi.md +122 -0
- data/docs/RateLimiterResponse.md +1 -1
- data/docs/ReadOnlyCustomerId.md +9 -0
- data/docs/ReadOnlyId.md +9 -0
- data/docs/ReadOnlyIdService.md +9 -0
- data/docs/ReadOnlyUserId.md +9 -0
- data/lib/fastly/api/automation_tokens_api.rb +5 -5
- data/lib/fastly/api/rate_limiter_api.rb +345 -0
- data/lib/fastly/configuration.rb +12 -0
- data/lib/fastly/models/automation_token_create_request_attributes.rb +0 -1
- data/lib/fastly/models/automation_token_create_response.rb +3 -6
- data/lib/fastly/models/automation_token_create_response_all_of.rb +3 -6
- data/lib/fastly/models/automation_token_response.rb +2 -4
- data/lib/fastly/models/automation_token_response_all_of.rb +2 -4
- data/lib/fastly/models/{rate_limiter_response1.rb → error_response.rb} +30 -77
- data/lib/fastly/models/historical_field_results_attributes.rb +1 -2
- data/lib/fastly/models/historical_field_results_attributes_all_of.rb +1 -2
- data/lib/fastly/models/rate_limiter.rb +5 -2
- data/lib/fastly/models/rate_limiter_response.rb +5 -2
- data/lib/fastly/models/read_only_customer_id.rb +207 -0
- data/lib/fastly/models/read_only_id.rb +207 -0
- data/lib/fastly/models/read_only_id_service.rb +207 -0
- data/lib/fastly/models/read_only_user_id.rb +207 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +5 -1
- data/sig.json +1 -1
- metadata +12 -4
- data/docs/RateLimiterResponse1.md +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c3742c86b7a3ebb49a32c347d3d861c1b5283e29cec0275b53bf805aba8a971
|
4
|
+
data.tar.gz: 9efd52c7c9ceba6560182a942a2df7e574c68a637e2370e06b146c38f7d9ec28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d984ff4c06039d109d4dac339b9ced309929c92212f9a08c08d475e8f1dc03372642cab2583ce2e8cd7326eff1919ee50ca429d8086b0207d2d5914768c149ce
|
7
|
+
data.tar.gz: 6adb541facd607662f32f504598f6109f343903bd2b15f864d01f3e3ce475d33599e38884d4fc9cb6391bd92726e3c5e43d89a6cc48335599191541f1b715d94
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v5.3.0](https://github.com/fastly/fastly-ruby/releases/tag/release/v5.3.0) (2023-06-27)
|
4
|
+
|
5
|
+
**Enhancements:**
|
6
|
+
|
7
|
+
- feat(rate_limiter): implement POST/PUT endpoints.
|
8
|
+
|
9
|
+
**Bug fixes:**
|
10
|
+
|
11
|
+
- fix(automation_tokens): generate explicit error response type.
|
12
|
+
- fix(historical_stats): extract primitive into custom type.
|
13
|
+
|
3
14
|
## [v5.2.2](https://github.com/fastly/fastly-ruby/releases/tag/release/v5.2.2) (2023-06-23)
|
4
15
|
|
5
16
|
**Bug fixes:**
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@ A Ruby client library for interacting with most facets of the [Fastly API](https
|
|
8
8
|
To install via RubyGems, add the following to your project's `Gemfile`:
|
9
9
|
|
10
10
|
```ruby
|
11
|
-
gem 'fastly', '~> 5.
|
11
|
+
gem 'fastly', '~> 5.3.0'
|
12
12
|
```
|
13
13
|
|
14
14
|
Then run `bundle install`.
|
@@ -354,9 +354,11 @@ Class | Method | Description
|
|
354
354
|
[*Fastly::PurgeApi*](docs/PurgeApi.md) | [**purge_all**](docs/PurgeApi.md#purge_all) | Purge everything from a service
|
355
355
|
[*Fastly::PurgeApi*](docs/PurgeApi.md) | [**purge_single_url**](docs/PurgeApi.md#purge_single_url) | Purge a URL
|
356
356
|
[*Fastly::PurgeApi*](docs/PurgeApi.md) | [**purge_tag**](docs/PurgeApi.md#purge_tag) | Purge by surrogate key tag
|
357
|
+
[*Fastly::RateLimiterApi*](docs/RateLimiterApi.md) | [**create_rate_limiter**](docs/RateLimiterApi.md#create_rate_limiter) | Create a rate limiter
|
357
358
|
[*Fastly::RateLimiterApi*](docs/RateLimiterApi.md) | [**delete_rate_limiter**](docs/RateLimiterApi.md#delete_rate_limiter) | Delete a rate limiter
|
358
359
|
[*Fastly::RateLimiterApi*](docs/RateLimiterApi.md) | [**get_rate_limiter**](docs/RateLimiterApi.md#get_rate_limiter) | Get a rate limiter
|
359
360
|
[*Fastly::RateLimiterApi*](docs/RateLimiterApi.md) | [**list_rate_limiters**](docs/RateLimiterApi.md#list_rate_limiters) | List rate limiters
|
361
|
+
[*Fastly::RateLimiterApi*](docs/RateLimiterApi.md) | [**update_rate_limiter**](docs/RateLimiterApi.md#update_rate_limiter) | Update a rate limiter
|
360
362
|
[*Fastly::RealtimeApi*](docs/RealtimeApi.md) | [**get_stats_last120_seconds**](docs/RealtimeApi.md#get_stats_last120_seconds) | Get real-time data for the last 120 seconds
|
361
363
|
[*Fastly::RealtimeApi*](docs/RealtimeApi.md) | [**get_stats_last120_seconds_limit_entries**](docs/RealtimeApi.md#get_stats_last120_seconds_limit_entries) | Get a limited number of real-time data entries
|
362
364
|
[*Fastly::RealtimeApi*](docs/RealtimeApi.md) | [**get_stats_last_second**](docs/RealtimeApi.md#get_stats_last_second) | Get real-time data from specified time
|
@@ -507,7 +509,6 @@ The fastly-ruby API client currently does not support the following endpoints:
|
|
507
509
|
- [`/customer/{customer_id}/contacts`](https://developer.fastly.com/reference/api/account/contact) (POST)
|
508
510
|
- [`/metrics/domains/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/domain-inspector/historical) (GET)
|
509
511
|
- [`/metrics/origins/services/{service_id}`](https://developer.fastly.com/reference/api/metrics-stats/origin-inspector/historical) (GET)
|
510
|
-
- [`/rate-limiters/{rate_limiter_id}`](https://developer.fastly.com/reference/api/vcl-services/rate-limiter) (PUT)
|
511
512
|
- [`/resources/stores/secret/client-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (POST)
|
512
513
|
- [`/resources/stores/secret/signing-key`](https://developer.fastly.com/reference/api/services/resources/secret-store) (GET)
|
513
514
|
- [`/resources/stores/secret/{store_id}/secrets/{secret_name}`](https://developer.fastly.com/reference/api/services/resources/secret) (DELETE, GET)
|
@@ -528,7 +529,6 @@ The fastly-ruby API client currently does not support the following endpoints:
|
|
528
529
|
- [`/service/{service_id}/version/{version_id}/director/{director_name}`](https://developer.fastly.com/reference/api/load-balancing/directors/director) (PUT)
|
529
530
|
- [`/service/{service_id}/version/{version_id}/logging/kafka/{logging_kafka_name}`](https://developer.fastly.com/reference/api/logging/kafka) (PUT)
|
530
531
|
- [`/service/{service_id}/version/{version_id}/logging/kinesis/{logging_kinesis_name}`](https://developer.fastly.com/reference/api/logging/kinesis) (PUT)
|
531
|
-
- [`/service/{service_id}/version/{version_id}/rate-limiters`](https://developer.fastly.com/reference/api/vcl-services/rate-limiter) (POST)
|
532
532
|
- [`/service/{service_id}/version/{version_id}/request_settings`](https://developer.fastly.com/reference/api/vcl-services/request-settings) (POST)
|
533
533
|
- [`/service/{service_id}/version/{version_id}/response_object/{response_object_name}`](https://developer.fastly.com/reference/api/vcl-services/response-object) (PUT)
|
534
534
|
- [`/service/{service_id}/version/{version_id}/response_object`](https://developer.fastly.com/reference/api/vcl-services/response-object) (POST)
|
@@ -12,9 +12,9 @@
|
|
12
12
|
| **created_at** | **Time** | A UTC time-stamp of when the token was created. | [optional][readonly] |
|
13
13
|
| **deleted_at** | **Time** | Date and time in ISO 8601 format. | [optional][readonly] |
|
14
14
|
| **updated_at** | **Time** | Date and time in ISO 8601 format. | [optional][readonly] |
|
15
|
-
| **id** | **
|
16
|
-
| **user_id** | **
|
17
|
-
| **customer_id** | **
|
15
|
+
| **id** | [**ReadOnlyId**](ReadOnlyId.md) | | [optional] |
|
16
|
+
| **user_id** | [**ReadOnlyUserId**](ReadOnlyUserId.md) | | [optional] |
|
17
|
+
| **customer_id** | [**ReadOnlyCustomerId**](ReadOnlyCustomerId.md) | | [optional] |
|
18
18
|
| **sudo_expires_at** | **Time** | | [optional][readonly] |
|
19
19
|
| **access_token** | **String** | | [optional][readonly] |
|
20
20
|
| **last_used_at** | **Time** | A UTC time-stamp of when the token was last used. | [optional][readonly] |
|
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **id** | **
|
8
|
-
| **user_id** | **
|
9
|
-
| **customer_id** | **
|
7
|
+
| **id** | [**ReadOnlyId**](ReadOnlyId.md) | | [optional] |
|
8
|
+
| **user_id** | [**ReadOnlyUserId**](ReadOnlyUserId.md) | | [optional] |
|
9
|
+
| **customer_id** | [**ReadOnlyCustomerId**](ReadOnlyCustomerId.md) | | [optional] |
|
10
10
|
| **sudo_expires_at** | **Time** | | [optional][readonly] |
|
11
11
|
| **created_at** | **Time** | A UTC time-stamp of when the token was created. | [optional][readonly] |
|
12
12
|
| **access_token** | **String** | | [optional][readonly] |
|
@@ -12,8 +12,8 @@
|
|
12
12
|
| **created_at** | **String** | A UTC time-stamp of when the token was created. | [optional] |
|
13
13
|
| **deleted_at** | **Time** | Date and time in ISO 8601 format. | [optional][readonly] |
|
14
14
|
| **updated_at** | **Time** | Date and time in ISO 8601 format. | [optional][readonly] |
|
15
|
-
| **id** | **
|
16
|
-
| **customer_id** | **
|
15
|
+
| **id** | [**ReadOnlyId**](ReadOnlyId.md) | | [optional] |
|
16
|
+
| **customer_id** | [**ReadOnlyCustomerId**](ReadOnlyCustomerId.md) | | [optional] |
|
17
17
|
| **ip** | **String** | The IP address of the client that last used the token. | [optional] |
|
18
18
|
| **user_agent** | **String** | The User-Agent header of the client that last used the token. | [optional] |
|
19
19
|
| **sudo_expires_at** | **String** | | [optional][readonly] |
|
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **id** | **
|
8
|
-
| **customer_id** | **
|
7
|
+
| **id** | [**ReadOnlyId**](ReadOnlyId.md) | | [optional] |
|
8
|
+
| **customer_id** | [**ReadOnlyCustomerId**](ReadOnlyCustomerId.md) | | [optional] |
|
9
9
|
| **role** | **String** | | [optional] |
|
10
10
|
| **ip** | **String** | The IP address of the client that last used the token. | [optional] |
|
11
11
|
| **user_agent** | **String** | The User-Agent header of the client that last used the token. | [optional] |
|
data/docs/AutomationTokensApi.md
CHANGED
@@ -174,7 +174,7 @@ end
|
|
174
174
|
## `revoke_automation_token_id()`
|
175
175
|
|
176
176
|
```ruby
|
177
|
-
revoke_automation_token_id(opts) # Revoke an Automation Token by ID
|
177
|
+
revoke_automation_token_id(opts): <ErrorResponse> # Revoke an Automation Token by ID
|
178
178
|
```
|
179
179
|
|
180
180
|
Revoke an automation token by ID.
|
@@ -189,7 +189,8 @@ opts = {
|
|
189
189
|
|
190
190
|
begin
|
191
191
|
# Revoke an Automation Token by ID
|
192
|
-
api_instance.revoke_automation_token_id(opts)
|
192
|
+
result = api_instance.revoke_automation_token_id(opts)
|
193
|
+
p result
|
193
194
|
rescue Fastly::ApiError => e
|
194
195
|
puts "Error when calling AutomationTokensApi->revoke_automation_token_id: #{e}"
|
195
196
|
end
|
@@ -203,7 +204,7 @@ end
|
|
203
204
|
|
204
205
|
### Return type
|
205
206
|
|
206
|
-
|
207
|
+
[**ErrorResponse**](ErrorResponse.md)
|
207
208
|
|
208
209
|
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
209
210
|
[[Back to README]](../../README.md)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Fastly::ErrorResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **detail** | **String** | | [optional] |
|
8
|
+
| **errors** | **Array<Object>** | | [optional] |
|
9
|
+
| **status** | **Integer** | | [optional] |
|
10
|
+
| **title** | **String** | | [optional] |
|
11
|
+
|
12
|
+
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
13
|
+
|
@@ -220,7 +220,7 @@
|
|
220
220
|
| **ddos_action_tarpit** | **Integer** | The number of times the tarpit action was taken. The tarpit action delays writing the response to the client. | [optional] |
|
221
221
|
| **ddos_action_close** | **Integer** | The number of times the close action was taken. The close action aborts the connection as soon as possible. The close action takes effect either right after accept, right after the client hello, or right after the response was sent. | [optional] |
|
222
222
|
| **ddos_action_blackhole** | **Integer** | The number of times the blackhole action was taken. The blackhole action quietly closes a TCP connection without sending a reset. The blackhole action quietly closes a TCP connection without notifying its peer (all TCP state is dropped). | [optional] |
|
223
|
-
| **service_id** | **
|
223
|
+
| **service_id** | [**ReadOnlyIdService**](ReadOnlyIdService.md) | | [optional] |
|
224
224
|
| **start_time** | **Integer** | | [optional] |
|
225
225
|
|
226
226
|
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **service_id** | **
|
7
|
+
| **service_id** | [**ReadOnlyIdService**](ReadOnlyIdService.md) | | [optional] |
|
8
8
|
| **start_time** | **Integer** | | [optional] |
|
9
9
|
|
10
10
|
[[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
data/docs/RateLimiter.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
| **client_key** | **Array<String>** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] |
|
13
13
|
| **penalty_box_duration** | **Integer** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] |
|
14
14
|
| **action** | **String** | The action to take when a rate limiter violation is detected. | [optional] |
|
15
|
-
| **response** |
|
15
|
+
| **response** | **Hash<String, String>** | Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. | [optional] |
|
16
16
|
| **response_object_name** | **String** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] |
|
17
17
|
| **logger_type** | **String** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] |
|
18
18
|
| **feature_revision** | **Integer** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] |
|
data/docs/RateLimiterApi.md
CHANGED
@@ -10,11 +10,74 @@ api_instance = Fastly::RateLimiterApi.new
|
|
10
10
|
|
11
11
|
| Method | HTTP request | Description |
|
12
12
|
| ------ | ------------ | ----------- |
|
13
|
+
| [**create_rate_limiter**](RateLimiterApi.md#create_rate_limiter) | **POST** /service/{service_id}/version/{version_id}/rate-limiters | Create a rate limiter |
|
13
14
|
| [**delete_rate_limiter**](RateLimiterApi.md#delete_rate_limiter) | **DELETE** /rate-limiters/{rate_limiter_id} | Delete a rate limiter |
|
14
15
|
| [**get_rate_limiter**](RateLimiterApi.md#get_rate_limiter) | **GET** /rate-limiters/{rate_limiter_id} | Get a rate limiter |
|
15
16
|
| [**list_rate_limiters**](RateLimiterApi.md#list_rate_limiters) | **GET** /service/{service_id}/version/{version_id}/rate-limiters | List rate limiters |
|
17
|
+
| [**update_rate_limiter**](RateLimiterApi.md#update_rate_limiter) | **PUT** /rate-limiters/{rate_limiter_id} | Update a rate limiter |
|
16
18
|
|
17
19
|
|
20
|
+
## `create_rate_limiter()`
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
create_rate_limiter(opts): <RateLimiterResponse> # Create a rate limiter
|
24
|
+
```
|
25
|
+
|
26
|
+
Create a rate limiter for a particular service and version.
|
27
|
+
|
28
|
+
### Examples
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
api_instance = Fastly::RateLimiterApi.new
|
32
|
+
opts = {
|
33
|
+
service_id: 'service_id_example', # String | Alphanumeric string identifying the service.
|
34
|
+
version_id: 56, # Integer | Integer identifying a service version.
|
35
|
+
name: 'name_example', # String | A human readable name for the rate limiting rule.
|
36
|
+
uri_dictionary_name: 'uri_dictionary_name_example', # String | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited.
|
37
|
+
http_methods: ['HEAD'], # Array<String> | Array of HTTP methods to apply rate limiting to.
|
38
|
+
rps_limit: 56, # Integer | Upper limit of requests per second allowed by the rate limiter.
|
39
|
+
window_size: 1, # Integer | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation.
|
40
|
+
client_key: ['inner_example'], # Array<String> | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`.
|
41
|
+
penalty_box_duration: 56, # Integer | Length of time in minutes that the rate limiter is in effect after the initial violation is detected.
|
42
|
+
action: 'response', # String | The action to take when a rate limiter violation is detected.
|
43
|
+
response_object_name: 'response_object_name_example', # String | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
|
44
|
+
logger_type: 'azureblob', # String | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries.
|
45
|
+
feature_revision: 56, # Integer | Revision number of the rate limiting feature implementation. Defaults to the most recent revision.
|
46
|
+
}
|
47
|
+
|
48
|
+
begin
|
49
|
+
# Create a rate limiter
|
50
|
+
result = api_instance.create_rate_limiter(opts)
|
51
|
+
p result
|
52
|
+
rescue Fastly::ApiError => e
|
53
|
+
puts "Error when calling RateLimiterApi->create_rate_limiter: #{e}"
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
### Options
|
58
|
+
|
59
|
+
| Name | Type | Description | Notes |
|
60
|
+
| ---- | ---- | ----------- | ----- |
|
61
|
+
| **service_id** | **String** | Alphanumeric string identifying the service. | |
|
62
|
+
| **version_id** | **Integer** | Integer identifying a service version. | |
|
63
|
+
| **name** | **String** | A human readable name for the rate limiting rule. | [optional] |
|
64
|
+
| **uri_dictionary_name** | **String** | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. | [optional] |
|
65
|
+
| **http_methods** | [**Array<String>**](String.md) | Array of HTTP methods to apply rate limiting to. | [optional] |
|
66
|
+
| **rps_limit** | **Integer** | Upper limit of requests per second allowed by the rate limiter. | [optional] |
|
67
|
+
| **window_size** | **Integer** | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. | [optional] |
|
68
|
+
| **client_key** | [**Array<String>**](String.md) | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] |
|
69
|
+
| **penalty_box_duration** | **Integer** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] |
|
70
|
+
| **action** | **String** | The action to take when a rate limiter violation is detected. | [optional] |
|
71
|
+
| **response_object_name** | **String** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] |
|
72
|
+
| **logger_type** | **String** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] |
|
73
|
+
| **feature_revision** | **Integer** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] |
|
74
|
+
|
75
|
+
### Return type
|
76
|
+
|
77
|
+
[**RateLimiterResponse**](RateLimiterResponse.md)
|
78
|
+
|
79
|
+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
80
|
+
[[Back to README]](../../README.md)
|
18
81
|
## `delete_rate_limiter()`
|
19
82
|
|
20
83
|
```ruby
|
@@ -128,3 +191,62 @@ end
|
|
128
191
|
|
129
192
|
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
130
193
|
[[Back to README]](../../README.md)
|
194
|
+
## `update_rate_limiter()`
|
195
|
+
|
196
|
+
```ruby
|
197
|
+
update_rate_limiter(opts): <RateLimiterResponse> # Update a rate limiter
|
198
|
+
```
|
199
|
+
|
200
|
+
Update a rate limiter by its ID.
|
201
|
+
|
202
|
+
### Examples
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
api_instance = Fastly::RateLimiterApi.new
|
206
|
+
opts = {
|
207
|
+
rate_limiter_id: 'rate_limiter_id_example', # String | Alphanumeric string identifying the rate limiter.
|
208
|
+
name: 'name_example', # String | A human readable name for the rate limiting rule.
|
209
|
+
uri_dictionary_name: 'uri_dictionary_name_example', # String | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited.
|
210
|
+
http_methods: ['HEAD'], # Array<String> | Array of HTTP methods to apply rate limiting to.
|
211
|
+
rps_limit: 56, # Integer | Upper limit of requests per second allowed by the rate limiter.
|
212
|
+
window_size: 1, # Integer | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation.
|
213
|
+
client_key: ['inner_example'], # Array<String> | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`.
|
214
|
+
penalty_box_duration: 56, # Integer | Length of time in minutes that the rate limiter is in effect after the initial violation is detected.
|
215
|
+
action: 'response', # String | The action to take when a rate limiter violation is detected.
|
216
|
+
response_object_name: 'response_object_name_example', # String | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
|
217
|
+
logger_type: 'azureblob', # String | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries.
|
218
|
+
feature_revision: 56, # Integer | Revision number of the rate limiting feature implementation. Defaults to the most recent revision.
|
219
|
+
}
|
220
|
+
|
221
|
+
begin
|
222
|
+
# Update a rate limiter
|
223
|
+
result = api_instance.update_rate_limiter(opts)
|
224
|
+
p result
|
225
|
+
rescue Fastly::ApiError => e
|
226
|
+
puts "Error when calling RateLimiterApi->update_rate_limiter: #{e}"
|
227
|
+
end
|
228
|
+
```
|
229
|
+
|
230
|
+
### Options
|
231
|
+
|
232
|
+
| Name | Type | Description | Notes |
|
233
|
+
| ---- | ---- | ----------- | ----- |
|
234
|
+
| **rate_limiter_id** | **String** | Alphanumeric string identifying the rate limiter. | |
|
235
|
+
| **name** | **String** | A human readable name for the rate limiting rule. | [optional] |
|
236
|
+
| **uri_dictionary_name** | **String** | The name of an Edge Dictionary containing URIs as keys. If not defined or `null`, all origin URIs will be rate limited. | [optional] |
|
237
|
+
| **http_methods** | [**Array<String>**](String.md) | Array of HTTP methods to apply rate limiting to. | [optional] |
|
238
|
+
| **rps_limit** | **Integer** | Upper limit of requests per second allowed by the rate limiter. | [optional] |
|
239
|
+
| **window_size** | **Integer** | Number of seconds during which the RPS limit must be exceeded in order to trigger a violation. | [optional] |
|
240
|
+
| **client_key** | [**Array<String>**](String.md) | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] |
|
241
|
+
| **penalty_box_duration** | **Integer** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] |
|
242
|
+
| **action** | **String** | The action to take when a rate limiter violation is detected. | [optional] |
|
243
|
+
| **response_object_name** | **String** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] |
|
244
|
+
| **logger_type** | **String** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] |
|
245
|
+
| **feature_revision** | **Integer** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] |
|
246
|
+
|
247
|
+
### Return type
|
248
|
+
|
249
|
+
[**RateLimiterResponse**](RateLimiterResponse.md)
|
250
|
+
|
251
|
+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
252
|
+
[[Back to README]](../../README.md)
|
data/docs/RateLimiterResponse.md
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
| **client_key** | **Array<String>** | Array of VCL variables used to generate a counter key to identify a client. Example variables include `req.http.Fastly-Client-IP`, `req.http.User-Agent`, or a custom header like `req.http.API-Key`. | [optional] |
|
13
13
|
| **penalty_box_duration** | **Integer** | Length of time in minutes that the rate limiter is in effect after the initial violation is detected. | [optional] |
|
14
14
|
| **action** | **String** | The action to take when a rate limiter violation is detected. | [optional] |
|
15
|
-
| **response** |
|
15
|
+
| **response** | **Hash<String, String>** | Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`. | [optional] |
|
16
16
|
| **response_object_name** | **String** | Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration. | [optional] |
|
17
17
|
| **logger_type** | **String** | Name of the type of logging endpoint to be used when action is `log_only`. The logging endpoint type is used to determine the appropriate log format to use when emitting log entries. | [optional] |
|
18
18
|
| **feature_revision** | **Integer** | Revision number of the rate limiting feature implementation. Defaults to the most recent revision. | [optional] |
|
data/docs/ReadOnlyId.md
ADDED
@@ -277,16 +277,16 @@ module Fastly
|
|
277
277
|
# Revoke an Automation Token by ID
|
278
278
|
# Revoke an automation token by ID.
|
279
279
|
# @option opts [String] :id (required)
|
280
|
-
# @return [
|
280
|
+
# @return [ErrorResponse]
|
281
281
|
def revoke_automation_token_id(opts = {})
|
282
|
-
revoke_automation_token_id_with_http_info(opts)
|
283
|
-
|
282
|
+
data, _status_code, _headers = revoke_automation_token_id_with_http_info(opts)
|
283
|
+
data
|
284
284
|
end
|
285
285
|
|
286
286
|
# Revoke an Automation Token by ID
|
287
287
|
# Revoke an automation token by ID.
|
288
288
|
# @option opts [String] :id (required)
|
289
|
-
# @return [Array<(
|
289
|
+
# @return [Array<(ErrorResponse, Integer, Hash)>] ErrorResponse data, response status code and response headers
|
290
290
|
def revoke_automation_token_id_with_http_info(opts = {})
|
291
291
|
if @api_client.config.debugging
|
292
292
|
@api_client.config.logger.debug 'Calling API: AutomationTokensApi.revoke_automation_token_id ...'
|
@@ -315,7 +315,7 @@ module Fastly
|
|
315
315
|
post_body = opts[:debug_body]
|
316
316
|
|
317
317
|
# return_type
|
318
|
-
return_type = opts[:debug_return_type]
|
318
|
+
return_type = opts[:debug_return_type] || 'ErrorResponse'
|
319
319
|
|
320
320
|
# auth_names
|
321
321
|
auth_names = opts[:debug_auth_names] || ['token']
|