Class: AWSCDK::CloudWatch::LogQueryWidgetProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::LogQueryWidgetProps
- Defined in:
- cloud_watch/log_query_widget_props.rb
Overview
Properties for a Query widget.
Instance Attribute Summary collapse
-
#account_id ⇒ String?
readonly
The AWS account ID where the log groups are located.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#log_group_names ⇒ Array<String>
readonly
Names of log groups to query.
-
#query_language ⇒ AWSCDK::CloudWatch::LogQueryLanguage?
readonly
The query language to use for the query.
-
#query_lines ⇒ Array<String>?
readonly
A sequence of lines to use to build the query.
-
#query_string ⇒ String?
readonly
Full query string for log insights.
-
#region ⇒ String?
readonly
The region the metrics of this widget should be taken from.
-
#title ⇒ String?
readonly
Title for the widget.
-
#view ⇒ AWSCDK::CloudWatch::LogQueryVisualizationType?
readonly
The type of view to use.
-
#width ⇒ Numeric?
readonly
Width of the widget, in a grid of 24 units wide.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(log_group_names:, account_id: nil, height: nil, query_language: nil, query_lines: nil, query_string: nil, region: nil, title: nil, view: nil, width: nil) ⇒ LogQueryWidgetProps
constructor
A new instance of LogQueryWidgetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(log_group_names:, account_id: nil, height: nil, query_language: nil, query_lines: nil, query_string: nil, region: nil, title: nil, view: nil, width: nil) ⇒ LogQueryWidgetProps
Returns a new instance of LogQueryWidgetProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'cloud_watch/log_query_widget_props.rb', line 17 def initialize(log_group_names:, account_id: nil, height: nil, query_language: nil, query_lines: nil, query_string: nil, region: nil, title: nil, view: nil, width: nil) @log_group_names = log_group_names Jsii::Type.check_type(@log_group_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "logGroupNames") @account_id = account_id Jsii::Type.check_type(@account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountId") unless @account_id.nil? @height = height Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil? @query_language = query_language Jsii::Type.check_type(@query_language, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Mb2dRdWVyeUxhbmd1YWdlIn0=")), "queryLanguage") unless @query_language.nil? @query_lines = query_lines Jsii::Type.check_type(@query_lines, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "queryLines") unless @query_lines.nil? @query_string = query_string Jsii::Type.check_type(@query_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryString") unless @query_string.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @title = title Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title") unless @title.nil? @view = view Jsii::Type.check_type(@view, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Mb2dRdWVyeVZpc3VhbGl6YXRpb25UeXBlIn0=")), "view") unless @view.nil? @width = width Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil? end |
Instance Attribute Details
#account_id ⇒ String? (readonly)
Default: - Current account
The AWS account ID where the log groups are located.
This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account.
For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
55 56 57 |
# File 'cloud_watch/log_query_widget_props.rb', line 55 def account_id @account_id end |
#height ⇒ Numeric? (readonly)
Default: 6
Height of the widget.
60 61 62 |
# File 'cloud_watch/log_query_widget_props.rb', line 60 def height @height end |
#log_group_names ⇒ Array<String> (readonly)
Names of log groups to query.
43 44 45 |
# File 'cloud_watch/log_query_widget_props.rb', line 43 def log_group_names @log_group_names end |
#query_language ⇒ AWSCDK::CloudWatch::LogQueryLanguage? (readonly)
Default: LogQueryLanguage.LOGS_INSIGHTS
The query language to use for the query.
65 66 67 |
# File 'cloud_watch/log_query_widget_props.rb', line 65 def query_language @query_language end |
#query_lines ⇒ Array<String>? (readonly)
Default: - Exactly one of queryString, queryLines is required.
A sequence of lines to use to build the query.
The query will be built by joining the lines together using \n|.
72 73 74 |
# File 'cloud_watch/log_query_widget_props.rb', line 72 def query_lines @query_lines end |
#query_string ⇒ String? (readonly)
Default: - Exactly one of queryString, queryLines is required.
Full query string for log insights.
Be sure to prepend every new line with a newline and pipe character
(\n|).
80 81 82 |
# File 'cloud_watch/log_query_widget_props.rb', line 80 def query_string @query_string end |
#region ⇒ String? (readonly)
Default: Current region
The region the metrics of this widget should be taken from.
85 86 87 |
# File 'cloud_watch/log_query_widget_props.rb', line 85 def region @region end |
#title ⇒ String? (readonly)
Default: No title
Title for the widget.
90 91 92 |
# File 'cloud_watch/log_query_widget_props.rb', line 90 def title @title end |
#view ⇒ AWSCDK::CloudWatch::LogQueryVisualizationType? (readonly)
Default: LogQueryVisualizationType.TABLE
The type of view to use.
95 96 97 |
# File 'cloud_watch/log_query_widget_props.rb', line 95 def view @view end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
100 101 102 |
# File 'cloud_watch/log_query_widget_props.rb', line 100 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'cloud_watch/log_query_widget_props.rb', line 102 def self.jsii_properties { :log_group_names => "logGroupNames", :account_id => "accountId", :height => "height", :query_language => "queryLanguage", :query_lines => "queryLines", :query_string => "queryString", :region => "region", :title => "title", :view => "view", :width => "width", } end |
Instance Method Details
#to_jsii ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'cloud_watch/log_query_widget_props.rb', line 117 def to_jsii result = {} result.merge!({ "logGroupNames" => @log_group_names, "accountId" => @account_id, "height" => @height, "queryLanguage" => @query_language, "queryLines" => @query_lines, "queryString" => @query_string, "region" => @region, "title" => @title, "view" => @view, "width" => @width, }) result.compact end |