Show / Hide Table of Contents

Class RestApiBase

Base implementation that are common to various implementations of IRestApi.

Inheritance
System.Object
Resource
RestApiBase
RestApi
SpecRestApi
Implements
IRestApi
IResource
Constructs.IConstruct
Constructs.IDependable
Inherited Members
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 abstract class RestApiBase : Resource, IRestApi, IResource
Syntax (vb)
Public MustInherit Class RestApiBase
    Inherits Resource
    Implements IRestApi, IResource
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.Route53;
using Amazon.CDK.AWS.Route53.Targets;

RestApi api;
var hostedZoneForExampleCom;


new ARecord(this, "CustomDomainAliasRecord", new ARecordProps {
    Zone = hostedZoneForExampleCom,
    Target = RecordTarget.FromAlias(new ApiGateway(api))
});

Synopsis

Constructors

RestApiBase(ByRefValue)

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

RestApiBase(DeputyBase.DeputyProps)

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

RestApiBase(Construct, String, IRestApiBaseProps)

Properties

CloudWatchAccount
DeploymentStage

API Gateway stage that points to the latest deployment (if defined).

DomainName

The first domain name mapped to this API, if defined through the domainName configuration prop, or added via addDomainName.

LatestDeployment

API Gateway deployment that represents the latest changes of the API.

RestApiId

The ID of this API Gateway RestApi.

RestApiName

A human friendly name for this Rest API.

RestApiRootResourceId

The resource ID of the root resource.

Root

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

Methods

AddApiKey(String, IApiKeyOptions)

Add an ApiKey to the deploymentStage.

AddDomainName(String, IDomainNameOptions)

Defines an API Gateway domain name and maps it to this API.

AddGatewayResponse(String, IGatewayResponseOptions)

Adds a new gateway response.

AddUsagePlan(String, IUsagePlanProps)

Adds a usage plan.

ArnForExecuteApi(String, String, String)

Gets the "execute-api" ARN.

Metric(String, IMetricOptions)

Returns the given named metric for this API.

MetricCacheHitCount(IMetricOptions)

Metric for the number of requests served from the API cache in a given period.

MetricCacheMissCount(IMetricOptions)

Metric for the number of requests served from the backend in a given period, when API caching is enabled.

MetricClientError(IMetricOptions)

Metric for the number of client-side errors captured in a given period.

MetricCount(IMetricOptions)

Metric for the total number API requests in a given period.

MetricIntegrationLatency(IMetricOptions)

Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.

MetricLatency(IMetricOptions)

The time between when API Gateway receives a request from a client and when it returns a response to the client.

MetricServerError(IMetricOptions)

Metric for the number of server-side errors captured in a given period.

UrlForPath(String)

Returns the URL for an HTTP path.

Constructors

RestApiBase(ByRefValue)

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

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

The Javascript-owned object reference

RestApiBase(DeputyBase.DeputyProps)

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

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

The deputy props

RestApiBase(Construct, String, IRestApiBaseProps)

protected RestApiBase(Construct scope, string id, IRestApiBaseProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IRestApiBaseProps

Properties

CloudWatchAccount

protected virtual CfnAccount CloudWatchAccount { get; set; }
Property Value

CfnAccount

DeploymentStage

API Gateway stage that points to the latest deployment (if defined).

public virtual Stage DeploymentStage { get; set; }
Property Value

Stage

Remarks

If deploy is disabled, you will need to explicitly assign this value in order to set up integrations.

DomainName

The first domain name mapped to this API, if defined through the domainName configuration prop, or added via addDomainName.

public virtual DomainName_ DomainName { get; }
Property Value

DomainName_

LatestDeployment

API Gateway deployment that represents the latest changes of the API.

public virtual Deployment LatestDeployment { get; }
Property Value

Deployment

Remarks

This resource will be automatically updated every time the REST API model changes. This will be undefined if deploy is false.

RestApiId

The ID of this API Gateway RestApi.

public abstract string RestApiId { get; }
Property Value

System.String

RestApiName

A human friendly name for this Rest API.

public virtual string RestApiName { get; }
Property Value

System.String

Remarks

Note that this is different from restApiId.

Attribute: true

RestApiRootResourceId

The resource ID of the root resource.

public abstract string RestApiRootResourceId { get; }
Property Value

System.String

Remarks

Attribute: true

Root

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

public abstract IResource Root { get; }
Property Value

IResource

Remarks

Resources and Methods are added to this resource.

Methods

AddApiKey(String, IApiKeyOptions)

Add an ApiKey to the deploymentStage.

public virtual IApiKey AddApiKey(string id, IApiKeyOptions options = null)
Parameters
id System.String
options IApiKeyOptions
Returns

IApiKey

AddDomainName(String, IDomainNameOptions)

Defines an API Gateway domain name and maps it to this API.

public virtual DomainName_ AddDomainName(string id, IDomainNameOptions options)
Parameters
id System.String

The construct id.

options IDomainNameOptions

custom domain options.

Returns

DomainName_

AddGatewayResponse(String, IGatewayResponseOptions)

Adds a new gateway response.

public virtual GatewayResponse AddGatewayResponse(string id, IGatewayResponseOptions options)
Parameters
id System.String
options IGatewayResponseOptions
Returns

GatewayResponse

AddUsagePlan(String, IUsagePlanProps)

Adds a usage plan.

public virtual UsagePlan AddUsagePlan(string id, IUsagePlanProps props = null)
Parameters
id System.String
props IUsagePlanProps
Returns

UsagePlan

ArnForExecuteApi(String, String, String)

Gets the "execute-api" ARN.

public virtual string ArnForExecuteApi(string method = null, string path = null, string stage = null)
Parameters
method System.String
path System.String
stage System.String
Returns

System.String

Metric(String, IMetricOptions)

Returns the given named metric for this API.

public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
metricName System.String
props IMetricOptions
Returns

Metric

MetricCacheHitCount(IMetricOptions)

Metric for the number of requests served from the API cache in a given period.

public virtual Metric MetricCacheHitCount(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sum over 5 minutes

MetricCacheMissCount(IMetricOptions)

Metric for the number of requests served from the backend in a given period, when API caching is enabled.

public virtual Metric MetricCacheMissCount(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sum over 5 minutes

MetricClientError(IMetricOptions)

Metric for the number of client-side errors captured in a given period.

public virtual Metric MetricClientError(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sum over 5 minutes

MetricCount(IMetricOptions)

Metric for the total number API requests in a given period.

public virtual Metric MetricCount(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sample count over 5 minutes

MetricIntegrationLatency(IMetricOptions)

Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.

public virtual Metric MetricIntegrationLatency(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: average over 5 minutes.

MetricLatency(IMetricOptions)

The time between when API Gateway receives a request from a client and when it returns a response to the client.

public virtual Metric MetricLatency(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

The latency includes the integration latency and other API Gateway overhead.

Default: average over 5 minutes.

MetricServerError(IMetricOptions)

Metric for the number of server-side errors captured in a given period.

public virtual Metric MetricServerError(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Default: sum over 5 minutes

UrlForPath(String)

Returns the URL for an HTTP path.

public virtual string UrlForPath(string path = null)
Parameters
path System.String
Returns

System.String

Remarks

Fails if deploymentStage is not set either by deploy or explicitly.

Implements

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