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: use OpenCloud\CloudMonitoring\Exception;
14: use OpenCloud\Common\Collection\ResourceIterator;
15: 
16: /**
17:  * Agent class.
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: }
PHP OpenCloud API API documentation generated by ApiGen 2.8.0