Skip to main content

droplet_bandwidth_metrics

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

Overview

Namedroplet_bandwidth_metrics
TypeResource
Iddigitalocean.monitoring.droplet_bandwidth_metrics

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called data and status.

NameDatatypeDescription
dataobject
statusstring (example: success)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
monitoring_get_droplet_bandwidth_metricsselecthost_id, interface, direction, start, endTo retrieve bandwidth metrics for a given Droplet, send a GET request to /v2/monitoring/metrics/droplet/bandwidth. Use the interface query parameter to specify if the results should be for the private or public interface. Use the direction query parameter to specify if the results should be for inbound or outbound traffic.
The metrics in the response body are in megabits per second (Mbps).

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
directionstringThe traffic direction. (example: inbound)
endstringUNIX timestamp to end metric window. (example: 1620705417)
host_idstringThe droplet ID. (example: 17209102)
interfacestringThe network interface. (example: private)
startstringUNIX timestamp to start metric window. (example: 1620683817)

SELECT examples

To retrieve bandwidth metrics for a given Droplet, send a GET request to /v2/monitoring/metrics/droplet/bandwidth. Use the interface query parameter to specify if the results should be for the private or public interface. Use the direction query parameter to specify if the results should be for inbound or outbound traffic.
The metrics in the response body are in megabits per second (Mbps).

SELECT
data,
status
FROM digitalocean.monitoring.droplet_bandwidth_metrics
WHERE host_id = '{{ host_id }}' -- required
AND interface = '{{ interface }}' -- required
AND direction = '{{ direction }}' -- required
AND start = '{{ start }}' -- required
AND end = '{{ end }}' -- required;