fog-xenserver 0.0.1.alpha2 → 0.0.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +27 -0
  3. data/.travis.yml +19 -0
  4. data/CONTRIBUTING.md +6 -6
  5. data/Gemfile +1 -1
  6. data/LICENSE.md +1 -1
  7. data/README.md +3 -1
  8. data/Rakefile +10 -1
  9. data/fog-xenserver.gemspec +6 -4
  10. data/gemfiles/Gemfile.1.8.7 +7 -0
  11. data/gemfiles/Gemfile.1.9.2+ +6 -0
  12. data/lib/fog.rb +1 -1
  13. data/lib/fog/collection.rb +37 -0
  14. data/lib/fog/compute/xen_server.rb +132 -0
  15. data/lib/fog/compute/xen_server/mock.rb +27 -0
  16. data/lib/fog/compute/xen_server/models.rb +78 -0
  17. data/lib/fog/compute/xen_server/models/blob.rb +24 -0
  18. data/lib/fog/compute/xen_server/models/blobs.rb +11 -0
  19. data/lib/fog/compute/xen_server/models/bond.rb +26 -0
  20. data/lib/fog/compute/xen_server/models/bonds.rb +11 -0
  21. data/lib/fog/compute/xen_server/models/console.rb +23 -0
  22. data/lib/fog/compute/xen_server/models/consoles.rb +11 -0
  23. data/lib/fog/compute/xen_server/models/crash_dump.rb +22 -0
  24. data/lib/fog/compute/xen_server/models/crash_dumps.rb +11 -0
  25. data/lib/fog/compute/xen_server/models/dr_task.rb +20 -0
  26. data/lib/fog/compute/xen_server/models/dr_tasks.rb +11 -0
  27. data/lib/fog/compute/xen_server/models/gpu_group.rb +25 -0
  28. data/lib/fog/compute/xen_server/models/gpu_groups.rb +11 -0
  29. data/lib/fog/compute/xen_server/models/guest_metrics.rb +28 -0
  30. data/lib/fog/compute/xen_server/models/guests_metrics.rb +11 -0
  31. data/lib/fog/compute/xen_server/models/host.rb +121 -0
  32. data/lib/fog/compute/xen_server/models/host_cpu.rb +31 -0
  33. data/lib/fog/compute/xen_server/models/host_cpus.rb +11 -0
  34. data/lib/fog/compute/xen_server/models/host_crash_dump.rb +23 -0
  35. data/lib/fog/compute/xen_server/models/host_crash_dumps.rb +11 -0
  36. data/lib/fog/compute/xen_server/models/host_metrics.rb +28 -0
  37. data/lib/fog/compute/xen_server/models/host_patch.rb +28 -0
  38. data/lib/fog/compute/xen_server/models/host_patchs.rb +11 -0
  39. data/lib/fog/compute/xen_server/models/hosts.rb +11 -0
  40. data/lib/fog/compute/xen_server/models/hosts_metrics.rb +11 -0
  41. data/lib/fog/compute/xen_server/models/network.rb +65 -0
  42. data/lib/fog/compute/xen_server/models/networks.rb +11 -0
  43. data/lib/fog/compute/xen_server/models/pbd.rb +30 -0
  44. data/lib/fog/compute/xen_server/models/pbds.rb +11 -0
  45. data/lib/fog/compute/xen_server/models/pci.rb +25 -0
  46. data/lib/fog/compute/xen_server/models/pcis.rb +11 -0
  47. data/lib/fog/compute/xen_server/models/pgpu.rb +23 -0
  48. data/lib/fog/compute/xen_server/models/pgpus.rb +11 -0
  49. data/lib/fog/compute/xen_server/models/pif.rb +49 -0
  50. data/lib/fog/compute/xen_server/models/pif_metrics.rb +30 -0
  51. data/lib/fog/compute/xen_server/models/pifs.rb +11 -0
  52. data/lib/fog/compute/xen_server/models/pifs_metrics.rb +9 -0
  53. data/lib/fog/compute/xen_server/models/pool.rb +47 -0
  54. data/lib/fog/compute/xen_server/models/pool_patch.rb +27 -0
  55. data/lib/fog/compute/xen_server/models/pool_patchs.rb +11 -0
  56. data/lib/fog/compute/xen_server/models/pools.rb +11 -0
  57. data/lib/fog/compute/xen_server/models/role.rb +22 -0
  58. data/lib/fog/compute/xen_server/models/roles.rb +11 -0
  59. data/lib/fog/compute/xen_server/models/server.rb +203 -0
  60. data/lib/fog/compute/xen_server/models/server_appliance.rb +24 -0
  61. data/lib/fog/compute/xen_server/models/server_appliances.rb +11 -0
  62. data/lib/fog/compute/xen_server/models/server_metrics.rb +29 -0
  63. data/lib/fog/compute/xen_server/models/servers.rb +38 -0
  64. data/lib/fog/compute/xen_server/models/servers_metrics.rb +11 -0
  65. data/lib/fog/compute/xen_server/models/storage_manager.rb +30 -0
  66. data/lib/fog/compute/xen_server/models/storage_managers.rb +11 -0
  67. data/lib/fog/compute/xen_server/models/storage_repositories.rb +11 -0
  68. data/lib/fog/compute/xen_server/models/storage_repository.rb +77 -0
  69. data/lib/fog/compute/xen_server/models/tunnel.rb +23 -0
  70. data/lib/fog/compute/xen_server/models/tunnels.rb +11 -0
  71. data/lib/fog/compute/xen_server/models/vbd.rb +64 -0
  72. data/lib/fog/compute/xen_server/models/vbd_metrics.rb +27 -0
  73. data/lib/fog/compute/xen_server/models/vbds.rb +11 -0
  74. data/lib/fog/compute/xen_server/models/vbds_metrics.rb +11 -0
  75. data/lib/fog/compute/xen_server/models/vdi.rb +75 -0
  76. data/lib/fog/compute/xen_server/models/vdis.rb +11 -0
  77. data/lib/fog/compute/xen_server/models/vif.rb +53 -0
  78. data/lib/fog/compute/xen_server/models/vif_metrics.rb +22 -0
  79. data/lib/fog/compute/xen_server/models/vifs.rb +11 -0
  80. data/lib/fog/compute/xen_server/models/vifs_metrics.rb +11 -0
  81. data/lib/fog/compute/xen_server/models/vlan.rb +65 -0
  82. data/lib/fog/compute/xen_server/models/vlans.rb +11 -0
  83. data/lib/fog/compute/xen_server/models/vmpp.rb +38 -0
  84. data/lib/fog/compute/xen_server/models/vmpps.rb +11 -0
  85. data/lib/fog/compute/xen_server/models/vtpm.rb +21 -0
  86. data/lib/fog/compute/xen_server/models/vtpms.rb +11 -0
  87. data/lib/fog/compute/xen_server/real.rb +36 -0
  88. data/lib/fog/compute/xen_server/requests/builtin_templates.rb +21 -0
  89. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/clone_server.rb +1 -5
  90. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_network.rb +1 -6
  91. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_server.rb +1 -14
  92. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_sr.rb +1 -7
  93. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vbd.rb +1 -6
  94. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vdi.rb +1 -6
  95. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vif.rb +1 -6
  96. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/create_vlan.rb +1 -6
  97. data/lib/fog/compute/xen_server/requests/custom_templates.rb +21 -0
  98. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_network.rb +1 -6
  99. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_server.rb +1 -6
  100. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_sr.rb +1 -6
  101. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vdi.rb +1 -6
  102. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vif.rb +1 -6
  103. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/destroy_vlan.rb +1 -6
  104. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/disable_host.rb +1 -7
  105. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/eject_vbd.rb +1 -6
  106. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/enable_host.rb +1 -7
  107. data/lib/fog/compute/xen_server/requests/get_record.rb +41 -0
  108. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/get_records.rb +1 -9
  109. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/insert_vbd.rb +1 -6
  110. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/provision_server.rb +1 -5
  111. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/reboot_host.rb +2 -8
  112. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/reboot_server.rb +2 -8
  113. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/scan_sr.rb +1 -6
  114. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/set_affinity.rb +1 -9
  115. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/set_attribute.rb +1 -9
  116. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/shutdown_host.rb +2 -8
  117. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/shutdown_server.rb +2 -8
  118. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/snapshot_revert.rb +1 -6
  119. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/snapshot_server.rb +1 -6
  120. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/start_server.rb +1 -7
  121. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/start_vm.rb +2 -8
  122. data/lib/fog/compute/xen_server/requests/templates.rb +21 -0
  123. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/unplug_pbd.rb +1 -6
  124. data/lib/fog/{xenserver/requests/compute → compute/xen_server/requests}/unplug_vbd.rb +1 -6
  125. data/lib/fog/model.rb +48 -0
  126. data/lib/fog/parsers/xen_server.rb +15 -0
  127. data/lib/fog/{xenserver/parser.rb → parsers/xen_server/base.rb} +1 -3
  128. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_hosts.rb +1 -4
  129. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_networks.rb +1 -4
  130. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_pools.rb +1 -4
  131. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_records.rb +1 -4
  132. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_storage_repositories.rb +1 -4
  133. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vbds.rb +2 -5
  134. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vifs.rb +2 -5
  135. data/lib/fog/{xenserver/parsers → parsers/xen_server}/get_vms.rb +1 -5
  136. data/lib/fog/{xenserver/utilities.rb → utilities.rb} +0 -0
  137. data/lib/fog/{xenserver/core.rb → xen_server/connection.rb} +2 -40
  138. data/lib/fog/xen_server/invalid_login.rb +5 -0
  139. data/lib/fog/xen_server/nokogiri_stream_parser.rb +20 -0
  140. data/lib/fog/xen_server/not_found.rb +5 -0
  141. data/lib/fog/xen_server/request_failed.rb +5 -0
  142. data/lib/fog/xen_server/version.rb +5 -0
  143. data/lib/fog/xenserver.rb +27 -1
  144. data/lib/fog/xenserver/compute.rb +0 -176
  145. data/test/fog/compute/xen_server/models/blob_test.rb +40 -0
  146. data/test/fog/compute/xen_server/models/bond_test.rb +42 -0
  147. data/test/fog/compute/xen_server/models/console_test.rb +38 -0
  148. data/test/fog/compute/xen_server/models/crash_dump_test.rb +39 -0
  149. data/test/fog/compute/xen_server/models/dr_task_test.rb +35 -0
  150. data/test/fog/compute/xen_server/models/gpu_group_test.rb +45 -0
  151. data/test/fog/compute/xen_server/models/guest_metrics_test.rb +44 -0
  152. data/test/fog/compute/xen_server/models/host_cpu_test.rb +46 -0
  153. data/test/fog/compute/xen_server/models/host_crash_dump_test.rb +37 -0
  154. data/test/fog/compute/xen_server/models/host_metrics_test.rb +38 -0
  155. data/test/fog/compute/xen_server/models/host_patch_test.rb +45 -0
  156. data/test/fog/compute/xen_server/models/host_test.rb +102 -0
  157. data/test/fog/compute/xen_server/models/network_test.rb +51 -0
  158. data/test/fog/compute/xen_server/models/pbd_test.rb +40 -0
  159. data/test/fog/compute/xen_server/models/pci_test.rb +40 -0
  160. data/test/fog/compute/xen_server/models/pgpu_test.rb +41 -0
  161. data/test/fog/compute/xen_server/models/pif_metrics_test.rb +45 -0
  162. data/test/fog/compute/xen_server/models/pif_test.rb +81 -0
  163. data/test/fog/compute/xen_server/models/pool_patch_test.rb +43 -0
  164. data/test/fog/compute/xen_server/models/pool_test.rb +69 -0
  165. data/test/fog/compute/xen_server/models/role_test.rb +38 -0
  166. data/test/fog/compute/xen_server/models/server_appliance_test.rb +41 -0
  167. data/test/fog/compute/xen_server/models/server_metrics_test.rb +48 -0
  168. data/test/fog/compute/xen_server/models/server_test.rb +149 -0
  169. data/test/fog/compute/xen_server/models/storage_manger_test.rb +46 -0
  170. data/test/fog/compute/xen_server/models/storage_repository_test.rb +56 -0
  171. data/test/fog/compute/xen_server/models/tunnel_test.rb +40 -0
  172. data/test/fog/compute/xen_server/models/vbd_metrics_test.rb +37 -0
  173. data/test/fog/compute/xen_server/models/vbd_test.rb +58 -0
  174. data/test/fog/compute/xen_server/models/vdi_test.rb +71 -0
  175. data/test/fog/compute/xen_server/models/vif_metrics_test.rb +37 -0
  176. data/test/fog/compute/xen_server/models/vif_test.rb +59 -0
  177. data/test/fog/compute/xen_server/models/vlan_test.rb +40 -0
  178. data/test/fog/compute/xen_server/models/vmpp_test.rb +55 -0
  179. data/test/fog/compute/xen_server/models/vtpm_test.rb +36 -0
  180. data/test/minitest_helper.rb +28 -0
  181. metadata +239 -120
  182. data/lib/fog/compute.rb +0 -7
  183. data/lib/fog/xenserver/examples/README.md +0 -11
  184. data/lib/fog/xenserver/examples/chage_default_storage_repository.md +0 -99
  185. data/lib/fog/xenserver/examples/creating_servers.md +0 -168
  186. data/lib/fog/xenserver/examples/getting_started.md +0 -163
  187. data/lib/fog/xenserver/examples/networks-and-vlans.rb +0 -45
  188. data/lib/fog/xenserver/examples/storage_repositories.md +0 -94
  189. data/lib/fog/xenserver/models/compute/blob.rb +0 -22
  190. data/lib/fog/xenserver/models/compute/blobs.rb +0 -25
  191. data/lib/fog/xenserver/models/compute/bond.rb +0 -23
  192. data/lib/fog/xenserver/models/compute/bonds.rb +0 -25
  193. data/lib/fog/xenserver/models/compute/console.rb +0 -29
  194. data/lib/fog/xenserver/models/compute/consoles.rb +0 -25
  195. data/lib/fog/xenserver/models/compute/crash_dump.rb +0 -19
  196. data/lib/fog/xenserver/models/compute/crash_dumps.rb +0 -25
  197. data/lib/fog/xenserver/models/compute/dr_task.rb +0 -17
  198. data/lib/fog/xenserver/models/compute/dr_tasks.rb +0 -25
  199. data/lib/fog/xenserver/models/compute/gpu_group.rb +0 -22
  200. data/lib/fog/xenserver/models/compute/gpu_groups.rb +0 -25
  201. data/lib/fog/xenserver/models/compute/guest_metrics.rb +0 -29
  202. data/lib/fog/xenserver/models/compute/host.rb +0 -159
  203. data/lib/fog/xenserver/models/compute/host_cpu.rb +0 -38
  204. data/lib/fog/xenserver/models/compute/host_crash_dump.rb +0 -20
  205. data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +0 -25
  206. data/lib/fog/xenserver/models/compute/host_metrics.rb +0 -29
  207. data/lib/fog/xenserver/models/compute/host_patch.rb +0 -25
  208. data/lib/fog/xenserver/models/compute/host_patchs.rb +0 -25
  209. data/lib/fog/xenserver/models/compute/hosts.rb +0 -29
  210. data/lib/fog/xenserver/models/compute/network.rb +0 -92
  211. data/lib/fog/xenserver/models/compute/networks.rb +0 -33
  212. data/lib/fog/xenserver/models/compute/pbd.rb +0 -40
  213. data/lib/fog/xenserver/models/compute/pbds.rb +0 -33
  214. data/lib/fog/xenserver/models/compute/pci.rb +0 -22
  215. data/lib/fog/xenserver/models/compute/pcis.rb +0 -25
  216. data/lib/fog/xenserver/models/compute/pgpu.rb +0 -20
  217. data/lib/fog/xenserver/models/compute/pgpus.rb +0 -25
  218. data/lib/fog/xenserver/models/compute/pif.rb +0 -57
  219. data/lib/fog/xenserver/models/compute/pif_metrics.rb +0 -28
  220. data/lib/fog/xenserver/models/compute/pifs.rb +0 -33
  221. data/lib/fog/xenserver/models/compute/pifs_metrics.rb +0 -25
  222. data/lib/fog/xenserver/models/compute/pool.rb +0 -79
  223. data/lib/fog/xenserver/models/compute/pool_patch.rb +0 -24
  224. data/lib/fog/xenserver/models/compute/pool_patchs.rb +0 -25
  225. data/lib/fog/xenserver/models/compute/pools.rb +0 -33
  226. data/lib/fog/xenserver/models/compute/role.rb +0 -19
  227. data/lib/fog/xenserver/models/compute/roles.rb +0 -25
  228. data/lib/fog/xenserver/models/compute/server.rb +0 -250
  229. data/lib/fog/xenserver/models/compute/server_appliance.rb +0 -21
  230. data/lib/fog/xenserver/models/compute/server_appliances.rb +0 -25
  231. data/lib/fog/xenserver/models/compute/servers.rb +0 -68
  232. data/lib/fog/xenserver/models/compute/storage_manager.rb +0 -28
  233. data/lib/fog/xenserver/models/compute/storage_managers.rb +0 -25
  234. data/lib/fog/xenserver/models/compute/storage_repositories.rb +0 -31
  235. data/lib/fog/xenserver/models/compute/storage_repository.rb +0 -93
  236. data/lib/fog/xenserver/models/compute/tunnel.rb +0 -20
  237. data/lib/fog/xenserver/models/compute/tunnels.rb +0 -25
  238. data/lib/fog/xenserver/models/compute/vbd.rb +0 -91
  239. data/lib/fog/xenserver/models/compute/vbd_metrics.rb +0 -27
  240. data/lib/fog/xenserver/models/compute/vbds.rb +0 -33
  241. data/lib/fog/xenserver/models/compute/vdi.rb +0 -105
  242. data/lib/fog/xenserver/models/compute/vdis.rb +0 -29
  243. data/lib/fog/xenserver/models/compute/vif.rb +0 -60
  244. data/lib/fog/xenserver/models/compute/vifs.rb +0 -29
  245. data/lib/fog/xenserver/models/compute/vlan.rb +0 -81
  246. data/lib/fog/xenserver/models/compute/vlans.rb +0 -39
  247. data/lib/fog/xenserver/models/compute/vmpp.rb +0 -35
  248. data/lib/fog/xenserver/models/compute/vmpps.rb +0 -25
  249. data/lib/fog/xenserver/models/compute/vtpm.rb +0 -18
  250. data/lib/fog/xenserver/models/compute/vtpms.rb +0 -25
  251. data/lib/fog/xenserver/requests/compute/get_record.rb +0 -29
  252. data/lib/fog/xenserver/version.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fba3cc54f2a21f22fb2353ae3a70ca83b4368b8
