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\Autoscale;
12:
13: use OpenCloud\OpenStack;
14: use OpenCloud\Common\Service\AbstractService;
15:
16: /**
17: * The Autoscale class represents the OpenStack Otter service.
18: */
19: class Service extends AbstractService
20: {
21: const DEFAULT_TYPE = 'rax:autoscale';
22: const DEFAULT_NAME = 'autoscale';
23:
24: /**
25: * Autoscale resources.
26: *
27: * @var array
28: * @access private
29: */
30: public $resources = array(
31: 'Group',
32: 'GroupConfiguration',
33: 'LaunchConfiguration',
34: 'ScalingPolicy'
35: );
36:
37: /**
38: * Convenience method for getting an autoscale group.
39: *
40: * @param mixed $info
41: * @return AbstractResource
42: */
43: public function group($info = null)
44: {
45: return $this->resource('Group', $info);
46: }
47:
48: /**
49: * Convenience method for getting a list of autoscale groups.
50: *
51: * @return OpenCloud\Common\Collection
52: */
53: public function groupList()
54: {
55: return $this->resourceList('Group');
56: }
57:
58: }
59: