Struct datadog_api_client::datadogV2::api::api_logs_archives::LogsArchivesAPI
source · pub struct LogsArchivesAPI { /* private fields */ }Expand description
Archives forward all the logs ingested to a cloud storage system.
See the Archives Page for a list of the archives currently configured in Datadog.
Implementations§
source§impl LogsArchivesAPI
impl LogsArchivesAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
.type_(RolesType::ROLES),
);
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api
.add_read_role_to_archive("archive_id".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 add_read_role_to_archive(
&self,
archive_id: String,
body: RelationshipToRole,
) -> Result<(), Error<AddReadRoleToArchiveError>>
pub async fn add_read_role_to_archive( &self, archive_id: String, body: RelationshipToRole, ) -> Result<(), Error<AddReadRoleToArchiveError>>
Adds a read role to an archive. (Roles API)
Examples found in repository?
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
.type_(RolesType::ROLES),
);
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api
.add_read_role_to_archive("archive_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn add_read_role_to_archive_with_http_info(
&self,
archive_id: String,
body: RelationshipToRole,
) -> Result<ResponseContent<()>, Error<AddReadRoleToArchiveError>>
pub async fn add_read_role_to_archive_with_http_info( &self, archive_id: String, body: RelationshipToRole, ) -> Result<ResponseContent<()>, Error<AddReadRoleToArchiveError>>
Adds a read role to an archive. (Roles API)
sourcepub async fn create_logs_archive(
&self,
body: LogsArchiveCreateRequest,
) -> Result<LogsArchive, Error<CreateLogsArchiveError>>
pub async fn create_logs_archive( &self, body: LogsArchiveCreateRequest, ) -> Result<LogsArchive, Error<CreateLogsArchiveError>>
Create an archive in your organization.
Examples found in repository?
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 38 39 40 41 42 43 44
async fn main() {
let body = LogsArchiveCreateRequest::new().data(
LogsArchiveCreateRequestDefinition::new("archives".to_string()).attributes(
LogsArchiveCreateRequestAttributes::new(
LogsArchiveCreateRequestDestination::LogsArchiveDestinationAzure(Box::new(
LogsArchiveDestinationAzure::new(
"container-name".to_string(),
LogsArchiveIntegrationAzure::new(
"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
),
"account-name".to_string(),
LogsArchiveDestinationAzureType::AZURE,
),
)),
"Nginx Archive".to_string(),
"source:nginx".to_string(),
)
.include_tags(false)
.rehydration_max_scan_size_in_gb(Some(100))
.rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]),
),
);
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api.create_logs_archive(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_logs_archive_with_http_info(
&self,
body: LogsArchiveCreateRequest,
) -> Result<ResponseContent<LogsArchive>, Error<CreateLogsArchiveError>>
pub async fn create_logs_archive_with_http_info( &self, body: LogsArchiveCreateRequest, ) -> Result<ResponseContent<LogsArchive>, Error<CreateLogsArchiveError>>
Create an archive in your organization.
sourcepub async fn delete_logs_archive(
&self,
archive_id: String,
) -> Result<(), Error<DeleteLogsArchiveError>>
pub async fn delete_logs_archive( &self, archive_id: String, ) -> Result<(), Error<DeleteLogsArchiveError>>
Delete a given archive from your organization.
sourcepub async fn delete_logs_archive_with_http_info(
&self,
archive_id: String,
) -> Result<ResponseContent<()>, Error<DeleteLogsArchiveError>>
pub async fn delete_logs_archive_with_http_info( &self, archive_id: String, ) -> Result<ResponseContent<()>, Error<DeleteLogsArchiveError>>
Delete a given archive from your organization.
sourcepub async fn get_logs_archive(
&self,
archive_id: String,
) -> Result<LogsArchive, Error<GetLogsArchiveError>>
pub async fn get_logs_archive( &self, archive_id: String, ) -> Result<LogsArchive, Error<GetLogsArchiveError>>
Get a specific archive from your organization.
sourcepub async fn get_logs_archive_with_http_info(
&self,
archive_id: String,
) -> Result<ResponseContent<LogsArchive>, Error<GetLogsArchiveError>>
pub async fn get_logs_archive_with_http_info( &self, archive_id: String, ) -> Result<ResponseContent<LogsArchive>, Error<GetLogsArchiveError>>
Get a specific archive from your organization.
sourcepub async fn get_logs_archive_order(
&self,
) -> Result<LogsArchiveOrder, Error<GetLogsArchiveOrderError>>
pub async fn get_logs_archive_order( &self, ) -> Result<LogsArchiveOrder, Error<GetLogsArchiveOrderError>>
Get the current order of your archives. This endpoint takes no JSON arguments.
sourcepub async fn get_logs_archive_order_with_http_info(
&self,
) -> Result<ResponseContent<LogsArchiveOrder>, Error<GetLogsArchiveOrderError>>
pub async fn get_logs_archive_order_with_http_info( &self, ) -> Result<ResponseContent<LogsArchiveOrder>, Error<GetLogsArchiveOrderError>>
Get the current order of your archives. This endpoint takes no JSON arguments.
sourcepub async fn list_archive_read_roles(
&self,
archive_id: String,
) -> Result<RolesResponse, Error<ListArchiveReadRolesError>>
pub async fn list_archive_read_roles( &self, archive_id: String, ) -> Result<RolesResponse, Error<ListArchiveReadRolesError>>
Returns all read roles a given archive is restricted to.
sourcepub async fn list_archive_read_roles_with_http_info(
&self,
archive_id: String,
) -> Result<ResponseContent<RolesResponse>, Error<ListArchiveReadRolesError>>
pub async fn list_archive_read_roles_with_http_info( &self, archive_id: String, ) -> Result<ResponseContent<RolesResponse>, Error<ListArchiveReadRolesError>>
Returns all read roles a given archive is restricted to.
sourcepub async fn list_logs_archives(
&self,
) -> Result<LogsArchives, Error<ListLogsArchivesError>>
pub async fn list_logs_archives( &self, ) -> Result<LogsArchives, Error<ListLogsArchivesError>>
Get the list of configured logs archives with their definitions.
sourcepub async fn list_logs_archives_with_http_info(
&self,
) -> Result<ResponseContent<LogsArchives>, Error<ListLogsArchivesError>>
pub async fn list_logs_archives_with_http_info( &self, ) -> Result<ResponseContent<LogsArchives>, Error<ListLogsArchivesError>>
Get the list of configured logs archives with their definitions.
sourcepub async fn remove_role_from_archive(
&self,
archive_id: String,
body: RelationshipToRole,
) -> Result<(), Error<RemoveRoleFromArchiveError>>
pub async fn remove_role_from_archive( &self, archive_id: String, body: RelationshipToRole, ) -> Result<(), Error<RemoveRoleFromArchiveError>>
Removes a role from an archive. (Roles API)
Examples found in repository?
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
async fn main() {
let body = RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
.type_(RolesType::ROLES),
);
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api
.remove_role_from_archive("archive_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn remove_role_from_archive_with_http_info(
&self,
archive_id: String,
body: RelationshipToRole,
) -> Result<ResponseContent<()>, Error<RemoveRoleFromArchiveError>>
pub async fn remove_role_from_archive_with_http_info( &self, archive_id: String, body: RelationshipToRole, ) -> Result<ResponseContent<()>, Error<RemoveRoleFromArchiveError>>
Removes a role from an archive. (Roles API)
sourcepub async fn update_logs_archive(
&self,
archive_id: String,
body: LogsArchiveCreateRequest,
) -> Result<LogsArchive, Error<UpdateLogsArchiveError>>
pub async fn update_logs_archive( &self, archive_id: String, body: LogsArchiveCreateRequest, ) -> Result<LogsArchive, Error<UpdateLogsArchiveError>>
Update a given archive configuration.
Note: Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization.
Examples found in repository?
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 38 39 40 41 42 43 44 45 46
async fn main() {
let body = LogsArchiveCreateRequest::new().data(
LogsArchiveCreateRequestDefinition::new("archives".to_string()).attributes(
LogsArchiveCreateRequestAttributes::new(
LogsArchiveCreateRequestDestination::LogsArchiveDestinationAzure(Box::new(
LogsArchiveDestinationAzure::new(
"container-name".to_string(),
LogsArchiveIntegrationAzure::new(
"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
),
"account-name".to_string(),
LogsArchiveDestinationAzureType::AZURE,
),
)),
"Nginx Archive".to_string(),
"source:nginx".to_string(),
)
.include_tags(false)
.rehydration_max_scan_size_in_gb(Some(100))
.rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]),
),
);
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api
.update_logs_archive("archive_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_logs_archive_with_http_info(
&self,
archive_id: String,
body: LogsArchiveCreateRequest,
) -> Result<ResponseContent<LogsArchive>, Error<UpdateLogsArchiveError>>
pub async fn update_logs_archive_with_http_info( &self, archive_id: String, body: LogsArchiveCreateRequest, ) -> Result<ResponseContent<LogsArchive>, Error<UpdateLogsArchiveError>>
Update a given archive configuration.
Note: Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization.
sourcepub async fn update_logs_archive_order(
&self,
body: LogsArchiveOrder,
) -> Result<LogsArchiveOrder, Error<UpdateLogsArchiveOrderError>>
pub async fn update_logs_archive_order( &self, body: LogsArchiveOrder, ) -> Result<LogsArchiveOrder, Error<UpdateLogsArchiveOrderError>>
Update the order of your archives. Since logs are processed sequentially, reordering an archive may change the structure and content of the data processed by other archives.
Note: Using the PUT method updates your archive’s order by replacing the current order
with the new one.
Examples found in repository?
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() {
let body = LogsArchiveOrder::new().data(LogsArchiveOrderDefinition::new(
LogsArchiveOrderAttributes::new(vec![
"a2zcMylnM4OCHpYusxIi1g".to_string(),
"a2zcMylnM4OCHpYusxIi2g".to_string(),
"a2zcMylnM4OCHpYusxIi3g".to_string(),
]),
LogsArchiveOrderDefinitionType::ARCHIVE_ORDER,
));
let configuration = datadog::Configuration::new();
let api = LogsArchivesAPI::with_config(configuration);
let resp = api.update_logs_archive_order(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_logs_archive_order_with_http_info(
&self,
body: LogsArchiveOrder,
) -> Result<ResponseContent<LogsArchiveOrder>, Error<UpdateLogsArchiveOrderError>>
pub async fn update_logs_archive_order_with_http_info( &self, body: LogsArchiveOrder, ) -> Result<ResponseContent<LogsArchiveOrder>, Error<UpdateLogsArchiveOrderError>>
Update the order of your archives. Since logs are processed sequentially, reordering an archive may change the structure and content of the data processed by other archives.
Note: Using the PUT method updates your archive’s order by replacing the current order
with the new one.
Trait Implementations§
source§impl Clone for LogsArchivesAPI
impl Clone for LogsArchivesAPI
source§fn clone(&self) -> LogsArchivesAPI
fn clone(&self) -> LogsArchivesAPI
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LogsArchivesAPI
impl Debug for LogsArchivesAPI
Auto Trait Implementations§
impl Freeze for LogsArchivesAPI
impl !RefUnwindSafe for LogsArchivesAPI
impl Send for LogsArchivesAPI
impl Sync for LogsArchivesAPI
impl Unpin for LogsArchivesAPI
impl !UnwindSafe for LogsArchivesAPI
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)