ogle 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,7 +92,19 @@ module Ogle
92
92
  # +image_id+: A String representing an image_id.
93
93
 
94
94
  def destroy image_id
95
- response = @connection.delete "/images/#{image_id}"
95
+ response = @connection.delete "/v1/images/#{image_id}"
96
+ end
97
+
98
+ ##
99
+ # Upload (create) a new image
100
+ #
101
+ # +file+: The file to upload
102
+ # +name+: The name of the file in glance (x-image-meta-name)
103
+ # +meta+: A hash of custom defined metadata to be added to the image (x-image-meta-properties-*)
104
+
105
+ def create file, name, meta
106
+ headers = { "x-image-meta-name" => name }.merge meta
107
+ response = @connection.post "/v1/images", :upload => { :file => file, :headers => headers }
96
108
  end
97
109
 
98
110
  private
@@ -1,3 +1,3 @@
1
1
  module Ogle
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency "hugs", "~> 2.6.0"
23
23
 
24
- s.add_development_dependency "rake"
24
+ s.add_development_dependency "rake", "0.8.7"
25
25
  s.add_development_dependency "vcr", "1.5.0"
26
26
  s.add_development_dependency "webmock"
27
27
  s.add_development_dependency "minitest"
@@ -0,0 +1,50 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://glance.trunk:9292/v1/images
6
+ body: |
7
+ Test-Image
8
+
9
+ headers:
10
+ accept:
11
+ - application/json
12
+ content-type:
13
+ - application/octet-stream
14
+ content-length:
15
+ - 11
16
+ transfer-encoding:
17
+ - chunked
18
+ x-image-meta-name:
19
+ - test-image
20
+ x-image-meta-is-public:
21
+ - "true"
22
+ x-image-meta-property-test:
23
+ - "yes"
24
+ x-image-meta-property-distro:
25
+ - test-distro
26
+ x-image-meta-property-version:
27
+ - test-version-1
28
+ connection:
29
+ - keep-alive
30
+ keep-alive:
31
+ - 30
32
+ response: !ruby/struct:VCR::Response
33
+ status: !ruby/struct:VCR::ResponseStatus
34
+ code: 201
35
+ message: Created
36
+ headers:
37
+ content-type:
38
+ - text/plain; charset=UTF-8
39
+ content-length:
40
+ - "434"
41
+ location:
42
+ - http://glance.trunk:9292/v1/images/56
43
+ etag:
44
+ - 8cb22c184821cdc62a9dc5c34cf8a125
45
+ date:
46
+ - Thu, 02 Jun 2011 15:20:11 GMT
47
+ connection:
48
+ - keep-alive
49
+ body: "{\"image\": {\"status\": \"active\", \"name\": \"test-image\", \"deleted\": false, \"container_format\": null, \"created_at\": \"2011-06-02T15:20:11\", \"disk_format\": null, \"updated_at\": \"2011-06-02T15:20:11\", \"id\": 56, \"location\": \"file:///var/lib/glance/images/56\", \"checksum\": \"8cb22c184821cdc62a9dc5c34cf8a125\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"test\": \"yes\", \"version\": \"test-version-1\", \"distro\": \"test-distro\"}, \"size\": 11}}"
50
+ http_version: "1.1"
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :delete
5
- uri: http://gluster.trunk:9292/images/41
5
+ uri: http://glance.trunk:9292/v1/images/56
6
6
  body:
7
7
  headers:
8
8
  accept:
@@ -13,16 +13,16 @@
13
13
  - 30
14
14
  response: !ruby/struct:VCR::Response
15
15
  status: !ruby/struct:VCR::ResponseStatus
16
- code: 300
17
- message: Multiple Choices
16
+ code: 200
17
+ message: OK
18
18
  headers:
19
19
  content-type:
20
- - application/json
20
+ - text/html; charset=UTF-8
21
21
  content-length:
22
- - "114"
22
+ - "0"
23
23
  date:
24
- - Sat, 28 May 2011 04:11:37 GMT
24
+ - Thu, 02 Jun 2011 15:38:50 GMT
25
25
  connection:
26
26
  - keep-alive
27
- body: "{\"versions\": [{\"status\": \"CURRENT\", \"id\": \"v1.0\", \"links\": [{\"href\": \"http://0.0.0.0:9292/v1/\", \"rel\": \"self\"}]}]}"
27
+ body:
28
28
  http_version: "1.1"
