@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-09T19:16:40.744Z") public class HttpApi extends Resource implements IHttpApi, IApi
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());
Modifier and Type | Class and Description |
---|---|
static class |
HttpApi.Builder
(experimental) A fluent builder for
HttpApi . |
IHttpApi.Jsii$Default, IHttpApi.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
HttpApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
HttpApi(software.amazon.jsii.JsiiObjectRef objRef) |
|
HttpApi(software.constructs.Construct scope,
java.lang.String id) |
|
HttpApi(software.constructs.Construct scope,
java.lang.String id,
HttpApiProps props) |
Modifier and Type | Method and Description |
---|---|
java.util.List<HttpRoute> |
addRoutes(AddRoutesOptions options)
(experimental) Add multiple routes that uses the same configuration.
|
HttpStage |
addStage(java.lang.String id,
HttpStageOptions options)
(experimental) Add a new stage.
|
VpcLink |
addVpcLink(VpcLinkProps options)
(experimental) Add a new VpcLink.
|
static IHttpApi |
fromHttpApiAttributes(software.constructs.Construct scope,
java.lang.String id,
HttpApiAttributes attrs)
(experimental) Import an existing HTTP API into this CDK app.
|
java.lang.String |
getApiEndpoint()
(experimental) Get the default endpoint for this API.
|
java.lang.String |
getApiId()
(experimental) The identifier of this API Gateway API.
|
IHttpStage |
getDefaultStage()
(experimental) The default stage of this API.
|
java.lang.Boolean |
getDisableExecuteApiEndpoint()
(experimental) Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint.
|
java.lang.String |
getHttpApiId()
(experimental) The identifier of this API Gateway HTTP API.
|
java.lang.String |
getHttpApiName()
(experimental) A human friendly name for this HTTP API.
|
java.lang.String |
getUrl()
(experimental) Get the URL to the default stage of this API.
|
Metric |
metric(java.lang.String metricName)
(experimental) Return the given named metric for this Api Gateway.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
(experimental) Return the given named metric for this Api Gateway.
|
Metric |
metricClientError()
(experimental) Metric for the number of client-side errors captured in a given period.
|
Metric |
metricClientError(MetricOptions props)
(experimental) Metric for the number of client-side errors captured in a given period.
|
Metric |
metricCount()
(experimental) Metric for the total number API requests in a given period.
|
Metric |
metricCount(MetricOptions props)
(experimental) Metric for the total number API requests in a given period.
|
Metric |
metricDataProcessed()
(experimental) Metric for the amount of data processed in bytes.
|
Metric |
metricDataProcessed(MetricOptions props)
(experimental) Metric for the amount of data processed in bytes.
|
Metric |
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.
|
Metric |
metricIntegrationLatency(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.
|
Metric |
metricLatency()
(experimental) 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)
(experimental) The time between when API Gateway receives a request from a client and when it returns a response to the client.
|
Metric |
metricServerError()
(experimental) Metric for the number of server-side errors captured in a given period.
|
Metric |
metricServerError(MetricOptions props)
(experimental) Metric for the number of server-side errors captured in a given period.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected HttpApi(software.amazon.jsii.JsiiObjectRef objRef)
protected HttpApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public HttpApi(software.constructs.Construct scope, java.lang.String id, HttpApiProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public HttpApi(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IHttpApi fromHttpApiAttributes(software.constructs.Construct scope, java.lang.String id, HttpApiAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public java.util.List<HttpRoute> addRoutes(AddRoutesOptions options)
The routes all go to the same path, but for different methods.
options
- This parameter is required.public HttpStage addStage(java.lang.String id, HttpStageOptions options)
id
- This parameter is required.options
- This parameter is required.public VpcLink addVpcLink(VpcLinkProps options)
addVpcLink
in interface IHttpApi
options
- This parameter is required.public Metric metric(java.lang.String metricName, MetricOptions props)
public Metric metric(java.lang.String metricName)
public Metric metricClientError(MetricOptions props)
metricClientError
in interface IHttpApi
props
- public Metric metricClientError()
metricClientError
in interface IHttpApi
public Metric metricCount(MetricOptions props)
metricCount
in interface IHttpApi
props
- public Metric metricCount()
metricCount
in interface IHttpApi
public Metric metricDataProcessed(MetricOptions props)
metricDataProcessed
in interface IHttpApi
props
- public Metric metricDataProcessed()
metricDataProcessed
in interface IHttpApi
public Metric metricIntegrationLatency(MetricOptions props)
metricIntegrationLatency
in interface IHttpApi
props
- public Metric metricIntegrationLatency()
metricIntegrationLatency
in interface IHttpApi
public Metric metricLatency(MetricOptions props)
The latency includes the integration latency and other API Gateway overhead.
metricLatency
in interface IHttpApi
props
- public Metric metricLatency()
The latency includes the integration latency and other API Gateway overhead.
metricLatency
in interface IHttpApi
public Metric metricServerError(MetricOptions props)
metricServerError
in interface IHttpApi
props
- public Metric metricServerError()
metricServerError
in interface IHttpApi
public java.lang.String getApiEndpoint()
getApiEndpoint
in interface IApi
public java.lang.String getApiId()
public java.lang.String getHttpApiId()
getHttpApiId
in interface IHttpApi
public IHttpStage getDefaultStage()
public java.lang.Boolean getDisableExecuteApiEndpoint()
public java.lang.String getHttpApiName()
Note that this is different from httpApiId
.
public java.lang.String getUrl()
Returns undefined
if createDefaultStage
is unset.