This endpoint is deprecated – use the V2 endpoints instead. List all Datadog-GCP integrations configured in your Datadog account.
This endpoint requires the gcp_configuration_read permission.
Should be https://www.googleapis.com/oauth2/v1/certs.
auth_uri
string
Should be https://accounts.google.com/o/oauth2/auth.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your email found in your JSON service account key.
client_id
string
Your ID found in your JSON service account key.
client_x509_cert_url
string
Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
where $CLIENT_EMAIL is the email found in your JSON service account key.
cloud_run_revision_filters
[string]
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.
errors
[string]
An array of errors.
host_filters
string
Limit the GCE instances that are pulled into Datadog by using tags.
Only hosts that match one of the defined tags are imported into Datadog.
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_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.
private_key
string
Your private key name found in your JSON service account key.
private_key_id
string
Your private key ID found in your JSON service account key.
project_id
string
Your Google Cloud project ID found in your JSON service account key.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
token_uri
string
Should be https://accounts.google.com/o/oauth2/token.
type
string
The value for service_account found in your JSON service account key.
"""
List all GCP integrations returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.gcp_integration_apiimportGCPIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.list_gcp_integration()print(response)
# List all GCP integrations returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::GCPIntegrationAPI.newpapi_instance.list_gcp_integration()
// List all GCP integrations returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewGCPIntegrationApi(apiClient)resp,r,err:=api.ListGCPIntegration(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.ListGCPIntegration`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.ListGCPIntegration`:\n%s\n",responseContent)}
// List all GCP integrations returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_gcp_integration::GCPIntegrationAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.list_gcp_integration().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* List all GCP integrations returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.GCPIntegrationApi(configuration);apiInstance.listGCPIntegration().then((data: v1.GCPAccount[])=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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]
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.
host_filters
[string]
Your Host Filters.
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_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.
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
"""
List all GCP STS-enabled service accounts returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.gcp_integration_apiimportGCPIntegrationApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.list_gcpsts_accounts()print(response)
# List all GCP STS-enabled service accounts returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.newpapi_instance.list_gcpsts_accounts()
// List all GCP STS-enabled service accounts returns "OK" response
packagemainimport("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(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGCPIntegrationApi(apiClient)resp,r,err:=api.ListGCPSTSAccounts(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.ListGCPSTSAccounts`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.ListGCPSTSAccounts`:\n%s\n",responseContent)}
// List all GCP STS-enabled service accounts 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.GCPSTSServiceAccountsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);try{GCPSTSServiceAccountsResponseresult=apiInstance.listGCPSTSAccounts();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#listGCPSTSAccounts");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List all GCP STS-enabled service accounts returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_gcp_integration::GCPIntegrationAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.list_gcpsts_accounts().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* List all GCP STS-enabled service accounts returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);apiInstance.listGCPSTSAccounts().then((data: v2.GCPSTSServiceAccountsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
This endpoint is deprecated – use the V2 endpoints instead. Create a Datadog-GCP integration.
This endpoint requires the gcp_configurations_manage permission.
Should be https://www.googleapis.com/oauth2/v1/certs.
auth_uri
string
Should be https://accounts.google.com/o/oauth2/auth.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your email found in your JSON service account key.
client_id
string
Your ID found in your JSON service account key.
client_x509_cert_url
string
Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
where $CLIENT_EMAIL is the email found in your JSON service account key.
cloud_run_revision_filters
[string]
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.
errors
[string]
An array of errors.
host_filters
string
Limit the GCE instances that are pulled into Datadog by using tags.
Only hosts that match one of the defined tags are imported into Datadog.
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_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.
private_key
string
Your private key name found in your JSON service account key.
private_key_id
string
Your private key ID found in your JSON service account key.
project_id
string
Your Google Cloud project ID found in your JSON service account key.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
token_uri
string
Should be https://accounts.google.com/o/oauth2/token.
type
string
The value for service_account found in your JSON service account key.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a GCP integration returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.GCPIntegrationApi(configuration);constparams: v1.GCPIntegrationApiCreateGCPIntegrationRequest={body:{authProviderX509CertUrl:"https://www.googleapis.com/oauth2/v1/certs",authUri:"https://accounts.google.com/o/oauth2/auth",clientEmail:"252bf553ef04b351@example.com",clientId:"163662907116366290710",clientX509CertUrl:"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",hostFilters:"key:value,filter:example",cloudRunRevisionFilters:["dr:dre"],isCspmEnabled: true,isSecurityCommandCenterEnabled: true,privateKey:"private_key",privateKeyId:"123456789abcdefghi123456789abcdefghijklm",projectId:"datadog-apitest",resourceCollectionEnabled: true,tokenUri:"https://accounts.google.com/o/oauth2/token",type:"service_account",},};apiInstance.createGCPIntegration(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
Additional metadata on your generated service account.
attributes
object
Attributes associated with your service account.
account_tags
[string]
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]
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.
host_filters
[string]
Your Host Filters.
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_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.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
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]
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.
host_filters
[string]
Your Host Filters.
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_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.
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
// Create a new entry for your service account returns "OK" response
packagemainimport("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(){body:=datadogV2.GCPSTSServiceAccountCreateRequest{Data:&datadogV2.GCPSTSServiceAccountData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{ClientEmail:datadog.PtrString("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com"),HostFilters:[]string{},},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.CreateGCPSTSAccount(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n",responseContent)}
// Create a new entry for your service account with account_tags returns "OK" response
packagemainimport("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(){body:=datadogV2.GCPSTSServiceAccountCreateRequest{Data:&datadogV2.GCPSTSServiceAccountData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{AccountTags:[]string{"lorem","ipsum",},ClientEmail:datadog.PtrString("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com"),HostFilters:[]string{},},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.CreateGCPSTSAccount(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n",responseContent)}
// Create a new entry for your service account with cloud run revision filters enabled returns "OK" response
packagemainimport("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(){body:=datadogV2.GCPSTSServiceAccountCreateRequest{Data:&datadogV2.GCPSTSServiceAccountData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{CloudRunRevisionFilters:[]string{"meh:bleh",},ClientEmail:datadog.PtrString("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com"),HostFilters:[]string{},},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.CreateGCPSTSAccount(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.CreateGCPSTSAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.CreateGCPSTSAccount`:\n%s\n",responseContent)}
// Create a new entry for your 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.GCPSTSServiceAccountCreateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountData;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPServiceAccountType;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);GCPSTSServiceAccountCreateRequestbody=newGCPSTSServiceAccountCreateRequest().data(newGCPSTSServiceAccountData().attributes(newGCPSTSServiceAccountAttributes().clientEmail("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com")).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.createGCPSTSAccount(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#createGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Create a new entry for your service account with account_tags 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.GCPSTSServiceAccountCreateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountData;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPServiceAccountType;importjava.util.Arrays;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);GCPSTSServiceAccountCreateRequestbody=newGCPSTSServiceAccountCreateRequest().data(newGCPSTSServiceAccountData().attributes(newGCPSTSServiceAccountAttributes().accountTags(Arrays.asList("lorem","ipsum")).clientEmail("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com")).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.createGCPSTSAccount(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#createGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Create a new entry for your service account with cloud run revision filters enabled 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.GCPSTSServiceAccountCreateRequest;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountData;importcom.datadog.api.client.v2.model.GCPSTSServiceAccountResponse;importcom.datadog.api.client.v2.model.GCPServiceAccountType;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);GCPSTSServiceAccountCreateRequestbody=newGCPSTSServiceAccountCreateRequest().data(newGCPSTSServiceAccountData().attributes(newGCPSTSServiceAccountAttributes().cloudRunRevisionFilters(Collections.singletonList("meh:bleh")).clientEmail("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com")).type(GCPServiceAccountType.GCP_SERVICE_ACCOUNT));try{GCPSTSServiceAccountResponseresult=apiInstance.createGCPSTSAccount(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#createGCPSTSAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create a new entry for your service account returns "OK" response
"""fromdatadog_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_create_requestimportGCPSTSServiceAccountCreateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_dataimportGCPSTSServiceAccountDatabody=GCPSTSServiceAccountCreateRequest(data=GCPSTSServiceAccountData(attributes=GCPSTSServiceAccountAttributes(client_email="Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters=[],),type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.create_gcpsts_account(body=body)print(response)
"""
Create a new entry for your service account with account_tags returns "OK" response
"""fromdatadog_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_create_requestimportGCPSTSServiceAccountCreateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_dataimportGCPSTSServiceAccountDatabody=GCPSTSServiceAccountCreateRequest(data=GCPSTSServiceAccountData(attributes=GCPSTSServiceAccountAttributes(account_tags=["lorem","ipsum",],client_email="Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters=[],),type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.create_gcpsts_account(body=body)print(response)
"""
Create a new entry for your service account with cloud run revision filters enabled returns "OK" response
"""fromdatadog_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_create_requestimportGCPSTSServiceAccountCreateRequestfromdatadog_api_client.v2.model.gcpsts_service_account_dataimportGCPSTSServiceAccountDatabody=GCPSTSServiceAccountCreateRequest(data=GCPSTSServiceAccountData(attributes=GCPSTSServiceAccountAttributes(cloud_run_revision_filters=["meh:bleh",],client_email="Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters=[],),type=GCPServiceAccountType.GCP_SERVICE_ACCOUNT,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.create_gcpsts_account(body=body)print(response)
# Create a new entry for your service account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.newbody=DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({client_email:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters:[],}),type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.create_gcpsts_account(body)
# Create a new entry for your service account with account_tags returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.newbody=DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({account_tags:["lorem","ipsum",],client_email:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters:[],}),type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.create_gcpsts_account(body)
# Create a new entry for your service account with cloud run revision filters enabled returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.newbody=DatadogAPIClient::V2::GCPSTSServiceAccountCreateRequest.new({data:DatadogAPIClient::V2::GCPSTSServiceAccountData.new({attributes:DatadogAPIClient::V2::GCPSTSServiceAccountAttributes.new({cloud_run_revision_filters:["meh:bleh",],client_email:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",host_filters:[],}),type:DatadogAPIClient::V2::GCPServiceAccountType::GCP_SERVICE_ACCOUNT,}),})papi_instance.create_gcpsts_account(body)
// Create a new entry for your 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::GCPSTSServiceAccountCreateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){letbody=GCPSTSServiceAccountCreateRequest::new().data(GCPSTSServiceAccountData::new().attributes(GCPSTSServiceAccountAttributes::new().client_email("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com".to_string(),).host_filters(vec![]),).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.create_gcpsts_account(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Create a new entry for your service account with account_tags 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::GCPSTSServiceAccountCreateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){letbody=GCPSTSServiceAccountCreateRequest::new().data(GCPSTSServiceAccountData::new().attributes(GCPSTSServiceAccountAttributes::new().account_tags(vec!["lorem".to_string(),"ipsum".to_string()]).client_email("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com".to_string(),).host_filters(vec![]),).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.create_gcpsts_account(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Create a new entry for your service account with cloud run revision filters
// enabled 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::GCPSTSServiceAccountCreateRequest;usedatadog_api_client::datadogV2::model::GCPSTSServiceAccountData;usedatadog_api_client::datadogV2::model::GCPServiceAccountType;#[tokio::main]asyncfnmain(){letbody=GCPSTSServiceAccountCreateRequest::new().data(GCPSTSServiceAccountData::new().attributes(GCPSTSServiceAccountAttributes::new().client_email("Test-252bf553ef04b351@test-project.iam.gserviceaccount.com".to_string(),).cloud_run_revision_filters(vec!["meh:bleh".to_string()]).host_filters(vec![]),).type_(GCPServiceAccountType::GCP_SERVICE_ACCOUNT),);letconfiguration=datadog::Configuration::new();letapi=GCPIntegrationAPI::with_config(configuration);letresp=api.create_gcpsts_account(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Create a new entry for your service account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiCreateGCPSTSAccountRequest={body:{data:{attributes:{clientEmail:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",hostFilters:[],},type:"gcp_service_account",},},};apiInstance.createGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a new entry for your service account with account_tags returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiCreateGCPSTSAccountRequest={body:{data:{attributes:{accountTags:["lorem","ipsum"],clientEmail:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",hostFilters:[],},type:"gcp_service_account",},},};apiInstance.createGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a new entry for your service account with cloud run revision filters enabled returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiCreateGCPSTSAccountRequest={body:{data:{attributes:{cloudRunRevisionFilters:["meh:bleh"],clientEmail:"Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",hostFilters:[],},type:"gcp_service_account",},},};apiInstance.createGCPSTSAccount(params).then((data: v2.GCPSTSServiceAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
This endpoint is deprecated – use the V2 endpoints instead. Delete a given Datadog-GCP integration.
This endpoint requires the gcp_configurations_manage permission.
Should be https://www.googleapis.com/oauth2/v1/certs.
auth_uri
string
Should be https://accounts.google.com/o/oauth2/auth.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your email found in your JSON service account key.
client_id
string
Your ID found in your JSON service account key.
client_x509_cert_url
string
Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
where $CLIENT_EMAIL is the email found in your JSON service account key.
cloud_run_revision_filters
[string]
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.
errors
[string]
An array of errors.
host_filters
string
Limit the GCE instances that are pulled into Datadog by using tags.
Only hosts that match one of the defined tags are imported into Datadog.
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_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.
private_key
string
Your private key name found in your JSON service account key.
private_key_id
string
Your private key ID found in your JSON service account key.
project_id
string
Your Google Cloud project ID found in your JSON service account key.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
token_uri
string
Should be https://accounts.google.com/o/oauth2/token.
type
string
The value for service_account found in your JSON service account key.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete a GCP integration returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.GCPIntegrationApi(configuration);constparams: v1.GCPIntegrationApiDeleteGCPIntegrationRequest={body:{clientEmail:"252bf553ef04b351@example.com",clientId:"163662907116366290710",projectId:"datadog-apitest",},};apiInstance.deleteGCPIntegration(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete an STS enabled GCP Account returns "No Content" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiDeleteGCPSTSAccountRequest={accountId:"account_id",};apiInstance.deleteGCPSTSAccount(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
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.
This endpoint requires the gcp_configuration_edit permission.
Should be https://www.googleapis.com/oauth2/v1/certs.
auth_uri
string
Should be https://accounts.google.com/o/oauth2/auth.
automute
boolean
Silence monitors for expected GCE instance shutdowns.
client_email
string
Your email found in your JSON service account key.
client_id
string
Your ID found in your JSON service account key.
client_x509_cert_url
string
Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL
where $CLIENT_EMAIL is the email found in your JSON service account key.
cloud_run_revision_filters
[string]
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.
errors
[string]
An array of errors.
host_filters
string
Limit the GCE instances that are pulled into Datadog by using tags.
Only hosts that match one of the defined tags are imported into Datadog.
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_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.
private_key
string
Your private key name found in your JSON service account key.
private_key_id
string
Your private key ID found in your JSON service account key.
project_id
string
Your Google Cloud project ID found in your JSON service account key.
resource_collection_enabled
boolean
When enabled, Datadog scans for all resources in your GCP environment.
token_uri
string
Should be https://accounts.google.com/o/oauth2/token.
type
string
The value for service_account found in your JSON service account key.
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Update a GCP integration cloud run revision filters returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.GCPIntegrationApi(configuration);constparams: v1.GCPIntegrationApiUpdateGCPIntegrationRequest={body:{authProviderX509CertUrl:"https://www.googleapis.com/oauth2/v1/certs",authUri:"https://accounts.google.com/o/oauth2/auth",clientEmail:"252bf553ef04b351@example.com",clientId:"163662907116366290710",clientX509CertUrl:"https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",hostFilters:"key:value,filter:example",cloudRunRevisionFilters:["merp:derp"],isCspmEnabled: true,isSecurityCommandCenterEnabled: true,privateKey:"private_key",privateKeyId:"123456789abcdefghi123456789abcdefghijklm",projectId:"datadog-apitest",resourceCollectionEnabled: true,tokenUri:"https://accounts.google.com/o/oauth2/token",type:"service_account",},};apiInstance.updateGCPIntegration(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));