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 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
ConstructorsModifierConstructorDescriptionprotectedSpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedSpecRestApi(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, 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, 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
-
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:
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
-