Skip to main content

daily_bandwidth_metrics

Creates, updates, deletes, gets or lists a daily_bandwidth_metrics resource.

Overview

Namedaily_bandwidth_metrics
TypeResource
Iddigitalocean.apps.daily_bandwidth_metrics

Fields

The following fields are returned by SELECT queries:

A JSON object with a app_bandwidth_usage key

NameDatatypeDescription
app_bandwidth_usagearrayA list of bandwidth usage details by app.
datestring (date-time)The date for the metrics data. (example: 2023-01-17T00:00:00Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
apps_get_metrics_bandwidth_dailyselectapp_iddateRetrieve daily bandwidth usage metrics for a single app.
apps_list_metrics_bandwidth_dailyinsertdata__app_idsRetrieve daily bandwidth usage metrics for multiple apps.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app_idstringThe app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf)
datestring (date-time)Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday. (example: 2023-01-17T00:00:00Z)

SELECT examples

Retrieve daily bandwidth usage metrics for a single app.

SELECT
app_bandwidth_usage,
date
FROM digitalocean.apps.daily_bandwidth_metrics
WHERE app_id = '{{ app_id }}' -- required
AND date = '{{ date }}';

INSERT examples

Retrieve daily bandwidth usage metrics for multiple apps.

INSERT INTO digitalocean.apps.daily_bandwidth_metrics (
data__app_ids,
data__date
)
SELECT
'{{ app_ids }}' --required,
'{{ date }}'
RETURNING
app_bandwidth_usage,
date
;