droplet_bandwidth_metrics
Creates, updates, deletes, gets or lists a droplet_bandwidth_metrics
resource.
Overview
Name | droplet_bandwidth_metrics |
Type | Resource |
Id | digitalocean.monitoring.droplet_bandwidth_metrics |
Fields
The following fields are returned by SELECT
queries:
- monitoring_get_droplet_bandwidth_metrics
The response will be a JSON object with a key called data
and status
.
Name | Datatype | Description |
---|---|---|
data | object | |
status | string | (example: success) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
monitoring_get_droplet_bandwidth_metrics | select | host_id , interface , direction , start , end | 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). |
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 |
---|---|---|
direction | string | The traffic direction. (example: inbound) |
end | string | UNIX timestamp to end metric window. (example: 1620705417) |
host_id | string | The droplet ID. (example: 17209102) |
interface | string | The network interface. (example: private) |
start | string | UNIX timestamp to start metric window. (example: 1620683817) |
SELECT
examples
- monitoring_get_droplet_bandwidth_metrics
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;