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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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