@@ -137,3 +137,141 @@
137
137
  - keep-alive
138
138
  body:
139
139
  http_version: "1.1"
140
+ - !ruby/struct:VCR::HTTPInteraction
141
+ request: !ruby/struct:VCR::Request
142
+ method: :head
143
+ uri: http://glance.trunk:9292/v1/images/4
144
+ body:
145
+ headers:
146
+ accept:
147
+ - application/json
148
+ connection:
149
+ - keep-alive
150
+ keep-alive:
151
+ - 30
152
+ response: !ruby/struct:VCR::Response
153
+ status: !ruby/struct:VCR::ResponseStatus
154
+ code: 200
155
+ message: OK
156
+ headers:
157
+ content-type:
158
+ - text/html; charset=UTF-8
159
+ content-length:
160
+ - "0"
161
+ x-image-meta-property-distro:
162
+ - Ubuntu
163
+ x-image-meta-id:
164
+ - "4"
165
+ x-image-meta-property-arch:
166
+ - amd64
167
+ x-image-meta-deleted:
168
+ - "False"
169
+ x-image-meta-container-format:
170
+ - ami
171
+ x-image-meta-property-uploader:
172
+ - root@enc1b11
173
+ x-image-meta-location:
174
+ - file:///var/lib/glance/images/4
175
+ x-image-meta-deleted-at:
176
+ - ""
177
+ x-image-meta-created-at:
178
+ - 2011-05-11T15:48:02
179
+ x-image-meta-size:
180
+ - "1476395008"
181
+ x-image-meta-status:
182
+ - active
183
+ x-image-meta-property-type:
184
+ - machine
185
+ x-image-meta-property-kernel-name:
186
+ - natty-server-uec-amd64-vmlinuz-virtual
187
+ x-image-meta-is-public:
188
+ - "True"
189
+ x-image-meta-property-kernel-id:
190
+ - "3"
191
+ x-image-meta-updated-at:
192
+ - 2011-05-11T15:48:08
193
+ x-image-meta-checksum:
194
+ - b6149317c554d2c335365e7bd43e9bf0
195
+ x-image-meta-property-version:
196
+ - "11.04"
197
+ x-image-meta-disk-format:
198
+ - ami
199
+ x-image-meta-name:
200
+ - natty-server-uec-amd64.img
201
+ location:
202
+ - http://glance.trunk:9292/v1/images/4
203
+ etag:
204
+ - b6149317c554d2c335365e7bd43e9bf0
205
+ date:
206
+ - Wed, 01 Jun 2011 21:01:43 GMT
207
+ connection:
208
+ - keep-alive
209
+ body:
210
+ http_version: "1.1"
211
+ - !ruby/struct:VCR::HTTPInteraction
212
+ request: !ruby/struct:VCR::Request
213
+ method: :head
214
+ uri: http://glance.trunk:9292/v1/images/36
215
+ body:
216
+ headers:
217
+ accept:
218
+ - application/json
219
+ connection:
220
+ - keep-alive
221
+ keep-alive:
222
+ - 30
223
+ response: !ruby/struct:VCR::Response
224
+ status: !ruby/struct:VCR::ResponseStatus
225
+ code: 200
226
+ message: OK
227
+ headers:
228
+ content-type:
229
+ - text/html; charset=UTF-8
230
+ content-length:
231
+ - "0"
232
+ x-image-meta-property-distro:
233
+ - CentOS
234
+ x-image-meta-id:
235
+ - "36"
236
+ x-image-meta-property-arch:
237
+ - x86_64
238
+ x-image-meta-deleted:
239
+ - "False"
240
+ x-image-meta-container-format:
241
+ - ami
242
+ x-image-meta-location:
243
+ - file:///var/lib/glance/images/36
244
+ x-image-meta-deleted-at:
245
+ - ""
246
+ x-image-meta-created-at:
247
+ - 2011-05-26T15:13:11
248
+ x-image-meta-size:
249
+ - "1430192128"
250
+ x-image-meta-status:
251
+ - active
252
+ x-image-meta-property-type:
253
+ - machine
254
+ x-image-meta-property-uploader:
255
+ - root@enc1b11
256
+ x-image-meta-is-public:
257
+ - "True"
258
+ x-image-meta-updated-at:
259
+ - 2011-05-26T15:13:16
260
+ x-image-meta-checksum:
261
+ - 8731b6dcb85e7554cc69aeb8acc6ad09
262
+ x-image-meta-property-version:
263
+ - "5.4"
264
+ x-image-meta-disk-format:
265
+ - ami
266
+ x-image-meta-name:
267
+ - CentOS-5.4-cloudinit
268
+ location:
269
+ - http://glance.trunk:9292/v1/images/36
270
+ etag:
271
+ - 8731b6dcb85e7554cc69aeb8acc6ad09
272
+ date:
273
+ - Wed, 01 Jun 2011 21:01:44 GMT
274
+ connection:
275
+ - keep-alive
276
+ body:
277
+ http_version: "1.1"
@@ -26,3 +26,30 @@
26
26
  - keep-alive
