@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:47.746Z") public class SpecRestApi extends RestApiBase
Some properties normally accessible on @see {@link 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);
Modifier and Type | Class and Description |
---|---|
static class |
SpecRestApi.Builder
A fluent builder for
SpecRestApi . |
IRestApi.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef) |
|
SpecRestApi(software.constructs.Construct scope,
java.lang.String id,
SpecRestApiProps props) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getRestApiId()
The ID of this API Gateway RestApi.
|
java.lang.String |
getRestApiRootResourceId()
The resource ID of the root resource.
|
IResource |
getRoot()
Represents the root resource of this API endpoint ('/').
|
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
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 SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef)
protected SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public SpecRestApi(software.constructs.Construct scope, java.lang.String id, SpecRestApiProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public java.lang.String getRestApiId()
getRestApiId
in interface IRestApi
getRestApiId
in class RestApiBase
public java.lang.String getRestApiRootResourceId()
getRestApiRootResourceId
in interface IRestApi
getRestApiRootResourceId
in class RestApiBase
public IResource getRoot()
Resources and Methods are added to this resource.
getRoot
in interface IRestApi
getRoot
in class RestApiBase