tim 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +392 -0
  3. data/Rakefile +33 -0
  4. data/app/assets/javascripts/tim/application.js +15 -0
  5. data/app/assets/stylesheets/tim/application.css +13 -0
  6. data/app/controllers/tim/application_controller.rb +19 -0
  7. data/app/controllers/tim/base_images_controller.rb +59 -0
  8. data/app/controllers/tim/entrypoint_controller.rb +8 -0
  9. data/app/controllers/tim/image_versions_controller.rb +48 -0
  10. data/app/controllers/tim/provider_images_controller.rb +59 -0
  11. data/app/controllers/tim/target_images_controller.rb +61 -0
  12. data/app/controllers/tim/templates_controller.rb +47 -0
  13. data/app/filters/tim/user_keys_filter.rb +59 -0
  14. data/app/helpers/tim/application_helper.rb +4 -0
  15. data/app/models/tim/base.rb +6 -0
  16. data/app/models/tim/base_image.rb +15 -0
  17. data/app/models/tim/image_version.rb +13 -0
  18. data/app/models/tim/provider_image.rb +51 -0
  19. data/app/models/tim/target_image.rb +50 -0
  20. data/app/models/tim/template.rb +19 -0
  21. data/app/responders/tim/custom_responder.rb +24 -0
  22. data/app/validators/template_validator.rb +15 -0
  23. data/app/views/layouts/tim/application.html.erb +14 -0
  24. data/app/views/tim/base_images/_base_image.xml.haml +11 -0
  25. data/app/views/tim/base_images/_base_image_minimal.xml.haml +2 -0
  26. data/app/views/tim/base_images/_form.html.erb +17 -0
  27. data/app/views/tim/base_images/edit.html.erb +6 -0
  28. data/app/views/tim/base_images/index.html.erb +17 -0
  29. data/app/views/tim/base_images/index.xml.haml +4 -0
  30. data/app/views/tim/base_images/new.html.erb +5 -0
  31. data/app/views/tim/base_images/show.html.erb +5 -0
  32. data/app/views/tim/base_images/show.xml.haml +2 -0
  33. data/app/views/tim/entrypoint/index.xml.haml +7 -0
  34. data/app/views/tim/image_versions/_form.html.erb +17 -0
  35. data/app/views/tim/image_versions/_image_version.xml.haml +9 -0
  36. data/app/views/tim/image_versions/_image_version_minimal.xml.haml +2 -0
  37. data/app/views/tim/image_versions/edit.html.erb +6 -0
  38. data/app/views/tim/image_versions/index.html.erb +17 -0
  39. data/app/views/tim/image_versions/index.xml.haml +4 -0
  40. data/app/views/tim/image_versions/new.html.erb +5 -0
  41. data/app/views/tim/image_versions/show.html.erb +5 -0
  42. data/app/views/tim/image_versions/show.xml.haml +2 -0
  43. data/app/views/tim/images/_form.html.erb +17 -0
  44. data/app/views/tim/images/edit.html.erb +6 -0
  45. data/app/views/tim/images/index.html.erb +21 -0
  46. data/app/views/tim/images/new.html.erb +5 -0
  47. data/app/views/tim/images/show.html.erb +5 -0
  48. data/app/views/tim/layouts/application.html.erb +14 -0
  49. data/app/views/tim/provider_images/_form.html.erb +17 -0
  50. data/app/views/tim/provider_images/_provider_image.xml.haml +12 -0
  51. data/app/views/tim/provider_images/_provider_image_minimal.xml.haml +2 -0
  52. data/app/views/tim/provider_images/edit.html.erb +6 -0
  53. data/app/views/tim/provider_images/index.html.erb +17 -0
  54. data/app/views/tim/provider_images/index.xml.haml +4 -0
  55. data/app/views/tim/provider_images/new.html.erb +5 -0
  56. data/app/views/tim/provider_images/show.html.erb +5 -0
  57. data/app/views/tim/provider_images/show.xml.haml +2 -0
  58. data/app/views/tim/target_images/_form.html.erb +17 -0
  59. data/app/views/tim/target_images/_target_image.xml.haml +13 -0
  60. data/app/views/tim/target_images/_target_image_minimal.xml.haml +2 -0
  61. data/app/views/tim/target_images/edit.html.erb +6 -0
  62. data/app/views/tim/target_images/index.html.erb +21 -0
  63. data/app/views/tim/target_images/index.xml.haml +4 -0
  64. data/app/views/tim/target_images/new.html.erb +5 -0
  65. data/app/views/tim/target_images/show.html.erb +5 -0
  66. data/app/views/tim/target_images/show.xml.haml +2 -0
  67. data/app/views/tim/templates/_form.html.erb +17 -0
  68. data/app/views/tim/templates/_template.xml.haml +8 -0
  69. data/app/views/tim/templates/_template_minimal.xml.haml +2 -0
  70. data/app/views/tim/templates/edit.html.erb +6 -0
  71. data/app/views/tim/templates/index.html.erb +17 -0
  72. data/app/views/tim/templates/index.xml.haml +4 -0
  73. data/app/views/tim/templates/new.html.erb +5 -0
  74. data/app/views/tim/templates/show.html.erb +5 -0
  75. data/app/views/tim/templates/show.xml.haml +2 -0
  76. data/config/cucumber.yml +8 -0
  77. data/config/initializers/haml.rb +1 -0
  78. data/config/routes.rb +9 -0
  79. data/config/schemas/tdl.rng +282 -0
  80. data/config/user_keys.yml +26 -0
  81. data/db/migrate/20120906180351_create_tim_base_images.rb +12 -0
  82. data/db/migrate/20120906210106_create_tim_image_versions.rb +10 -0
  83. data/db/migrate/20120910175233_create_tim_templates.rb +9 -0
  84. data/db/migrate/20120911202321_create_tim_target_images.rb +14 -0
  85. data/db/migrate/20120911204329_create_tim_provider_images.rb +19 -0
  86. data/lib/generators/tim/install_generator.rb +15 -0
  87. data/lib/generators/tim/templates/README +6 -0
  88. data/lib/generators/tim/templates/tim.rb +8 -0
  89. data/lib/image_factory/image_factory.rb +4 -0
  90. data/lib/image_factory/model/base.rb +88 -0
  91. data/lib/image_factory/model/provider_image.rb +6 -0
  92. data/lib/image_factory/model/target_image.rb +6 -0
  93. data/lib/tasks/cucumber.rake +59 -0
  94. data/lib/tasks/tim_tasks.rake +4 -0
  95. data/lib/tim.rb +8 -0
  96. data/lib/tim/engine.rb +9 -0
  97. data/lib/tim/version.rb +3 -0
  98. data/spec/controllers/base_images_controller_spec.rb +131 -0
  99. data/spec/controllers/entrypoint_controller_spec.rb +32 -0
  100. data/spec/controllers/image_versions_controller_spec.rb +146 -0
  101. data/spec/controllers/provider_images_controller_spec.rb +156 -0
  102. data/spec/controllers/target_images_controller_spec.rb +153 -0
  103. data/spec/controllers/templates_controller_spec.rb +41 -0
  104. data/spec/decorators/controllers/templates_controller_decorator_spec.rb +13 -0
  105. data/spec/factories/tim/base_image.rb +10 -0
  106. data/spec/factories/tim/image_factory/provider_image.rb +10 -0
  107. data/spec/factories/tim/image_factory/status_detail.rb +0 -0
  108. data/spec/factories/tim/image_factory/target_image.rb +7 -0
  109. data/spec/factories/tim/image_version.rb +20 -0
  110. data/spec/factories/tim/provider_image.rb +9 -0
  111. data/spec/factories/tim/target_image.rb +10 -0
  112. data/spec/factories/tim/template.rb +23 -0
  113. data/spec/filters/user_keys_filter_spec.rb +41 -0
  114. data/spec/fixtures/template.xml +13 -0
  115. data/spec/models/base_image_spec.rb +39 -0
  116. data/spec/models/dummy/pool_family_spec.rb +14 -0
  117. data/spec/models/dummy/provider_account_spec.rb +18 -0
  118. data/spec/models/dummy/provider_type_spec.rb +18 -0
  119. data/spec/models/dummy/user_spec.rb +14 -0
  120. data/spec/models/image_version_spec.rb +27 -0
  121. data/spec/models/provider_image_spec.rb +69 -0
  122. data/spec/models/target_image_spec.rb +75 -0
  123. data/spec/models/template_spec.rb +16 -0
  124. data/spec/spec_helper.rb +56 -0
  125. data/spec/support/routes.rb +41 -0
  126. data/spec/validators/template_validator_spec.rb +19 -0
  127. data/spec/views/base_images_spec.rb +23 -0
  128. data/spec/views/image_versions_spec.rb +25 -0
  129. data/spec/views/provider_images_spec.rb +30 -0
  130. data/spec/views/target_images_spec.rb +25 -0
  131. data/spec/views/templates_spec.rb +24 -0
  132. data/test/dummy/Rakefile +7 -0
  133. data/test/dummy/app/assets/javascripts/application.js +15 -0
  134. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  135. data/test/dummy/app/controllers/application_controller.rb +3 -0
  136. data/test/dummy/app/decorators/tim/controllers/templates_controller_decorator.rb +8 -0
  137. data/test/dummy/app/helpers/application_helper.rb +2 -0
  138. data/test/dummy/app/models/pool_family.rb +3 -0
  139. data/test/dummy/app/models/provider_account.rb +3 -0
  140. data/test/dummy/app/models/provider_type.rb +3 -0
  141. data/test/dummy/app/models/tim/base_image.rb +6 -0
  142. data/test/dummy/app/models/user.rb +3 -0
  143. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  144. data/test/dummy/app/views/tim/base_images/_custom.xml.haml +1 -0
  145. data/test/dummy/app/views/tim/image_versions/_custom.xml.haml +1 -0
  146. data/test/dummy/app/views/tim/layouts/application.html.erb +14 -0
  147. data/test/dummy/app/views/tim/provider_images/_custom.xml.haml +1 -0
  148. data/test/dummy/app/views/tim/target_images/_custom.xml.haml +1 -0
  149. data/test/dummy/app/views/tim/templates/_custom.xml.haml +1 -0
  150. data/test/dummy/config.ru +4 -0
  151. data/test/dummy/config/application.rb +58 -0
  152. data/test/dummy/config/boot.rb +10 -0
  153. data/test/dummy/config/database.yml +28 -0
  154. data/test/dummy/config/environment.rb +5 -0
  155. data/test/dummy/config/environments/development.rb +37 -0
  156. data/test/dummy/config/environments/production.rb +67 -0
  157. data/test/dummy/config/environments/test.rb +37 -0
  158. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  159. data/test/dummy/config/initializers/inflections.rb +15 -0
  160. data/test/dummy/config/initializers/mime_types.rb +5 -0
  161. data/test/dummy/config/initializers/secret_token.rb +7 -0
  162. data/test/dummy/config/initializers/session_store.rb +8 -0
  163. data/test/dummy/config/initializers/tim.rb +8 -0
  164. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  165. data/test/dummy/config/locales/en.yml +5 -0
  166. data/test/dummy/config/routes.rb +4 -0
  167. data/test/dummy/db/development.sqlite3 +0 -0
  168. data/test/dummy/db/migrate/20120326103723532622_create_users.rb +9 -0
  169. data/test/dummy/db/migrate/20120423123114264114_create_pool_families.rb +7 -0
  170. data/test/dummy/db/migrate/20120911182850_add_pool_family_id_to_tim_base_image.rb +5 -0
  171. data/test/dummy/db/migrate/20120911202845_add_provider_type_id_to_tim_target_image.rb +5 -0
  172. data/test/dummy/db/migrate/20120911203222_create_provider_types.rb +7 -0
  173. data/test/dummy/db/migrate/20120911205431_create_provider_accounts.rb +7 -0
  174. data/test/dummy/db/schema.rb +86 -0
  175. data/test/dummy/db/test.sqlite3 +0 -0
  176. data/test/dummy/log/development.log +982 -0
  177. data/test/dummy/log/test.log +8629 -0
  178. data/test/dummy/public/404.html +26 -0
  179. data/test/dummy/public/422.html +26 -0
  180. data/test/dummy/public/500.html +26 -0
  181. data/test/dummy/public/favicon.ico +0 -0
  182. data/test/dummy/script/rails +6 -0
  183. data/test/dummy/test.rb +0 -0
  184. data/test/dummy/tmp/cache/assets/C7A/BB0/sprockets%2F13445f7a19078dd2df39517062aa6711 +0 -0
  185. data/test/dummy/tmp/cache/assets/C8C/CC0/sprockets%2F95d79f3b3096348427f3e4e38b5202e3 +0 -0
  186. data/test/dummy/tmp/cache/assets/CB0/2B0/sprockets%2F79106b90879c02a115d7f6f1c8390ac4 +0 -0
  187. data/test/dummy/tmp/cache/assets/CE0/690/sprockets%2F04c628c2a636286bfa92a4966b82b92a +0 -0
  188. data/test/dummy/tmp/cache/assets/D03/040/sprockets%2Fd9e94204d4b307145f12efc109b16c1f +0 -0
  189. data/test/dummy/tmp/cache/assets/D06/DC0/sprockets%2Fcd282851b6e4c463409ba3ece67e0510 +0 -0
  190. data/test/dummy/tmp/cache/assets/D23/5F0/sprockets%2F2a521f3183c6bbcd71bd26a5490b201e +0 -0
  191. data/test/dummy/tmp/cache/assets/D64/3A0/sprockets%2F56ac1aed10c39b12a88cb1b30f668f58 +0 -0
  192. data/test/dummy/tmp/cache/assets/D69/BD0/sprockets%2F0aaf75cf34556b33a9fec534fe4d0415 +0 -0
  193. data/test/dummy/tmp/cache/assets/D87/D80/sprockets%2Fefa3c8b210e87358c7add88cd6f49597 +0 -0
  194. data/test/dummy/tmp/cache/assets/D89/200/sprockets%2Ff9b4e953c874ed6a87de6490d055d9db +0 -0
  195. data/test/dummy/tmp/cache/assets/DF4/430/sprockets%2F403bb1de60cae4325cebd7e6c389b8ad +0 -0
  196. data/test/dummy/tmp/cache/assets/E00/500/sprockets%2Faaddc5b6f2cb6b98930cc54cf4c64a95 +0 -0
  197. data/test/dummy/tmp/cache/assets/EB3/CE0/sprockets%2Fd75a89c9fffacd99bce7eed96844eafc +0 -0
  198. metadata +432 -0