27
27
  body: "{\"images\": [{\"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"id\": 1, \"size\": 4408496}, {\"name\": \"maverick-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"id\": 2, \"size\": 1476395008}, {\"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"id\": 3, \"size\": 4592768}, {\"name\": \"natty-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"id\": 4, \"size\": 1476395008}, {\"name\": \"Gateway-copy.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"id\": 16, \"size\": 21474836480}, {\"name\": \"CentOS-5.4-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"id\": 36, \"size\": 1430192128}, {\"name\": \"OpenVPN_Cloudpipe-base-v1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"id\": 37, \"size\": 637403136}, {\"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"id\": 38, \"size\": 637534208}, {\"name\": \"kvm1.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"id\": 41, \"size\": 20971520000}, {\"name\": \"CentOS-5.6-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"id\": 48, \"size\": 2362245120}]}"
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://glance.trunk:9292/v1/images
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/json
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/html; charset=UTF-8
48
+ content-length:
49
+ - "1662"
50
+ date:
51
+ - Wed, 01 Jun 2011 21:01:44 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: "{\"images\": [{\"name\": \"CentOS-5.6-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"id\": 48, \"size\": 2362245120}, {\"name\": \"kvm1.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"id\": 41, \"size\": 20971520000}, {\"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"id\": 38, \"size\": 637534208}, {\"name\": \"OpenVPN_Cloudpipe-base-v1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"id\": 37, \"size\": 637403136}, {\"name\": \"CentOS-5.4-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"id\": 36, \"size\": 1430192128}, {\"name\": \"Gateway-copy.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"id\": 16, \"size\": 21474836480}, {\"name\": \"natty-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"id\": 4, \"size\": 1476395008}, {\"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"id\": 3, \"size\": 4592768}, {\"name\": \"maverick-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"id\": 2, \"size\": 1476395008}, {\"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"id\": 1, \"size\": 4408496}]}"
55
+ http_version: "1.1"
@@ -26,3 +26,30 @@
26
26
  - keep-alive
