Class RestApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigateway.RestApiBase
software.amazon.awscdk.services.apigateway.RestApi
- All Implemented Interfaces:
 IConstruct,IDependable,IResource,IRestApi,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
- Direct Known Subclasses:
 LambdaRestApi,StepFunctionsRestApi
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
           date="2023-06-19T16:30:45.070Z")
@Stability(Stable)
public class RestApi
extends RestApiBase
Represents a REST API in Amazon API Gateway.
 
 Use addResource and addMethod to configure the API model.
 
By default, the API will automatically be deployed and accessible from a public endpoint.
Example:
 StateMachine stateMachine = StateMachine.Builder.create(this, "MyStateMachine")
         .stateMachineType(StateMachineType.EXPRESS)
         .definition(Chain.start(new Pass(this, "Pass")))
         .build();
 RestApi api = RestApi.Builder.create(this, "Api")
         .restApiName("MyApi")
         .build();
 api.root.addMethod("GET", StepFunctionsIntegration.startExecution(stateMachine));
 - 
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.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.core.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IRestApi
IRestApi.Jsii$Default - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedRestApi(software.amazon.jsii.JsiiObjectRef objRef) RestApi(software.constructs.Construct scope, String id, RestApiProps props)  - 
Method Summary
Modifier and TypeMethodDescriptionaddModel(String id, ModelOptions props) Adds a new model.addRequestValidator(String id, RequestValidatorOptions props) Adds a new request validator.static IRestApifromRestApiAttributes(software.constructs.Construct scope, String id, RestApiAttributes attrs) Import an existing RestApi that can be configured with additional Methods and Resources.static IRestApifromRestApiId(software.constructs.Construct scope, String id, String restApiId) Import an existing RestApi.The list of methods bound to this RestApi.The ID of this API Gateway RestApi.The resource ID of the root resource.getRoot()Represents the root resource of this API endpoint ('/').getUrl()The deployed root URL of this REST API.validate()Performs validation of the REST API.Methods inherited from class software.amazon.awscdk.services.apigateway.RestApiBase
addApiKey, addApiKey, addDomainName, addGatewayResponse, addUsagePlan, addUsagePlan, arnForExecuteApi, arnForExecuteApi, arnForExecuteApi, arnForExecuteApi, configureCloudWatchRole, configureDeployment, getCloudWatchAccount, getDeploymentStage, getDomainName, getLatestDeployment, getRestApiName, metric, metric, metricCacheHitCount, metricCacheHitCount, metricCacheMissCount, metricCacheMissCount, metricClientError, metricClientError, metricCount, metricCount, metricIntegrationLatency, metricIntegrationLatency, metricLatency, metricLatency, metricServerError, metricServerError, setCloudWatchAccount, setDeploymentStage, urlForPath, urlForPathMethods 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, synthesizeMethods 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
- 
RestApi
protected RestApi(software.amazon.jsii.JsiiObjectRef objRef)  - 
RestApi
protected RestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)  - 
RestApi
@Stability(Stable) public RestApi(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable RestApiProps props) - Parameters:
 scope- This parameter is required.id- This parameter is required.props-
 - 
RestApi
- Parameters:
 scope- This parameter is required.id- This parameter is required.
 
 - 
 - 
Method Details
- 
fromRestApiAttributes
@Stability(Stable) @NotNull public static IRestApi fromRestApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull RestApiAttributes attrs) Import an existing RestApi that can be configured with additional Methods and Resources.- Parameters:
 scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
 - 
fromRestApiId
@Stability(Stable) @NotNull public static IRestApi fromRestApiId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String restApiId) Import an existing RestApi.- Parameters:
 scope- This parameter is required.id- This parameter is required.restApiId- This parameter is required.
 - 
addModel
Adds a new model.- Parameters:
 id- This parameter is required.props- This parameter is required.
 - 
addRequestValidator
@Stability(Stable) @NotNull public RequestValidator addRequestValidator(@NotNull String id, @NotNull RequestValidatorOptions props) Adds a new request validator.- Parameters:
 id- This parameter is required.props- This parameter is required.
 - 
validate
Performs validation of the REST API. - 
getMethods
The list of methods bound to this RestApi. - 
getRestApiId
The ID of this API Gateway RestApi.- Specified by:
 getRestApiIdin interfaceIRestApi- Specified by:
 getRestApiIdin classRestApiBase
 - 
getRestApiRootResourceId
The resource ID of the root resource.- Specified by:
 getRestApiRootResourceIdin interfaceIRestApi- Specified by:
 getRestApiRootResourceIdin classRestApiBase
 - 
getRoot
Represents the root resource of this API endpoint ('/').Resources and Methods are added to this resource.
- Specified by:
 getRootin interfaceIRestApi- Specified by:
 getRootin classRestApiBase
 - 
getUrl
The deployed root URL of this REST API. 
 -