fog 0.0.20 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.20
1
+ 0.0.21
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fog}
8
- s.version = "0.0.20"
8
+ s.version = "0.0.21"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["geemus (Wesley Beary)"]
@@ -142,7 +142,9 @@ Gem::Specification.new do |s|
142
142
  "lib/fog/rackspace/models/servers/servers.rb",
143
143
  "lib/fog/rackspace/requests/files/get_containers.rb",
144
144
  "lib/fog/rackspace/requests/files/head_containers.rb",
145
+ "lib/fog/rackspace/requests/servers/create_image.rb",
145
146
  "lib/fog/rackspace/requests/servers/create_server.rb",
147
+ "lib/fog/rackspace/requests/servers/delete_image.rb",
146
148
  "lib/fog/rackspace/requests/servers/delete_server.rb",
147
149
  "lib/fog/rackspace/requests/servers/get_flavors.rb",
148
150
  "lib/fog/rackspace/requests/servers/get_images.rb",
@@ -0,0 +1,47 @@
1
+ unless Fog.mocking?
2
+
3
+ module Fog
4
+ module Rackspace
5
+ class Servers
6
+
7
+ # Create an image from a running server
8
+ #
9
+ # ==== Parameters
10
+ # * server_id<~Integer> - Id of server to create image from
11
+ # * options<~Hash> - Name
12
+ #
13
+ def create_image(server_id, options = {})
14
+ data = {
15
+ 'image' => {
16
+ "serverId" => server_id
17
+ }
18
+ }
19
+ if options['name']
20
+ data['image']['name'] = options['name']
21
+ end
22
+ request(
23
+ :body => data.to_json,
24
+ :expects => 202,
25
+ :method => 'POST',
26
+ :path => "images"
27
+ )
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+
34
+ else
35
+
36
+ module Fog
37
+ module Rackspace
38
+ class Servers
39
+
40
+ def create_image
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,37 @@
1
+ unless Fog.mocking?
2
+
3
+ module Fog
4
+ module Rackspace
5
+ class Servers
6
+
7
+ # Delete an image
8
+ #
9
+ # ==== Parameters
10
+ # * image_id<~Integer> - Id of image to delete
11
+ #
12
+ def delete_image(image_id)
13
+ request(
14
+ :expects => 204,
15
+ :method => 'DELETE',
16
+ :path => "images/#{image_id}"
17
+ )
18
+ end
19
+
20
+ end
21
+ end
22
+ end
23
+
24
+ else
25
+
26
+ module Fog
27
+ module Rackspace
28
+ class Servers
29
+
30
+ def delete_image
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+
37
+ end
@@ -6,7 +6,9 @@ module Fog
6
6
  load "fog/rackspace/models/servers/server.rb"
7
7
  load "fog/rackspace/models/servers/servers.rb"
8
8
 
9
+ load "fog/rackspace/requests/servers/create_image.rb"
9
10
  load "fog/rackspace/requests/servers/create_server.rb"
11
+ load "fog/rackspace/requests/servers/delete_image.rb"
10
12
  load "fog/rackspace/requests/servers/delete_server.rb"
11
13
  load "fog/rackspace/requests/servers/get_flavors.rb"
12
14
  load "fog/rackspace/requests/servers/get_images.rb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - geemus (Wesley Beary)
@@ -175,7 +175,9 @@ files:
175
175
  - lib/fog/rackspace/models/servers/servers.rb
176
176
  - lib/fog/rackspace/requests/files/get_containers.rb
177
177
  - lib/fog/rackspace/requests/files/head_containers.rb
178
+ - lib/fog/rackspace/requests/servers/create_image.rb
178
179
  - lib/fog/rackspace/requests/servers/create_server.rb
180
+ - lib/fog/rackspace/requests/servers/delete_image.rb
179
181
  - lib/fog/rackspace/requests/servers/delete_server.rb
180
182
  - lib/fog/rackspace/requests/servers/get_flavors.rb
181
183
  - lib/fog/rackspace/requests/servers/get_images.rb