27
27
  body: "{\"images\": [{\"status\": \"active\", \"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-10T21:53:36\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-10T21:53:36\", \"id\": 1, \"location\": \"file:///var/lib/glance/images/1\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.5.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4408496}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-10T21:53:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-10T21:53:44\", \"id\": 2, \"location\": \"file:///var/lib/glance/images/2\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"1\", \"type\": \"machine\", \"version\": \"10.10\", \"kernel_name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-11T15:48:02\", \"id\": 3, \"location\": \"file:///var/lib/glance/images/3\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.6.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4592768}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-11T15:48:08\", \"id\": 4, \"location\": \"file:///var/lib/glance/images/4\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"Gateway-copy.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-21T00:03:01\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-21T00:04:45\", \"id\": 16, \"location\": \"file:///var/lib/glance/images/16\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 21474836480}, {\"status\": \"active\", \"name\": \"CentOS-5.4-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T15:13:11\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T15:13:16\", \"id\": 36, \"location\": \"file:///var/lib/glance/images/36\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.4\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 1430192128}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T17:17:32\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T17:17:35\", \"id\": 37, \"location\": \"file:///var/lib/glance/images/37\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637403136}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T19:05:44\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T19:05:47\", \"id\": 38, \"location\": \"file:///var/lib/glance/images/38\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637534208}, {\"status\": \"active\", \"name\": \"kvm1.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T21:57:57\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T22:00:30\", \"id\": 41, \"location\": \"file:///var/lib/glance/images/41\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 20971520000}, {\"status\": \"active\", \"name\": \"CentOS-5.6-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-27T14:24:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-27T14:24:47\", \"id\": 48, \"location\": \"file:///var/lib/glance/images/48\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.6\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 2362245120}]}"
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://glance.trunk:9292/v1/images/detail
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/json
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/html; charset=UTF-8
48
+ content-length:
49
+ - "5149"
50
+ date:
51
+ - Wed, 01 Jun 2011 21:01:44 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: "{\"images\": [{\"status\": \"active\", \"name\": \"CentOS-5.6-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-27T14:24:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-27T14:24:47\", \"id\": 48, \"location\": \"file:///var/lib/glance/images/48\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.6\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 2362245120}, {\"status\": \"active\", \"name\": \"kvm1.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T21:57:57\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T22:00:30\", \"id\": 41, \"location\": \"file:///var/lib/glance/images/41\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 20971520000}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T19:05:44\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T19:05:47\", \"id\": 38, \"location\": \"file:///var/lib/glance/images/38\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637534208}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T17:17:32\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T17:17:35\", \"id\": 37, \"location\": \"file:///var/lib/glance/images/37\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637403136}, {\"status\": \"active\", \"name\": \"CentOS-5.4-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T15:13:11\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T15:13:16\", \"id\": 36, \"location\": \"file:///var/lib/glance/images/36\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.4\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 1430192128}, {\"status\": \"active\", \"name\": \"Gateway-copy.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-21T00:03:01\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-21T00:04:45\", \"id\": 16, \"location\": \"file:///var/lib/glance/images/16\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 21474836480}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-11T15:48:08\", \"id\": 4, \"location\": \"file:///var/lib/glance/images/4\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-11T15:48:02\", \"id\": 3, \"location\": \"file:///var/lib/glance/images/3\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.6.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4592768}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-10T21:53:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-10T21:53:44\", \"id\": 2, \"location\": \"file:///var/lib/glance/images/2\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"1\", \"type\": \"machine\", \"version\": \"10.10\", \"kernel_name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-10T21:53:36\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-10T21:53:36\", \"id\": 1, \"location\": \"file:///var/lib/glance/images/1\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.5.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4408496}]}"
55
+ http_version: "1.1"
@@ -70,3 +70,74 @@
70
70
  - keep-alive
71
71
  body:
72
72
  http_version: "1.1"
73
+ - !ruby/struct:VCR::HTTPInteraction
74
+ request: !ruby/struct:VCR::Request
75
+ method: :head
76
+ uri: http://glance.trunk:9292/v1/images/4
77
+ body:
78
+ headers:
79
+ accept:
80
+ - application/json
81
+ connection:
82
+ - keep-alive
83
+ keep-alive:
84
+ - 30
85
+ response: !ruby/struct:VCR::Response
86
+ status: !ruby/struct:VCR::ResponseStatus
87
+ code: 200
88
+ message: OK
89
+ headers:
90
+ content-type:
91
+ - text/html; charset=UTF-8
92
+ content-length:
93
+ - "0"
94
+ x-image-meta-property-distro:
95
+ - Ubuntu
96
+ x-image-meta-id:
97
+ - "4"
98
+ x-image-meta-property-arch:
99
+ - amd64
100
+ x-image-meta-deleted:
101
+ - "False"
102
+ x-image-meta-container-format:
103
+ - ami
104
+ x-image-meta-property-uploader:
105
+ - root@enc1b11
106
+ x-image-meta-location:
107
+ - file:///var/lib/glance/images/4
108
+ x-image-meta-deleted-at:
109
+ - ""
110
+ x-image-meta-created-at:
111
+ - 2011-05-11T15:48:02
112
+ x-image-meta-size:
113
+ - "1476395008"
114
+ x-image-meta-status:
115
+ - active
116
+ x-image-meta-property-type:
117
+ - machine
118
+ x-image-meta-property-kernel-name:
119
+ - natty-server-uec-amd64-vmlinuz-virtual
120
+ x-image-meta-is-public:
121
+ - "True"
122
+ x-image-meta-property-kernel-id:
123
+ - "3"
124
+ x-image-meta-updated-at:
125
+ - 2011-05-11T15:48:08
126
+ x-image-meta-checksum:
127
+ - b6149317c554d2c335365e7bd43e9bf0
128
+ x-image-meta-property-version:
129
+ - "11.04"
130
+ x-image-meta-disk-format:
131
+ - ami
132
+ x-image-meta-name:
133
+ - natty-server-uec-amd64.img
134
+ location:
135
+ - http://glance.trunk:9292/v1/images/4
136
+ etag:
137
+ - b6149317c554d2c335365e7bd43e9bf0
138
+ date:
139
+ - Wed, 01 Jun 2011 21:01:44 GMT
140
+ connection:
141
+ - keep-alive
142
+ body:
143
+ http_version: "1.1"
@@ -26,3 +26,30 @@
26
26
  - keep-alive
