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
impl GCPIntegrationAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
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}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}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}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}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_gcp_integration(
&self,
body: GCPAccount,
) -> Result<BTreeMap<String, Value>, Error<CreateGCPIntegrationError>>
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?
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}Sourcepub async fn create_gcp_integration_with_http_info(
&self,
body: GCPAccount,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<CreateGCPIntegrationError>>
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.
Sourcepub async fn delete_gcp_integration(
&self,
body: GCPAccount,
) -> Result<BTreeMap<String, Value>, Error<DeleteGCPIntegrationError>>
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?
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}Sourcepub async fn delete_gcp_integration_with_http_info(
&self,
body: GCPAccount,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<DeleteGCPIntegrationError>>
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.
Sourcepub async fn list_gcp_integration(
&self,
) -> Result<Vec<GCPAccount>, Error<ListGCPIntegrationError>>
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.
Sourcepub async fn list_gcp_integration_with_http_info(
&self,
) -> Result<ResponseContent<Vec<GCPAccount>>, Error<ListGCPIntegrationError>>
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.
Sourcepub async fn update_gcp_integration(
&self,
body: GCPAccount,
) -> Result<BTreeMap<String, Value>, Error<UpdateGCPIntegrationError>>
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?
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
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}Sourcepub async fn update_gcp_integration_with_http_info(
&self,
body: GCPAccount,
) -> Result<ResponseContent<BTreeMap<String, Value>>, Error<UpdateGCPIntegrationError>>
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
impl Clone for GCPIntegrationAPI
Source§fn clone(&self) -> GCPIntegrationAPI
fn clone(&self) -> GCPIntegrationAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more