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 21 22
23 class Entity extends AbstractResource
24 {
25 26 27
28 private $id;
29
30 31 32
33 private $label;
34
35 36 37
38 private $agent_id;
39
40 41 42
43 private $ip_addresses;
44
45 protected static $json_name = false;
46 protected static $url_resource = 'entities';
47 protected static $json_collection_name = 'values';
48
49 protected static $emptyObject = array(
50 'label',
51 'agent_id',
52 'ip_addresses',
53 'metadata'
54 );
55
56 protected static $requiredKeys = array(
57 'label'
58 );
59
60 public function getChecks()
61 {
62 return $this->getService()->resourceList('Check', null, $this);
63 }
64
65 public function getCheck($id = null)
66 {
67 return $this->getService()->resource('Check', $id, $this);
68 }
69
70 public function createCheck(array $params)
71 {
72 return $this->getCheck()->create($params);
73 }
74
75 public function testNewCheckParams(array $params, $debug = false)
76 {
77 return $this->getCheck()->testParams($params, $debug);
78 }
79
80 public function createAlarm(array $params)
81 {
82 return $this->getService()->resource('Alarm', $params, $this)->create();
83 }
84
85 public function testAlarm(array $params)
86 {
87 return $this->getService()->resource('Alarm', null, $this)->test($params);
88 }
89
90 public function getAlarms()
91 {
92 return $this->getService()->resourceList('Alarm', null, $this);
93 }
94
95 public function getAlarm($id = null)
96 {
97 return $this->getService()->resource('Alarm', $id, $this);
98 }
99 }
100