pub struct AuditAPI { /* private fields */ }Expand description
Search your Audit Logs events over HTTP.
Implementations§
source§impl AuditAPI
impl AuditAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
examples/v2_audit_ListAuditLogs.rs (line 9)
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let resp = api
.list_audit_logs(ListAuditLogsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
examples/v2_audit_ListAuditLogs_1275402458.rs (line 11)
9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let response =
api.list_audit_logs_with_pagination(ListAuditLogsOptionalParams::default().page_limit(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}examples/v2_audit_SearchAuditLogs_3215529662.rs (line 25)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
async fn main() {
let body = AuditLogsSearchEventsRequest::new()
.filter(
AuditLogsQueryFilter::new()
.from("now-15m".to_string())
.to("now".to_string()),
)
.options(AuditLogsQueryOptions::new().timezone("GMT".to_string()))
.page(AuditLogsQueryPageOptions::new().limit(2))
.sort(AuditLogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let response =
api.search_audit_logs_with_pagination(SearchAuditLogsOptionalParams::default().body(body));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}examples/v2_audit_SearchAuditLogs.rs (line 28)
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
async fn main() {
let body = AuditLogsSearchEventsRequest::new()
.filter(
AuditLogsQueryFilter::new()
.from("now-15m".to_string())
.query("@type:session AND @session.type:user".to_string())
.to("now".to_string()),
)
.options(
AuditLogsQueryOptions::new()
.time_offset(0)
.timezone("GMT".to_string()),
)
.page(AuditLogsQueryPageOptions::new().limit(25))
.sort(AuditLogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let resp = api
.search_audit_logs(SearchAuditLogsOptionalParams::default().body(body))
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn list_audit_logs(
&self,
params: ListAuditLogsOptionalParams,
) -> Result<AuditLogsEventsResponse, Error<ListAuditLogsError>>
pub async fn list_audit_logs( &self, params: ListAuditLogsOptionalParams, ) -> Result<AuditLogsEventsResponse, Error<ListAuditLogsError>>
List endpoint returns events that match a Audit Logs search query. Results are paginated.
Use this endpoint to see your latest Audit Logs events.
Examples found in repository?
examples/v2_audit_ListAuditLogs.rs (line 11)
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let resp = api
.list_audit_logs(ListAuditLogsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn list_audit_logs_with_pagination(
&self,
params: ListAuditLogsOptionalParams,
) -> impl Stream<Item = Result<AuditLogsEvent, Error<ListAuditLogsError>>> + '_
pub fn list_audit_logs_with_pagination( &self, params: ListAuditLogsOptionalParams, ) -> impl Stream<Item = Result<AuditLogsEvent, Error<ListAuditLogsError>>> + '_
Examples found in repository?
examples/v2_audit_ListAuditLogs_1275402458.rs (line 13)
9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let response =
api.list_audit_logs_with_pagination(ListAuditLogsOptionalParams::default().page_limit(2));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn list_audit_logs_with_http_info(
&self,
params: ListAuditLogsOptionalParams,
) -> Result<ResponseContent<AuditLogsEventsResponse>, Error<ListAuditLogsError>>
pub async fn list_audit_logs_with_http_info( &self, params: ListAuditLogsOptionalParams, ) -> Result<ResponseContent<AuditLogsEventsResponse>, Error<ListAuditLogsError>>
List endpoint returns events that match a Audit Logs search query. Results are paginated.
Use this endpoint to see your latest Audit Logs events.
sourcepub async fn search_audit_logs(
&self,
params: SearchAuditLogsOptionalParams,
) -> Result<AuditLogsEventsResponse, Error<SearchAuditLogsError>>
pub async fn search_audit_logs( &self, params: SearchAuditLogsOptionalParams, ) -> Result<AuditLogsEventsResponse, Error<SearchAuditLogsError>>
List endpoint returns Audit Logs events that match an Audit search query. Results are paginated.
Use this endpoint to build complex Audit Logs events filtering and search.
Examples found in repository?
examples/v2_audit_SearchAuditLogs.rs (line 30)
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
async fn main() {
let body = AuditLogsSearchEventsRequest::new()
.filter(
AuditLogsQueryFilter::new()
.from("now-15m".to_string())
.query("@type:session AND @session.type:user".to_string())
.to("now".to_string()),
)
.options(
AuditLogsQueryOptions::new()
.time_offset(0)
.timezone("GMT".to_string()),
)
.page(AuditLogsQueryPageOptions::new().limit(25))
.sort(AuditLogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let resp = api
.search_audit_logs(SearchAuditLogsOptionalParams::default().body(body))
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn search_audit_logs_with_pagination(
&self,
params: SearchAuditLogsOptionalParams,
) -> impl Stream<Item = Result<AuditLogsEvent, Error<SearchAuditLogsError>>> + '_
pub fn search_audit_logs_with_pagination( &self, params: SearchAuditLogsOptionalParams, ) -> impl Stream<Item = Result<AuditLogsEvent, Error<SearchAuditLogsError>>> + '_
Examples found in repository?
examples/v2_audit_SearchAuditLogs_3215529662.rs (line 27)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
async fn main() {
let body = AuditLogsSearchEventsRequest::new()
.filter(
AuditLogsQueryFilter::new()
.from("now-15m".to_string())
.to("now".to_string()),
)
.options(AuditLogsQueryOptions::new().timezone("GMT".to_string()))
.page(AuditLogsQueryPageOptions::new().limit(2))
.sort(AuditLogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = AuditAPI::with_config(configuration);
let response =
api.search_audit_logs_with_pagination(SearchAuditLogsOptionalParams::default().body(body));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}sourcepub async fn search_audit_logs_with_http_info(
&self,
params: SearchAuditLogsOptionalParams,
) -> Result<ResponseContent<AuditLogsEventsResponse>, Error<SearchAuditLogsError>>
pub async fn search_audit_logs_with_http_info( &self, params: SearchAuditLogsOptionalParams, ) -> Result<ResponseContent<AuditLogsEventsResponse>, Error<SearchAuditLogsError>>
List endpoint returns Audit Logs events that match an Audit search query. Results are paginated.
Use this endpoint to build complex Audit Logs events filtering and search.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuditAPI
impl !RefUnwindSafe for AuditAPI
impl Send for AuditAPI
impl Sync for AuditAPI
impl Unpin for AuditAPI
impl !UnwindSafe for AuditAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)