1: <?php
2: /**
3: * Copyright 2012-2014 Rackspace US, Inc.
4: *
5: * Licensed under the Apache License, Version 2.0 (the "License");
6: * you may not use this file except in compliance with the License.
7: * You may obtain a copy of the License at
8: *
9: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: namespace OpenCloud\Compute\Resource;
19:
20: use OpenCloud\Common\PersistentObject;
21: use OpenCloud\Image\Resource\ImageInterface;
22:
23: /**
24: * A collection of files for a specific operating system (OS) that you use to
25: * create or rebuild a server. Rackspace provides pre-built images. You can also
26: * create custom images from servers that you have launched. Custom images can
27: * be used for data backups or as "gold" images for additional servers.
28: *
29: * @note In the future, this may be abstracted to access Glance (the OpenStack
30: * image store) directly, but it is currently not available to Rackspace
31: * customers, so we're using the /images resource on the servers API endpoint.
32: */
33:
34: class Image extends PersistentObject implements ImageInterface
35: {
36: public $status;
37: public $updated;
38: public $links;
39: public $minDisk;
40: public $id;
41: public $name;
42: public $created;
43: public $progress;
44: public $minRam;
45: public $metadata;
46: public $server;
47:
48: protected static $json_name = 'image';
49: protected static $url_resource = 'images';
50:
51: public function setId($id)
52: {
53: $this->id = $id;
54: }
55:
56: public function getId()
57: {
58: return $this->id;
59: }
60:
61: public function create($params = array())
62: {
63: return $this->noCreate();
64: }
65:
66: public function update($params = array())
67: {
68: return $this->noUpdate();
69: }
70: }
71: