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 SummaryNested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IApiIApi.Jsii$Default, IApi.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstructIConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IHttpApiIHttpApi.Jsii$Default, IHttpApi.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResourceIResource.Jsii$Default
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedHttpApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedHttpApi(software.amazon.jsii.JsiiObjectRef objRef) HttpApi(software.constructs.Construct scope, String id, HttpApiProps props) 
- 
Method SummaryModifier 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.ResourceapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.ConstructgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.ConstructtoStringMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstructgetNodeMethods inherited from interface software.amazon.awscdk.core.IResourceapplyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Constructor Details- 
HttpApiprotected HttpApi(software.amazon.jsii.JsiiObjectRef objRef) 
- 
HttpApiprotected 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 interface- IHttpApi
- 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 interface- IHttpApi
- Parameters:
- props-
 
- 
metricClientError(experimental) Metric for the number of client-side errors captured in a given period.- Specified by:
- metricClientErrorin interface- IHttpApi
 
- 
metricCount(experimental) Metric for the total number API requests in a given period.- Specified by:
- metricCountin interface- IHttpApi
- Parameters:
- props-
 
- 
metricCount(experimental) Metric for the total number API requests in a given period.- Specified by:
- metricCountin interface- IHttpApi
 
- 
metricDataProcessed(experimental) Metric for the amount of data processed in bytes.- Specified by:
- metricDataProcessedin interface- IHttpApi
- Parameters:
- props-
 
- 
metricDataProcessed(experimental) Metric for the amount of data processed in bytes.- Specified by:
- metricDataProcessedin interface- IHttpApi
 
- 
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 interface- IHttpApi
- 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 interface- IHttpApi
 
- 
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 interface- IHttpApi
- 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 interface- IHttpApi
 
- 
metricServerError(experimental) Metric for the number of server-side errors captured in a given period.- Specified by:
- metricServerErrorin interface- IHttpApi
- Parameters:
- props-
 
- 
metricServerError(experimental) Metric for the number of server-side errors captured in a given period.- Specified by:
- metricServerErrorin interface- IHttpApi
 
- 
getApiEndpoint(experimental) Get the default endpoint for this API.- Specified by:
- getApiEndpointin interface- IApi
 
- 
getApiId(experimental) The identifier of this API Gateway API.
- 
getHttpApiId(experimental) The identifier of this API Gateway HTTP API.- Specified by:
- getHttpApiIdin interface- IHttpApi
 
- 
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.
 
-