Get a presigned URL to download a file attached to a Synthetic test.
The returned URL is temporary and expires after a short period.
This endpoint requires the synthetics_read permission.
OAuth apps require the synthetics_read authorization scope to access this endpoint.
"""
Get a presigned URL for downloading a test file returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.synthetics_apiimportSyntheticsApifromdatadog_api_client.v2.model.synthetics_test_file_download_requestimportSyntheticsTestFileDownloadRequestbody=SyntheticsTestFileDownloadRequest(bucket_key="api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=SyntheticsApi(api_client)response=api_instance.get_test_file_download_url(public_id="abc-def-123",body=body)print(response)
# Get a presigned URL for downloading a test file returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::SyntheticsAPI.newbody=DatadogAPIClient::V2::SyntheticsTestFileDownloadRequest.new({bucket_key:"api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",})papi_instance.get_test_file_download_url("abc-def-123",body)
// Get a presigned URL for downloading a test file 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.SyntheticsTestFileDownloadRequest{BucketKey:"api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewSyntheticsApi(apiClient)resp,r,err:=api.GetTestFileDownloadUrl(ctx,"abc-def-123",body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `SyntheticsApi.GetTestFileDownloadUrl`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `SyntheticsApi.GetTestFileDownloadUrl`:\n%s\n",responseContent)}
// Get a presigned URL for downloading a test file 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.SyntheticsTestFileDownloadRequest;importcom.datadog.api.client.v2.model.SyntheticsTestFileDownloadResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();SyntheticsApiapiInstance=newSyntheticsApi(defaultClient);SyntheticsTestFileDownloadRequestbody=newSyntheticsTestFileDownloadRequest().bucketKey("api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json");try{SyntheticsTestFileDownloadResponseresult=apiInstance.getTestFileDownloadUrl("abc-def-123",body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling SyntheticsApi#getTestFileDownloadUrl");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a presigned URL for downloading a test file returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;usedatadog_api_client::datadogV2::model::SyntheticsTestFileDownloadRequest;#[tokio::main]asyncfnmain(){letbody=SyntheticsTestFileDownloadRequest::new("api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json".to_string(),);letconfiguration=datadog::Configuration::new();letapi=SyntheticsAPI::with_config(configuration);letresp=api.get_test_file_download_url("abc-def-123".to_string(),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
/**
* Get a presigned URL for downloading a test file returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.SyntheticsApi(configuration);constparams: v2.SyntheticsApiGetTestFileDownloadUrlRequest={body:{bucketKey:"api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json",},publicId:"abc-def-123",};apiInstance.getTestFileDownloadUrl(params).then((data: v2.SyntheticsTestFileDownloadResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));