Manage your Datadog Confluent Cloud integration accounts and account resources directly through the Datadog API. See the Confluent Cloud page for more information.
"""
Get resource from Confluent account returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)response=api_instance.get_confluent_resource(account_id="account_id",resource_id="resource_id",)print(response)
# Get resource from Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.newpapi_instance.get_confluent_resource("account_id","resource_id")
// Get resource from Confluent 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(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)resp,r,err:=api.GetConfluentResource(ctx,"account_id","resource_id")iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.GetConfluentResource`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ConfluentCloudApi.GetConfluentResource`:\n%s\n",responseContent)}
/**
* Get resource from Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);constparams: v2.ConfluentCloudApiGetConfluentResourceRequest={accountId:"account_id",resourceId:"resource_id",};apiInstance.getConfluentResource(params).then((data: v2.ConfluentResourceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Add resource to Confluent 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 "confluent_account" in the system
ConfluentAccountDataID:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ID")body:=datadogV2.ConfluentResourceRequest{Data:datadogV2.ConfluentResourceRequestData{Attributes:datadogV2.ConfluentResourceRequestAttributes{ResourceType:"kafka",Tags:[]string{"myTag","myTag2:myValue",},EnableCustomMetrics:datadog.PtrBool(false),},Id:"exampleconfluentcloud",Type:datadogV2.CONFLUENTRESOURCETYPE_CONFLUENT_CLOUD_RESOURCES,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)resp,r,err:=api.CreateConfluentResource(ctx,ConfluentAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.CreateConfluentResource`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ConfluentCloudApi.CreateConfluentResource`:\n%s\n",responseContent)}
// Add resource to Confluent account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ConfluentCloudApi;importcom.datadog.api.client.v2.model.ConfluentResourceRequest;importcom.datadog.api.client.v2.model.ConfluentResourceRequestAttributes;importcom.datadog.api.client.v2.model.ConfluentResourceRequestData;importcom.datadog.api.client.v2.model.ConfluentResourceResponse;importcom.datadog.api.client.v2.model.ConfluentResourceType;importjava.util.Arrays;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ConfluentCloudApiapiInstance=newConfluentCloudApi(defaultClient);// there is a valid "confluent_account" in the systemStringCONFLUENT_ACCOUNT_DATA_ID=System.getenv("CONFLUENT_ACCOUNT_DATA_ID");ConfluentResourceRequestbody=newConfluentResourceRequest().data(newConfluentResourceRequestData().attributes(newConfluentResourceRequestAttributes().resourceType("kafka").tags(Arrays.asList("myTag","myTag2:myValue")).enableCustomMetrics(false)).id("exampleconfluentcloud").type(ConfluentResourceType.CONFLUENT_CLOUD_RESOURCES));try{ConfluentResourceResponseresult=apiInstance.createConfluentResource(CONFLUENT_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ConfluentCloudApi#createConfluentResource");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Add resource to Confluent account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApifromdatadog_api_client.v2.model.confluent_resource_requestimportConfluentResourceRequestfromdatadog_api_client.v2.model.confluent_resource_request_attributesimportConfluentResourceRequestAttributesfromdatadog_api_client.v2.model.confluent_resource_request_dataimportConfluentResourceRequestDatafromdatadog_api_client.v2.model.confluent_resource_typeimportConfluentResourceType# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=environ["CONFLUENT_ACCOUNT_DATA_ID"]body=ConfluentResourceRequest(data=ConfluentResourceRequestData(attributes=ConfluentResourceRequestAttributes(resource_type="kafka",tags=["myTag","myTag2:myValue",],enable_custom_metrics=False,),id="exampleconfluentcloud",type=ConfluentResourceType.CONFLUENT_CLOUD_RESOURCES,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)response=api_instance.create_confluent_resource(account_id=CONFLUENT_ACCOUNT_DATA_ID,body=body)print(response)
# Add resource to Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.new# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=ENV["CONFLUENT_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::ConfluentResourceRequest.new({data:DatadogAPIClient::V2::ConfluentResourceRequestData.new({attributes:DatadogAPIClient::V2::ConfluentResourceRequestAttributes.new({resource_type:"kafka",tags:["myTag","myTag2:myValue",],enable_custom_metrics:false,}),id:"exampleconfluentcloud",type:DatadogAPIClient::V2::ConfluentResourceType::CONFLUENT_CLOUD_RESOURCES,}),})papi_instance.create_confluent_resource(CONFLUENT_ACCOUNT_DATA_ID,body)
/**
* Add resource to Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);// there is a valid "confluent_account" in the system
constCONFLUENT_ACCOUNT_DATA_ID=process.env.CONFLUENT_ACCOUNT_DATA_IDasstring;constparams: v2.ConfluentCloudApiCreateConfluentResourceRequest={body:{data:{attributes:{resourceType:"kafka",tags:["myTag","myTag2:myValue"],enableCustomMetrics: false,},id:"exampleconfluentcloud",type:"confluent-cloud-resources",},},accountId: CONFLUENT_ACCOUNT_DATA_ID,};apiInstance.createConfluentResource(params).then((data: v2.ConfluentResourceResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Update Confluent 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 "confluent_account" in the system
ConfluentAccountDataAttributesAPIKey:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY")ConfluentAccountDataID:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ID")body:=datadogV2.ConfluentAccountUpdateRequest{Data:datadogV2.ConfluentAccountUpdateRequestData{Attributes:datadogV2.ConfluentAccountUpdateRequestAttributes{ApiKey:ConfluentAccountDataAttributesAPIKey,ApiSecret:"update-secret",Tags:[]string{"updated_tag:val",},},Type:datadogV2.CONFLUENTACCOUNTTYPE_CONFLUENT_CLOUD_ACCOUNTS,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)resp,r,err:=api.UpdateConfluentAccount(ctx,ConfluentAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.UpdateConfluentAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ConfluentCloudApi.UpdateConfluentAccount`:\n%s\n",responseContent)}
// Update Confluent account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ConfluentCloudApi;importcom.datadog.api.client.v2.model.ConfluentAccountResponse;importcom.datadog.api.client.v2.model.ConfluentAccountType;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequest;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequestAttributes;importcom.datadog.api.client.v2.model.ConfluentAccountUpdateRequestData;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ConfluentCloudApiapiInstance=newConfluentCloudApi(defaultClient);// there is a valid "confluent_account" in the systemStringCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=System.getenv("CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY");StringCONFLUENT_ACCOUNT_DATA_ID=System.getenv("CONFLUENT_ACCOUNT_DATA_ID");ConfluentAccountUpdateRequestbody=newConfluentAccountUpdateRequest().data(newConfluentAccountUpdateRequestData().attributes(newConfluentAccountUpdateRequestAttributes().apiKey(CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY).apiSecret("update-secret").tags(Collections.singletonList("updated_tag:val"))).type(ConfluentAccountType.CONFLUENT_CLOUD_ACCOUNTS));try{ConfluentAccountResponseresult=apiInstance.updateConfluentAccount(CONFLUENT_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ConfluentCloudApi#updateConfluentAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update Confluent account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApifromdatadog_api_client.v2.model.confluent_account_typeimportConfluentAccountTypefromdatadog_api_client.v2.model.confluent_account_update_requestimportConfluentAccountUpdateRequestfromdatadog_api_client.v2.model.confluent_account_update_request_attributesimport(ConfluentAccountUpdateRequestAttributes,)fromdatadog_api_client.v2.model.confluent_account_update_request_dataimportConfluentAccountUpdateRequestData# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=environ["CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY"]CONFLUENT_ACCOUNT_DATA_ID=environ["CONFLUENT_ACCOUNT_DATA_ID"]body=ConfluentAccountUpdateRequest(data=ConfluentAccountUpdateRequestData(attributes=ConfluentAccountUpdateRequestAttributes(api_key=CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,api_secret="update-secret",tags=["updated_tag:val",],),type=ConfluentAccountType.CONFLUENT_CLOUD_ACCOUNTS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)response=api_instance.update_confluent_account(account_id=CONFLUENT_ACCOUNT_DATA_ID,body=body)print(response)
# Update Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.new# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=ENV["CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY"]CONFLUENT_ACCOUNT_DATA_ID=ENV["CONFLUENT_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::ConfluentAccountUpdateRequest.new({data:DatadogAPIClient::V2::ConfluentAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::ConfluentAccountUpdateRequestAttributes.new({api_key:CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,api_secret:"update-secret",tags:["updated_tag:val",],}),type:DatadogAPIClient::V2::ConfluentAccountType::CONFLUENT_CLOUD_ACCOUNTS,}),})papi_instance.update_confluent_account(CONFLUENT_ACCOUNT_DATA_ID,body)
/**
* Update Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);// there is a valid "confluent_account" in the system
constCONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY=process.env.CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEYasstring;constCONFLUENT_ACCOUNT_DATA_ID=process.env.CONFLUENT_ACCOUNT_DATA_IDasstring;constparams: v2.ConfluentCloudApiUpdateConfluentAccountRequest={body:{data:{attributes:{apiKey: CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY,apiSecret:"update-secret",tags:["updated_tag:val"],},type:"confluent-cloud-accounts",},},accountId: CONFLUENT_ACCOUNT_DATA_ID,};apiInstance.updateConfluentAccount(params).then((data: v2.ConfluentAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get Confluent account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApi# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=environ["CONFLUENT_ACCOUNT_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)response=api_instance.get_confluent_account(account_id=CONFLUENT_ACCOUNT_DATA_ID,)print(response)
# Get Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.new# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=ENV["CONFLUENT_ACCOUNT_DATA_ID"]papi_instance.get_confluent_account(CONFLUENT_ACCOUNT_DATA_ID)
// Get Confluent 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 "confluent_account" in the system
ConfluentAccountDataID:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)resp,r,err:=api.GetConfluentAccount(ctx,ConfluentAccountDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.GetConfluentAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ConfluentCloudApi.GetConfluentAccount`:\n%s\n",responseContent)}
// Get Confluent account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ConfluentCloudApi;importcom.datadog.api.client.v2.model.ConfluentAccountResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ConfluentCloudApiapiInstance=newConfluentCloudApi(defaultClient);// there is a valid "confluent_account" in the systemStringCONFLUENT_ACCOUNT_DATA_ID=System.getenv("CONFLUENT_ACCOUNT_DATA_ID");try{ConfluentAccountResponseresult=apiInstance.getConfluentAccount(CONFLUENT_ACCOUNT_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ConfluentCloudApi#getConfluentAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
/**
* Get Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);// there is a valid "confluent_account" in the system
constCONFLUENT_ACCOUNT_DATA_ID=process.env.CONFLUENT_ACCOUNT_DATA_IDasstring;constparams: v2.ConfluentCloudApiGetConfluentAccountRequest={accountId: CONFLUENT_ACCOUNT_DATA_ID,};apiInstance.getConfluentAccount(params).then((data: v2.ConfluentAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Delete Confluent account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.confluent_cloud_apiimportConfluentCloudApi# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=environ["CONFLUENT_ACCOUNT_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ConfluentCloudApi(api_client)api_instance.delete_confluent_account(account_id=CONFLUENT_ACCOUNT_DATA_ID,)
# Delete Confluent account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::ConfluentCloudAPI.new# there is a valid "confluent_account" in the systemCONFLUENT_ACCOUNT_DATA_ID=ENV["CONFLUENT_ACCOUNT_DATA_ID"]api_instance.delete_confluent_account(CONFLUENT_ACCOUNT_DATA_ID)
// Delete Confluent account returns "OK" response
packagemainimport("context""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 "confluent_account" in the system
ConfluentAccountDataID:=os.Getenv("CONFLUENT_ACCOUNT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewConfluentCloudApi(apiClient)r,err:=api.DeleteConfluentAccount(ctx,ConfluentAccountDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ConfluentCloudApi.DeleteConfluentAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete Confluent account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ConfluentCloudApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ConfluentCloudApiapiInstance=newConfluentCloudApi(defaultClient);// there is a valid "confluent_account" in the systemStringCONFLUENT_ACCOUNT_DATA_ID=System.getenv("CONFLUENT_ACCOUNT_DATA_ID");try{apiInstance.deleteConfluentAccount(CONFLUENT_ACCOUNT_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling ConfluentCloudApi#deleteConfluentAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
/**
* Delete Confluent account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.ConfluentCloudApi(configuration);// there is a valid "confluent_account" in the system
constCONFLUENT_ACCOUNT_DATA_ID=process.env.CONFLUENT_ACCOUNT_DATA_IDasstring;constparams: v2.ConfluentCloudApiDeleteConfluentAccountRequest={accountId: CONFLUENT_ACCOUNT_DATA_ID,};apiInstance.deleteConfluentAccount(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));