27
27
  body: "{\"images\": [{\"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"id\": 1, \"size\": 4408496}, {\"name\": \"maverick-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"id\": 2, \"size\": 1476395008}, {\"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"id\": 3, \"size\": 4592768}, {\"name\": \"natty-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"id\": 4, \"size\": 1476395008}, {\"name\": \"Gateway-copy.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"id\": 16, \"size\": 21474836480}, {\"name\": \"CentOS-5.4-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"id\": 36, \"size\": 1430192128}, {\"name\": \"OpenVPN_Cloudpipe-base-v1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"id\": 37, \"size\": 637403136}, {\"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"id\": 38, \"size\": 637534208}, {\"name\": \"kvm1.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"id\": 41, \"size\": 20971520000}, {\"name\": \"CentOS-5.6-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"id\": 48, \"size\": 2362245120}]}"
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://glance.trunk:9292/v1/images
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/json
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/html; charset=UTF-8
48
+ content-length:
49
+ - "1662"
50
+ date:
51
+ - Wed, 01 Jun 2011 21:01:44 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: "{\"images\": [{\"name\": \"CentOS-5.6-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"id\": 48, \"size\": 2362245120}, {\"name\": \"kvm1.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"id\": 41, \"size\": 20971520000}, {\"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"id\": 38, \"size\": 637534208}, {\"name\": \"OpenVPN_Cloudpipe-base-v1\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"id\": 37, \"size\": 637403136}, {\"name\": \"CentOS-5.4-cloudinit\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"id\": 36, \"size\": 1430192128}, {\"name\": \"Gateway-copy.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"id\": 16, \"size\": 21474836480}, {\"name\": \"natty-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"id\": 4, \"size\": 1476395008}, {\"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"id\": 3, \"size\": 4592768}, {\"name\": \"maverick-server-uec-amd64.img\", \"container_format\": \"ami\", \"disk_format\": \"ami\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"id\": 2, \"size\": 1476395008}, {\"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"container_format\": \"aki\", \"disk_format\": \"aki\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"id\": 1, \"size\": 4408496}]}"
55
+ http_version: "1.1"
@@ -26,3 +26,30 @@
26
26
  - keep-alive
27
27
  body: "{\"images\": [{\"status\": \"active\", \"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-10T21:53:36\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-10T21:53:36\", \"id\": 1, \"location\": \"file:///var/lib/glance/images/1\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.5.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4408496}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-10T21:53:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-10T21:53:44\", \"id\": 2, \"location\": \"file:///var/lib/glance/images/2\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"1\", \"type\": \"machine\", \"version\": \"10.10\", \"kernel_name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-11T15:48:02\", \"id\": 3, \"location\": \"file:///var/lib/glance/images/3\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.6.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4592768}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-11T15:48:08\", \"id\": 4, \"location\": \"file:///var/lib/glance/images/4\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"Gateway-copy.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-21T00:03:01\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-21T00:04:45\", \"id\": 16, \"location\": \"file:///var/lib/glance/images/16\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 21474836480}, {\"status\": \"active\", \"name\": \"CentOS-5.4-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T15:13:11\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T15:13:16\", \"id\": 36, \"location\": \"file:///var/lib/glance/images/36\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.4\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 1430192128}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T17:17:32\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T17:17:35\", \"id\": 37, \"location\": \"file:///var/lib/glance/images/37\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637403136}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T19:05:44\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T19:05:47\", \"id\": 38, \"location\": \"file:///var/lib/glance/images/38\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637534208}, {\"status\": \"active\", \"name\": \"kvm1.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T21:57:57\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T22:00:30\", \"id\": 41, \"location\": \"file:///var/lib/glance/images/41\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 20971520000}, {\"status\": \"active\", \"name\": \"CentOS-5.6-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-27T14:24:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-27T14:24:47\", \"id\": 48, \"location\": \"file:///var/lib/glance/images/48\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.6\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 2362245120}]}"
28
28
  http_version: "1.1"
