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

Class Method Details

.jsii_overridable_methodsObject



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).

Parameters:



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

Note:

Default: "*" returns the execute API ARN for all methods/resources in this API.

Gets the "execute-api" ARN.

Parameters:

  • method (String, nil) (defaults to: nil)

    The method (default *).

  • path (String, nil) (defaults to: nil)

    The resource path.

  • stage (String, nil) (defaults to: nil)

    The stage (default *).

Returns:

  • (String)

    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_stageAWSCDK::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

#envAWSCDK::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_deploymentAWSCDK::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

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


11
12
13
# File 'api_gateway/i_rest_api.rb', line 11

def node()
  jsii_get_property("node")
end

#rest_api_idString

The ID of this API Gateway RestApi.

Returns:

  • (String)


47
48
49
# File 'api_gateway/i_rest_api.rb', line 47

def rest_api_id()
  jsii_get_property("restApiId")
end

#rest_api_nameString

The name of this API Gateway RestApi.

Returns:

  • (String)


54
55
56
# File 'api_gateway/i_rest_api.rb', line 54

def rest_api_name()
  jsii_get_property("restApiName")
end

#rest_api_refAWSCDK::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_idString

The resource ID of the root resource.

Returns:

  • (String)


61
62
63
# File 'api_gateway/i_rest_api.rb', line 61

def rest_api_root_resource_id()
  jsii_get_property("restApiRootResourceId")
end

#rootAWSCDK::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

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



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