Tags to be associated with GCP metrics and service checks from your account.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your service account email address.
cloud_run_revision_filters
[string]
DEPRECATED: List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags.
Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
Note: This field is deprecated. Instead, use monitored_resource_configs with type=cloud_run_revision
host_filters
[string]
DEPRECATED: List of filters to limit the VM instances that are pulled into Datadog by using tags.
Only VM instance resources that apply to specified filters are imported into Datadog.
Note: This field is deprecated. Instead, use monitored_resource_configs with type=gce_instance
is_cspm_enabled
boolean
When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
is_global_location_enabled
boolean
When enabled, Datadog collects metrics where location is explicitly stated as "global" or where location information cannot be deduced from GCP labels.
default: true
is_per_project_quota_enabled
boolean
When enabled, Datadog applies the X-Goog-User-Project header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project.
is_resource_change_collection_enabled
boolean
When enabled, Datadog scans for all resource change data in your Google Cloud environment.
is_security_command_center_enabled
boolean
When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
metric_namespace_configs
[object]
Configurations for GCP metric namespaces.
disabled
boolean
When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.
filters
[string]
When enabled, Datadog applies these additional filters to limit metric collection. A metric is collected only if it does not match all exclusion filters and matches at least one allow filter.
id
string
The id of the GCP metric namespace.
monitored_resource_configs
[object]
Configurations for GCP monitored resources.
filters
[string]
List of filters to limit the monitored resources that are pulled into Datadog by using tags.
Only monitored resources that apply to specified filters are imported into Datadog.
type
enum
The GCP monitored resource type. Only a subset of resource types are supported.
Allowed enum values: cloud_function,cloud_run_revision,gce_instance
region_filter_configs
[string]
Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
id
string
Your service account's unique ID.
type
enum
The type of account.
Allowed enum values: gcp_service_account
Tags to be associated with GCP metrics and service checks from your account.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your service account email address.
cloud_run_revision_filters
[string]
DEPRECATED: List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags.
Only Cloud Run revision resources that apply to specified filters are imported into Datadog.
Note: This field is deprecated. Instead, use monitored_resource_configs with type=cloud_run_revision
host_filters
[string]
DEPRECATED: List of filters to limit the VM instances that are pulled into Datadog by using tags.
Only VM instance resources that apply to specified filters are imported into Datadog.
Note: This field is deprecated. Instead, use monitored_resource_configs with type=gce_instance
is_cspm_enabled
boolean
When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.
is_global_location_enabled
boolean
When enabled, Datadog collects metrics where location is explicitly stated as "global" or where location information cannot be deduced from GCP labels.
default: true
is_per_project_quota_enabled
boolean
When enabled, Datadog applies the X-Goog-User-Project header, attributing Google Cloud billing and quota usage to the project being monitored rather than the default service account project.
is_resource_change_collection_enabled
boolean
When enabled, Datadog scans for all resource change data in your Google Cloud environment.
is_security_command_center_enabled
boolean
When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.
metric_namespace_configs
[object]
Configurations for GCP metric namespaces.
disabled
boolean
When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.
filters
[string]
When enabled, Datadog applies these additional filters to limit metric collection. A metric is collected only if it does not match all exclusion filters and matches at least one allow filter.
id
string
The id of the GCP metric namespace.
monitored_resource_configs
[object]
Configurations for GCP monitored resources.
filters
[string]
List of filters to limit the monitored resources that are pulled into Datadog by using tags.
Only monitored resources that apply to specified filters are imported into Datadog.
type
enum
The GCP monitored resource type. Only a subset of resource types are supported.
Allowed enum values: cloud_function,cloud_run_revision,gce_instance
region_filter_configs
[string]
Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
id
string
Your service account's unique ID.
meta
object
Additional information related to your service account.
accessible_projects
[string]
The current list of projects accessible from your service account.
type
enum
The type of account.
Allowed enum values: gcp_service_account
// Update STS Service Account returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "gcp_sts_account" in the systemGcpStsAccountDataID:=os.Getenv("GCP_STS_ACCOUNT_DATA_ID")body:=datadogV2.GCPSTSServiceAccountUpdateRequest{Data:&datadogV2.GCPSTSServiceAccountUpdateRequestData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{ClientEmail:datadog.PtrString("Test-252bf553ef04b351@example.com"),HostFilters:[]string{"foo:bar",},},Id:datadog.PtrString(GcpStsAccountDataID),Type:datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(),},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGCPIntegrationApi(apiClient)resp,r,err:=api.UpdateGCPSTSAccount(ctx,GcpStsAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n",responseContent)}
// Update STS Service Account returns "OK" response with cloud run revision filterspackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "gcp_sts_account" in the systemGcpStsAccountDataID:=os.Getenv("GCP_STS_ACCOUNT_DATA_ID")body:=datadogV2.GCPSTSServiceAccountUpdateRequest{Data:&datadogV2.GCPSTSServiceAccountUpdateRequestData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{ClientEmail:datadog.PtrString("Test-252bf553ef04b351@example.com"),CloudRunRevisionFilters:[]string{"merp:derp",},},Id:datadog.PtrString(GcpStsAccountDataID),Type:datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(),},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGCPIntegrationApi(apiClient)resp,r,err:=api.UpdateGCPSTSAccount(ctx,GcpStsAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n",responseContent)}
// Update STS Service Account returns "OK" response with enable resource collection turned onpackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "gcp_sts_account" in the systemGcpStsAccountDataID:=os.Getenv("GCP_STS_ACCOUNT_DATA_ID")body:=datadogV2.GCPSTSServiceAccountUpdateRequest{Data:&datadogV2.GCPSTSServiceAccountUpdateRequestData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{ClientEmail:datadog.PtrString("Test-252bf553ef04b351@example.com"),ResourceCollectionEnabled:datadog.PtrBool(true),},Id:datadog.PtrString(GcpStsAccountDataID),Type:datadogV2.GCPSERVICEACCOUNTTYPE_GCP_SERVICE_ACCOUNT.Ptr(),},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGCPIntegrationApi(apiClient)resp,r,err:=api.UpdateGCPSTSAccount(ctx,GcpStsAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.UpdateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.UpdateGCPSTSAccount`:\n%s\n",responseContent)}
// Update STS Service Account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GcpIntegrationApi;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountAttributes;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequestData;importcom.datadog.api.client.v2.model.GCPServiceAccountType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);// there is a valid "gcp_sts_account" in the systemStringGCP_STS_ACCOUNT_DATA_ID=System.getenv("GCP_STS_ACCOUNT_DATA_ID");GCPSTSServiceAccountUpdateRequestbody=newGCPSTSServiceAccountUpdateRequest().data(newGCPSTSServiceAccountUpdateRequestData().attributes(newGCPSTSServiceAccountAttributes().clientEmail("Test-252bf553ef04b351@example.com").hostFilters(Collections.singletonList("foo:bar"))).id(GCP_STS_ACCOUNT_DATA_ID).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.updateGCPSTSAccount(GCP_STS_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#updateGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Update STS Service Account returns "OK" response with cloud run revision filtersimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GcpIntegrationApi;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountAttributes;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequestData;importcom.datadog.api.client.v2.model.GCPServiceAccountType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);// there is a valid "gcp_sts_account" in the systemStringGCP_STS_ACCOUNT_DATA_ID=System.getenv("GCP_STS_ACCOUNT_DATA_ID");GCPSTSServiceAccountUpdateRequestbody=newGCPSTSServiceAccountUpdateRequest().data(newGCPSTSServiceAccountUpdateRequestData().attributes(newGCPSTSServiceAccountAttributes().clientEmail("Test-252bf553ef04b351@example.com").cloudRunRevisionFilters(Collections.singletonList("merp:derp"))).id(GCP_STS_ACCOUNT_DATA_ID).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.updateGCPSTSAccount(GCP_STS_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#updateGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Update STS Service Account returns "OK" response with enable resource collection turned onimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GcpIntegrationApi;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountAttributes;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountUpdateRequestData;importcom.datadog.api.client.v2.model.GCPServiceAccountType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);// there is a valid "gcp_sts_account" in the systemStringGCP_STS_ACCOUNT_DATA_ID=System.getenv("GCP_STS_ACCOUNT_DATA_ID");GCPSTSServiceAccountUpdateRequestbody=newGCPSTSServiceAccountUpdateRequest().data(newGCPSTSServiceAccountUpdateRequestData().attributes(newGCPSTSServiceAccountAttributes().clientEmail("Test-252bf553ef04b351@example.com").resourceCollectionEnabled(true)).id(GCP_STS_ACCOUNT_DATA_ID).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.updateGCPSTSAccount(GCP_STS_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#updateGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update STS Service Account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.gcp_integration_apiimportGCPIntegrationApifromdatadog_api_client.v2.model.gcp_service_account_typeimportGCPServiceAccountTypefromdatadog_api_client.v2.model.gcpsts_service_account_attributesimportGCPSTSServiceAccountAttributesfromdatadog_api_client.v2.model.gcpsts_service_account_update_requestimportGCPSTSServiceAccountUpdateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_update_request_dataimportGCPSTSServiceAccountUpdateRequestData# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=environ["GCP_STS_ACCOUNT_DATA_ID"]body=GCPSTSServiceAccountUpdateRequest(data=GCPSTSServiceAccountUpdateRequestData(attributes=GCPSTSServiceAccountAttributes(client_email="Test-252bf553ef04b351@example.com",host_filters=["foo:bar",],),id=GCP_STS_ACCOUNT_DATA_ID,type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.update_gcpsts_account(account_id=GCP_STS_ACCOUNT_DATA_ID,body=body)print(response)
"""
Update STS Service Account returns "OK" response with cloud run revision filters
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.gcp_integration_apiimportGCPIntegrationApifromdatadog_api_client.v2.model.gcp_service_account_typeimportGCPServiceAccountTypefromdatadog_api_client.v2.model.gcpsts_service_account_attributesimportGCPSTSServiceAccountAttributesfromdatadog_api_client.v2.model.gcpsts_service_account_update_requestimportGCPSTSServiceAccountUpdateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_update_request_dataimportGCPSTSServiceAccountUpdateRequestData# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=environ["GCP_STS_ACCOUNT_DATA_ID"]body=GCPSTSServiceAccountUpdateRequest(data=GCPSTSServiceAccountUpdateRequestData(attributes=GCPSTSServiceAccountAttributes(client_email="Test-252bf553ef04b351@example.com",cloud_run_revision_filters=["merp:derp",],),id=GCP_STS_ACCOUNT_DATA_ID,type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.update_gcpsts_account(account_id=GCP_STS_ACCOUNT_DATA_ID,body=body)print(response)
"""
Update STS Service Account returns "OK" response with enable resource collection turned on
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.gcp_integration_apiimportGCPIntegrationApifromdatadog_api_client.v2.model.gcp_service_account_typeimportGCPServiceAccountTypefromdatadog_api_client.v2.model.gcpsts_service_account_attributesimportGCPSTSServiceAccountAttributesfromdatadog_api_client.v2.model.gcpsts_service_account_update_requestimportGCPSTSServiceAccountUpdateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_update_request_dataimportGCPSTSServiceAccountUpdateRequestData# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=environ["GCP_STS_ACCOUNT_DATA_ID"]body=GCPSTSServiceAccountUpdateRequest(data=GCPSTSServiceAccountUpdateRequestData(attributes=GCPSTSServiceAccountAttributes(client_email="Test-252bf553ef04b351@example.com",resource_collection_enabled=True,),id=GCP_STS_ACCOUNT_DATA_ID,type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.update_gcpsts_account(account_id=GCP_STS_ACCOUNT_DATA_ID,body=body)print(response)
# Update STS Service Account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.new# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=ENV["GCP_STS_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({client_email:"Test-252bf553ef04b351@example.com",host_filters:["foo:bar",],}),id:GCP_STS_ACCOUNT_DATA_ID,type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.update_gcpsts_account(GCP_STS_ACCOUNT_DATA_ID,body)
# Update STS Service Account returns "OK" response with cloud run revision filtersrequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.new# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=ENV["GCP_STS_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({client_email:"Test-252bf553ef04b351@example.com",cloud_run_revision_filters:["merp:derp",],}),id:GCP_STS_ACCOUNT_DATA_ID,type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.update_gcpsts_account(GCP_STS_ACCOUNT_DATA_ID,body)
# Update STS Service Account returns "OK" response with enable resource collection turned onrequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.new# there is a valid "gcp_sts_account" in the systemGCP_STS_ACCOUNT_DATA_ID=ENV["GCP_STS_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({client_email:"Test-252bf553ef04b351@example.com",resource_collection_enabled:true,}),id:GCP_STS_ACCOUNT_DATA_ID,type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.update_gcpsts_account(GCP_STS_ACCOUNT_DATA_ID,body)
// Update STS Service Account returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){// there is a valid "gcp_sts_account" in the system
letgcp_sts_account_data_id=std::env::var("GCP_STS_ACCOUNT_DATA_ID").unwrap();letbody=GCPSTSServiceAccountUpdateRequest::new().data(GCPSTSServiceAccountUpdateRequestData::new().attributes(GCPSTSServiceAccountAttributes::new().client_email("Test-252bf553ef04b351@example.com".to_string()).host_filters(vec!["foo:bar".to_string()]),).id(gcp_sts_account_data_id.clone()).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.update_gcpsts_account(gcp_sts_account_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Update STS Service Account returns "OK" response with cloud run revision filters
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){// there is a valid "gcp_sts_account" in the system
letgcp_sts_account_data_id=std::env::var("GCP_STS_ACCOUNT_DATA_ID").unwrap();letbody=GCPSTSServiceAccountUpdateRequest::new().data(GCPSTSServiceAccountUpdateRequestData::new().attributes(GCPSTSServiceAccountAttributes::new().client_email("Test-252bf553ef04b351@example.com".to_string()).cloud_run_revision_filters(vec!["merp:derp".to_string()]),).id(gcp_sts_account_data_id.clone()).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.update_gcpsts_account(gcp_sts_account_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Update STS Service Account returns "OK" response with enable resource
// collection turned on
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountAttributes;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountUpdateRequestData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){// there is a valid "gcp_sts_account" in the system
letgcp_sts_account_data_id=std::env::var("GCP_STS_ACCOUNT_DATA_ID").unwrap();letbody=GCPSTSServiceAccountUpdateRequest::new().data(GCPSTSServiceAccountUpdateRequestData::new().attributes(GCPSTSServiceAccountAttributes::new().client_email("Test-252bf553ef04b351@example.com".to_string()).resource_collection_enabled(true),).id(gcp_sts_account_data_id.clone()).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.update_gcpsts_account(gcp_sts_account_data_id.clone(),body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Update STS Service Account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);// there is a valid "gcp_sts_account" in the system
constGCP_STS_ACCOUNT_DATA_ID=process.env.GCP_STS_ACCOUNT_DATA_IDasstring;constparams: v2.GCPIntegrationApiUpdateGCPSTSAccountRequest={body:{data:{attributes:{clientEmail:"Test-252bf553ef04b351@example.com",hostFilters:["foo:bar"],},id: GCP_STS_ACCOUNT_DATA_ID,type:"gcp_service_account",},},accountId: GCP_STS_ACCOUNT_DATA_ID,};apiInstance.updateGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Update STS Service Account returns "OK" response with cloud run revision filters
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);// there is a valid "gcp_sts_account" in the system
constGCP_STS_ACCOUNT_DATA_ID=process.env.GCP_STS_ACCOUNT_DATA_IDasstring;constparams: v2.GCPIntegrationApiUpdateGCPSTSAccountRequest={body:{data:{attributes:{clientEmail:"Test-252bf553ef04b351@example.com",cloudRunRevisionFilters:["merp:derp"],},id: GCP_STS_ACCOUNT_DATA_ID,type:"gcp_service_account",},},accountId: GCP_STS_ACCOUNT_DATA_ID,};apiInstance.updateGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Update STS Service Account returns "OK" response with enable resource collection turned on
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);// there is a valid "gcp_sts_account" in the system
constGCP_STS_ACCOUNT_DATA_ID=process.env.GCP_STS_ACCOUNT_DATA_IDasstring;constparams: v2.GCPIntegrationApiUpdateGCPSTSAccountRequest={body:{data:{attributes:{clientEmail:"Test-252bf553ef04b351@example.com",resourceCollectionEnabled: true,},id: GCP_STS_ACCOUNT_DATA_ID,type:"gcp_service_account",},},accountId: GCP_STS_ACCOUNT_DATA_ID,};apiInstance.updateGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));