Struct 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

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_logs-archives_ListLogsArchives.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.list_logs_archives().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_logs-archives_GetLogsArchiveOrder.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.get_logs_archive_order().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_logs-archives_GetLogsArchive.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.get_logs_archive("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_logs-archives_DeleteLogsArchive.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.delete_logs_archive("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_logs-archives_ListArchiveReadRoles.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.list_archive_read_roles("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_logs-archives_AddReadRoleToArchive.rs (line 16)
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}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

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?
examples/v2_logs-archives_AddReadRoleToArchive.rs (line 18)
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}
Source

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)

Source

pub async fn create_logs_archive( &self, body: LogsArchiveCreateRequest, ) -> Result<LogsArchive, Error<CreateLogsArchiveError>>

Create an archive in your organization.

Examples found in repository?
examples/v2_logs-archives_CreateLogsArchive.rs (line 38)
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}
Source

pub async fn create_logs_archive_with_http_info( &self, body: LogsArchiveCreateRequest, ) -> Result<ResponseContent<LogsArchive>, Error<CreateLogsArchiveError>>

Create an archive in your organization.

Source

pub async fn delete_logs_archive( &self, archive_id: String, ) -> Result<(), Error<DeleteLogsArchiveError>>

Delete a given archive from your organization.

Examples found in repository?
examples/v2_logs-archives_DeleteLogsArchive.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.delete_logs_archive("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_logs_archive_with_http_info( &self, archive_id: String, ) -> Result<ResponseContent<()>, Error<DeleteLogsArchiveError>>

Delete a given archive from your organization.

Source

pub async fn get_logs_archive( &self, archive_id: String, ) -> Result<LogsArchive, Error<GetLogsArchiveError>>

Get a specific archive from your organization.

Examples found in repository?
examples/v2_logs-archives_GetLogsArchive.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.get_logs_archive("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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.

Examples found in repository?
examples/v2_logs-archives_GetLogsArchiveOrder.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.get_logs_archive_order().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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.

Examples found in repository?
examples/v2_logs-archives_ListArchiveReadRoles.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.list_archive_read_roles("archive_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

pub async fn list_logs_archives( &self, ) -> Result<LogsArchives, Error<ListLogsArchivesError>>

Get the list of configured logs archives with their definitions.

Examples found in repository?
examples/v2_logs-archives_ListLogsArchives.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = LogsArchivesAPI::with_config(configuration);
9    let resp = api.list_logs_archives().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

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.

Source

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?
examples/v2_logs-archives_RemoveRoleFromArchive.rs (line 18)
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}
Source

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)

Source

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?
examples/v2_logs-archives_UpdateLogsArchive.rs (line 39)
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}
Source

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.

Source

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?
examples/v2_logs-archives_UpdateLogsArchiveOrder.rs (line 21)
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}
Source

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

Source§

fn clone(&self) -> LogsArchivesAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LogsArchivesAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LogsArchivesAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,