1: <?php
2: /**
3: * Defines a block storage volume type
4: *
5: * @copyright 2012-2013 Rackspace Hosting, Inc.
6: * See COPYING for licensing information
7: *
8: * @package phpOpenCloud
9: * @version 1.0
10: * @author Glen Campbell <glen.campbell@rackspace.com>
11: */
12:
13: namespace OpenCloud\Volume;
14:
15: use OpenCloud\Common\PersistentObject;
16: use OpenCloud\Common\Lang;
17: use OpenCloud\Common\Exceptions;
18:
19: /**
20: * The VolumeType class represents a single block storage volume type
21: *
22: * @api
23: * @author Glen Campbell <glen.campbell@rackspace.com>
24: */
25: class VolumeType extends PersistentObject
26: {
27:
28: public $id;
29: public $name;
30: public $extra_specs;
31:
32: protected static $json_name = 'volume_type';
33: protected static $url_resource = 'types';
34:
35: /**
36: * Creates are not permitted
37: *
38: * @throws OpenCloud\CreateError always
39: */
40: public function Create($params = array())
41: {
42: throw new Exceptions\CreateError(
43: Lang::translate('VolumeType cannot be created')
44: );
45: }
46:
47: /**
48: * updates are not permitted
49: *
50: * @throws OpenCloud\UpdateError always
51: */
52: public function Update($params = array())
53: {
54: throw new Exceptions\UpdateError(
55: Lang::translate('VolumeType cannot be updated')
56: );
57: }
58:
59: /**
60: * deletes are not permitted
61: *
62: * @throws OpenCloud\DeleteError
63: */
64: public function Delete()
65: {
66: throw new Exceptions\DeleteError(
67: Lang::translate('VolumeType cannot be deleted')
68: );
69: }
70:
71: }
72: