Metric API Reference¶
The hosting.metric
API methods are used to retrieve usage statistics for
simplehost instances and virtual machines.
Methods¶
-
hosting.metric.
available
(apikey[, opts=nil])¶ List availables metrics for hosting resources.
Parameters: - apikey (string) – API connection key
- opts (struct) –
Filtering options
Returns: struct –
list of metrics per resource type
-
hosting.metric.
query
(apikey[, opts=nil])¶ Query metrics for hosting resources. All dates are in UTC.
Parameters: - apikey (string) – API connection key
- opts (struct) –
Filtering options
Returns: struct –
list of metric query results
Parameters¶
HostingMetricOptions
¶parameter of
hosting.metric.available()
Name Default Type Mandatory resource
string no filter on specific resources, all resources by default
MetricQueryFilter
¶parameter of
hosting.metric.query()
Name Default Type Mandatory end string yes query string yes resource_id int or array of int yes resource_type
string yes sampler
struct yes start string yes
ResourceType
¶used by
HostingMetricOptions
,MetricAvailableReturn
,MetricQueryFilter
andMetricValueReturn
Name Description vm Virtual Machine iface Network Interface disk Disk paas Paas Virtual Machine rproxy A Rproxy
Sampler
¶used by
MetricQueryFilter
Changed in version 3.3.25: key
percentile
has been added.
percentile
parameter.
Name Default Type Mandatory function
string yes sampling function to apply unit
string yes sampling duration value int yes sampling step percentile double no percentile precision, works only with percentile function, default is 0.75
Returns¶
MetricAvailableReturn
¶returned by
hosting.metric.available()
Name Type metrics string resource
string
MetricValueReturn
¶returned by
hosting.metric.query()
Name Type metric string points array resource_id int resource_type
string