Class SpecRestApi
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.SpecRestApi
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IRestApi
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:45.089Z")
@Stability(Stable)
public class SpecRestApi
extends RestApiBase
Represents a REST API in Amazon API Gateway, created with an OpenAPI specification.
Some properties normally accessible on @see RestApi
- such as the description -
must be declared in the specification. All Resources and Methods need to be defined as
part of the OpenAPI specification file, and cannot be added via the CDK.
By default, the API will automatically be deployed and accessible from a
public endpoint.
Example:
Integration integration; SpecRestApi api = SpecRestApi.Builder.create(this, "books-api") .apiDefinition(ApiDefinition.fromAsset("path-to-file.json")) .build(); Resource booksResource = api.root.addResource("books"); booksResource.addMethod("GET", integration);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apigateway.IRestApi
IRestApi.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
SpecRestApi
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
SpecRestApi
(software.amazon.jsii.JsiiObjectRef objRef) SpecRestApi
(software.constructs.Construct scope, String id, SpecRestApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ID of this API Gateway RestApi.The resource ID of the root resource.getRoot()
Represents the root resource of this API endpoint ('/').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, urlForPath
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
SpecRestApi
protected SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef) -
SpecRestApi
protected SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
SpecRestApi
@Stability(Stable) public SpecRestApi(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull SpecRestApiProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
getRestApiId
The ID of this API Gateway RestApi.- Specified by:
getRestApiId
in interfaceIRestApi
- Specified by:
getRestApiId
in classRestApiBase
-
getRestApiRootResourceId
The resource ID of the root resource.- Specified by:
getRestApiRootResourceId
in interfaceIRestApi
- Specified by:
getRestApiRootResourceId
in classRestApiBase
-
getRoot
Represents the root resource of this API endpoint ('/').Resources and Methods are added to this resource.
- Specified by:
getRoot
in interfaceIRestApi
- Specified by:
getRoot
in classRestApiBase
-