Struct datadog_api_client::datadogV1::api::api_logs_indexes::LogsIndexesAPI
source · pub struct LogsIndexesAPI { /* private fields */ }Expand description
Manage configuration of log indexes. You need an API and application key with Admin rights to interact with this endpoint.
Implementations§
source§impl LogsIndexesAPI
impl LogsIndexesAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let body = LogsIndexesOrder::new(vec![
"main".to_string(),
"payments".to_string(),
"web".to_string(),
]);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.update_logs_index_order(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
async fn main() {
let body = LogsIndex::new(
LogsFilter::new().query("source:python".to_string()),
"main".to_string(),
)
.daily_limit(300000000)
.daily_limit_reset(
LogsDailyLimitReset::new()
.reset_time("14:00".to_string())
.reset_utc_offset("+02:00".to_string()),
)
.daily_limit_warning_threshold_percentage(70.0 as f64)
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
.num_flex_logs_retention_days(360)
.num_retention_days(15);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.create_logs_index(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
async fn main() {
let body = LogsIndexUpdateRequest::new(LogsFilter::new().query("source:python".to_string()))
.daily_limit(300000000)
.daily_limit_reset(
LogsDailyLimitReset::new()
.reset_time("14:00".to_string())
.reset_utc_offset("+02:00".to_string()),
)
.daily_limit_warning_threshold_percentage(70.0 as f64)
.disable_daily_limit(false)
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
.num_flex_logs_retention_days(360)
.num_retention_days(15);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.update_logs_index("name".to_string(), 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 create_logs_index(
&self,
body: LogsIndex,
) -> Result<LogsIndex, Error<CreateLogsIndexError>>
pub async fn create_logs_index( &self, body: LogsIndex, ) -> Result<LogsIndex, Error<CreateLogsIndexError>>
Creates a new index. Returns the Index object passed in the request body when the request is successful.
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
async fn main() {
let body = LogsIndex::new(
LogsFilter::new().query("source:python".to_string()),
"main".to_string(),
)
.daily_limit(300000000)
.daily_limit_reset(
LogsDailyLimitReset::new()
.reset_time("14:00".to_string())
.reset_utc_offset("+02:00".to_string()),
)
.daily_limit_warning_threshold_percentage(70.0 as f64)
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
.num_flex_logs_retention_days(360)
.num_retention_days(15);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.create_logs_index(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_logs_index_with_http_info(
&self,
body: LogsIndex,
) -> Result<ResponseContent<LogsIndex>, Error<CreateLogsIndexError>>
pub async fn create_logs_index_with_http_info( &self, body: LogsIndex, ) -> Result<ResponseContent<LogsIndex>, Error<CreateLogsIndexError>>
Creates a new index. Returns the Index object passed in the request body when the request is successful.
sourcepub async fn get_logs_index(
&self,
name: String,
) -> Result<LogsIndex, Error<GetLogsIndexError>>
pub async fn get_logs_index( &self, name: String, ) -> Result<LogsIndex, Error<GetLogsIndexError>>
Get one log index from your organization. This endpoint takes no JSON arguments.
sourcepub async fn get_logs_index_with_http_info(
&self,
name: String,
) -> Result<ResponseContent<LogsIndex>, Error<GetLogsIndexError>>
pub async fn get_logs_index_with_http_info( &self, name: String, ) -> Result<ResponseContent<LogsIndex>, Error<GetLogsIndexError>>
Get one log index from your organization. This endpoint takes no JSON arguments.
sourcepub async fn get_logs_index_order(
&self,
) -> Result<LogsIndexesOrder, Error<GetLogsIndexOrderError>>
pub async fn get_logs_index_order( &self, ) -> Result<LogsIndexesOrder, Error<GetLogsIndexOrderError>>
Get the current order of your log indexes. This endpoint takes no JSON arguments.
sourcepub async fn get_logs_index_order_with_http_info(
&self,
) -> Result<ResponseContent<LogsIndexesOrder>, Error<GetLogsIndexOrderError>>
pub async fn get_logs_index_order_with_http_info( &self, ) -> Result<ResponseContent<LogsIndexesOrder>, Error<GetLogsIndexOrderError>>
Get the current order of your log indexes. This endpoint takes no JSON arguments.
sourcepub async fn list_log_indexes(
&self,
) -> Result<LogsIndexListResponse, Error<ListLogIndexesError>>
pub async fn list_log_indexes( &self, ) -> Result<LogsIndexListResponse, Error<ListLogIndexesError>>
The Index object describes the configuration of a log index.
This endpoint returns an array of the LogIndex objects of your organization.
sourcepub async fn list_log_indexes_with_http_info(
&self,
) -> Result<ResponseContent<LogsIndexListResponse>, Error<ListLogIndexesError>>
pub async fn list_log_indexes_with_http_info( &self, ) -> Result<ResponseContent<LogsIndexListResponse>, Error<ListLogIndexesError>>
The Index object describes the configuration of a log index.
This endpoint returns an array of the LogIndex objects of your organization.
sourcepub async fn update_logs_index(
&self,
name: String,
body: LogsIndexUpdateRequest,
) -> Result<LogsIndex, Error<UpdateLogsIndexError>>
pub async fn update_logs_index( &self, name: String, body: LogsIndexUpdateRequest, ) -> Result<LogsIndex, Error<UpdateLogsIndexError>>
Update an index as identified by its name. Returns the Index object passed in the request body when the request is successful.
Using the PUT method updates your index’s configuration by replacing
your current configuration with the new one sent to your Datadog organization.
Examples found in repository?
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
async fn main() {
let body = LogsIndexUpdateRequest::new(LogsFilter::new().query("source:python".to_string()))
.daily_limit(300000000)
.daily_limit_reset(
LogsDailyLimitReset::new()
.reset_time("14:00".to_string())
.reset_utc_offset("+02:00".to_string()),
)
.daily_limit_warning_threshold_percentage(70.0 as f64)
.disable_daily_limit(false)
.exclusion_filters(vec![LogsExclusion::new("payment".to_string())
.filter(LogsExclusionFilter::new(1.0).query("*".to_string()))])
.num_flex_logs_retention_days(360)
.num_retention_days(15);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.update_logs_index("name".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_logs_index_with_http_info(
&self,
name: String,
body: LogsIndexUpdateRequest,
) -> Result<ResponseContent<LogsIndex>, Error<UpdateLogsIndexError>>
pub async fn update_logs_index_with_http_info( &self, name: String, body: LogsIndexUpdateRequest, ) -> Result<ResponseContent<LogsIndex>, Error<UpdateLogsIndexError>>
Update an index as identified by its name. Returns the Index object passed in the request body when the request is successful.
Using the PUT method updates your index’s configuration by replacing
your current configuration with the new one sent to your Datadog organization.
sourcepub async fn update_logs_index_order(
&self,
body: LogsIndexesOrder,
) -> Result<LogsIndexesOrder, Error<UpdateLogsIndexOrderError>>
pub async fn update_logs_index_order( &self, body: LogsIndexesOrder, ) -> Result<LogsIndexesOrder, Error<UpdateLogsIndexOrderError>>
This endpoint updates the index order of your organization. It returns the index order object passed in the request body when the request is successful.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let body = LogsIndexesOrder::new(vec![
"main".to_string(),
"payments".to_string(),
"web".to_string(),
]);
let configuration = datadog::Configuration::new();
let api = LogsIndexesAPI::with_config(configuration);
let resp = api.update_logs_index_order(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_logs_index_order_with_http_info(
&self,
body: LogsIndexesOrder,
) -> Result<ResponseContent<LogsIndexesOrder>, Error<UpdateLogsIndexOrderError>>
pub async fn update_logs_index_order_with_http_info( &self, body: LogsIndexesOrder, ) -> Result<ResponseContent<LogsIndexesOrder>, Error<UpdateLogsIndexOrderError>>
This endpoint updates the index order of your organization. It returns the index order object passed in the request body when the request is successful.
Trait Implementations§
source§impl Clone for LogsIndexesAPI
impl Clone for LogsIndexesAPI
source§fn clone(&self) -> LogsIndexesAPI
fn clone(&self) -> LogsIndexesAPI
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LogsIndexesAPI
impl Debug for LogsIndexesAPI
Auto Trait Implementations§
impl Freeze for LogsIndexesAPI
impl !RefUnwindSafe for LogsIndexesAPI
impl Send for LogsIndexesAPI
impl Sync for LogsIndexesAPI
impl Unpin for LogsIndexesAPI
impl !UnwindSafe for LogsIndexesAPI
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
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)
clone_to_uninit)