Class HttpApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigatewayv2.HttpApi
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IApi,IHttpApi,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.247Z")
@Stability(Experimental)
public class HttpApi
extends Resource
implements IHttpApi, IApi
(experimental) Create a new API Gateway HTTP API endpoint.
Example:
import software.amazon.awscdk.services.apigatewayv2.integrations.HttpLambdaIntegration;
Function booksDefaultFn;
HttpLambdaIntegration booksIntegration = new HttpLambdaIntegration("BooksIntegration", booksDefaultFn);
HttpApi httpApi = new HttpApi(this, "HttpApi");
httpApi.addRoutes(AddRoutesOptions.builder()
.path("/books")
.methods(List.of(HttpMethod.GET))
.integration(booksIntegration)
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IApi
IApi.Jsii$Default, IApi.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IHttpApi
IHttpApi.Jsii$Default, IHttpApi.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedHttpApi(software.amazon.jsii.JsiiObjectRef objRef) HttpApi(software.constructs.Construct scope, String id, HttpApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddRoutes(AddRoutesOptions options) (experimental) Add multiple routes that uses the same configuration.addStage(String id, HttpStageOptions options) (experimental) Add a new stage.addVpcLink(VpcLinkProps options) (experimental) Add a new VpcLink.static IHttpApifromHttpApiAttributes(software.constructs.Construct scope, String id, HttpApiAttributes attrs) (experimental) Import an existing HTTP API into this CDK app.(experimental) Get the default endpoint for this API.getApiId()(experimental) The identifier of this API Gateway API.(experimental) The default stage of this API.(experimental) Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint.(experimental) The identifier of this API Gateway HTTP API.(experimental) A human friendly name for this HTTP API.getUrl()(experimental) Get the URL to the default stage of this API.(experimental) Return the given named metric for this Api Gateway.metric(String metricName, MetricOptions props) (experimental) Return the given named metric for this Api Gateway.(experimental) Metric for the number of client-side errors captured in a given period.metricClientError(MetricOptions props) (experimental) Metric for the number of client-side errors captured in a given period.(experimental) Metric for the total number API requests in a given period.metricCount(MetricOptions props) (experimental) Metric for the total number API requests in a given period.(experimental) Metric for the amount of data processed in bytes.metricDataProcessed(MetricOptions props) (experimental) Metric for the amount of data processed in bytes.(experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.(experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.(experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.metricLatency(MetricOptions props) (experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.(experimental) Metric for the number of server-side errors captured in a given period.metricServerError(MetricOptions props) (experimental) Metric for the number of server-side errors captured in a given period.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
HttpApi
protected HttpApi(software.amazon.jsii.JsiiObjectRef objRef) -
HttpApi
protected HttpApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
HttpApi
@Stability(Experimental) public HttpApi(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable HttpApiProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
HttpApi
@Stability(Experimental) public HttpApi(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromHttpApiAttributes
@Stability(Experimental) @NotNull public static IHttpApi fromHttpApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull HttpApiAttributes attrs) (experimental) Import an existing HTTP API into this CDK app.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
addRoutes
@Stability(Experimental) @NotNull public List<HttpRoute> addRoutes(@NotNull AddRoutesOptions options) (experimental) Add multiple routes that uses the same configuration.The routes all go to the same path, but for different methods.
- Parameters:
options- This parameter is required.
-
addStage
@Stability(Experimental) @NotNull public HttpStage addStage(@NotNull String id, @NotNull HttpStageOptions options) (experimental) Add a new stage.- Parameters:
id- This parameter is required.options- This parameter is required.
-
addVpcLink
(experimental) Add a new VpcLink.- Specified by:
addVpcLinkin interfaceIHttpApi- Parameters:
options- This parameter is required.
-
metric
@Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) (experimental) Return the given named metric for this Api Gateway. -
metric
(experimental) Return the given named metric for this Api Gateway. -
metricClientError
(experimental) Metric for the number of client-side errors captured in a given period.- Specified by:
metricClientErrorin interfaceIHttpApi- Parameters:
props-
-
metricClientError
(experimental) Metric for the number of client-side errors captured in a given period.- Specified by:
metricClientErrorin interfaceIHttpApi
-
metricCount
(experimental) Metric for the total number API requests in a given period.- Specified by:
metricCountin interfaceIHttpApi- Parameters:
props-
-
metricCount
(experimental) Metric for the total number API requests in a given period.- Specified by:
metricCountin interfaceIHttpApi
-
metricDataProcessed
(experimental) Metric for the amount of data processed in bytes.- Specified by:
metricDataProcessedin interfaceIHttpApi- Parameters:
props-
-
metricDataProcessed
(experimental) Metric for the amount of data processed in bytes.- Specified by:
metricDataProcessedin interfaceIHttpApi
-
metricIntegrationLatency
@Stability(Experimental) @NotNull public Metric metricIntegrationLatency(@Nullable MetricOptions props) (experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.- Specified by:
metricIntegrationLatencyin interfaceIHttpApi- Parameters:
props-
-
metricIntegrationLatency
(experimental) Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.- Specified by:
metricIntegrationLatencyin interfaceIHttpApi
-
metricLatency
(experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.The latency includes the integration latency and other API Gateway overhead.
- Specified by:
metricLatencyin interfaceIHttpApi- Parameters:
props-
-
metricLatency
(experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.The latency includes the integration latency and other API Gateway overhead.
- Specified by:
metricLatencyin interfaceIHttpApi
-
metricServerError
(experimental) Metric for the number of server-side errors captured in a given period.- Specified by:
metricServerErrorin interfaceIHttpApi- Parameters:
props-
-
metricServerError
(experimental) Metric for the number of server-side errors captured in a given period.- Specified by:
metricServerErrorin interfaceIHttpApi
-
getApiEndpoint
(experimental) Get the default endpoint for this API.- Specified by:
getApiEndpointin interfaceIApi
-
getApiId
(experimental) The identifier of this API Gateway API. -
getHttpApiId
(experimental) The identifier of this API Gateway HTTP API.- Specified by:
getHttpApiIdin interfaceIHttpApi
-
getDefaultStage
(experimental) The default stage of this API. -
getDisableExecuteApiEndpoint
(experimental) Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint. -
getHttpApiName
(experimental) A human friendly name for this HTTP API.Note that this is different from
httpApiId. -
getUrl
(experimental) Get the URL to the default stage of this API.Returns
undefinedifcreateDefaultStageis unset.
-