Interface ThrottleSettings

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ThrottleSettings.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:02.089Z") @Stability(Stable) public interface ThrottleSettings extends software.amazon.jsii.JsiiSerializable
Container for defining throttling parameters to API stages or methods.

Example:

 LambdaIntegration integration;
 RestApi api = new RestApi(this, "hello-api");
 Resource v1 = api.root.addResource("v1");
 Resource echo = v1.addResource("echo");
 Method echoMethod = echo.addMethod("GET", integration, MethodOptions.builder().apiKeyRequired(true).build());
 UsagePlan plan = api.addUsagePlan("UsagePlan", UsagePlanProps.builder()
         .name("Easy")
         .throttle(ThrottleSettings.builder()
                 .rateLimit(10)
                 .burstLimit(2)
                 .build())
         .build());
 IApiKey key = api.addApiKey("ApiKey");
 plan.addApiKey(key);
 
  • Method Details

    • getBurstLimit

      @Stability(Stable) @Nullable default Number getBurstLimit()
      The maximum API request rate limit over a time ranging from one to a few seconds.

      Default: none

    • getRateLimit

      @Stability(Stable) @Nullable default Number getRateLimit()
      The API request steady-state rate limit (average requests per second over an extended period of time).

      Default: none

    • builder

      @Stability(Stable) static ThrottleSettings.Builder builder()
      Returns:
      a ThrottleSettings.Builder of ThrottleSettings