// Save new value for on-demand concurrency cap 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/datadogV2")funcmain(){body:=datadogV2.OnDemandConcurrencyCapAttributes{OnDemandConcurrencyCap:datadog.PtrFloat64(20),}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewSyntheticsApi(apiClient)resp,r,err:=api.SetOnDemandConcurrencyCap(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `SyntheticsApi.SetOnDemandConcurrencyCap`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `SyntheticsApi.SetOnDemandConcurrencyCap`:\n%s\n",responseContent)}
// Save new value for on-demand concurrency cap returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.SyntheticsApi;importcom.datadog.api.client.v2.model.OnDemandConcurrencyCapAttributes;importcom.datadog.api.client.v2.model.OnDemandConcurrencyCapResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();SyntheticsApiapiInstance=newSyntheticsApi(defaultClient);OnDemandConcurrencyCapAttributesbody=newOnDemandConcurrencyCapAttributes().onDemandConcurrencyCap(20.0);try{OnDemandConcurrencyCapResponseresult=apiInstance.setOnDemandConcurrencyCap(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling SyntheticsApi#setOnDemandConcurrencyCap");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Save new value for on-demand concurrency cap returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.synthetics_apiimportSyntheticsApifromdatadog_api_client.v2.model.on_demand_concurrency_cap_attributesimportOnDemandConcurrencyCapAttributesbody=OnDemandConcurrencyCapAttributes(on_demand_concurrency_cap=20.0,)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=SyntheticsApi(api_client)response=api_instance.set_on_demand_concurrency_cap(body=body)print(response)
# Save new value for on-demand concurrency cap returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::SyntheticsAPI.newbody=DatadogAPIClient::V2::OnDemandConcurrencyCapAttributes.new({on_demand_concurrency_cap:20,})papi_instance.set_on_demand_concurrency_cap(body)
// Save new value for on-demand concurrency cap returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;usedatadog_api_client::datadogV2::model::OnDemandConcurrencyCapAttributes;#[tokio::main]asyncfnmain(){letbody=OnDemandConcurrencyCapAttributes::new().on_demand_concurrency_cap(20.0asf64);letconfiguration=datadog::Configuration::new();letapi=SyntheticsAPI::with_config(configuration);letresp=api.set_on_demand_concurrency_cap(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="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Save new value for on-demand concurrency cap returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SyntheticsApi(configuration);constparams: v2.SyntheticsApiSetOnDemandConcurrencyCapRequest={body:{onDemandConcurrencyCap: 20,},};apiInstance.setOnDemandConcurrencyCap(params).then((data: v2.OnDemandConcurrencyCapResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));