Get daily custom reports.
Note: This endpoint will be fully deprecated on December 1, 2022.
Refer to Migrating from v1 to v2 of the Usage Attribution API for the associated migration guide.
This endpoint requires the usage_read permission.
Arguments
Query Strings
Name
Type
Description
page[size]
integer
The number of files to return in the response. [default=60].
page[number]
integer
The identifier of the first page to return. This parameter is used for the pagination feature [default=0].
sort_dir
enum
The direction to sort by: [desc, asc]. Allowed enum values: desc, asc
sort
enum
The field to sort by: [computed_on, size, start_date, end_date]. Allowed enum values: computed_on, size, start_date, end_date
"""
Get the list of available daily custom reports returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.usage_metering_apiimportUsageMeteringApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=UsageMeteringApi(api_client)response=api_instance.get_daily_custom_reports()print(response)
# Get the list of available daily custom reports returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::UsageMeteringAPI.newpapi_instance.get_daily_custom_reports()
// Get the list of available daily custom reports 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(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewUsageMeteringApi(apiClient)resp,r,err:=api.GetDailyCustomReports(ctx,*datadogV1.NewGetDailyCustomReportsOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `UsageMeteringApi.GetDailyCustomReports`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `UsageMeteringApi.GetDailyCustomReports`:\n%s\n",responseContent)}
// Get the list of available daily custom reports returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.UsageMeteringApi;importcom.datadog.api.client.v1.model.UsageCustomReportsResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();UsageMeteringApiapiInstance=newUsageMeteringApi(defaultClient);try{UsageCustomReportsResponseresult=apiInstance.getDailyCustomReports();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling UsageMeteringApi#getDailyCustomReports");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get the list of available daily custom reports returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_usage_metering::GetDailyCustomReportsOptionalParams;usedatadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=UsageMeteringAPI::with_config(configuration);letresp=api.get_daily_custom_reports(GetDailyCustomReportsOptionalParams::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="<API-KEY>"DD_APP_KEY="<APP-KEY>"cargo run
/**
* Get the list of available daily custom reports returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.UsageMeteringApi(configuration);apiInstance.getDailyCustomReports().then((data: v1.UsageCustomReportsResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));