1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: namespace OpenCloud\CloudMonitoring\Resource;
12:
13: 14: 15:
16: class Entity extends AbstractResource
17: {
18: 19: 20:
21: private $id;
22:
23: 24: 25:
26: private $label;
27:
28: 29: 30:
31: private $agent_id;
32:
33: 34: 35:
36: private $ip_addresses;
37:
38: protected static $json_name = false;
39: protected static $url_resource = 'entities';
40: protected static $json_collection_name = 'values';
41:
42: protected static $emptyObject = array(
43: 'label',
44: 'agent_id',
45: 'ip_addresses',
46: 'metadata'
47: );
48:
49: protected static $requiredKeys = array(
50: 'label'
51: );
52:
53: public function getChecks()
54: {
55: return $this->getService()->resourceList('Check', null, $this);
56: }
57:
58: public function getCheck($id = null)
59: {
60: return $this->getService()->resource('Check', $id, $this);
61: }
62:
63: public function createCheck(array $params)
64: {
65: return $this->getCheck()->create($params);
66: }
67:
68: public function testNewCheckParams(array $params, $debug = false)
69: {
70: return $this->getCheck()->testParams($params, $debug);
71: }
72:
73: public function createAlarm(array $params)
74: {
75: return $this->getService()->resource('Alarm', $params, $this)->create();
76: }
77:
78: public function testAlarm(array $params)
79: {
80: return $this->getService()->resource('Alarm', null, $this)->test($params);
81: }
82:
83: public function getAlarms()
84: {
85: return $this->getService()->resourceList('Alarm', null, $this);
86: }
87:
88: public function getAlarm($id = null)
89: {
90: return $this->getService()->resource('Alarm', $id, $this);
91: }
92:
93: }