Class: AWSCDK::APIGateway::CfnStage::MethodSettingProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/cfn_stage.rb

Overview

The MethodSetting property type configures settings for all methods in a stage.

The MethodSettings property of the AWS::ApiGateway::Stage resource contains a list of MethodSetting property types.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache_data_encrypted: nil, cache_ttl_in_seconds: nil, caching_enabled: nil, data_trace_enabled: nil, http_method: nil, logging_level: nil, metrics_enabled: nil, resource_path: nil, throttling_burst_limit: nil, throttling_rate_limit: nil) ⇒ MethodSettingProperty

Returns a new instance of MethodSettingProperty.

Parameters:

  • cache_data_encrypted (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether the cached responses are encrypted.

  • cache_ttl_in_seconds (Numeric, nil) (defaults to: nil)

    Specifies the time to live (TTL), in seconds, for cached responses.

  • caching_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether responses should be cached and returned for requests.

  • data_trace_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs.

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

    The HTTP method.

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

    Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs.

  • metrics_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether Amazon CloudWatch metrics are enabled for this method.

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

    The resource path for this method.

  • throttling_burst_limit (Numeric, nil) (defaults to: nil)

    Specifies the throttling burst limit.

  • throttling_rate_limit (Numeric, nil) (defaults to: nil)

    Specifies the throttling rate limit.



796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'api_gateway/cfn_stage.rb', line 796

def initialize(cache_data_encrypted: nil, cache_ttl_in_seconds: nil, caching_enabled: nil, data_trace_enabled: nil, http_method: nil, logging_level: nil, metrics_enabled: nil, resource_path: nil, throttling_burst_limit: nil, throttling_rate_limit: nil)
  @cache_data_encrypted = cache_data_encrypted
  Jsii::Type.check_type(@cache_data_encrypted, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "cacheDataEncrypted") unless @cache_data_encrypted.nil?
  @cache_ttl_in_seconds = cache_ttl_in_seconds
  Jsii::Type.check_type(@cache_ttl_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cacheTtlInSeconds") unless @cache_ttl_in_seconds.nil?
  @caching_enabled = caching_enabled
  Jsii::Type.check_type(@caching_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "cachingEnabled") unless @caching_enabled.nil?
  @data_trace_enabled = data_trace_enabled
  Jsii::Type.check_type(@data_trace_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "dataTraceEnabled") unless @data_trace_enabled.nil?
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpMethod") unless @http_method.nil?
  @logging_level = logging_level
  Jsii::Type.check_type(@logging_level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "loggingLevel") unless @logging_level.nil?
  @metrics_enabled = metrics_enabled
  Jsii::Type.check_type(@metrics_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "metricsEnabled") unless @metrics_enabled.nil?
  @resource_path = resource_path
  Jsii::Type.check_type(@resource_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourcePath") unless @resource_path.nil?
  @throttling_burst_limit = throttling_burst_limit
  Jsii::Type.check_type(@throttling_burst_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throttlingBurstLimit") unless @throttling_burst_limit.nil?
  @throttling_rate_limit = throttling_rate_limit
  Jsii::Type.check_type(@throttling_rate_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "throttlingRateLimit") unless @throttling_rate_limit.nil?
end

Instance Attribute Details

#cache_data_encryptedBoolean, ... (readonly)

Specifies whether the cached responses are encrypted.



823
824
825
# File 'api_gateway/cfn_stage.rb', line 823

def cache_data_encrypted
  @cache_data_encrypted
end

#cache_ttl_in_secondsNumeric? (readonly)

Specifies the time to live (TTL), in seconds, for cached responses.

The higher the TTL, the longer the response will be cached.



830
831
832
# File 'api_gateway/cfn_stage.rb', line 830

def cache_ttl_in_seconds
  @cache_ttl_in_seconds
end

#caching_enabledBoolean, ... (readonly)

Specifies whether responses should be cached and returned for requests.

A cache cluster must be enabled on the stage for responses to be cached.



837
838
839
# File 'api_gateway/cfn_stage.rb', line 837

def caching_enabled
  @caching_enabled
end

#data_trace_enabledBoolean, ... (readonly)

Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs.

This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don't enable this option for production APIs.



844
845
846
# File 'api_gateway/cfn_stage.rb', line 844

def data_trace_enabled
  @data_trace_enabled
end

#http_methodString? (readonly)

The HTTP method.

To apply settings to multiple resources and methods, specify an asterisk ( * ) for the HttpMethod and /* for the ResourcePath . This parameter is required when you specify a MethodSetting .



851
852
853
# File 'api_gateway/cfn_stage.rb', line 851

def http_method
  @http_method
end

#logging_levelString? (readonly)

Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs.

Valid values are OFF , ERROR , and INFO . Choose ERROR to write only error-level entries to CloudWatch Logs, or choose INFO to include all ERROR events as well as extra informational events.



858
859
860
# File 'api_gateway/cfn_stage.rb', line 858

def logging_level
  @logging_level
end

#metrics_enabledBoolean, ... (readonly)

Specifies whether Amazon CloudWatch metrics are enabled for this method.



863
864
865
# File 'api_gateway/cfn_stage.rb', line 863

def metrics_enabled
  @metrics_enabled
end

#resource_pathString? (readonly)

The resource path for this method.

Forward slashes ( / ) are encoded as ~1 and the initial slash must include a forward slash. For example, the path value /resource/subresource must be encoded as /~1resource~1subresource . To specify the root path, use only a slash ( / ). To apply settings to multiple resources and methods, specify an asterisk ( * ) for the HttpMethod and /* for the ResourcePath . This parameter is required when you specify a MethodSetting .



870
871
872
# File 'api_gateway/cfn_stage.rb', line 870

def resource_path
  @resource_path
end

#throttling_burst_limitNumeric? (readonly)

Specifies the throttling burst limit.



875
876
877
# File 'api_gateway/cfn_stage.rb', line 875

def throttling_burst_limit
  @throttling_burst_limit
end

#throttling_rate_limitNumeric? (readonly)

Specifies the throttling rate limit.



880
881
882
# File 'api_gateway/cfn_stage.rb', line 880

def throttling_rate_limit
  @throttling_rate_limit
end

Class Method Details

.jsii_propertiesObject



882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'api_gateway/cfn_stage.rb', line 882

def self.jsii_properties
  {
    :cache_data_encrypted => "cacheDataEncrypted",
    :cache_ttl_in_seconds => "cacheTtlInSeconds",
    :caching_enabled => "cachingEnabled",
    :data_trace_enabled => "dataTraceEnabled",
    :http_method => "httpMethod",
    :logging_level => "loggingLevel",
    :metrics_enabled => "metricsEnabled",
    :resource_path => "resourcePath",
    :throttling_burst_limit => "throttlingBurstLimit",
    :throttling_rate_limit => "throttlingRateLimit",
  }
end

Instance Method Details

#to_jsiiObject



897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
# File 'api_gateway/cfn_stage.rb', line 897

def to_jsii
  result = {}
  result.merge!({
    "cacheDataEncrypted" => @cache_data_encrypted,
    "cacheTtlInSeconds" => @cache_ttl_in_seconds,
    "cachingEnabled" => @caching_enabled,
    "dataTraceEnabled" => @data_trace_enabled,
    "httpMethod" => @http_method,
    "loggingLevel" => @logging_level,
    "metricsEnabled" => @metrics_enabled,
    "resourcePath" => @resource_path,
    "throttlingBurstLimit" => @throttling_burst_limit,
    "throttlingRateLimit" => @throttling_rate_limit,
  })
  result.compact
end