"""
Delete tests returns "OK." response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.synthetics_apiimportSyntheticsApifromdatadog_api_client.v1.model.synthetics_delete_tests_payloadimportSyntheticsDeleteTestsPayload# there is a valid "synthetics_api_test" in the systemSYNTHETICS_API_TEST_PUBLIC_ID=environ["SYNTHETICS_API_TEST_PUBLIC_ID"]body=SyntheticsDeleteTestsPayload(public_ids=[SYNTHETICS_API_TEST_PUBLIC_ID,],)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=SyntheticsApi(api_client)response=api_instance.delete_tests(body=body)print(response)
# Delete tests returns "OK." responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::SyntheticsAPI.new# there is a valid "synthetics_api_test" in the systemSYNTHETICS_API_TEST_PUBLIC_ID=ENV["SYNTHETICS_API_TEST_PUBLIC_ID"]body=DatadogAPIClient::V1::SyntheticsDeleteTestsPayload.new({public_ids:[SYNTHETICS_API_TEST_PUBLIC_ID,],})papi_instance.delete_tests(body)
// Delete tests 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/datadogV1")funcmain(){// there is a valid "synthetics_api_test" in the systemSyntheticsAPITestPublicID:=os.Getenv("SYNTHETICS_API_TEST_PUBLIC_ID")body:=datadogV1.SyntheticsDeleteTestsPayload{PublicIds:[]string{SyntheticsAPITestPublicID,},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewSyntheticsApi(apiClient)resp,r,err:=api.DeleteTests(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `SyntheticsApi.DeleteTests`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `SyntheticsApi.DeleteTests`:\n%s\n",responseContent)}
// Delete tests returns "OK." responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.SyntheticsApi;importcom.datadog.api.client.v1.model.SyntheticsDeleteTestsPayload;importcom.datadog.api.client.v1.model.SyntheticsDeleteTestsResponse;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();SyntheticsApiapiInstance=newSyntheticsApi(defaultClient);// there is a valid "synthetics_api_test" in the systemStringSYNTHETICS_API_TEST_PUBLIC_ID=System.getenv("SYNTHETICS_API_TEST_PUBLIC_ID");SyntheticsDeleteTestsPayloadbody=newSyntheticsDeleteTestsPayload().publicIds(Collections.singletonList(SYNTHETICS_API_TEST_PUBLIC_ID));try{SyntheticsDeleteTestsResponseresult=apiInstance.deleteTests(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling SyntheticsApi#deleteTests");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete tests returns "OK." response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;usedatadog_api_client::datadogV1::model::SyntheticsDeleteTestsPayload;#[tokio::main]asyncfnmain(){// there is a valid "synthetics_api_test" in the system
letsynthetics_api_test_public_id=std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();letbody=SyntheticsDeleteTestsPayload::new().public_ids(vec![synthetics_api_test_public_id.clone()]);letconfiguration=datadog::Configuration::new();letapi=SyntheticsAPI::with_config(configuration);letresp=api.delete_tests(body).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="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Delete tests returns "OK." response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.SyntheticsApi(configuration);// there is a valid "synthetics_api_test" in the system
constSYNTHETICS_API_TEST_PUBLIC_ID=process.env.SYNTHETICS_API_TEST_PUBLIC_IDasstring;constparams: v1.SyntheticsApiDeleteTestsRequest={body:{publicIds:[SYNTHETICS_API_TEST_PUBLIC_ID],},};apiInstance.deleteTests(params).then((data: v1.SyntheticsDeleteTestsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));