@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.181Z") @Stability(value=Stable) public class Method extends Resource
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);
| Modifier and Type | Class and Description |
|---|---|
static class |
Method.Builder
A fluent builder for
Method. |
software.amazon.jsii.JsiiObject.InitializationModeIResource.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
Method(software.constructs.Construct scope,
String id,
MethodProps props) |
protected |
Method(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Method(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMethodResponse(MethodResponse methodResponse)
Add a method response to this method.
|
IRestApi |
getApi()
The API Gateway RestApi associated with this method.
|
String |
getHttpMethod() |
String |
getMethodArn()
Returns an execute-api ARN for this method:.
|
String |
getMethodId() |
IResource |
getResource() |
String |
getTestMethodArn()
Returns an execute-api ARN for this method's "test-invoke-stage" stage.
|
Metric |
metric(String metricName,
IStage stage)
Returns the given named metric for this API method.
|
Metric |
metric(String metricName,
IStage stage,
MetricOptions props)
Returns the given named metric for this API method.
|
Metric |
metricCacheHitCount(IStage stage)
Metric for the number of requests served from the API cache in a given period.
|
Metric |
metricCacheHitCount(IStage stage,
MetricOptions props)
Metric for the number of requests served from the API cache in a given period.
|
Metric |
metricCacheMissCount(IStage stage)
Metric for the number of requests served from the backend in a given period, when API caching is enabled.
|
Metric |
metricCacheMissCount(IStage stage,
MetricOptions props)
Metric for the number of requests served from the backend in a given period, when API caching is enabled.
|
Metric |
metricClientError(IStage stage)
Metric for the number of client-side errors captured in a given period.
|
Metric |
metricClientError(IStage stage,
MetricOptions props)
Metric for the number of client-side errors captured in a given period.
|
Metric |
metricCount(IStage stage)
Metric for the total number API requests in a given period.
|
Metric |
metricCount(IStage stage,
MetricOptions props)
Metric for the total number API requests in a given period.
|
Metric |
metricIntegrationLatency(IStage stage)
Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
|
Metric |
metricIntegrationLatency(IStage stage,
MetricOptions props)
Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
|
Metric |
metricLatency(IStage stage)
The time between when API Gateway receives a request from a client and when it returns a response to the client.
|
Metric |
metricLatency(IStage stage,
MetricOptions props)
The time between when API Gateway receives a request from a client and when it returns a response to the client.
|
Metric |
metricServerError(IStage stage)
Metric for the number of server-side errors captured in a given period.
|
Metric |
metricServerError(IStage stage,
MetricOptions props)
Metric for the number of server-side errors captured in a given period.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Method(software.amazon.jsii.JsiiObjectRef objRef)
protected Method(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Method(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
MethodProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable)
public void addMethodResponse(@NotNull
MethodResponse methodResponse)
methodResponse - This parameter is required.@Stability(value=Stable) @NotNull public Metric metric(@NotNull String metricName, @NotNull IStage stage, @Nullable MetricOptions props)
metricName - This parameter is required.stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metric(@NotNull String metricName, @NotNull IStage stage)
metricName - This parameter is required.stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricCacheHitCount(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - sum over 5 minutes
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricCacheHitCount(@NotNull IStage stage)
Default: - sum over 5 minutes
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricCacheMissCount(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - sum over 5 minutes
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricCacheMissCount(@NotNull IStage stage)
Default: - sum over 5 minutes
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricClientError(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - sum over 5 minutes
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricClientError(@NotNull IStage stage)
Default: - sum over 5 minutes
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricCount(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - sample count over 5 minutes
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricCount(@NotNull IStage stage)
Default: - sample count over 5 minutes
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricIntegrationLatency(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - average over 5 minutes.
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricIntegrationLatency(@NotNull IStage stage)
Default: - average over 5 minutes.
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricLatency(@NotNull IStage stage, @Nullable MetricOptions props)
The latency includes the integration latency and other API Gateway overhead.
Default: - average over 5 minutes.
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricLatency(@NotNull IStage stage)
The latency includes the integration latency and other API Gateway overhead.
Default: - average over 5 minutes.
stage - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricServerError(@NotNull IStage stage, @Nullable MetricOptions props)
Default: - sum over 5 minutes
stage - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metricServerError(@NotNull IStage stage)
Default: - sum over 5 minutes
stage - This parameter is required.@Stability(value=Stable) @NotNull public IRestApi getApi()
@Stability(value=Stable) @NotNull public String getHttpMethod()
@Stability(value=Stable) @NotNull public String getMethodArn()
arn:aws:execute-api:{region}:{account}:{restApiId}/{stage}/{method}/{path}
NOTE: {stage} will refer to the restApi.deploymentStage, which will
automatically set if auto-deploy is enabled, or can be explicitly assigned.
When not configured, {stage} will be set to '*', as a shorthand for 'all stages'.
@Stability(value=Stable) @NotNull public String getMethodId()
@Stability(value=Stable) @NotNull public IResource getResource()
@Stability(value=Stable) @NotNull public String getTestMethodArn()
This stage is used by the AWS Console UI when testing the method.
Copyright © 2022. All rights reserved.