Module: AWSCDK::APIGatewayv2::IHttpStage

Includes:
IHttpStageRef, IStage
Included in:
HttpStage
Defined in:
api_gatewayv2/i_http_stage.rb

Overview

Represents the HttpStage.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'api_gatewayv2/i_http_stage.rb', line 208

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 },
    :stage_ref => { kind: :property, name: "stageRef", is_optional: false },
    :stage_name => { kind: :property, name: "stageName", is_optional: false },
    :url => { kind: :property, name: "url", is_optional: false },
    :is_http_stage => { kind: :property, name: "isHttpStage", is_optional: false },
    :api => { kind: :property, name: "api", is_optional: false },
    :domain_url => { kind: :property, name: "domainUrl", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_stage_variable => { kind: :method, name: "addStageVariable", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_client_error => { kind: :method, name: "metricClientError", is_optional: false },
    :metric_count => { kind: :method, name: "metricCount", is_optional: false },
    :metric_data_processed => { kind: :method, name: "metricDataProcessed", is_optional: false },
    :metric_integration_latency => { kind: :method, name: "metricIntegrationLatency", is_optional: false },
    :metric_latency => { kind: :method, name: "metricLatency", is_optional: false },
    :metric_server_error => { kind: :method, name: "metricServerError", is_optional: false },
  }
end

Instance Method Details

#add_stage_variable(name, value) ⇒ void

This method returns an undefined value.

Adds a stage variable to this stage.

Parameters:

  • name (String)

    The name of the stage variable.

  • value (String)

    The value of the stage variable.



121
122
123
124
125
# File 'api_gatewayv2/i_http_stage.rb', line 121

def add_stage_variable(name, value)
  Jsii::Type.check_type(name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
  jsii_call_method("addStageVariable", [name, value])
end

#apiAWSCDK::APIGatewayv2::IHttpAPI

The API this stage is associated to.



74
75
76
# File 'api_gatewayv2/i_http_stage.rb', line 74

def api()
  jsii_get_property("api")
end

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



111
112
113
114
# File 'api_gatewayv2/i_http_stage.rb', line 111

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#domain_urlString

The custom domain URL to this stage.

Returns:

  • (String)


81
82
83
# File 'api_gatewayv2/i_http_stage.rb', line 81

def domain_url()
  jsii_get_property("domainUrl")
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.



27
28
29
# File 'api_gatewayv2/i_http_stage.rb', line 27

def env()
  jsii_get_property("env")
end

#is_http_stageBoolean

Indicates that this is an HTTP Stage.

Will always return true, but is necessary to prevent accidental structural equality in TypeScript.

Returns:

  • (Boolean)


67
68
69
# File 'api_gatewayv2/i_http_stage.rb', line 67

def is_http_stage()
  jsii_get_property("isHttpStage")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - average over 5 minutes

Return the given named metric for this HTTP Api Gateway Stage.

Parameters:

Returns:



133
134
135
136
137
138
# File 'api_gatewayv2/i_http_stage.rb', line 133

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_client_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - sum over 5 minutes

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

Parameters:

Returns:



145
146
147
148
149
# File 'api_gatewayv2/i_http_stage.rb', line 145

def metric_client_error(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricClientError", [props])
end

#metric_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - SampleCount over 5 minutes

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

Parameters:

Returns:



156
157
158
159
160
# File 'api_gatewayv2/i_http_stage.rb', line 156

def metric_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricCount", [props])
end

#metric_data_processed(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - sum over 5 minutes

Metric for the amount of data processed in bytes.

Parameters:

Returns:



167
168
169
170
171
# File 'api_gatewayv2/i_http_stage.rb', line 167

def metric_data_processed(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricDataProcessed", [props])
end

#metric_integration_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - no statistic

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

Parameters:

Returns:



178
179
180
181
182
# File 'api_gatewayv2/i_http_stage.rb', line 178

def metric_integration_latency(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricIntegrationLatency", [props])
end

#metric_latency(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - no statistic

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

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

Parameters:

Returns:



191
192
193
194
195
# File 'api_gatewayv2/i_http_stage.rb', line 191

def metric_latency(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricLatency", [props])
end

#metric_server_error(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Note:

Default: - sum over 5 minutes

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

Parameters:

Returns:



202
203
204
205
206
# File 'api_gatewayv2/i_http_stage.rb', line 202

def metric_server_error(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricServerError", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


12
13
14
# File 'api_gatewayv2/i_http_stage.rb', line 12

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



34
35
36
# File 'api_gatewayv2/i_http_stage.rb', line 34

def stack()
  jsii_get_property("stack")
end

#stage_nameString

The name of the stage;

its primary identifier.

Returns:

  • (String)


50
51
52
# File 'api_gatewayv2/i_http_stage.rb', line 50

def stage_name()
  jsii_get_property("stageName")
end

#stage_refAWSCDK::Interfaces::AWSApigatewayv2::StageReference

A reference to a Stage resource.



41
42
43
# File 'api_gatewayv2/i_http_stage.rb', line 41

def stage_ref()
  jsii_get_property("stageRef")
end

#urlString

The URL to this stage.

Returns:

  • (String)


57
58
59
# File 'api_gatewayv2/i_http_stage.rb', line 57

def url()
  jsii_get_property("url")
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



92
93
94
95
96
97
# File 'api_gatewayv2/i_http_stage.rb', line 92

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