Class CfnRestApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.apigateway.CfnRestApi
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-12-17T21:37:25.442Z")
@Stability(Stable)
public class CfnRestApi
extends CfnResource
implements IInspectable, ITaggable
The
AWS::ApiGateway::RestApi
resource creates a REST API.
For more information, see restapi:create in the Amazon API Gateway REST API Reference .
On January 1, 2016, the Swagger Specification was donated to the OpenAPI initiative , becoming the foundation of the OpenAPI Specification.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.apigateway.*; Object body; Object policy; CfnRestApi cfnRestApi = CfnRestApi.Builder.create(this, "MyCfnRestApi") .apiKeySourceType("apiKeySourceType") .binaryMediaTypes(List.of("binaryMediaTypes")) .body(body) .bodyS3Location(S3LocationProperty.builder() .bucket("bucket") .eTag("eTag") .key("key") .version("version") .build()) .cloneFrom("cloneFrom") .description("description") .disableExecuteApiEndpoint(false) .endpointConfiguration(EndpointConfigurationProperty.builder() .types(List.of("types")) .vpcEndpointIds(List.of("vpcEndpointIds")) .build()) .failOnWarnings(false) .minimumCompressionSize(123) .mode("mode") .name("name") .parameters(Map.of( "parametersKey", "parameters")) .policy(policy) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnRestApi
.static interface
TheEndpointConfiguration
property type specifies the endpoint types of a REST API.static interface
S3Location
is a property of the AWS::ApiGateway::RestApi resource that specifies the Amazon S3 location of a OpenAPI (formerly Swagger) file that defines a set of RESTful APIs in JSON or YAML.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnRestApi
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnRestApi
(software.amazon.jsii.JsiiObjectRef objRef) CfnRestApi
(software.constructs.Construct scope, String id) CfnRestApi
(software.constructs.Construct scope, String id, CfnRestApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe source of the API key for metering requests according to a usage plan.The string identifier of the associated RestApi.The root resource ID for aRestApi
resource, such asa0bc123d4e
.The list of binary media types supported by the RestApi.getBody()
An OpenAPI specification that defines a set of RESTful APIs in JSON format.The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.The ID of the RestApi that you want to clone from.The description of the RestApi.Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint.A list of the endpoint types of the API.A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered.A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API.getMode()
This property applies only when you use OpenAPI to define your REST API.getName()
The name of the RestApi.Custom header parameters as part of the request.A policy document that contains the permissions for theRestApi
resource.getTags()
Tag Manager which manages the tags for this resource.The key-value map of strings.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setApiKeySourceType
(String value) The source of the API key for metering requests according to a usage plan.void
setBinaryMediaTypes
(List<String> value) The list of binary media types supported by the RestApi.void
An OpenAPI specification that defines a set of RESTful APIs in JSON format.void
setBodyS3Location
(IResolvable value) The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.void
The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.void
setCloneFrom
(String value) The ID of the RestApi that you want to clone from.void
setDescription
(String value) The description of the RestApi.void
Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint.void
Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint.void
A list of the endpoint types of the API.void
A list of the endpoint types of the API.void
setFailOnWarnings
(Boolean value) A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered.void
setFailOnWarnings
(IResolvable value) A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered.void
setMinimumCompressionSize
(Number value) A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API.void
This property applies only when you use OpenAPI to define your REST API.void
The name of the RestApi.void
setParameters
(Map<String, String> value) Custom header parameters as part of the request.void
setParameters
(IResolvable value) Custom header parameters as part of the request.void
A policy document that contains the permissions for theRestApi
resource.void
setTagsRaw
(List<CfnTag> value) The key-value map of strings.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRestApi
protected CfnRestApi(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRestApi
protected CfnRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRestApi
@Stability(Stable) public CfnRestApi(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnRestApiProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties.
-
CfnRestApi
@Stability(Stable) public CfnRestApi(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrRestApiId
The string identifier of the associated RestApi. -
getAttrRootResourceId
The root resource ID for aRestApi
resource, such asa0bc123d4e
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getApiKeySourceType
The source of the API key for metering requests according to a usage plan. -
setApiKeySourceType
The source of the API key for metering requests according to a usage plan. -
getBinaryMediaTypes
The list of binary media types supported by the RestApi. -
setBinaryMediaTypes
The list of binary media types supported by the RestApi. -
getBody
An OpenAPI specification that defines a set of RESTful APIs in JSON format. -
setBody
An OpenAPI specification that defines a set of RESTful APIs in JSON format. -
getBodyS3Location
The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format. -
setBodyS3Location
The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format. -
setBodyS3Location
The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format. -
getCloneFrom
The ID of the RestApi that you want to clone from. -
setCloneFrom
The ID of the RestApi that you want to clone from. -
getDescription
The description of the RestApi. -
setDescription
The description of the RestApi. -
getDisableExecuteApiEndpoint
Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint. -
setDisableExecuteApiEndpoint
Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint. -
setDisableExecuteApiEndpoint
Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint. -
getEndpointConfiguration
A list of the endpoint types of the API. -
setEndpointConfiguration
A list of the endpoint types of the API. -
setEndpointConfiguration
@Stability(Stable) public void setEndpointConfiguration(@Nullable CfnRestApi.EndpointConfigurationProperty value) A list of the endpoint types of the API. -
getFailOnWarnings
A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered. -
setFailOnWarnings
A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered. -
setFailOnWarnings
A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered. -
getMinimumCompressionSize
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. -
setMinimumCompressionSize
A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. -
getMode
This property applies only when you use OpenAPI to define your REST API. -
setMode
This property applies only when you use OpenAPI to define your REST API. -
getName
The name of the RestApi. -
setName
The name of the RestApi. -
getParameters
Custom header parameters as part of the request. -
setParameters
Custom header parameters as part of the request. -
setParameters
Custom header parameters as part of the request. -
getPolicy
A policy document that contains the permissions for theRestApi
resource. -
setPolicy
A policy document that contains the permissions for theRestApi
resource. -
getTagsRaw
The key-value map of strings. -
setTagsRaw
The key-value map of strings.
-