-
Notifications
You must be signed in to change notification settings - Fork 8
Servers::getMetrics
Danny Li edited this page Feb 4, 2018
·
1 revision
Get metrics for specified server.
Metrics are available for the last 30 days only.
If you do not provide the step argument the API will automatically adjust it so that a maximum of 100 samples are returned.
The API limits the number of samples returned to a maximum of 500 and will adjust the step
parameter accordingly.
Parameter | Type | Description | Optional | Default |
---|---|---|---|---|
$id |
int | Server ID | No | - |
$start |
int/string | Start of period to get metrics for (can be UNIX timestamp or date string) | No | - |
$end |
int/string | End of period to get metrics for (can be UNIX timestamp or date string) | No | - |
$types |
array | Type of metrics to get (cpu , disk , network ) |
No | array('cpu', 'disk', 'network') |
$step |
int/null | Resolution of results in seconds. If you do not provide the step argument the API will automatically adjust it so that a maximum of 100 samples are returned. | Yes | null |
object
Hetzner Cloud documentation:
For more information about the metrics object, please read the official documentation.
<?php
use Exploriment\HetznerCloud;
// retrieve the metrics of the past hour
$metrics = HetznerCloud\Servers::getMetrics(1, time() - 3600, time());
var_dump($metrics);
by Exploriment.io
- README.md
-
Resources introduction
- Actions
-
Servers
::findAction
::create
::getMetrics
::rename
::start
-
::powerOn
(alias) ::reboot
-
::restart
(alias) ::reset
::shutdown
-
::stop
(alias) ::powerOff
::resetPassword
::enableRescue
::disableRescue
::createImage
::rebuild
::changeType
::enableBackups
::disableBackups
::attachIso
::detachIso
::changeDnsPtr
::changeProtection
::requestConsole
::delete
- FloatingIps
- SshKeys
- ServerTypes
- Locations
- Datacenters
- Images
- ISOs