daily_bandwidth_metrics
Creates, updates, deletes, gets or lists a daily_bandwidth_metrics
resource.
Overview
Name | daily_bandwidth_metrics |
Type | Resource |
Id | digitalocean.apps.daily_bandwidth_metrics |
Fields
The following fields are returned by SELECT
queries:
- apps_get_metrics_bandwidth_daily
A JSON object with a app_bandwidth_usage
key
Name | Datatype | Description |
---|---|---|
app_bandwidth_usage | array | A list of bandwidth usage details by app. |
date | string (date-time) | The date for the metrics data. (example: 2023-01-17T00:00:00Z) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
apps_get_metrics_bandwidth_daily | select | app_id | date | Retrieve daily bandwidth usage metrics for a single app. |
apps_list_metrics_bandwidth_daily | insert | data__app_ids | Retrieve 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.
Name | Datatype | Description |
---|---|---|
app_id | string | The app ID (example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf) |
date | string (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
- apps_get_metrics_bandwidth_daily
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
- apps_list_metrics_bandwidth_daily
- Manifest
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
;
# Description fields are for documentation purposes
- name: daily_bandwidth_metrics
props:
- name: app_ids
value: array
description: >
A list of app IDs to query bandwidth metrics for.
- name: date
value: string
description: >
Optional day to query. Only the date component of the timestamp will be considered. Default: yesterday.