@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.217Z") @Stability(value=Stable) public class Stage extends Resource implements IStage
// production stage
LogGroup prdLogGroup = new LogGroup(this, "PrdLogs");
RestApi api = RestApi.Builder.create(this, "books")
.deployOptions(StageOptions.builder()
.accessLogDestination(new LogGroupLogDestination(prdLogGroup))
.accessLogFormat(AccessLogFormat.jsonWithStandardFields())
.build())
.build();
Deployment deployment = Deployment.Builder.create(this, "Deployment").api(api).build();
// development stage
LogGroup devLogGroup = new LogGroup(this, "DevLogs");
Stage.Builder.create(this, "dev")
.deployment(deployment)
.accessLogDestination(new LogGroupLogDestination(devLogGroup))
.accessLogFormat(AccessLogFormat.jsonWithStandardFields(JsonWithStandardFieldProps.builder()
.caller(false)
.httpMethod(true)
.ip(true)
.protocol(true)
.requestTime(true)
.resourcePath(true)
.responseLength(true)
.status(true)
.user(true)
.build()))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
Stage.Builder
A fluent builder for
Stage. |
software.amazon.jsii.JsiiObject.InitializationModeIStage.Jsii$Default, IStage.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
Stage(software.constructs.Construct scope,
String id,
StageProps props) |
protected |
Stage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Stage(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
IRestApi |
getRestApi()
RestApi to which this stage is associated.
|
String |
getStageArn()
Returns the resource ARN for this stage:.
|
String |
getStageName()
Name of this stage.
|
Metric |
metric(String metricName)
Returns the given named metric for this stage.
|
Metric |
metric(String metricName,
MetricOptions props)
Returns the given named metric for this stage.
|
Metric |
metricCacheHitCount()
Metric for the number of requests served from the API cache in a given period.
|
Metric |
metricCacheHitCount(MetricOptions props)
Metric for the number of requests served from the API cache in a given period.
|
Metric |
metricCacheMissCount()
Metric for the number of requests served from the backend in a given period, when API caching is enabled.
|
Metric |
metricCacheMissCount(MetricOptions props)
Metric for the number of requests served from the backend in a given period, when API caching is enabled.
|
Metric |
metricClientError()
Metric for the number of client-side errors captured in a given period.
|
Metric |
metricClientError(MetricOptions props)
Metric for the number of client-side errors captured in a given period.
|
Metric |
metricCount()
Metric for the total number API requests in a given period.
|
Metric |
metricCount(MetricOptions props)
Metric for the total number API requests in a given period.
|
Metric |
metricIntegrationLatency()
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(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()
The time between when API Gateway receives a request from a client and when it returns a response to the client.
|
Metric |
metricLatency(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()
Metric for the number of server-side errors captured in a given period.
|
Metric |
metricServerError(MetricOptions props)
Metric for the number of server-side errors captured in a given period.
|
String |
urlForPath()
Returns the invoke URL for a certain path.
|
String |
urlForPath(String path)
Returns the invoke URL for a certain path.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected Stage(software.amazon.jsii.JsiiObjectRef objRef)
protected Stage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Stage(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
StageProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
metricName - This parameter is required.props - @Stability(value=Stable) @NotNull public Metric metric(@NotNull String metricName)
metricName - This parameter is required.@Stability(value=Stable) @NotNull public Metric metricCacheHitCount(@Nullable MetricOptions props)
Default: - sum over 5 minutes
props - @Stability(value=Stable) @NotNull public Metric metricCacheHitCount()
Default: - sum over 5 minutes
@Stability(value=Stable) @NotNull public Metric metricCacheMissCount(@Nullable MetricOptions props)
Default: - sum over 5 minutes
props - @Stability(value=Stable) @NotNull public Metric metricCacheMissCount()
Default: - sum over 5 minutes
@Stability(value=Stable) @NotNull public Metric metricClientError(@Nullable MetricOptions props)
Default: - sum over 5 minutes
props - @Stability(value=Stable) @NotNull public Metric metricClientError()
Default: - sum over 5 minutes
@Stability(value=Stable) @NotNull public Metric metricCount(@Nullable MetricOptions props)
Default: - sample count over 5 minutes
props - @Stability(value=Stable) @NotNull public Metric metricCount()
Default: - sample count over 5 minutes
@Stability(value=Stable) @NotNull public Metric metricIntegrationLatency(@Nullable MetricOptions props)
Default: - average over 5 minutes.
props - @Stability(value=Stable) @NotNull public Metric metricIntegrationLatency()
Default: - average over 5 minutes.
@Stability(value=Stable) @NotNull public Metric metricLatency(@Nullable MetricOptions props)
The latency includes the integration latency and other API Gateway overhead.
Default: - average over 5 minutes.
props - @Stability(value=Stable) @NotNull public Metric metricLatency()
The latency includes the integration latency and other API Gateway overhead.
Default: - average over 5 minutes.
@Stability(value=Stable) @NotNull public Metric metricServerError(@Nullable MetricOptions props)
Default: - sum over 5 minutes
props - @Stability(value=Stable) @NotNull public Metric metricServerError()
Default: - sum over 5 minutes
@Stability(value=Stable) @NotNull public String urlForPath(@Nullable String path)
path - The resource path.@Stability(value=Stable) @NotNull public String urlForPath()
@Stability(value=Stable) @NotNull public IRestApi getRestApi()
getRestApi in interface IStage@Stability(value=Stable) @NotNull public String getStageArn()
arn:aws:apigateway:{region}::/restapis/{restApiId}/stages/{stageName}
Note that this is separate from the execute-api ARN for methods and resources within this stage.
@Stability(value=Stable) @NotNull public String getStageName()
getStageName in interface IStageCopyright © 2022. All rights reserved.