"""
Delete an SLO returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.service_level_objectives_apiimportServiceLevelObjectivesApi# there is a valid "slo" in the systemSLO_DATA_0_ID=environ["SLO_DATA_0_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=ServiceLevelObjectivesApi(api_client)response=api_instance.delete_slo(slo_id=SLO_DATA_0_ID,)print(response)
# Delete an SLO returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::ServiceLevelObjectivesAPI.new# there is a valid "slo" in the systemSLO_DATA_0_ID=ENV["SLO_DATA_0_ID"]papi_instance.delete_slo(SLO_DATA_0_ID)
// Delete an SLO 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 "slo" in the systemSloData0ID:=os.Getenv("SLO_DATA_0_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewServiceLevelObjectivesApi(apiClient)resp,r,err:=api.DeleteSLO(ctx,SloData0ID,*datadogV1.NewDeleteSLOOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ServiceLevelObjectivesApi.DeleteSLO`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ServiceLevelObjectivesApi.DeleteSLO`:\n%s\n",responseContent)}
// Delete an SLO returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.ServiceLevelObjectivesApi;importcom.datadog.api.client.v1.model.SLODeleteResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();ServiceLevelObjectivesApiapiInstance=newServiceLevelObjectivesApi(defaultClient);// there is a valid "slo" in the systemStringSLO_DATA_0_ID=System.getenv("SLO_DATA_0_ID");try{SLODeleteResponseresult=apiInstance.deleteSLO(SLO_DATA_0_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ServiceLevelObjectivesApi#deleteSLO");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Delete an SLO returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_service_level_objectives::DeleteSLOOptionalParams;usedatadog_api_client::datadogV1::api_service_level_objectives::ServiceLevelObjectivesAPI;#[tokio::main]asyncfnmain(){// there is a valid "slo" in the system
letslo_data_0_id=std::env::var("SLO_DATA_0_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=ServiceLevelObjectivesAPI::with_config(configuration);letresp=api.delete_slo(slo_data_0_id.clone(),DeleteSLOOptionalParams::default()).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 an SLO returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.ServiceLevelObjectivesApi(configuration);// there is a valid "slo" in the system
constSLO_DATA_0_ID=process.env.SLO_DATA_0_IDasstring;constparams: v1.ServiceLevelObjectivesApiDeleteSLORequest={sloId: SLO_DATA_0_ID,};apiInstance.deleteSLO(params).then((data: v1.SLODeleteResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));