Struct GCPIntegrationAPI

Source
pub struct GCPIntegrationAPI { /* private fields */ }
Expand description

Configure your Datadog-Google Cloud Platform (GCP) integration directly through the Datadog API. Read more about the Datadog-Google Cloud Platform integration.

Implementations§

Source§

impl GCPIntegrationAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v1_gcp-integration_ListGCPIntegration.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = GCPIntegrationAPI::with_config(configuration);
9    let resp = api.list_gcp_integration().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/v1_gcp-integration_DeleteGCPIntegration.rs (line 13)
7async fn main() {
8    let body = GCPAccount::new()
9        .client_email("252bf553ef04b351@example.com".to_string())
10        .client_id("163662907116366290710".to_string())
11        .project_id("datadog-apitest".to_string());
12    let configuration = datadog::Configuration::new();
13    let api = GCPIntegrationAPI::with_config(configuration);
14    let resp = api.delete_gcp_integration(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
examples/v1_gcp-integration_UpdateGCPIntegration.rs (line 27)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .host_filters("key:value,filter:example".to_string())
17        .is_cspm_enabled(true)
18        .is_resource_change_collection_enabled(true)
19        .is_security_command_center_enabled(true)
20        .private_key("private_key".to_string())
21        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
22        .project_id("datadog-apitest".to_string())
23        .resource_collection_enabled(true)
24        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
25        .type_("service_account".to_string());
26    let configuration = datadog::Configuration::new();
27    let api = GCPIntegrationAPI::with_config(configuration);
28    let resp = api.update_gcp_integration(body).await;
29    if let Ok(value) = resp {
30        println!("{:#?}", value);
31    } else {
32        println!("{:#?}", resp.unwrap_err());
33    }
34}
examples/v1_gcp-integration_CreateGCPIntegration.rs (line 28)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .cloud_run_revision_filters(vec!["dr:dre".to_string()])
17        .host_filters("key:value,filter:example".to_string())
18        .is_cspm_enabled(true)
19        .is_resource_change_collection_enabled(true)
20        .is_security_command_center_enabled(true)
21        .private_key("private_key".to_string())
22        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
23        .project_id("datadog-apitest".to_string())
24        .resource_collection_enabled(true)
25        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
26        .type_("service_account".to_string());
27    let configuration = datadog::Configuration::new();
28    let api = GCPIntegrationAPI::with_config(configuration);
29    let resp = api.create_gcp_integration(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
examples/v1_gcp-integration_UpdateGCPIntegration_3544259255.rs (line 28)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .cloud_run_revision_filters(vec!["merp:derp".to_string()])
17        .host_filters("key:value,filter:example".to_string())
18        .is_cspm_enabled(true)
19        .is_resource_change_collection_enabled(true)
20        .is_security_command_center_enabled(true)
21        .private_key("private_key".to_string())
22        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
23        .project_id("datadog-apitest".to_string())
24        .resource_collection_enabled(true)
25        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
26        .type_("service_account".to_string());
27    let configuration = datadog::Configuration::new();
28    let api = GCPIntegrationAPI::with_config(configuration);
29    let resp = api.update_gcp_integration(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

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

Source

pub async fn create_gcp_integration( &self, body: GCPAccount, ) -> Result<BTreeMap<String, Value>, Error<CreateGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Create a Datadog-GCP integration.

Examples found in repository?
examples/v1_gcp-integration_CreateGCPIntegration.rs (line 29)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .cloud_run_revision_filters(vec!["dr:dre".to_string()])
17        .host_filters("key:value,filter:example".to_string())
18        .is_cspm_enabled(true)
19        .is_resource_change_collection_enabled(true)
20        .is_security_command_center_enabled(true)
21        .private_key("private_key".to_string())
22        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
23        .project_id("datadog-apitest".to_string())
24        .resource_collection_enabled(true)
25        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
26        .type_("service_account".to_string());
27    let configuration = datadog::Configuration::new();
28    let api = GCPIntegrationAPI::with_config(configuration);
29    let resp = api.create_gcp_integration(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

pub async fn create_gcp_integration_with_http_info( &self, body: GCPAccount, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<CreateGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Create a Datadog-GCP integration.

Source

pub async fn delete_gcp_integration( &self, body: GCPAccount, ) -> Result<BTreeMap<String, Value>, Error<DeleteGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Delete a given Datadog-GCP integration.

Examples found in repository?
examples/v1_gcp-integration_DeleteGCPIntegration.rs (line 14)
7async fn main() {
8    let body = GCPAccount::new()
9        .client_email("252bf553ef04b351@example.com".to_string())
10        .client_id("163662907116366290710".to_string())
11        .project_id("datadog-apitest".to_string());
12    let configuration = datadog::Configuration::new();
13    let api = GCPIntegrationAPI::with_config(configuration);
14    let resp = api.delete_gcp_integration(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}
Source

pub async fn delete_gcp_integration_with_http_info( &self, body: GCPAccount, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<DeleteGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Delete a given Datadog-GCP integration.

Source

pub async fn list_gcp_integration( &self, ) -> Result<Vec<GCPAccount>, Error<ListGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. List all Datadog-GCP integrations configured in your Datadog account.

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

pub async fn list_gcp_integration_with_http_info( &self, ) -> Result<ResponseContent<Vec<GCPAccount>>, Error<ListGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. List all Datadog-GCP integrations configured in your Datadog account.

Source

pub async fn update_gcp_integration( &self, body: GCPAccount, ) -> Result<BTreeMap<String, Value>, Error<UpdateGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Update a Datadog-GCP integrations host_filters and/or auto-mute. Requires a project_id and client_email, however these fields cannot be updated. If you need to update these fields, delete and use the create (POST) endpoint. The unspecified fields will keep their original values.

Examples found in repository?
examples/v1_gcp-integration_UpdateGCPIntegration.rs (line 28)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .host_filters("key:value,filter:example".to_string())
17        .is_cspm_enabled(true)
18        .is_resource_change_collection_enabled(true)
19        .is_security_command_center_enabled(true)
20        .private_key("private_key".to_string())
21        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
22        .project_id("datadog-apitest".to_string())
23        .resource_collection_enabled(true)
24        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
25        .type_("service_account".to_string());
26    let configuration = datadog::Configuration::new();
27    let api = GCPIntegrationAPI::with_config(configuration);
28    let resp = api.update_gcp_integration(body).await;
29    if let Ok(value) = resp {
30        println!("{:#?}", value);
31    } else {
32        println!("{:#?}", resp.unwrap_err());
33    }
34}
More examples
Hide additional examples
examples/v1_gcp-integration_UpdateGCPIntegration_3544259255.rs (line 29)
7async fn main() {
8    let body = GCPAccount::new()
9        .auth_provider_x509_cert_url("https://www.googleapis.com/oauth2/v1/certs".to_string())
10        .auth_uri("https://accounts.google.com/o/oauth2/auth".to_string())
11        .client_email("252bf553ef04b351@example.com".to_string())
12        .client_id("163662907116366290710".to_string())
13        .client_x509_cert_url(
14            "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL".to_string(),
15        )
16        .cloud_run_revision_filters(vec!["merp:derp".to_string()])
17        .host_filters("key:value,filter:example".to_string())
18        .is_cspm_enabled(true)
19        .is_resource_change_collection_enabled(true)
20        .is_security_command_center_enabled(true)
21        .private_key("private_key".to_string())
22        .private_key_id("123456789abcdefghi123456789abcdefghijklm".to_string())
23        .project_id("datadog-apitest".to_string())
24        .resource_collection_enabled(true)
25        .token_uri("https://accounts.google.com/o/oauth2/token".to_string())
26        .type_("service_account".to_string());
27    let configuration = datadog::Configuration::new();
28    let api = GCPIntegrationAPI::with_config(configuration);
29    let resp = api.update_gcp_integration(body).await;
30    if let Ok(value) = resp {
31        println!("{:#?}", value);
32    } else {
33        println!("{:#?}", resp.unwrap_err());
34    }
35}
Source

pub async fn update_gcp_integration_with_http_info( &self, body: GCPAccount, ) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<UpdateGCPIntegrationError>>

This endpoint is deprecated – use the V2 endpoints instead. Update a Datadog-GCP integrations host_filters and/or auto-mute. Requires a project_id and client_email, however these fields cannot be updated. If you need to update these fields, delete and use the create (POST) endpoint. The unspecified fields will keep their original values.

Trait Implementations§

Source§

impl Clone for GCPIntegrationAPI

Source§

fn clone(&self) -> GCPIntegrationAPI

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GCPIntegrationAPI

Source§

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

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

impl Default for GCPIntegrationAPI

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,