4
- data.tar.gz: 4eaa107b94d576c93b9c8f760e33020461b07923
3
+ metadata.gz: acd0afd1ca263634b14096a02b1939be30393632
4
+ data.tar.gz: eb6e22787766fc16f3f4bef32f5699ea9fafd223
5
5
  SHA512:
6
- metadata.gz: cf35f40513aa783d0b49f511297639cbbd02c1c36db8e861b4530adb061c059ddef6cfb2b6071ee05e9002e0579e0637a914b94c16f3622726496db69eed1966
7
- data.tar.gz: f29794030a1a9365a481a7a5d843f36f83e27122dfde625fa58dd3fafa5c3a7dbb572abbcb0645af1336971194293f42a8b558b2157bbe638a8388a1be46290a
6
+ metadata.gz: 9cbfee8e5dac3866abefa1d248e5b0f3f132bbada4a9998d23dc2dee40bec141100e08797f45b4ee3602245ca86ade883fe43abb6ef35403289215f3c7710a94
7
+ data.tar.gz: 45faf83c18e7cffc641f8fa3053d2c4685b3c5b3882ac80b71a7124db4c391416504cdf2784a5bbceb3ebe7cac1e2f9ce635e9a2eeac9234239d0e04d94aa248
data/.hound.yml ADDED
@@ -0,0 +1,27 @@
1
+ StringLiterals:
2
+ EnforcedStyle: single_quotes
3
+
4
+ Style/InlineComment:
5
+ Enabled: true
6
+
7
+ Style/MethodCalledOnDoEndBlock:
8
+ Enabled: true
9
+
10
+ Style/HashSyntax:
11
+ EnforcedStyle: hash_rockets
12
+
13
+ Style/LineLength:
14
+ Max: 120
15
+ AllowURI: true
16
+
17
+ Style/SingleSpaceBeforeFirstArg:
18
+ Enabled: false
19
+
20
+ Style/SymbolArray:
21
+ Enabled: true
22
+
23
+ Style/TrailingBlankLines:
24
+ Enabled: false
25
+
26
+ Style/TrailingWhitespace:
27
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,19 @@
1
+ matrix:
2
+ include:
3
+ - rvm: 1.8.7
4
+ gemfile: gemfiles/Gemfile.1.8.7
5
+ - rvm: 1.9.2
6
+ gemfile: gemfiles/Gemfile.1.9.2+
7
+ - rvm: 1.9.3
8
+ gemfile: gemfiles/Gemfile.1.9.2+
9
+ - rvm: 2.0.0
10
+ gemfile: gemfiles/Gemfile.1.9.2+
11
+ - rvm: 2.1.1
12
+ gemfile: gemfiles/Gemfile.1.9.2+
13
+ - rvm: ree
14
+ gemfile: gemfiles/Gemfile.1.8.7
15
+ - rvm: jruby
16
+ gemfile: gemfiles/Gemfile.1.9.2+
17
+ allow_failures:
18
+ - rvm: 1.8.7
19
+ - rvm: ree
data/CONTRIBUTING.md CHANGED
@@ -5,14 +5,14 @@ New contributors are always welcome, when it doubt please ask questions. We stri
5
5
  ### Coding