29
+ - !ruby/struct:VCR::HTTPInteraction
30
+ request: !ruby/struct:VCR::Request
31
+ method: :get
32
+ uri: http://glance.trunk:9292/v1/images/detail
33
+ body:
34
+ headers:
35
+ accept:
36
+ - application/json
37
+ connection:
38
+ - keep-alive
39
+ keep-alive:
40
+ - 30
41
+ response: !ruby/struct:VCR::Response
42
+ status: !ruby/struct:VCR::ResponseStatus
43
+ code: 200
44
+ message: OK
45
+ headers:
46
+ content-type:
47
+ - text/html; charset=UTF-8
48
+ content-length:
49
+ - "5149"
50
+ date:
51
+ - Wed, 01 Jun 2011 21:01:43 GMT
52
+ connection:
53
+ - keep-alive
54
+ body: "{\"images\": [{\"status\": \"active\", \"name\": \"CentOS-5.6-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-27T14:24:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-27T14:24:47\", \"id\": 48, \"location\": \"file:///var/lib/glance/images/48\", \"checksum\": \"654fb40e9c3c2917a10b7475ce895e57\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.6\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 2362245120}, {\"status\": \"active\", \"name\": \"kvm1.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T21:57:57\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T22:00:30\", \"id\": 41, \"location\": \"file:///var/lib/glance/images/41\", \"checksum\": \"0d36e66650833b38bba46da56a35820f\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 20971520000}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1.1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T19:05:44\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T19:05:47\", \"id\": 38, \"location\": \"file:///var/lib/glance/images/38\", \"checksum\": \"50b799cc99724691129a95b44256c6e1\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637534208}, {\"status\": \"active\", \"name\": \"OpenVPN_Cloudpipe-base-v1\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T17:17:32\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T17:17:35\", \"id\": 37, \"location\": \"file:///var/lib/glance/images/37\", \"checksum\": \"396c52780d4624d574704cf578e7e7dd\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"x86_64\", \"distro\": \"Ubuntu\"}, \"size\": 637403136}, {\"status\": \"active\", \"name\": \"CentOS-5.4-cloudinit\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-26T15:13:11\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-26T15:13:16\", \"id\": 36, \"location\": \"file:///var/lib/glance/images/36\", \"checksum\": \"8731b6dcb85e7554cc69aeb8acc6ad09\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"5.4\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 1430192128}, {\"status\": \"active\", \"name\": \"Gateway-copy.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-21T00:03:01\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-21T00:04:45\", \"id\": 16, \"location\": \"file:///var/lib/glance/images/16\", \"checksum\": \"86c2df3d9d60fe41577aca870ee89b41\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"x86_64\", \"version\": \"3.8\", \"type\": \"machine\", \"uploader\": \"root@enc1b11\", \"distro\": \"CentOS\"}, \"size\": 21474836480}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-11T15:48:08\", \"id\": 4, \"location\": \"file:///var/lib/glance/images/4\", \"checksum\": \"b6149317c554d2c335365e7bd43e9bf0\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"3\", \"type\": \"machine\", \"version\": \"11.04\", \"kernel_name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"natty-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-11T15:48:02\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-11T15:48:02\", \"id\": 3, \"location\": \"file:///var/lib/glance/images/3\", \"checksum\": \"55c855957ae2ca4b476dabc26dbb1685\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.6.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4592768}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64.img\", \"deleted\": false, \"container_format\": \"ami\", \"created_at\": \"2011-05-10T21:53:37\", \"disk_format\": \"ami\", \"updated_at\": \"2011-05-10T21:53:44\", \"id\": 2, \"location\": \"file:///var/lib/glance/images/2\", \"checksum\": \"04845edf42118420a9d13a53186a5f59\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"kernel_id\": \"1\", \"type\": \"machine\", \"version\": \"10.10\", \"kernel_name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"uploader\": \"root@enc1b11\", \"arch\": \"amd64\", \"distro\": \"Ubuntu\"}, \"size\": 1476395008}, {\"status\": \"active\", \"name\": \"maverick-server-uec-amd64-vmlinuz-virtual\", \"deleted\": false, \"container_format\": \"aki\", \"created_at\": \"2011-05-10T21:53:36\", \"disk_format\": \"aki\", \"updated_at\": \"2011-05-10T21:53:36\", \"id\": 1, \"location\": \"file:///var/lib/glance/images/1\", \"checksum\": \"83d999516352e8311f5ee9a314679b6c\", \"is_public\": true, \"deleted_at\": null, \"properties\": {\"arch\": \"amd64\", \"version\": \"2.5.35\", \"type\": \"kernel\", \"uploader\": \"root@enc1b11\", \"distro\": \"ubuntu\"}, \"size\": 4408496}]}"
55
+ http_version: "1.1"
@@ -1,7 +1,7 @@
1
1
  require "test_helper"
2
2
 
3
3
  CONNECTION = Ogle::Client.new(
4
- :host => "gluster.trunk"
4
+ :host => "glance.trunk"
5
5
  )
6
6
 
7
7
  describe Ogle::Image do
@@ -89,14 +89,33 @@ describe Ogle::Image do
89
89
 
90
90
  describe "#destroy" do
91
91
  VCR.use_cassette "image_destroy" do
92
- response = CONNECTION.image.destroy 41
92
+ response = CONNECTION.image.destroy 56
93
93
 
94
94
  it "returns an HTTP/1.1 200 OK" do
95
- response.code.must_equal "300"
95
+ response.code.must_equal "200"
96
96
  end
97
97
  end
98
98
  end
99
99
 
100
+ describe "#create" do
101
+ VCR.use_cassette "image_create" do
102
+ testfile = File.join TEST_ROOT, "support", "test-image"
103
+ metadata = {
104
+ "x-image-meta-is-public" => "true",
105
+ "x-image-meta-property-test" => "yes",
106
+ "x-image-meta-property-distro" => "test-distro",
107
+ "x-image-meta-property-version" => "test-version-1"
108
+ }
109
+
110
+ response = CONNECTION.image.create "#{testfile}", "test-image", metadata
111
+
112
+ it "returns an HTTP/1.1 201 OK" do
113
+ response.code.must_equal "201"
114
+ end
115
+ end
116
+ end
117
+
118
+
100
119
  def must_have_valid_keys response, keys
101
120
  raise "The response passed in is empty." if response.keys.empty?
102
121
  response.keys.delete_if { |k| keys.include? k }.must_be_empty
@@ -0,0 +1 @@
1
+ Test-Image
@@ -2,6 +2,8 @@ Bundler.setup :default, :test
2
2
 
3
3
  %w(minitest/spec ogle vcr webmock).each { |r| require r }
4
4
 
5
+ TEST_ROOT = File.dirname File.expand_path __FILE__
6
+
5
7
  class MiniTest::Unit::TestCase
6
8
  METADATA_KEYS = %w(
7
9
  name
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ogle
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.3
5
+ version: 0.2.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Bringard
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-05-28 00:00:00 -06:00
14
+ date: 2011-06-02 00:00:00 -06:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -31,9 +31,9 @@ dependencies:
31
31
  requirement: &id002 !ruby/object:Gem::Requirement
32
32
  none: false
33
33
  requirements:
34
- - - ">="
34
+ - - "="
35
35
  - !ruby/object:Gem::Version
36
- version: "0"
36
+ version: 0.8.7
37
37
  type: :development
38
38
  version_requirements: *id002
39
39
  - !ruby/object:Gem::Dependency
@@ -90,6 +90,7 @@ files:
90
90
  - lib/ogle/image.rb
91
91
  - lib/ogle/version.rb
92
92
  - ogle.gemspec
93
+ - test/cassettes/image_create.yml
93
94
  - test/cassettes/image_destroy.yml
94
95
  - test/cassettes/image_find.yml
95
96
  - test/cassettes/images_all.yml
@@ -98,6 +99,7 @@ files:
98
99
  - test/cassettes/images_runable.yml
99
100
  - test/cassettes/images_runable_with_details.yml
100
101
  - test/lib/ogle/image_test.rb
102
+ - test/support/test-image
101
103
  - test/test_helper.rb
102
104
  has_rdoc: true
103
105
  homepage: http://github.com/kevinbringard/ogle
@@ -128,6 +130,7 @@ signing_key:
128
130
  specification_version: 3
129
131
  summary: Ruby interface for OpenStack Glance
130
132
  test_files:
133
+ - test/cassettes/image_create.yml
131
134
  - test/cassettes/image_destroy.yml
132
135
  - test/cassettes/image_find.yml
133
136
  - test/cassettes/images_all.yml
@@ -136,4 +139,5 @@ test_files:
136
139
  - test/cassettes/images_runable.yml
137
140
  - test/cassettes/images_runable_with_details.yml
138
141
  - test/lib/ogle/image_test.rb
142
+ - test/support/test-image
139
143
  - test/test_helper.rb