#[non_exhaustive]pub struct ListLogsGetOptionalParams {
pub filter_query: Option<String>,
pub filter_indexes: Option<Vec<String>>,
pub filter_from: Option<DateTime<Utc>>,
pub filter_to: Option<DateTime<Utc>>,
pub filter_storage_tier: Option<LogsStorageTier>,
pub sort: Option<LogsSort>,
pub page_cursor: Option<String>,
pub page_limit: Option<i32>,
}
Expand description
ListLogsGetOptionalParams is a struct for passing parameters to the method LogsAPI::list_logs_get
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.filter_query: Option<String>
Search query following logs syntax.
filter_indexes: Option<Vec<String>>
For customers with multiple indexes, the indexes to search. Defaults to ‘*’ which means all indexes
filter_from: Option<DateTime<Utc>>
Minimum timestamp for requested logs.
filter_to: Option<DateTime<Utc>>
Maximum timestamp for requested logs.
filter_storage_tier: Option<LogsStorageTier>
Specifies the storage type to be used
sort: Option<LogsSort>
Order of logs in results.
page_cursor: Option<String>
List following results with a cursor provided in the previous query.
page_limit: Option<i32>
Maximum number of logs in the response.
Implementations§
Source§impl ListLogsGetOptionalParams
impl ListLogsGetOptionalParams
Sourcepub fn filter_query(self, value: String) -> Self
pub fn filter_query(self, value: String) -> Self
Search query following logs syntax.
Examples found in repository?
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = LogsAPI::with_config(configuration);
11 let resp = api
12 .list_logs_get(
13 ListLogsGetOptionalParams::default()
14 .filter_query("datadog-agent".to_string())
15 .filter_indexes(vec!["main".to_string()])
16 .filter_from(
17 DateTime::parse_from_rfc3339("2020-09-17T11:48:36+01:00")
18 .expect("Failed to parse datetime")
19 .with_timezone(&Utc),
20 )
21 .filter_to(
22 DateTime::parse_from_rfc3339("2020-09-17T12:48:36+01:00")
23 .expect("Failed to parse datetime")
24 .with_timezone(&Utc),
25 )
26 .page_limit(5),
27 )
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub fn filter_indexes(self, value: Vec<String>) -> Self
pub fn filter_indexes(self, value: Vec<String>) -> Self
For customers with multiple indexes, the indexes to search. Defaults to ‘*’ which means all indexes
Examples found in repository?
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = LogsAPI::with_config(configuration);
11 let resp = api
12 .list_logs_get(
13 ListLogsGetOptionalParams::default()
14 .filter_query("datadog-agent".to_string())
15 .filter_indexes(vec!["main".to_string()])
16 .filter_from(
17 DateTime::parse_from_rfc3339("2020-09-17T11:48:36+01:00")
18 .expect("Failed to parse datetime")
19 .with_timezone(&Utc),
20 )
21 .filter_to(
22 DateTime::parse_from_rfc3339("2020-09-17T12:48:36+01:00")
23 .expect("Failed to parse datetime")
24 .with_timezone(&Utc),
25 )
26 .page_limit(5),
27 )
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub fn filter_from(self, value: DateTime<Utc>) -> Self
pub fn filter_from(self, value: DateTime<Utc>) -> Self
Minimum timestamp for requested logs.
Examples found in repository?
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = LogsAPI::with_config(configuration);
11 let resp = api
12 .list_logs_get(
13 ListLogsGetOptionalParams::default()
14 .filter_query("datadog-agent".to_string())
15 .filter_indexes(vec!["main".to_string()])
16 .filter_from(
17 DateTime::parse_from_rfc3339("2020-09-17T11:48:36+01:00")
18 .expect("Failed to parse datetime")
19 .with_timezone(&Utc),
20 )
21 .filter_to(
22 DateTime::parse_from_rfc3339("2020-09-17T12:48:36+01:00")
23 .expect("Failed to parse datetime")
24 .with_timezone(&Utc),
25 )
26 .page_limit(5),
27 )
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub fn filter_to(self, value: DateTime<Utc>) -> Self
pub fn filter_to(self, value: DateTime<Utc>) -> Self
Maximum timestamp for requested logs.
Examples found in repository?
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = LogsAPI::with_config(configuration);
11 let resp = api
12 .list_logs_get(
13 ListLogsGetOptionalParams::default()
14 .filter_query("datadog-agent".to_string())
15 .filter_indexes(vec!["main".to_string()])
16 .filter_from(
17 DateTime::parse_from_rfc3339("2020-09-17T11:48:36+01:00")
18 .expect("Failed to parse datetime")
19 .with_timezone(&Utc),
20 )
21 .filter_to(
22 DateTime::parse_from_rfc3339("2020-09-17T12:48:36+01:00")
23 .expect("Failed to parse datetime")
24 .with_timezone(&Utc),
25 )
26 .page_limit(5),
27 )
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub fn filter_storage_tier(self, value: LogsStorageTier) -> Self
pub fn filter_storage_tier(self, value: LogsStorageTier) -> Self
Specifies the storage type to be used
Sourcepub fn page_cursor(self, value: String) -> Self
pub fn page_cursor(self, value: String) -> Self
List following results with a cursor provided in the previous query.
Sourcepub fn page_limit(self, value: i32) -> Self
pub fn page_limit(self, value: i32) -> Self
Maximum number of logs in the response.
Examples found in repository?
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = LogsAPI::with_config(configuration);
12 let response =
13 api.list_logs_get_with_pagination(ListLogsGetOptionalParams::default().page_limit(2));
14 pin_mut!(response);
15 while let Some(resp) = response.next().await {
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21 }
22}
More examples
8async fn main() {
9 let configuration = datadog::Configuration::new();
10 let api = LogsAPI::with_config(configuration);
11 let resp = api
12 .list_logs_get(
13 ListLogsGetOptionalParams::default()
14 .filter_query("datadog-agent".to_string())
15 .filter_indexes(vec!["main".to_string()])
16 .filter_from(
17 DateTime::parse_from_rfc3339("2020-09-17T11:48:36+01:00")
18 .expect("Failed to parse datetime")
19 .with_timezone(&Utc),
20 )
21 .filter_to(
22 DateTime::parse_from_rfc3339("2020-09-17T12:48:36+01:00")
23 .expect("Failed to parse datetime")
24 .with_timezone(&Utc),
25 )
26 .page_limit(5),
27 )
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Trait Implementations§
Source§impl Clone for ListLogsGetOptionalParams
impl Clone for ListLogsGetOptionalParams
Source§fn clone(&self) -> ListLogsGetOptionalParams
fn clone(&self) -> ListLogsGetOptionalParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more