1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: namespace OpenCloud\CloudMonitoring\Resource;
12:
13: use OpenCloud\CloudMonitoring\Exception;
14: use OpenCloud\Common\Collection\ResourceIterator;
15:
16: 17: 18:
19: class AgentHost extends ReadOnlyResource
20: {
21: private $token;
22: private $label;
23:
24: protected static $json_name = false;
25: protected static $json_collection_name = 'info';
26: protected static $url_resource = 'host_info';
27:
28: private $allowedTypes = array(
29: 'cpus',
30: 'disks',
31: 'filesystems',
32: 'memory',
33: 'network_interfaces',
34: 'processes',
35: 'system',
36: 'who'
37: );
38:
39: public function info($type)
40: {
41: if (!in_array($type, $this->allowedTypes)) {
42: throw new Exception\AgentException(sprintf(
43: 'Incorrect info type. Please specify one of the following: %s',
44: implode(', ', $this->allowedTypes)
45: ));
46: }
47:
48: return $this->getService()->resourceList('AgentHostInfo', $this->getUrl($type), $this);
49: }
50:
51: }