Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Identity
      • Log
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Resource
    • LoadBalancer
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
    • Queues
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

  • AbstractResource
  • Agent
  • AgentConnection
  • AgentHost
  • AgentHostInfo
  • AgentTarget
  • AgentToken
  • Alarm
  • Changelog
  • Check
  • CheckType
  • Entity
  • Metric
  • Notification
  • NotificationHistory
  • NotificationPlan
  • NotificationType
  • ReadonlyResource
  • View
  • Zone
  • Overview
  • Namespace
  • Class
  • Tree
  • Download
 1: <?php
 2: /**
 3:  * PHP OpenCloud library.
 4:  * 
 5:  * @copyright 2013 Rackspace Hosting, Inc. See LICENSE for information.
 6:  * @license   https://www.apache.org/licenses/LICENSE-2.0
 7:  * @author    Glen Campbell <glen.campbell@rackspace.com>
 8:  * @author    Jamie Hannaford <jamie.hannaford@rackspace.com>
 9:  */
10: 
11: namespace OpenCloud\CloudMonitoring\Resource;
12: 
13: /**
14:  * Entity class.
15:  */
16: class Entity extends AbstractResource
17: {
18:     /**
19:      * @var string
20:      */
21:     private $id;
22: 
23:     /**
24:      * @var string Defines a name for the entity.
25:      */
26:     private $label;
27: 
28:     /**
29:      * @var string Agent to which this entity is bound to.
30:      */
31:     private $agent_id;
32: 
33:     /**
34:      * @var array Hash of IP addresses that can be referenced by checks on this entity.
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: }
PHP OpenCloud API API documentation generated by ApiGen 2.8.0