Show / Hide Table of Contents

Class SpecRestApi

Represents a REST API in Amazon API Gateway, created with an OpenAPI specification.

Inheritance
System.Object
Resource
RestApiBase
SpecRestApi
Implements
IRestApi
IResource
Constructs.IConstruct
Constructs.IDependable
Inherited Members
RestApiBase.AddApiKey(String, IApiKeyOptions)
RestApiBase.AddDomainName(String, IDomainNameOptions)
RestApiBase.AddGatewayResponse(String, IGatewayResponseOptions)
RestApiBase.AddUsagePlan(String, IUsagePlanProps)
RestApiBase.ArnForExecuteApi(String, String, String)
RestApiBase.Metric(String, IMetricOptions)
RestApiBase.MetricCacheHitCount(IMetricOptions)
RestApiBase.MetricCacheMissCount(IMetricOptions)
RestApiBase.MetricClientError(IMetricOptions)
RestApiBase.MetricCount(IMetricOptions)
RestApiBase.MetricIntegrationLatency(IMetricOptions)
RestApiBase.MetricLatency(IMetricOptions)
RestApiBase.MetricServerError(IMetricOptions)
RestApiBase.UrlForPath(String)
RestApiBase.RestApiName
RestApiBase.DomainName
RestApiBase.LatestDeployment
RestApiBase.DeploymentStage
RestApiBase.CloudWatchAccount
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SpecRestApi : RestApiBase, IRestApi, IResource
Syntax (vb)
Public Class SpecRestApi
    Inherits RestApiBase
    Implements IRestApi, IResource
Remarks

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.

Resource: AWS::ApiGateway::RestApi

ExampleMetadata: infused

Examples
Integration integration;


var api = new SpecRestApi(this, "books-api", new SpecRestApiProps {
    ApiDefinition = ApiDefinition.FromAsset("path-to-file.json")
});

var booksResource = api.Root.AddResource("books");
booksResource.AddMethod("GET", integration);

Synopsis

Constructors

SpecRestApi(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

SpecRestApi(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

SpecRestApi(Construct, String, ISpecRestApiProps)

Properties

RestApiId

The ID of this API Gateway RestApi.

RestApiRootResourceId

The resource ID of the root resource.

Root

Represents the root resource of this API endpoint ('/').

Constructors

SpecRestApi(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected SpecRestApi(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

SpecRestApi(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected SpecRestApi(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

SpecRestApi(Construct, String, ISpecRestApiProps)

public SpecRestApi(Construct scope, string id, ISpecRestApiProps props)
Parameters
scope Constructs.Construct
id System.String
props ISpecRestApiProps

Properties

RestApiId

The ID of this API Gateway RestApi.

public override string RestApiId { get; }
Property Value

System.String

Overrides
RestApiBase.RestApiId

RestApiRootResourceId

The resource ID of the root resource.

public override string RestApiRootResourceId { get; }
Property Value

System.String

Overrides
RestApiBase.RestApiRootResourceId
Remarks

Attribute: true

Root

Represents the root resource of this API endpoint ('/').

public override IResource Root { get; }
Property Value

IResource

Overrides
RestApiBase.Root
Remarks

Resources and Methods are added to this resource.

Implements

IRestApi
IResource
Constructs.IConstruct
Constructs.IDependable
Back to top Generated by DocFX