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