Module: AWSCDK::APIGateway::IRestAPI
- Includes:
- IResource, Interfaces::AWSApigateway::IRestAPIRef
- Included in:
- RestAPIBase
- Defined in:
- api_gateway/i_rest_api.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#arn_for_execute_api(method = nil, path = nil, stage = nil) ⇒ String
Gets the "execute-api" ARN.
-
#deployment_stage ⇒ AWSCDK::APIGateway::Stage
API Gateway stage that points to the latest deployment (if defined).
- #deployment_stage=(value) ⇒ Object
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#latest_deployment ⇒ AWSCDK::APIGateway::Deployment?
API Gateway deployment that represents the latest changes of the API.
-
#node ⇒ Constructs::Node
The tree node.
-
#rest_api_id ⇒ String
The ID of this API Gateway RestApi.
-
#rest_api_name ⇒ String
The name of this API Gateway RestApi.
-
#rest_api_ref ⇒ AWSCDK::Interfaces::AWSApigateway::RestAPIReference
A reference to a RestApi resource.
-
#rest_api_root_resource_id ⇒ String
The resource ID of the root resource.
-
#root ⇒ AWSCDK::APIGateway::IResource
Represents the root resource ("/") of this API.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'api_gateway/i_rest_api.rb', line 142 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :rest_api_ref => { kind: :property, name: "restApiRef", is_optional: false }, :rest_api_id => { kind: :property, name: "restApiId", is_optional: false }, :rest_api_name => { kind: :property, name: "restApiName", is_optional: false }, :rest_api_root_resource_id => { kind: :property, name: "restApiRootResourceId", is_optional: false }, :root => { kind: :property, name: "root", is_optional: false }, :latest_deployment => { kind: :property, name: "latestDeployment", is_optional: true }, :deployment_stage => { kind: :property, name: "deploymentStage", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :arn_for_execute_api => { kind: :method, name: "arnForExecuteApi", is_optional: false }, } end |
Instance Method Details
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
123 124 125 126 |
# File 'api_gateway/i_rest_api.rb', line 123 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#arn_for_execute_api(method = nil, path = nil, stage = nil) ⇒ String
Default: "*" returns the execute API ARN for all methods/resources in this API.
Gets the "execute-api" ARN.
135 136 137 138 139 140 |
# File 'api_gateway/i_rest_api.rb', line 135 def arn_for_execute_api(method = nil, path = nil, stage = nil) Jsii::Type.check_type(method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "method") unless method.nil? Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless path.nil? Jsii::Type.check_type(stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stage") unless stage.nil? jsii_call_method("arnForExecuteApi", [method, path, stage]) end |
#deployment_stage ⇒ AWSCDK::APIGateway::Stage
API Gateway stage that points to the latest deployment (if defined).
88 89 90 |
# File 'api_gateway/i_rest_api.rb', line 88 def deployment_stage() jsii_get_property("deploymentStage") end |
#deployment_stage=(value) ⇒ Object
92 93 94 95 |
# File 'api_gateway/i_rest_api.rb', line 92 def deployment_stage=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5TdGFnZSJ9")), "deploymentStage") jsii_set_property("deploymentStage", value) end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
26 27 28 |
# File 'api_gateway/i_rest_api.rb', line 26 def env() jsii_get_property("env") end |
#latest_deployment ⇒ AWSCDK::APIGateway::Deployment?
API Gateway deployment that represents the latest changes of the API.
This resource will be automatically updated every time the REST API model changes.
undefined when no deployment is configured.
81 82 83 |
# File 'api_gateway/i_rest_api.rb', line 81 def latest_deployment() jsii_get_property("latestDeployment") end |
#node ⇒ Constructs::Node
The tree node.
11 12 13 |
# File 'api_gateway/i_rest_api.rb', line 11 def node() jsii_get_property("node") end |
#rest_api_id ⇒ String
The ID of this API Gateway RestApi.
47 48 49 |
# File 'api_gateway/i_rest_api.rb', line 47 def rest_api_id() jsii_get_property("restApiId") end |
#rest_api_name ⇒ String
The name of this API Gateway RestApi.
54 55 56 |
# File 'api_gateway/i_rest_api.rb', line 54 def rest_api_name() jsii_get_property("restApiName") end |
#rest_api_ref ⇒ AWSCDK::Interfaces::AWSApigateway::RestAPIReference
A reference to a RestApi resource.
40 41 42 |
# File 'api_gateway/i_rest_api.rb', line 40 def rest_api_ref() jsii_get_property("restApiRef") end |
#rest_api_root_resource_id ⇒ String
The resource ID of the root resource.
61 62 63 |
# File 'api_gateway/i_rest_api.rb', line 61 def rest_api_root_resource_id() jsii_get_property("restApiRootResourceId") end |
#root ⇒ AWSCDK::APIGateway::IResource
Represents the root resource ("/") of this API. Use it to define the API model:.
api.root.addMethod('ANY', redirectToHomePage); // "ANY /" api.root.addResource('friends').addMethod('GET', getFriendsHandler); // "GET /friends"
71 72 73 |
# File 'api_gateway/i_rest_api.rb', line 71 def root() jsii_get_property("root") end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
33 34 35 |
# File 'api_gateway/i_rest_api.rb', line 33 def stack() jsii_get_property("stack") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.
104 105 106 107 108 109 |
# File 'api_gateway/i_rest_api.rb', line 104 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |