"""
Delete a custom destination returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.logs_custom_destinations_apiimportLogsCustomDestinationsApi# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=environ["CUSTOM_DESTINATION_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=LogsCustomDestinationsApi(api_client)api_instance.delete_logs_custom_destination(custom_destination_id=CUSTOM_DESTINATION_DATA_ID,)
# Delete a custom destination returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::LogsCustomDestinationsAPI.new# there is a valid "custom_destination" in the systemCUSTOM_DESTINATION_DATA_ID=ENV["CUSTOM_DESTINATION_DATA_ID"]api_instance.delete_logs_custom_destination(CUSTOM_DESTINATION_DATA_ID)
// Delete a custom destination returns "OK" responsepackagemainimport("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 "custom_destination" in the systemCustomDestinationDataID:=os.Getenv("CUSTOM_DESTINATION_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewLogsCustomDestinationsApi(apiClient)r,err:=api.DeleteLogsCustomDestination(ctx,CustomDestinationDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `LogsCustomDestinationsApi.DeleteLogsCustomDestination`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}}
// Delete a custom destination returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.LogsCustomDestinationsApi;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();LogsCustomDestinationsApiapiInstance=newLogsCustomDestinationsApi(defaultClient);// there is a valid "custom_destination" in the systemStringCUSTOM_DESTINATION_DATA_ID=System.getenv("CUSTOM_DESTINATION_DATA_ID");try{apiInstance.deleteLogsCustomDestination(CUSTOM_DESTINATION_DATA_ID);}catch(ApiExceptione){System.err.println("Exception when calling LogsCustomDestinationsApi#deleteLogsCustomDestination");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete a custom destination returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_logs_custom_destinations::LogsCustomDestinationsAPI;#[tokio::main]asyncfnmain(){// there is a valid "custom_destination" in the system
letcustom_destination_data_id=std::env::var("CUSTOM_DESTINATION_DATA_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=LogsCustomDestinationsAPI::with_config(configuration);letresp=api.delete_logs_custom_destination(custom_destination_data_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Delete a custom destination returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.LogsCustomDestinationsApi(configuration);// there is a valid "custom_destination" in the system
constCUSTOM_DESTINATION_DATA_ID=process.env.CUSTOM_DESTINATION_DATA_IDasstring;constparams: v2.LogsCustomDestinationsApiDeleteLogsCustomDestinationRequest={customDestinationId: CUSTOM_DESTINATION_DATA_ID,};apiInstance.deleteLogsCustomDestination(params).then((data: any)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));