Class: AWSCDK::APIGateway::AccessLogFormat
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::APIGateway::AccessLogFormat
- Defined in:
- api_gateway/access_log_format.rb
Overview
factory methods for access log format.
Class Method Summary collapse
-
.clf ⇒ AWSCDK::APIGateway::AccessLogFormat
Generate Common Log Format.
-
.custom(format) ⇒ AWSCDK::APIGateway::AccessLogFormat
Custom log format.
- .jsii_overridable_methods ⇒ Object
-
.json_with_standard_fields(fields = nil) ⇒ AWSCDK::APIGateway::AccessLogFormat
Access log will be produced in the JSON format with a set of fields most useful in the access log.
Instance Method Summary collapse
-
#initialize(format) ⇒ AccessLogFormat
constructor
A new instance of AccessLogFormat.
-
#to_string ⇒ String
Output a format string to be used with CloudFormation.
Constructor Details
#initialize(format) ⇒ AccessLogFormat
Returns a new instance of AccessLogFormat.
9 10 11 12 |
# File 'api_gateway/access_log_format.rb', line 9 def initialize(format) Jsii::Type.check_type(format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "format") Jsii::Object.instance_method(:initialize).bind(self).call(format) end |
Class Method Details
.clf ⇒ AWSCDK::APIGateway::AccessLogFormat
Generate Common Log Format.
23 24 25 |
# File 'api_gateway/access_log_format.rb', line 23 def self.clf() Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_apigateway.AccessLogFormat", "clf", []) end |
.custom(format) ⇒ AWSCDK::APIGateway::AccessLogFormat
Custom log format.
You can create any log format string. You can easily get the $ context variable by using the methods of AccessLogField.
43 44 45 46 |
# File 'api_gateway/access_log_format.rb', line 43 def self.custom(format) Jsii::Type.check_type(format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "format") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_apigateway.AccessLogFormat", "custom", [format]) end |
.jsii_overridable_methods ⇒ Object
14 15 16 17 18 |
# File 'api_gateway/access_log_format.rb', line 14 def self.jsii_overridable_methods { :to_string => { kind: :method, name: "toString", is_optional: false }, } end |
.json_with_standard_fields(fields = nil) ⇒ AWSCDK::APIGateway::AccessLogFormat
Access log will be produced in the JSON format with a set of fields most useful in the access log.
All fields are turned on by default with the option to turn off specific fields.
55 56 57 58 59 |
# File 'api_gateway/access_log_format.rb', line 55 def self.json_with_standard_fields(fields = nil) fields = fields.is_a?(Hash) ? ::AWSCDK::APIGateway::JsonWithStandardFieldProps.new(**fields.transform_keys(&:to_sym)) : fields Jsii::Type.check_type(fields, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Kc29uV2l0aFN0YW5kYXJkRmllbGRQcm9wcyJ9")), "fields") unless fields.nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_apigateway.AccessLogFormat", "jsonWithStandardFields", [fields]) end |
Instance Method Details
#to_string ⇒ String
Output a format string to be used with CloudFormation.
64 65 66 |
# File 'api_gateway/access_log_format.rb', line 64 def to_string() jsii_call_method("toString", []) end |