6
6
 
7
7
  * Pick a task:
8
- * Offer feedback on open [pull requests](https://github.com/zertico/fog-xenserver/pulls).
9
- * Review open [issues](https://github.com/zertico/fog-xenserver/issues) for things to help on.
10
- * [Create an issue](https://github.com/zertico/fog-xenserver/issues/new) to start a discussion on additions or features.
8
+ * Offer feedback on open [pull requests](https://github.com/fog/fog-xenserver/pulls).
9
+ * Review open [issues](https://github.com/fog/fog-xenserver/issues) for things to help on.
10
+ * [Create an issue](https://github.com/fog/fog-xenserver/issues/new) to start a discussion on additions or features.
11
11
  * Fork the project, add your changes and tests to cover them in a topic branch.
12
- * Commit your changes and rebase against `zertico/fog-xenserver` to ensure everything is up to date.
13
- * [Submit a pull request](https://github.com/zertico/fog-xenserver/compare/)
12
+ * Commit your changes and rebase against `fog/fog-xenserver` to ensure everything is up to date.
13
+ * [Submit a pull request](https://github.com/fog/fog-xenserver/compare/)
14
14
 
15
15
  ### Non-Coding
16
16
 
17
- * Offer feedback on open [issues](https://github.com/zertico/fog-xenserver/issues).
17
+ * Offer feedback on open [issues](https://github.com/fog/fog-xenserver/issues).
18
18
  * Organize or volunteer at events.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in fog-xenserver.gemspec
4
- gemspec
4
+ gemspec
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2014 [CONTRIBUTORS.md](https://github.com/zertico/fog-xenserver/blob/master/CONTRIBUTORS.md)
3
+ Copyright (c) 2014-2014 [CONTRIBUTORS.md](https://github.com/fog/fog-xenserver/blob/master/CONTRIBUTORS.md)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Fog::Xenserver
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/fog-xenserver.svg)](http://badge.fury.io/rb/fog-xenserver) [![Build Status](https://travis-ci.org/fog/fog-xenserver.svg)](https://travis-ci.org/fog/fog-xenserver) [![Dependency Status](https://gemnasium.com/fog/fog-xenserver.svg)](https://gemnasium.com/fog/fog-xenserver) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-xenserver.svg)](https://coveralls.io/r/fog/fog-xenserver) [![Code Climate](https://codeclimate.com/github/fog/fog-xenserver.png)](https://codeclimate.com/github/fog/fog-xenserver) [![Stories in Ready](https://badge.waffle.io/fog/fog-xenserver.png?label=ready&title=Ready)](https://waffle.io/fog/fog-xenserver)
4
+
3
5
  TODO: Write a gem description
4
6
 
5
7
  ## Installation
@@ -22,7 +24,7 @@ TODO: Write usage instructions here
22
24
 
23
25
  ## Contributing
24
26
 
25
- 1. Fork it ( https://github.com/zertico/fog-xenserver/fork )
27
+ 1. Fork it ( https://github.com/fog/fog-xenserver/fork )
26
28
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
29
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
30
  4. Push to the branch (`git push origin my-new-feature`)
data/Rakefile CHANGED
@@ -1,2 +1,11 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
2
3
 
4
+ Rake::TestTask.new do |t|
5
+ t.libs.push %w(test)
6
+ t.test_files = FileList['test/**/*_test.rb']
7
+ t.verbose = true
8
+ end
9
+
10
+ desc 'Default Task'
11
+ task :default => [ :test ]
@@ -1,17 +1,17 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'fog/xenserver/version'
4
+ require 'fog/xen_server/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fog-xenserver'
8
- spec.version = Fog::Xenserver::VERSION
8
+ spec.version = Fog::XenServer::VERSION
9
9
  spec.authors = %q(Paulo Henrique Lopes Ribeiro)
10
10
  spec.email = %q(plribeiro3000@gmail.com)
11
11
  spec.description = %q{Module for the 'fog' gem to support XENSERVER.}
12
12
  spec.summary = %q{This library can be used as a module for `fog` or as standalone provider
13
13
  to use the XENSERVER in applications.}
14
- spec.homepage = 'https://github.com/zertico/fog-xenserver'
14
+ spec.homepage = 'https://github.com/fog/fog-xenserver'
15
15
  spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
@@ -22,5 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'fog-core'
23
23
  spec.add_dependency 'fog-xml'
24
24
  spec.add_development_dependency 'rake'
25
- spec.add_development_dependency 'rspec'
25
+ spec.add_development_dependency 'minitest'
26
+ spec.add_development_dependency 'turn'
27
+ spec.add_development_dependency 'coveralls'
26
28
  end
@@ -0,0 +1,7 @@
1
+ source :rubygems
2
+
3
+ gem 'mime-types', '< 2.0'
4
+ gem 'nokogiri', '< 1.6'
5
+ gem 'rest-client', '~> 1.6.8'
6
+
7
+ gemspec :path => '../'
@@ -0,0 +1,6 @@
1
+ source :rubygems
2
+
3
+ gem 'activesupport', '>= 3.0', '< 4'
4
+ gem 'mime-types', '< 2.0'
5
+
6
+ gemspec :path => '../'
data/lib/fog.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fog
2
- autoload :Compute, 'lib/fog/compute'
2
+ autoload :XenServer, 'lib/fog/xenserver'
3
3
  end
@@ -0,0 +1,37 @@
1
+ require 'fog/core/collection'
2
+
3
+ module Fog
4
+ class Collection
5
+ def all(options = {})
6
+ data = service.get_records model.provider_class
7
+ load(data)
8
+ end
9
+
10
+ def get(ref)
11
+ data = service.get_record(ref, model.provider_class)
12
+ new(data)
13
+ rescue Fog::XenServer::NotFound
14
+ nil
15
+ end
16
+
17
+ def get_by_name(name)
18
+ ref = service.get_by_name(name, model.provider_class)
19
+ return nil if ref.nil?
20
+ get(ref)
21
+ rescue Fog::XenServer::NotFound
22
+ nil
23
+ end
24
+
25
+ alias_method :find_by_name, :get_by_name
26
+
27
+ def get_by_uuid(uuid)
28
+ ref = service.get_by_uuid(uuid, model.provider_class)
29
+ return nil if ref.nil?
30
+ get(ref)
31
+ rescue Fog::XenServer::NotFound
32
+ nil
33
+ end
34
+
35
+ alias_method :find_by_uuid, :get_by_uuid
36
+ end
37
+ end
@@ -0,0 +1,132 @@
1
+ require 'fog/core'
2
+
3
+ module Fog
4
+ module Compute
5
+ class XenServer < Fog::Service
6
+ autoload :Models, 'fog/compute/xen_server/models'
7
+ autoload :Real, 'fog/compute/xen_server/real'
8
+ autoload :Mock, 'fog/compute/xen_server/mock'
9
+
10
+ requires :xenserver_username
11
+ requires :xenserver_password
12
+ requires :xenserver_url
13
+ recognizes :xenserver_defaults
14
+ recognizes :xenserver_timeout
15
+
16
+ model_path 'fog/compute/xen_server/models'
17
+ model :blob
18
+ collection :blobs
19
+ model :bond
20
+ collection :bonds
21
+ model :crash_dump
22
+ collection :crash_dumps
23
+ model :dr_task
24
+ collection :dr_tasks
25
+ model :gpu_group
26
+ collection :gpu_groups
27
+ model :host_crash_dump
28
+ collection :host_crash_dumps
29
+ model :host_patch
30
+ collection :host_patchs
31
+ model :pci
32
+ collection :pcis
33
+ model :pgpu
34
+ collection :pgpus
35
+ model :pif_metrics
36
+ collection :pifs_metrics
37
+ model :pool_patch
38
+ collection :pool_patchs
39
+ model :role
40
+ collection :roles
41
+ model :server
42
+ collection :servers
43
+ model :server_appliance
44
+ collection :server_appliances
45
+ model :storage_manager
46
+ collection :storage_managers
47
+ model :tunnel
48
+ collection :tunnels
49
+ model :vmpp
50
+ collection :vmpps
51
+ model :vtpm
52
+ collection :vtpms
53
+ model :host
54
+ collection :hosts
55
+ collection :vifs
56
+ model :vif
57
+ collection :storage_repositories
58
+ model :storage_repository
59
+ collection :pools
60
+ model :pool
61
+ collection :vbds
62
+ model :vbd
63
+ collection :vdis
64
+ model :vdi
65
+ collection :networks
66
+ model :network
67
+ collection :pifs
68
+ model :pif
69
+ collection :pbds
70
+ model :pbd
71
+ model :guest_metrics
72
+ collection :guests_metrics
73
+ model :server_metrics
74
+ collection :servers_metrics
75
+ model :vbd_metrics
76
+ collection :vbds_metrics
77
+ model :vif_metrics
78
+ collection :vifs_metrics
79
+ model :host_metrics
80
+ collection :hosts_metrics
81
+ model :host_cpu
82
+ collection :host_cpus
83
+ model :vlan
84
+ collection :vlans
85
+ model :console
86
+ collection :consoles
87
+
88
+ request_path 'fog/compute/xen_server/requests'
89
+ request :builtin_templates
90
+ request :create_server
91
+ request :create_vif
92
+ request :create_vdi
93
+ request :create_vbd
94
+ request :custom_templates
95
+ request :destroy_vif
96
+ request :clone_server
97
+ request :destroy_server
98
+ request :templates
99
+ request :unplug_vbd
100
+ request :eject_vbd
101
+ request :insert_vbd
102
+ request :destroy_vdi
103
+ request :shutdown_server
104
+ request :start_vm
105
+ request :start_server
106
+ request :get_record
107
+ request :get_records
108
+ request :set_affinity
109
+ request :set_attribute
110
+ request :reboot_server
111
+ request :provision_server
112
+ request :scan_sr
113
+ request :unplug_pbd
114
+ request :destroy_sr
115
+ request :create_sr
116
+ request :reboot_host
117
+ request :disable_host
118
+ request :enable_host
119
+ request :shutdown_host
120
+ request :create_network
121
+ request :destroy_network
122
+ request :create_vlan
123
+ request :destroy_vlan
124
+ request :snapshot_server
125
+ request :snapshot_revert
126
+
127
+ def self.const_missing(name)
128
+ Models.const_get(name)
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,27 @@
1
+ module Fog
2
+ module Compute
3
+ class XenServer
4
+ class Mock
5
+ def self.data
6
+ @data ||= Hash.new do |hash, key|
7
+ hash[key] = {}
8
+ end
9
+ end
10
+
11
+ def self.reset_data(keys=data.keys)
12
+ for key in [*keys]
13
+ data.delete(key)
14
+ end
15
+ end
16
+
17
+ def initialize(options={})
18
+ @host = options[:xenserver_pool_master]
19
+ @username = options[:xenserver_username]
20
+ @password = options[:xenserver_password]
21
+ @connection = Fog::XML::Connection.new(@host)
22
+ @connection.authenticate(@username, @password)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,78 @@
1
+ module Fog
2
+ module Compute
3
+ class XenServer
4
+ module Models
5
+ autoload :Blob, 'fog/compute/xen_server/models/blob'
6
+ autoload :Blobs, 'fog/compute/xen_server/models/blobs'
7
+ autoload :Bond, 'fog/compute/xen_server/models/bond'
8
+ autoload :Bonds, 'fog/compute/xen_server/models/bonds'
9
+ autoload :Console, 'fog/compute/xen_server/models/console'
10
+ autoload :Consoles, 'fog/compute/xen_server/models/consoles'
11
+ autoload :CrashDump, 'fog/compute/xen_server/models/crash_dump'
12
+ autoload :CrashDumps, 'fog/compute/xen_server/models/crash_dumps'
13
+ autoload :DrTask, 'fog/compute/xen_server/models/dr_task'
14
+ autoload :DrTasks, 'fog/compute/xen_server/models/dr_tasks'
15
+ autoload :GpuGroup, 'fog/compute/xen_server/models/gpu_group'
16
+ autoload :GpuGroups, 'fog/compute/xen_server/models/gpu_groups'
17
+ autoload :GuestMetrics, 'fog/compute/xen_server/models/guest_metrics'
18
+ autoload :Host, 'fog/compute/xen_server/models/host'
19
+ autoload :HostCpu, 'fog/compute/xen_server/models/host_cpu'
20
+ autoload :HostCpus, 'fog/compute/xen_server/models/host_cpus'
21
+ autoload :HostCrashDump, 'fog/compute/xen_server/models/host_crash_dump'
22
+ autoload :HostCrashDumps, 'fog/compute/xen_server/models/host_crash_dumps'
23
+ autoload :HostMetrics, 'fog/compute/xen_server/models/host_metrics'
24
+ autoload :HostPatch, 'fog/compute/xen_server/models/host_patch'
25
+ autoload :HostPatchs, 'fog/compute/xen_server/models/host_patchs'
26
+ autoload :Hosts, 'fog/compute/xen_server/models/hosts'
27
+ autoload :HostsMetrics, 'fog/compute/xen_server/models/hosts_metrics'
28
+ autoload :Model, 'fog/compute/xen_server/models/model'
29
+ autoload :Network, 'fog/compute/xen_server/models/network'
30
+ autoload :Networks, 'fog/compute/xen_server/models/networks'
31
+ autoload :Pbd, 'fog/compute/xen_server/models/pbd'
32
+ autoload :Pbds, 'fog/compute/xen_server/models/pbds'
33
+ autoload :Pci, 'fog/compute/xen_server/models/pci'
34
+ autoload :Pcis, 'fog/compute/xen_server/models/pcis'
35
+ autoload :Pgpu, 'fog/compute/xen_server/models/pgpu'
36
+ autoload :Pgpus, 'fog/compute/xen_server/models/pgpus'
37
+ autoload :Pif, 'fog/compute/xen_server/models/pif'
38
+ autoload :PifMetrics, 'fog/compute/xen_server/models/pif_metrics'
39
+ autoload :Pifs, 'fog/compute/xen_server/models/pifs'
40
+ autoload :PifsMetrics, 'fog/compute/xen_server/models/pifs_metrics'
41
+ autoload :Pool, 'fog/compute/xen_server/models/pool'
42
+ autoload :PoolPatch, 'fog/compute/xen_server/models/pool_patch'
43
+ autoload :PoolPatchs, 'fog/compute/xen_server/models/pool_patchs'
44
+ autoload :Pools, 'fog/compute/xen_server/models/pools'
45
+ autoload :Role, 'fog/compute/xen_server/models/role'
46
+ autoload :Roles, 'fog/compute/xen_server/models/roles'
47
+ autoload :Server, 'fog/compute/xen_server/models/server'
48
+ autoload :ServerAppliance, 'fog/compute/xen_server/models/server_appliance'
49
+ autoload :ServerAppliances, 'fog/compute/xen_server/models/server_appliances'
50
+ autoload :ServerMetrics, 'fog/compute/xen_server/models/server_metrics'
51
+ autoload :ServersMetrics, 'fog/compute/xen_server/models/servers_metrics'
52
+ autoload :Servers, 'fog/compute/xen_server/models/servers'
53
+ autoload :StorageManager, 'fog/compute/xen_server/models/storage_manager'
54
+ autoload :StorageManagers, 'fog/compute/xen_server/models/storage_managers'
55
+ autoload :StorageRepositories, 'fog/compute/xen_server/models/storage_repositories'
56
+ autoload :StorageRepository, 'fog/compute/xen_server/models/storage_repository'
57
+ autoload :Tunnel, 'fog/compute/xen_server/models/tunnel'
58
+ autoload :Tunnels, 'fog/compute/xen_server/models/tunnels'
59
+ autoload :Vbd, 'fog/compute/xen_server/models/vbd'
60
+ autoload :VbdMetrics, 'fog/compute/xen_server/models/vbd_metrics'
61
+ autoload :Vbds, 'fog/compute/xen_server/models/vbds'
62
+ autoload :VbdsMetrics, 'fog/compute/xen_server/models/vbds_metrics'
63
+ autoload :Vdi, 'fog/compute/xen_server/models/vdi'
64
+ autoload :Vdis, 'fog/compute/xen_server/models/vdis'
65
+ autoload :Vif, 'fog/compute/xen_server/models/vif'
66
+ autoload :VifMetrics, 'fog/compute/xen_server/models/vif_metrics'
67
+ autoload :Vifs, 'fog/compute/xen_server/models/vifs'
68
+ autoload :VifsMetrics, 'fog/compute/xen_server/models/vifs_metrics'
69
+ autoload :Vlan, 'fog/compute/xen_server/models/vlan'
70
+ autoload :Vlans, 'fog/compute/xen_server/models/vlans'
71
+ autoload :Vmpp, 'fog/compute/xen_server/models/vmpp'
72
+ autoload :Vmpps, 'fog/compute/xen_server/models/vmpps'
73
+ autoload :Vtpm, 'fog/compute/xen_server/models/vtpm'
74
+ autoload :Vtpms, 'fog/compute/xen_server/models/vtpms'
75
+ end
76
+ end
77
+ end
78
+ end