aws_sdk_cloudwatchlogs/operation/start_query/_start_query_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct StartQueryInput {
6 /// <p>Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html">Supported query languages</a>.</p>
7 pub query_language: ::std::option::Option<crate::types::QueryLanguage>,
8 /// <p>The log group on which to perform the query.</p><note>
9 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
10 /// </note>
11 pub log_group_name: ::std::option::Option<::std::string::String>,
12 /// <p>The list of log groups to be queried. You can include up to 50 log groups.</p><note>
13 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
14 /// </note>
15 pub log_group_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16 /// <p>The list of log groups to query. You can include up to 50 log groups.</p>
17 /// <p>You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.</p>
18 /// <p>If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
19 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
20 pub log_group_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21 /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
22 pub start_time: ::std::option::Option<i64>,
23 /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
24 pub end_time: ::std::option::Option<i64>,
25 /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
26 pub query_string: ::std::option::Option<::std::string::String>,
27 /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 10,000.</p>
28 pub limit: ::std::option::Option<i32>,
29}
30impl StartQueryInput {
31 /// <p>Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html">Supported query languages</a>.</p>
32 pub fn query_language(&self) -> ::std::option::Option<&crate::types::QueryLanguage> {
33 self.query_language.as_ref()
34 }
35 /// <p>The log group on which to perform the query.</p><note>
36 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
37 /// </note>
38 pub fn log_group_name(&self) -> ::std::option::Option<&str> {
39 self.log_group_name.as_deref()
40 }
41 /// <p>The list of log groups to be queried. You can include up to 50 log groups.</p><note>
42 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
43 /// </note>
44 ///
45 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_group_names.is_none()`.
46 pub fn log_group_names(&self) -> &[::std::string::String] {
47 self.log_group_names.as_deref().unwrap_or_default()
48 }
49 /// <p>The list of log groups to query. You can include up to 50 log groups.</p>
50 /// <p>You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.</p>
51 /// <p>If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
52 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
53 ///
54 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_group_identifiers.is_none()`.
55 pub fn log_group_identifiers(&self) -> &[::std::string::String] {
56 self.log_group_identifiers.as_deref().unwrap_or_default()
57 }
58 /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
59 pub fn start_time(&self) -> ::std::option::Option<i64> {
60 self.start_time
61 }
62 /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
63 pub fn end_time(&self) -> ::std::option::Option<i64> {
64 self.end_time
65 }
66 /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
67 pub fn query_string(&self) -> ::std::option::Option<&str> {
68 self.query_string.as_deref()
69 }
70 /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 10,000.</p>
71 pub fn limit(&self) -> ::std::option::Option<i32> {
72 self.limit
73 }
74}
75impl StartQueryInput {
76 /// Creates a new builder-style object to manufacture [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
77 pub fn builder() -> crate::operation::start_query::builders::StartQueryInputBuilder {
78 crate::operation::start_query::builders::StartQueryInputBuilder::default()
79 }
80}
81
82/// A builder for [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct StartQueryInputBuilder {
86 pub(crate) query_language: ::std::option::Option<crate::types::QueryLanguage>,
87 pub(crate) log_group_name: ::std::option::Option<::std::string::String>,
88 pub(crate) log_group_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
89 pub(crate) log_group_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
90 pub(crate) start_time: ::std::option::Option<i64>,
91 pub(crate) end_time: ::std::option::Option<i64>,
92 pub(crate) query_string: ::std::option::Option<::std::string::String>,
93 pub(crate) limit: ::std::option::Option<i32>,
94}
95impl StartQueryInputBuilder {
96 /// <p>Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html">Supported query languages</a>.</p>
97 pub fn query_language(mut self, input: crate::types::QueryLanguage) -> Self {
98 self.query_language = ::std::option::Option::Some(input);
99 self
100 }
101 /// <p>Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html">Supported query languages</a>.</p>
102 pub fn set_query_language(mut self, input: ::std::option::Option<crate::types::QueryLanguage>) -> Self {
103 self.query_language = input;
104 self
105 }
106 /// <p>Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html">Supported query languages</a>.</p>
107 pub fn get_query_language(&self) -> &::std::option::Option<crate::types::QueryLanguage> {
108 &self.query_language
109 }
110 /// <p>The log group on which to perform the query.</p><note>
111 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
112 /// </note>
113 pub fn log_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.log_group_name = ::std::option::Option::Some(input.into());
115 self
116 }
117 /// <p>The log group on which to perform the query.</p><note>
118 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
119 /// </note>
120 pub fn set_log_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.log_group_name = input;
122 self
123 }
124 /// <p>The log group on which to perform the query.</p><note>
125 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
126 /// </note>
127 pub fn get_log_group_name(&self) -> &::std::option::Option<::std::string::String> {
128 &self.log_group_name
129 }
130 /// Appends an item to `log_group_names`.
131 ///
132 /// To override the contents of this collection use [`set_log_group_names`](Self::set_log_group_names).
133 ///
134 /// <p>The list of log groups to be queried. You can include up to 50 log groups.</p><note>
135 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
136 /// </note>
137 pub fn log_group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 let mut v = self.log_group_names.unwrap_or_default();
139 v.push(input.into());
140 self.log_group_names = ::std::option::Option::Some(v);
141 self
142 }
143 /// <p>The list of log groups to be queried. You can include up to 50 log groups.</p><note>
144 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
145 /// </note>
146 pub fn set_log_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
147 self.log_group_names = input;
148 self
149 }
150 /// <p>The list of log groups to be queried. You can include up to 50 log groups.</p><note>
151 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
152 /// </note>
153 pub fn get_log_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
154 &self.log_group_names
155 }
156 /// Appends an item to `log_group_identifiers`.
157 ///
158 /// To override the contents of this collection use [`set_log_group_identifiers`](Self::set_log_group_identifiers).
159 ///
160 /// <p>The list of log groups to query. You can include up to 50 log groups.</p>
161 /// <p>You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.</p>
162 /// <p>If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
163 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
164 pub fn log_group_identifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 let mut v = self.log_group_identifiers.unwrap_or_default();
166 v.push(input.into());
167 self.log_group_identifiers = ::std::option::Option::Some(v);
168 self
169 }
170 /// <p>The list of log groups to query. You can include up to 50 log groups.</p>
171 /// <p>You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.</p>
172 /// <p>If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
173 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
174 pub fn set_log_group_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
175 self.log_group_identifiers = input;
176 self
177 }
178 /// <p>The list of log groups to query. You can include up to 50 log groups.</p>
179 /// <p>You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.</p>
180 /// <p>If you specify an ARN, use the format arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> Don't include an * at the end.</p>
181 /// <p>A <code>StartQuery</code> operation must include exactly one of the following parameters: <code>logGroupName</code>, <code>logGroupNames</code>, or <code>logGroupIdentifiers</code>. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the <code>querystring</code> instead of here.</p>
182 pub fn get_log_group_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
183 &self.log_group_identifiers
184 }
185 /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
186 /// This field is required.
187 pub fn start_time(mut self, input: i64) -> Self {
188 self.start_time = ::std::option::Option::Some(input);
189 self
190 }
191 /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
192 pub fn set_start_time(mut self, input: ::std::option::Option<i64>) -> Self {
193 self.start_time = input;
194 self
195 }
196 /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
197 pub fn get_start_time(&self) -> &::std::option::Option<i64> {
198 &self.start_time
199 }
200 /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
201 /// This field is required.
202 pub fn end_time(mut self, input: i64) -> Self {
203 self.end_time = ::std::option::Option::Some(input);
204 self
205 }
206 /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
207 pub fn set_end_time(mut self, input: ::std::option::Option<i64>) -> Self {
208 self.end_time = input;
209 self
210 }
211 /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since <code>January 1, 1970, 00:00:00 UTC</code>.</p>
212 pub fn get_end_time(&self) -> &::std::option::Option<i64> {
213 &self.end_time
214 }
215 /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
216 /// This field is required.
217 pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.query_string = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
222 pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.query_string = input;
224 self
225 }
226 /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
227 pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
228 &self.query_string
229 }
230 /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 10,000.</p>
231 pub fn limit(mut self, input: i32) -> Self {
232 self.limit = ::std::option::Option::Some(input);
233 self
234 }
235 /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 10,000.</p>
236 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
237 self.limit = input;
238 self
239 }
240 /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 10,000.</p>
241 pub fn get_limit(&self) -> &::std::option::Option<i32> {
242 &self.limit
243 }
244 /// Consumes the builder and constructs a [`StartQueryInput`](crate::operation::start_query::StartQueryInput).
245 pub fn build(self) -> ::std::result::Result<crate::operation::start_query::StartQueryInput, ::aws_smithy_types::error::operation::BuildError> {
246 ::std::result::Result::Ok(crate::operation::start_query::StartQueryInput {
247 query_language: self.query_language,
248 log_group_name: self.log_group_name,
249 log_group_names: self.log_group_names,
250 log_group_identifiers: self.log_group_identifiers,
251 start_time: self.start_time,
252 end_time: self.end_time,
253 query_string: self.query_string,
254 limit: self.limit,
255 })
256 }
257}