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
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .add_read_role_to_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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?
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .add_read_role_to_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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?
13async fn main() {
14 let body = LogsArchiveCreateRequest::new().data(
15 LogsArchiveCreateRequestDefinition::new("archives".to_string()).attributes(
16 LogsArchiveCreateRequestAttributes::new(
17 LogsArchiveCreateRequestDestination::LogsArchiveDestinationAzure(Box::new(
18 LogsArchiveDestinationAzure::new(
19 "container-name".to_string(),
20 LogsArchiveIntegrationAzure::new(
21 "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
22 "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
23 ),
24 "account-name".to_string(),
25 LogsArchiveDestinationAzureType::AZURE,
26 ),
27 )),
28 "Nginx Archive".to_string(),
29 "source:nginx".to_string(),
30 )
31 .include_tags(false)
32 .rehydration_max_scan_size_in_gb(Some(100))
33 .rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]),
34 ),
35 );
36 let configuration = datadog::Configuration::new();
37 let api = LogsArchivesAPI::with_config(configuration);
38 let resp = api.create_logs_archive(body).await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
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?
9async fn main() {
10 let body = RelationshipToRole::new().data(
11 RelationshipToRoleData::new()
12 .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13 .type_(RolesType::ROLES),
14 );
15 let configuration = datadog::Configuration::new();
16 let api = LogsArchivesAPI::with_config(configuration);
17 let resp = api
18 .remove_role_from_archive("archive_id".to_string(), body)
19 .await;
20 if let Ok(value) = resp {
21 println!("{:#?}", value);
22 } else {
23 println!("{:#?}", resp.unwrap_err());
24 }
25}
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?
13async fn main() {
14 let body = LogsArchiveCreateRequest::new().data(
15 LogsArchiveCreateRequestDefinition::new("archives".to_string()).attributes(
16 LogsArchiveCreateRequestAttributes::new(
17 LogsArchiveCreateRequestDestination::LogsArchiveDestinationAzure(Box::new(
18 LogsArchiveDestinationAzure::new(
19 "container-name".to_string(),
20 LogsArchiveIntegrationAzure::new(
21 "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
22 "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
23 ),
24 "account-name".to_string(),
25 LogsArchiveDestinationAzureType::AZURE,
26 ),
27 )),
28 "Nginx Archive".to_string(),
29 "source:nginx".to_string(),
30 )
31 .include_tags(false)
32 .rehydration_max_scan_size_in_gb(Some(100))
33 .rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]),
34 ),
35 );
36 let configuration = datadog::Configuration::new();
37 let api = LogsArchivesAPI::with_config(configuration);
38 let resp = api
39 .update_logs_archive("archive_id".to_string(), body)
40 .await;
41 if let Ok(value) = resp {
42 println!("{:#?}", value);
43 } else {
44 println!("{:#?}", resp.unwrap_err());
45 }
46}
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?
10async fn main() {
11 let body = LogsArchiveOrder::new().data(LogsArchiveOrderDefinition::new(
12 LogsArchiveOrderAttributes::new(vec![
13 "a2zcMylnM4OCHpYusxIi1g".to_string(),
14 "a2zcMylnM4OCHpYusxIi2g".to_string(),
15 "a2zcMylnM4OCHpYusxIi3g".to_string(),
16 ]),
17 LogsArchiveOrderDefinitionType::ARCHIVE_ORDER,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = LogsArchivesAPI::with_config(configuration);
21 let resp = api.update_logs_archive_order(body).await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
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 more