"""
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
*/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));
"""
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" response
importcom.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
*/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));
// 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("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("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" response
importcom.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("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" response
importcom.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("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="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="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:"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:"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
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiCreateGCPSTSAccountRequest={body:{data:{attributes:{clientEmail:"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:"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));
Mettez à jour les filtres de host et/ou la désactivation automatique pour des intégrations Datadog/GCP. Les champs project_id et client_email sont requis, mais ils ne peuvent pas être mis à jour. Si vous devez mettre à jour ces champs, supprimez-les et utilisez l’endpoint de création (POST). Les champs non spécifiés conserveront leurs valeurs originales.
// Update STS 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(){// there is a valid "gcp_sts_account" in the system
GcpStsAccountDataID:=os.Getenv("GCP_STS_ACCOUNT_DATA_ID")body:=datadogV2.GCPSTSServiceAccountUpdateRequest{Data:&datadogV2.GCPSTSServiceAccountUpdateRequestData{Attributes:&datadogV2.GCPSTSServiceAccountAttributes{ClientEmail:datadog.PtrString("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
importcom.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 system
StringGCP_STS_ACCOUNT_DATA_ID=System.getenv("GCP_STS_ACCOUNT_DATA_ID");GCPSTSServiceAccountUpdateRequestbody=newGCPSTSServiceAccountUpdateRequest().data(newGCPSTSServiceAccountUpdateRequestData().attributes(newGCPSTSServiceAccountAttributes().clientEmail("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
"""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="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" 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:"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
*/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:"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));
// Create a Datadog GCP principal with empty body 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:=new(interface{})ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewGCPIntegrationApi(apiClient)resp,r,err:=api.MakeGCPSTSDelegate(ctx,*datadogV2.NewMakeGCPSTSDelegateOptionalParameters().WithBody(body))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `GCPIntegrationApi.MakeGCPSTSDelegate`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `GCPIntegrationApi.MakeGCPSTSDelegate`:\n%s\n",responseContent)}
// Create a Datadog GCP principal with empty body returns "OK" response
importcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.GcpIntegrationApi;importcom.datadog.api.client.v2.api.GcpIntegrationApi.MakeGCPSTSDelegateOptionalParameters;importcom.datadog.api.client.v2.model.GCPSTSDelegateAccountResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();GcpIntegrationApiapiInstance=newGcpIntegrationApi(defaultClient);Objectbody=newObject();try{GCPSTSDelegateAccountResponseresult=apiInstance.makeGCPSTSDelegate(newMakeGCPSTSDelegateOptionalParameters().body(body));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling GcpIntegrationApi#makeGCPSTSDelegate");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create a Datadog GCP principal with empty body returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.gcp_integration_apiimportGCPIntegrationApibody=dict()configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=GCPIntegrationApi(api_client)response=api_instance.make_gcpsts_delegate(body=body)print(response)
# Create a Datadog GCP principal with empty body returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::GCPIntegrationAPI.newbody={}opts={body:body,}papi_instance.make_gcpsts_delegate(opts)
/**
* Create a Datadog GCP principal with empty body returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.GCPIntegrationApi(configuration);constparams: v2.GCPIntegrationApiMakeGCPSTSDelegateRequest={body:{},};apiInstance.makeGCPSTSDelegate(params).then((data: v2.GCPSTSDelegateAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));