@@ -0,0 +1,20 @@
1
+ Copyright 2012 Red Hat, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,392 @@
1
+ = Tim
2
+
3
+ == Running Tests
4
+
5
+ {<img src="https://secure.travis-ci.org/aeolus-incubator/tim.png"
6
+ alt="Build Status" />}[http://travis-ci.org/aeolus-incubator/tim]
7
+
8
+ Tests are run from the project root directory. But are run in the
9
+ context of the dummy app located under test/dummy. In order to run
10
+ the tests you must first setup dummy app database.
11
+
12
+ rake db:setup; rake -f test/dummy/Rakefile test:prepare
13
+
14
+ Once you have done this cd to the project root and run the following:
15
+
16
+ rake spec
17
+
18
+ == Running the Dummy app
19
+
20
+ This will allow you to runn the commands below to test out the engine
21
+ in isolation (if mounted in another application, the main difference
22
+ will just be where the engine gets mounted, so adjust your url
23
+ accordingly).
24
+
25
+ cd test/dummy; rails s
26
+
27
+ == API Reference
28
+
29
+ === Base Images
30
+
31
+ ==== Create Base Image
32
+
33
+ Request
34
+
35
+ curl -X POST --header "Accept: application/xml" --header \
36
+ "Content-Type: application/xml" http://localhost:3000/tim/base_images --data \
37
+ "<base_image>
38
+ <name>MyFirstBaseImage</name>
39
+ <description>This is my very first base image</description>
40
+ </base_image>"
41
+
42
+ Response
43
+
44
+ Code: 201
45
+
46
+ Body:
47
+
48
+ <base_image href='http://localhost:3000/tim/base_images/1' id='1'>
49
+ <name>MyFirstBaseImage</name>
50
+ <description>This is my very first base image</description>
51
+ </base_image>
52
+
53
+ ==== Show Base Image
54
+
55
+ Request
56
+
57
+ curl --header "Accept: application/xml" http://localhost:3000/tim/base_images/1
58
+
59
+ Response
60
+
61
+ Code: 200
62
+
63
+ Body:
64
+
65
+ <base_image href='http://localhost:3000/tim/base_images/1' id='1'>
66
+ <name>MyFirstBaseImage</name>
67
+ <description>This is my very first base image</description>
68
+ <image_versions>
69
+ </image_versions>
70
+ </base_image>
71
+
72
+ ==== List Base Images
73
+
74
+ Request
75
+
76
+ curl --header "Accept: application/xml" http://localhost:3000/tim/base_images
77
+
78
+ Response
79
+
80
+ Code: 200
81
+
82
+ Body:
83
+
84
+ <base_images>
85
+ <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
86
+ <base_image href='http://localhost:3000/tim/base_images/2' id='2'></base_image>
87
+ <base_image href='http://localhost:3000/tim/base_images/3' id='3'></base_image>
88
+ </base_images>
89
+
90
+ ==== Delete Base Image
91
+
92
+ Request
93
+
94
+ curl -X DELETE--header "Accept: application/xml" http://localhost:3000/tim/base_images/1
95
+
96
+ Response
97
+
98
+ Code: 204
99
+
100
+ Body:
101
+
102
+ === Image Versions
103
+
104
+ ==== Create Image Version
105
+
106
+ Request
107
+
108
+ curl -X POST --header "Accept: application/xml" --header \
109
+ "Content-Type: application/xml" http://localhost:3000/tim/image_versions --data \
110
+ "<image_version>
111
+ <base_image id='1'></base_image>
112
+ </image_version>"
113
+
114
+ Response
115
+
116
+ Code: 201
117
+
118
+ Body:
119
+
120
+ <image_version href='http://localhost:3000/tim/image_versions/5' id='5'>
121
+ <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
122
+ <target_images>
123
+ </target_images>
124
+ </image_version>
125
+
126
+ ==== Show Image Version
127
+
128
+ Request
129
+
130
+ curl --header "Accept: application/xml" http://localhost:3000/tim/image_versions/1
131
+
132
+ Response
133
+
134
+ Code: 200
135
+
136
+ Body:
137
+
138
+ <image_version href='http://localhost:3000/tim/image_versions/1' id='1'>
139
+ <base_image href='http://localhost:3000/tim/base_images/1' id='1'></base_image>
140
+ <target_images>
141
+ </target_images>
142
+ </image_version>
143
+
144
+ ==== List Image Versions
145
+
146
+ Request
147
+
148
+ curl --header "Accept: application/xml" http://localhost:3000/tim/image_versions
149
+
150
+ Response
151
+
152
+ Code: 200
153
+
154
+ Body:
155
+
156
+ <image_versions>
157
+ <image_version href='http://localhost:3000/tim/image_versions/1' id='1'></image_version>
158
+ <image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
159
+ <image_version href='http://localhost:3000/tim/image_versions/3' id='3'></image_version>
160
+ </image_versions>
161
+
162
+ ==== Delete Image Version
163
+
164
+ Request
165
+
166
+ curl -X DELETE--header "Accept: application/xml" http://localhost:3000/tim/image_versions/1
167
+
168
+ Response
169
+
170
+ Code: 204
171
+
172
+ Body:
173
+
174
+ ==== Update Image Version
175
+
176
+ Request
177
+
178
+ curl -X PUT --header "Accept: application/xml" --header \
179
+ "Content-Type: application/xml" http://localhost:3000/tim/image_versions/1 --data \
180
+ "<image_version>
181
+ <base_image id='2'></base_image>
182
+ </image_version>"
183
+
184
+ Response
185
+
186
+ Code: 200
187
+
188
+ body:
189
+
190
+ <image_version href='http://localhost:3000/tim/image_versions/1' id='1'>
191
+ <base_image href='http://localhost:3000/tim/base_images/2' id='2'></base_image>
192
+ <target_images>
193
+ </target_images>
194
+ </image_version>
195
+
196
+ ==== Create Target Image
197
+
198
+ Request
199
+
200
+ curl -X POST --header "Accept: application/xml" --header \
201
+ "Content-Type: application/xml" http://localhost:3000/tim/target_images --data \
202
+ "<target_image>
203
+ <image_version id='2' />
204
+ </target_image>"
205
+
206
+ Response
207
+
208
+ Code: 201
209
+
210
+ Body:
211
+
212
+ <target_image href='http://localhost:3000/tim/target_images/1' id='1'>
213
+ <target>EC2</target>
214
+ <status>BUILDING</status>
215
+ <status_detail></status_detail>
216
+ <progress>0</progress>
217
+ <image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
218
+ <provider_images></provider_images>
219
+ </target_image>
220
+
221
+ ==== Show Target Image
222
+
223
+ Request
224
+
225
+ curl --header "Accept: application/xml" http://localhost:3000/tim/target_images/1
226
+
227
+ Response
228
+
229
+ Code: 200
230
+
231
+ Body:
232
+
233
+ <target_image href='http://localhost:3000/tim/target_images/1' id='1'>
234
+ <target>EC2</target>
235
+ <status>COMPLETE</status>
236
+ <status_detail></status_detail>
237
+ <progress>100</progress>
238
+ <image_version href='http://localhost:3000/tim/image_versions/2' id='2'></image_version>
239
+ <provider_images></provider_images>
240
+ </target_image>
241
+
242
+ ==== List Target Image
243
+
244
+ Request
245
+
246
+ curl --header "Accept: application/xml" http://localhost:3000/tim/target_images
247
+
248
+ Response
249
+
250
+ Code: 200
251
+
252
+ Body:
253
+
254
+ <target_images>
255
+ <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
256
+ <target_image href='http://localhost:3000/tim/target_images/2' id='2'></target_image>
257
+ <target_image href='http://localhost:3000/tim/target_images/3' id='3'></target_image>
258
+ </target_images>
259
+
260
+ ==== Delete Target Image
261
+
262
+ Request
263
+
264
+ curl -X DELETE --header "Accept: application/xml" http://localhost:3000/tim/target_images/1
265
+
266
+ Response
267
+
268
+ Code: 204
269
+
270
+ Body:
271
+
272
+ ==== Update Target Image
273
+
274
+ Request
275
+
276
+ curl -X PUT --header "Accept: application/xml" --header \
277
+ "Content-Type: application/xml" http://localhost:3000/tim/target_images/2 --data \
278
+ "<target_image>
279
+ <image_version id='3'></image_version>
280
+ </target_image>"
281
+
282
+ Response
283
+
284
+ Code: 204
285
+
286
+ ==== Create Provider Image
287
+
288
+ Request
289
+
290
+ curl -X POST --header "Accept: application/xml" --header \
291
+ "Content-Type: application/xml" http://localhost:3000/tim/provider_images --data \
292
+ "<provider_image>
293
+ <target_image id='1' />
294
+ </provider_image>"
295
+
296
+ Response
297
+
298
+ Code: 201
299
+
300
+ Body:
301
+
302
+ <provider_image href='http://localhost:3000/tim/provider_images/85' id='85'>
303
+ <provider>Amazon EC2</provider>
304
+ <external_image_id>ami-123456</external_image_id>
305
+ <snapshot>false</snapshot>
306
+ <status>NEW</status>
307
+ <status_detail></status_detail>
308
+ <progress>0</progress>
309
+ <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
310
+ </provider_image>
311
+
312
+ ==== Show Provider Image
313
+
314
+ Request
315
+
316
+ curl --header "Accept: application/xml" http://localhost:3000/tim/provider_images/1
317
+
318
+ Response
319
+
320
+ Code: 200
321
+
322
+ Body:
323
+
324
+ <provider_image href='http://localhost:3000/tim/provider_images/85' id='85'>
325
+ <provider>Amazon EC2</provider>
326
+ <external_image_id>ami-123456</external_image_id>
327
+ <snapshot>false</snapshot>
328
+ <status>NEW</status>
329
+ <status_detail></status_detail>
330
+ <progress>0</progress>
331
+ <target_image href='http://localhost:3000/tim/target_images/1' id='1'></target_image>
332
+ </provider_image>
333
+
334
+ ==== List Provider Images
335
+
336
+ Request
337
+
338
+ curl --header "Accept: application/xml" http://localhost:3000/tim/provider_images
339
+
340
+ Response
341
+
342
+ Code: 200
343
+
344
+ Body:
345
+
346
+ <provider_images>
347
+ <provider_image href='http://localhost:3000/tim/provider_images/1' id='1'></provider_image>
348
+ <provider_image href='http://localhost:3000/tim/provider_images/2' id='2'></provider_image>
349
+ <provider_image href='http://localhost:3000/tim/provider_images/3' id='3'></provider_image>
350
+ </provider_image>
351
+
352
+ ==== Delete Target Image
353
+
354
+ Request
355
+
356
+ curl -X DELETE --header "Accept: application/xml" http://localhost:3000/tim/provider_images/1
357
+
358
+ Response
359
+
360
+ Code: 204
361
+
362
+ Body:
363
+
364
+ ==== Update Target Image
365
+
366
+ Request
367
+
368
+ curl -X PUT --header "Accept: application/xml" --header \
369
+ "Content-Type: application/xml" http://localhost:3000/tim/provider_images/2 --data \
370
+ "<provider_image>
371
+ <target_image id='3'></target_image>
372
+ </provider_image>"
373
+
374
+ Response
375
+
376
+ Code: 204
377
+
378
+ Body:
379
+
380
+ <provider_image href='http://localhost:3000/tim/provider_images/84' id='84'>
381
+ <provider></provider>
382
+ <external_image_id></external_image_id>
383
+ <snapshot></snapshot>
384
+ <status></status>
385
+ <status_detail></status_detail>
386
+ <progress></progress>
387
+ <target_image href='http://localhost:3000/tim/target_images/3' id='3'></target_image>
388
+ </provider_image>
389
+
390
+ == License
391
+
392
+ Image Management Engine is released under the MIT license.
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Tim'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+ Bundler::GemHelper.install_tasks
28
+
29
+ require 'rspec/core/rake_task'
30
+
31
+ RSpec::Core::RakeTask.new('spec')
32
+
33
+ task :default => :spec
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .