@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.215Z") @Stability(value=Stable) 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. |
software.amazon.jsii.JsiiObject.InitializationModeIRestApi.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
SpecRestApi(software.constructs.Construct scope,
String id,
SpecRestApiProps props) |
protected |
SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getRestApiId()
The ID of this API Gateway RestApi.
|
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, getCloudWatchAccount, getDeploymentStage, getDomainName, getLatestDeployment, getRestApiName, metric, metric, metricCacheHitCount, metricCacheHitCount, metricCacheMissCount, metricCacheMissCount, metricClientError, metricClientError, metricCount, metricCount, metricIntegrationLatency, metricIntegrationLatency, metricLatency, metricLatency, metricServerError, metricServerError, setCloudWatchAccount, setDeploymentStage, urlForPath, urlForPathapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef)
protected SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public SpecRestApi(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
SpecRestApiProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public String getRestApiId()
getRestApiId in interface IRestApigetRestApiId in class RestApiBase@Stability(value=Stable) @NotNull public String getRestApiRootResourceId()
getRestApiRootResourceId in interface IRestApigetRestApiRootResourceId in class RestApiBase@Stability(value=Stable) @NotNull public IResource getRoot()
Resources and Methods are added to this resource.
getRoot in interface IRestApigetRoot in class RestApiBaseCopyright © 2022. All rights reserved.