fog-ecloud 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/fog-ecloud.gemspec +4 -1
  4. data/lib/fog/bin/ecloud.rb +1 -1
  5. data/lib/fog/compute/ecloud.rb +826 -0
  6. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/admin_organization.rb +0 -0
  7. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/admin_organizations.rb +1 -1
  8. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/api_key.rb +0 -0
  9. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/api_keys.rb +1 -1
  10. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/association.rb +0 -0
  11. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/associations.rb +1 -1
  12. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/authentication_level.rb +0 -0
  13. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/authentication_levels.rb +1 -1
  14. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/backup_internet_service.rb +0 -0
  15. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/backup_internet_services.rb +1 -1
  16. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog.rb +1 -1
  17. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_configuration.rb +0 -0
  18. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_configurations.rb +1 -1
  19. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/catalog_item.rb +0 -0
  20. data/lib/fog/{ecloud → compute/ecloud/models}/collection.rb +0 -0
  21. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/compute_pool.rb +2 -2
  22. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/compute_pools.rb +1 -1
  23. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/cpu_usage_detail.rb +0 -0
  24. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/cpu_usage_detail_summary.rb +1 -1
  25. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/detached_disk.rb +0 -0
  26. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/detached_disks.rb +1 -1
  27. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/environment.rb +0 -0
  28. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/environments.rb +1 -1
  29. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/firewall_acl.rb +0 -0
  30. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/firewall_acls.rb +1 -1
  31. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/group.rb +0 -0
  32. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/groups.rb +1 -1
  33. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/guest_process.rb +0 -0
  34. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/guest_processes.rb +1 -1
  35. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/hardware_configuration.rb +0 -0
  36. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/hardware_configurations.rb +1 -1
  37. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/internet_service.rb +0 -0
  38. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/internet_services.rb +1 -1
  39. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ip_address.rb +0 -0
  40. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ip_addresses.rb +1 -1
  41. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/layout.rb +0 -0
  42. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/layouts.rb +1 -1
  43. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/location.rb +0 -0
  44. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/locations.rb +1 -1
  45. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/login_banner.rb +0 -0
  46. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/login_banners.rb +1 -1
  47. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/memory_usage_detail.rb +0 -0
  48. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/memory_usage_detail_summary.rb +1 -1
  49. data/lib/fog/{ecloud → compute/ecloud/models}/model.rb +0 -0
  50. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/monitor.rb +0 -0
  51. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/monitors.rb +1 -1
  52. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/network.rb +0 -0
  53. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/networks.rb +1 -1
  54. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/node.rb +0 -0
  55. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/nodes.rb +1 -1
  56. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system.rb +0 -0
  57. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system_families.rb +1 -1
  58. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_system_family.rb +0 -0
  59. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/operating_systems.rb +1 -1
  60. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/organization.rb +0 -0
  61. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/organizations.rb +1 -1
  62. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/password_complexity_rule.rb +0 -0
  63. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/password_complexity_rules.rb +1 -1
  64. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/physical_device.rb +0 -0
  65. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/physical_devices.rb +1 -1
  66. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/public_ip.rb +0 -0
  67. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/public_ips.rb +1 -1
  68. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rnat.rb +0 -0
  69. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rnats.rb +1 -1
  70. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/role.rb +0 -0
  71. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/roles.rb +1 -1
  72. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/row.rb +0 -0
  73. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/rows.rb +1 -1
  74. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server.rb +5 -5
  75. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server_configuration_option.rb +0 -0
  76. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/server_configuration_options.rb +1 -1
  77. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/servers.rb +1 -1
  78. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ssh_key.rb +0 -0
  79. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/ssh_keys.rb +1 -1
  80. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/storage_usage_detail.rb +0 -0
  81. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/storage_usage_detail_summary.rb +1 -1
  82. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/support_ticket.rb +0 -0
  83. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/support_tickets.rb +1 -1
  84. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tag.rb +0 -0
  85. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tags.rb +1 -1
  86. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/task.rb +0 -0
  87. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/tasks.rb +1 -1
  88. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/template.rb +0 -0
  89. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/templates.rb +1 -1
  90. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/trusted_network_group.rb +0 -0
  91. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/trusted_network_groups.rb +1 -1
  92. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/user.rb +0 -0
  93. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/users.rb +1 -1
  94. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/virtual_machine_assigned_ip.rb +0 -0
  95. data/lib/fog/{ecloud/models/compute → compute/ecloud/models}/virtual_machine_assigned_ips.rb +1 -1
  96. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_disable_support_access.rb +1 -1
  97. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_authentication_levels.rb +1 -1
  98. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_login_banner.rb +1 -1
  99. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_edit_password_complexity_rules.rb +1 -1
  100. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/admin_enable_support_access.rb +1 -1
  101. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_create.rb +0 -0
  102. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_delete.rb +1 -1
  103. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/backup_internet_service_edit.rb +0 -0
  104. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/compute_pool_edit.rb +1 -1
  105. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/firewall_acls_create.rb +0 -0
  106. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/firewall_acls_delete.rb +1 -1
  107. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_admin_organization.rb +0 -0
  108. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_api_key.rb +0 -0
  109. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_api_keys.rb +0 -0
  110. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_association.rb +0 -0
  111. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_associations.rb +0 -0
  112. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_authentication_level.rb +0 -0
  113. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_authentication_levels.rb +0 -0
  114. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_backup_internet_service.rb +0 -0
  115. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_backup_internet_services.rb +0 -0
  116. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog.rb +0 -0
  117. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_configuration.rb +0 -0
  118. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_configurations.rb +0 -0
  119. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_catalog_item.rb +0 -0
  120. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_compute_pool.rb +0 -0
  121. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_compute_pools.rb +0 -0
  122. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_cpu_usage_detail.rb +0 -0
  123. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_cpu_usage_detail_summary.rb +0 -0
  124. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_detached_disk.rb +0 -0
  125. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_detached_disks.rb +0 -0
  126. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_environment.rb +0 -0
  127. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_environments.rb +0 -0
  128. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_firewall_acl.rb +0 -0
  129. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_firewall_acls.rb +0 -0
  130. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_group.rb +0 -0
  131. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_groups.rb +0 -0
  132. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_guest_process.rb +0 -0
  133. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_guest_processes.rb +0 -0
  134. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_hardware_configuration.rb +0 -0
  135. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_hardware_configurations.rb +0 -0
  136. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_internet_service.rb +0 -0
  137. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_internet_services.rb +0 -0
  138. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ip_address.rb +0 -0
  139. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_layout.rb +0 -0
  140. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_layouts.rb +0 -0
  141. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_location.rb +0 -0
  142. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_locations.rb +0 -0
  143. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_login_banner.rb +0 -0
  144. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_login_banners.rb +0 -0
  145. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_memory_usage_detail.rb +0 -0
  146. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_memory_usage_detail_summary.rb +0 -0
  147. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_monitor.rb +0 -0
  148. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_monitors.rb +0 -0
  149. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_network.rb +0 -0
  150. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_network_summary.rb +0 -0
  151. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_networks.rb +0 -0
  152. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_node.rb +0 -0
  153. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_nodes.rb +0 -0
  154. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_operating_system.rb +0 -0
  155. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_operating_system_families.rb +0 -0
  156. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_organization.rb +0 -0
  157. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_organizations.rb +0 -0
  158. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_password_complexity_rule.rb +0 -0
  159. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_password_complexity_rules.rb +0 -0
  160. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_physical_device.rb +0 -0
  161. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_physical_devices.rb +0 -0
  162. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_process.rb +0 -0
  163. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_processes.rb +0 -0
  164. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_public_ip.rb +0 -0
  165. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_public_ips.rb +0 -0
  166. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rnat.rb +0 -0
  167. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rnats.rb +0 -0
  168. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_role.rb +0 -0
  169. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_roles.rb +0 -0
  170. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_row.rb +0 -0
  171. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_rows.rb +0 -0
  172. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server.rb +0 -0
  173. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server_configuration_option.rb +0 -0
  174. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_server_configuration_options.rb +0 -0
  175. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_servers.rb +0 -0
  176. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ssh_key.rb +0 -0
  177. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_ssh_keys.rb +0 -0
  178. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_storage_usage_detail.rb +0 -0
  179. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_storage_usage_detail_summary.rb +0 -0
  180. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_support_ticket.rb +0 -0
  181. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_support_tickets.rb +0 -0
  182. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tag.rb +0 -0
  183. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tags.rb +0 -0
  184. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_task.rb +0 -0
  185. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_tasks.rb +0 -0
  186. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_template.rb +0 -0
  187. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_templates.rb +0 -0
  188. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_trusted_network_group.rb +0 -0
  189. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_trusted_network_groups.rb +0 -0
  190. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_user.rb +0 -0
  191. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_users.rb +0 -0
  192. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/get_virtual_machine_assigned_ips.rb +0 -0
  193. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_create.rb +0 -0
  194. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_delete.rb +1 -1
  195. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_edit.rb +0 -0
  196. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_movedown.rb +1 -1
  197. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/groups_moveup.rb +1 -1
  198. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_create.rb +2 -2
  199. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_delete.rb +1 -1
  200. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/internet_service_edit.rb +3 -3
  201. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_default.rb +1 -1
  202. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_ecv.rb +0 -0
  203. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_http.rb +0 -0
  204. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_loopback.rb +1 -1
  205. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_create_ping.rb +0 -0
  206. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_disable.rb +1 -1
  207. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_ecv.rb +0 -0
  208. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_http.rb +0 -0
  209. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_edit_ping.rb +0 -0
  210. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/monitors_enable.rb +1 -1
  211. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_create.rb +0 -0
  212. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_delete.rb +1 -1
  213. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/node_service_edit.rb +1 -1
  214. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_off.rb +1 -1
  215. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_on.rb +1 -1
  216. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_reset.rb +1 -1
  217. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/power_shutdown.rb +1 -1
  218. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/public_ip_activate.rb +1 -1
  219. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_create_device.rb +0 -0
  220. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_delete.rb +1 -1
  221. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rnat_associations_edit_network.rb +0 -0
  222. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_create.rb +0 -0
  223. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_delete.rb +1 -1
  224. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_edit.rb +0 -0
  225. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_movedown.rb +1 -1
  226. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/rows_moveup.rb +1 -1
  227. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_create.rb +1 -1
  228. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_delete.rb +1 -1
  229. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/trusted_network_groups_edit.rb +1 -1
  230. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_attach_disk.rb +1 -1
  231. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_copy.rb +1 -1
  232. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_copy_identical.rb +1 -1
  233. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_create_from_template.rb +1 -1
  234. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_delete.rb +1 -1
  235. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_detach_disk.rb +1 -1
  236. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit.rb +1 -1
  237. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit_assigned_ips.rb +1 -1
  238. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_edit_hardware_configuration.rb +1 -1
  239. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_import.rb +1 -1
  240. data/lib/fog/{ecloud/requests/compute → compute/ecloud/requests}/virtual_machine_upload_file.rb +3 -3
  241. data/lib/fog/ecloud.rb +37 -3
  242. data/lib/fog/ecloud/compute.rb +1 -824
  243. data/lib/fog/ecloud/version.rb +1 -1
  244. metadata +238 -239
  245. data/lib/fog/ecloud/core.rb +0 -32
  246. data/lib/fog/ecloud/generate_collection.rb +0 -127
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ecb53ec77476de2ae11bca42cd621d2181aef8c
4
- data.tar.gz: 0956e35728fcf98253e49e7a10fe7e9fe98df445
3
+ metadata.gz: ba48be01cb0c4f4af5cf107563c528f2e828b557
4
+ data.tar.gz: 0b9629b3d32eb16aab63e64a04b06c27177740ce
5
5
  SHA512:
6
- metadata.gz: e26aa4b832d36e988f677fc6547b3017071abe5c34d56ac2a365c09dfb497e70782dafff44e7bfae1dce49afd3820f4f5e1e46e981260ce6f05cee08d27a92d3
7
- data.tar.gz: 735e16b3978c5d16633982f81e8cea6b33199a2db7a11e05f31f0b9bdaa3c026ddefb292c9f87bda9fb45b78b99ce846b08767ae31567b1d5d8063d2bec0ec25
6
+ metadata.gz: 57bf7711527a28076c985b98c7793e727e67dc2d482b16e96e280c5ba6f7fc5e8451ce2748cef24e2fb7d8a9a9a10c1d3c603a5bc5c9075be8d5c46489e2d17d
7
+ data.tar.gz: e1904ac3dceb915ec294a4b28b8e4aa7945bdd3a0e6a6863aafcd6ec703ad2273e424efc9bc6142172f2a81f6c78fe944aab131bcf26b6830bbc9eaefa3c471c
@@ -18,3 +18,9 @@ Style/SignalException:
18
18
 
19
19
  Style/StringLiterals:
20
20
  EnforcedStyle: double_quotes
21
+
22
+ Style/ExtraSpacing:
23
+ Enabled: false
24
+
25
+ Metrics/AbcSize:
26
+ Enabled: false
@@ -14,7 +14,10 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = ""
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0")
17
+ files = `git ls-files -z`.split("\x0")
18
+ files.delete(".hound.yml")
19
+ spec.files = files
20
+
18
21
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
23
  spec.require_paths = ["lib"]
@@ -18,7 +18,7 @@ class Ecloud < Fog::Bin
18
18
  hash[key] = case key
19
19
  when :compute
20
20
  Fog::Logger.warning("Ecloud[:compute] is not recommended, use Compute[:ecloud] for portability")
21
- Fog::Compute.new(:provider => 'Ecloud')
21
+ Fog::Compute.new(:provider => "Ecloud")
22
22
  else
23
23
  raise ArgumentError, "Unrecognized service: #{key.inspect}"
24
24
  end
@@ -0,0 +1,826 @@
1
+ require File.expand_path("../ecloud/models/model", __FILE__)
2
+ require File.expand_path("../ecloud/models/collection", __FILE__)
3
+
4
+ module Fog
5
+ module Compute
6
+ class Ecloud < Fog::Service
7
+ API_URL = "https://services.enterprisecloud.terremark.com"
8
+
9
+ attr_reader :authentication_method, :version
10
+
11
+ #### Credentials
12
+ # requires
13
+ recognizes :ecloud_username, :ecloud_password, :ecloud_version,
14
+ :ecloud_access_key, :ecloud_private_key,
15
+ :ecloud_authentication_method, :base_path
16
+
17
+ #### Models
18
+ model_path "fog/compute/ecloud/models/"
19
+ model :organization
20
+ collection :organizations
21
+ model :location
22
+ collection :locations
23
+ model :catalog_item
24
+ collection :catalog
25
+ model :catalog_configuration
26
+ collection :catalog_configurations
27
+ model :environment
28
+ collection :environments
29
+ model :task
30
+ collection :tasks
31
+ model :compute_pool
32
+ collection :compute_pools
33
+ model :server
34
+ collection :servers
35
+ model :virtual_machine_assigned_ip
36
+ collection :virtual_machine_assigned_ips
37
+ model :hardware_configuration
38
+ collection :hardware_configurations
39
+ model :server_configuration_option
40
+ collection :server_configuration_options
41
+ model :guest_process
42
+ collection :guest_processes
43
+ model :layout
44
+ collection :layouts
45
+ model :row
46
+ collection :rows
47
+ model :group
48
+ collection :groups
49
+ model :internet_service
50
+ collection :internet_services
51
+ model :node
52
+ collection :nodes
53
+ model :monitor
54
+ collection :monitors
55
+ model :cpu_usage_detail
56
+ collection :cpu_usage_detail_summary
57
+ model :memory_usage_detail
58
+ collection :memory_usage_detail_summary
59
+ model :storage_usage_detail
60
+ collection :storage_usage_detail_summary
61
+ model :operating_system_family
62
+ collection :operating_system_families
63
+ model :operating_system
64
+ collection :operating_systems
65
+ model :template
66
+ collection :templates
67
+ model :firewall_acl
68
+ collection :firewall_acls
69
+ model :network
70
+ collection :networks
71
+ model :ip_address
72
+ collection :ip_addresses
73
+ model :physical_device
74
+ collection :physical_devices
75
+ model :public_ip
76
+ collection :public_ips
77
+ model :trusted_network_group
78
+ collection :trusted_network_groups
79
+ model :backup_internet_service
80
+ collection :backup_internet_services
81
+ model :rnat
82
+ collection :rnats
83
+ model :association
84
+ collection :associations
85
+ model :tag
86
+ collection :tags
87
+ model :admin_organization
88
+ collection :admin_organizations
89
+ model :ssh_key
90
+ collection :ssh_keys
91
+ model :password_complexity_rule
92
+ collection :password_complexity_rules
93
+ model :authentication_level
94
+ collection :authentication_levels
95
+ model :login_banner
96
+ collection :login_banners
97
+ model :user
98
+ collection :users
99
+ model :role
100
+ collection :roles
101
+ model :ssh_key
102
+ collection :ssh_keys
103
+ model :support_ticket
104
+ collection :support_tickets
105
+ model :detached_disk
106
+ collection :detached_disks
107
+
108
+ #### Requests
109
+ request_path "fog/compute/ecloud/requests/"
110
+ request :backup_internet_service_create
111
+ request :backup_internet_service_delete
112
+ request :backup_internet_service_edit
113
+ request :compute_pool_edit
114
+ request :firewall_acls_create
115
+ request :firewall_acls_delete
116
+ request :get_admin_organization
117
+ request :get_api_key
118
+ request :get_api_keys
119
+ request :get_association
120
+ request :get_associations
121
+ request :get_authentication_level
122
+ request :get_authentication_levels
123
+ request :get_backup_internet_service
124
+ request :get_backup_internet_services
125
+ request :get_catalog
126
+ request :get_catalog_configuration
127
+ request :get_catalog_configurations
128
+ request :get_catalog_item
129
+ request :get_compute_pool
130
+ request :get_compute_pools
131
+ request :get_cpu_usage_detail
132
+ request :get_cpu_usage_detail_summary
133
+ request :get_environment
134
+ request :get_firewall_acl
135
+ request :get_firewall_acls
136
+ request :get_group
137
+ request :get_groups
138
+ request :get_guest_process
139
+ request :get_guest_processes
140
+ request :get_hardware_configuration
141
+ request :get_internet_service
142
+ request :get_internet_services
143
+ request :get_ip_address
144
+ request :get_layout
145
+ request :get_layouts
146
+ request :get_location
147
+ request :get_locations
148
+ request :get_login_banner
149
+ request :get_login_banners
150
+ request :get_memory_usage_detail
151
+ request :get_memory_usage_detail_summary
152
+ request :get_monitor
153
+ request :get_monitors
154
+ request :get_network
155
+ request :get_network_summary
156
+ request :get_networks
157
+ request :get_node
158
+ request :get_nodes
159
+ request :get_operating_system
160
+ request :get_operating_system_families
161
+ request :get_organization
162
+ request :get_organizations
163
+ request :get_password_complexity_rule
164
+ request :get_password_complexity_rules
165
+ request :get_physical_device
166
+ request :get_physical_devices
167
+ request :get_public_ip
168
+ request :get_public_ips
169
+ request :get_rnat
170
+ request :get_rnats
171
+ request :get_role
172
+ request :get_roles
173
+ request :get_row
174
+ request :get_rows
175
+ request :get_server
176
+ request :get_server_configuration_option
177
+ request :get_server_configuration_options
178
+ request :get_servers
179
+ request :get_ssh_key
180
+ request :get_ssh_keys
181
+ request :get_storage_usage_detail
182
+ request :get_storage_usage_detail_summary
183
+ request :get_support_ticket
184
+ request :get_support_tickets
185
+ request :get_tag
186
+ request :get_tags
187
+ request :get_task
188
+ request :get_tasks
189
+ request :get_template
190
+ request :get_templates
191
+ request :get_trusted_network_group
192
+ request :get_trusted_network_groups
193
+ request :get_user
194
+ request :get_users
195
+ request :get_virtual_machine_assigned_ips
196
+ request :get_detached_disks
197
+ request :get_detached_disk
198
+ request :groups_create
199
+ request :groups_delete
200
+ request :groups_edit
201
+ request :groups_movedown
202
+ request :groups_moveup
203
+ request :internet_service_create
204
+ request :internet_service_delete
205
+ request :internet_service_edit
206
+ request :monitors_create_default
207
+ request :monitors_create_ecv
208
+ request :monitors_create_http
209
+ request :monitors_create_loopback
210
+ request :monitors_create_ping
211
+ request :monitors_disable
212
+ request :monitors_edit_ecv
213
+ request :monitors_edit_http
214
+ request :monitors_edit_ping
215
+ request :monitors_enable
216
+ request :node_service_create
217
+ request :node_service_delete
218
+ request :node_service_edit
219
+ request :power_off
220
+ request :power_on
221
+ request :power_reset
222
+ request :power_shutdown
223
+ request :public_ip_activate
224
+ request :rnat_associations_create_device
225
+ request :rnat_associations_delete
226
+ request :rnat_associations_edit_network
227
+ request :rows_create
228
+ request :rows_delete
229
+ request :rows_edit
230
+ request :rows_movedown
231
+ request :rows_moveup
232
+ request :trusted_network_groups_create
233
+ request :trusted_network_groups_delete
234
+ request :trusted_network_groups_edit
235
+ request :virtual_machine_edit_assigned_ips
236
+ request :virtual_machine_copy
237
+ request :virtual_machine_copy_identical
238
+ request :virtual_machine_create_from_template
239
+ request :virtual_machine_delete
240
+ request :virtual_machine_edit
241
+ request :virtual_machine_edit_hardware_configuration
242
+ request :virtual_machine_import
243
+ request :virtual_machine_upload_file
244
+ request :virtual_machine_detach_disk
245
+ request :virtual_machine_attach_disk
246
+
247
+ module Shared
248
+ attr_accessor :base_path
249
+ attr_reader :versions_uri
250
+
251
+ def validate_data(required_opts = [], options = {})
252
+ unless required_opts.all? { |opt| options.key?(opt) }
253
+ raise ArgumentError.new("Required data missing: #{(required_opts - options.keys).map(&:inspect).join(', ')}")
254
+ end
255
+ end
256
+
257
+ def id_from_uri(uri)
258
+ uri.match(/(\d+)$/)[1].to_i
259
+ end
260
+
261
+ def default_organization_uri
262
+ "#{@base_path}/organizations"
263
+ end
264
+ end
265
+
266
+ class Real
267
+ include Shared
268
+
269
+ class << self
270
+ def basic_request(name, expects = [200], method = :get, headers = {}, body = "")
271
+ define_method(name) do |uri|
272
+ request(
273
+ :expects => expects,
274
+ :method => method,
275
+ :headers => headers,
276
+ :body => body,
277
+ :parse => true,
278
+ :uri => uri
279
+ )
280
+ end
281
+ end
282
+ end
283
+
284
+ def initialize(options = {})
285
+ @base_path = options[:base_path] || "/cloudapi/ecloud"
286
+ @connections = {}
287
+ @connection_options = options[:connection_options] || {}
288
+ @host = options[:ecloud_host] || API_URL
289
+ @persistent = options[:persistent] || false
290
+ @version = options[:ecloud_version] || "2013-06-01"
291
+ @authentication_method = options[:ecloud_authentication_method] || :cloud_api_auth
292
+ @access_key = options[:ecloud_access_key]
293
+ @private_key = options[:ecloud_private_key]
294
+ if @private_key.nil? || @authentication_method == :basic_auth
295
+ @authentication_method = :basic_auth
296
+ @username = options[:ecloud_username]
297
+ @password = options[:ecloud_password]
298
+ if @username.nil? || @password.nil?
299
+ raise ArgumentError, "No credentials (cloud auth, or basic auth) passed!"
300
+ end
301
+ else
302
+ @hmac = Fog::HMAC.new("sha256", @private_key)
303
+ end
304
+ end
305
+
306
+ def request(params)
307
+ # Convert the uri to a URI if it's a string.
308
+ if params[:uri].is_a?(String)
309
+ params[:uri] = URI.parse(@host + params[:uri])
310
+ end
311
+ host_url = "#{params[:uri].scheme}://#{params[:uri].host}#{params[:uri].port ? ':#{params[:uri].port}' : ''}"
312
+
313
+ # Hash connections on the host_url ... There"s nothing to say we won"t get URI"s that go to
314
+ # different hosts.
315
+ @connections[host_url] ||= Fog::XML::Connection.new(host_url, @persistent, @connection_options)
316
+
317
+ # Set headers to an empty hash if none are set.
318
+ headers = set_extra_headers_for(params) || set_extra_headers_for({})
319
+
320
+ # Make the request
321
+ options = {
322
+ :expects => (params[:expects] || 200),
323
+ :method => params[:method] || "GET",
324
+ :path => params[:uri].path + "#{"?#{params[:uri].query}" if params[:uri].query}",
325
+ :headers => headers
326
+ }
327
+ unless params[:body].nil? || params[:body].empty?
328
+ options.merge!(:body => params[:body])
329
+ end
330
+ response = @connections[host_url].request(options)
331
+ # Parse the response body into a hash
332
+ unless response.body.empty?
333
+ if params[:parse]
334
+ document = Fog::ToHashDocument.new
335
+ parser = Nokogiri::XML::SAX::PushParser.new(document)
336
+ parser << response.body
337
+ parser.finish
338
+
339
+ response.body = document.body
340
+ end
341
+ end
342
+
343
+ response
344
+ end
345
+
346
+ private
347
+
348
+ # if Authorization and x-tmrk-authorization are used, the x-tmrk-authorization takes precendence.
349
+ def set_extra_headers_for(params)
350
+ params[:headers] = {
351
+ "x-tmrk-version" => @version,
352
+ "Date" => Time.now.utc.strftime("%a, %d %b %Y %H:%M:%S GMT"),
353
+ }.merge(params[:headers] || {})
354
+ if params[:method] == "POST" || params[:method] == "PUT"
355
+ params[:headers].merge!("Content-Type" => "application/xml") unless params[:headers]["Content-Type"]
356
+ params[:headers].merge!("Accept" => "application/xml")
357
+ end
358
+ unless params[:body].nil? || params[:body].empty?
359
+ params[:headers].merge!("x-tmrk-contenthash" => "Sha256 #{Base64.encode64(Digest::SHA2.digest(params[:body].to_s)).chomp}")
360
+ end
361
+ if @authentication_method == :basic_auth
362
+ params[:headers].merge!("Authorization" => "Basic #{Base64.encode64(@username + ":" + @password).delete("\r\n")}")
363
+ elsif @authentication_method == :cloud_api_auth
364
+ signature = cloud_api_signature(params)
365
+ params[:headers].merge!(
366
+ "x-tmrk-authorization" => %{CloudApi AccessKey="#{@access_key}" SignatureType="HmacSha256" Signature="#{signature}"},
367
+ "Authorization" => %{CloudApi AccessKey="#{@access_key}" SignatureType="HmacSha256" Signature="#{signature}"}
368
+ )
369
+ end
370
+ params[:headers]
371
+ end
372
+
373
+ def cloud_api_signature(params)
374
+ verb = params[:method].upcase
375
+ headers = params[:headers]
376
+ path = params[:uri].path
377
+ canonicalized_headers = canonicalize_headers(headers)
378
+ canonicalized_resource = canonicalize_resource(path)
379
+ string = [
380
+ verb,
381
+ headers["Content-Length"].to_s,
382
+ headers["Content-Type"].to_s,
383
+ headers["Date"].to_s,
384
+ canonicalized_headers,
385
+ canonicalized_resource + "\n"
386
+ ].join("\n")
387
+ Base64.encode64(@hmac.sign(string)).chomp
388
+ end
389
+
390
+ # section 5.6.3.2 in the ~1000 page pdf spec
391
+ def canonicalize_headers(headers)
392
+ tmp = headers.inject({}) do |ret, h|
393
+ ret[h.first.downcase] = h.last if h.first.match(/^x-tmrk/i)
394
+ ret
395
+ end
396
+ tmp.reject! { |k, _v| k == "x-tmrk-authorization" }
397
+ tmp = tmp.sort.map { |e| "#{e.first}:#{e.last}" }.join("\n")
398
+ tmp
399
+ end
400
+
401
+ # section 5.6.3.3 in the ~1000 page pdf spec
402
+ def canonicalize_resource(path)
403
+ uri, query_string = path.split("?")
404
+ return uri if query_string.nil?
405
+ query_string_pairs = query_string.split("&").sort.map { |e| e.split("=") }
406
+ tm_query_string = query_string_pairs.map { |x| "#{x.first.downcase}:#{x.last}" }.join("\n")
407
+ "#{uri.downcase}\n#{tm_query_string}\n"
408
+ end
409
+ end
410
+
411
+ class Mock
412
+ include Shared
413
+
414
+ def self.data
415
+ @data ||= Hash.new do |hash, key|
416
+ hash[key] = begin
417
+ compute_pool_id = Fog.credentials[:ecloud_compute_pool_id] || Fog::Mock.random_numbers(3).to_i
418
+ environment_id = Fog.credentials[:ecloud_environment_id] || Fog::Mock.random_numbers(3).to_i
419
+ public_ip_id = Fog.credentials[:ecloud_public_ip_id] || Fog::Mock.random_numbers(6).to_i
420
+ internet_service_id = Fog::Mock.random_numbers(6).to_i
421
+ node_service_id = Fog::Mock.random_numbers(6).to_i
422
+ environment_name = Fog.credentials[:ecloud_environment_name] || Fog::Mock.random_letters(12)
423
+ location_id = Fog::Mock.random_numbers(4).to_i
424
+ network_id = Fog.credentials[:ecloud_network_id] || Fog::Mock.random_numbers(6).to_i
425
+ network_ip = Fog::Ecloud.ip_address
426
+ public_ip = Fog.credentials[:ecloud_public_ip_name] || Fog::Ecloud.ip_address
427
+ ip_address_id = Fog::Ecloud.ip_address
428
+ ip_address2_id = Fog::Ecloud.ip_address
429
+ operating_system_id = Fog::Mock.random_numbers(7).to_i
430
+ operating_system_family_id = Fog::Mock.random_numbers(7).to_i
431
+ organization_id = Fog::Mock.random_numbers(7).to_i
432
+ organization_name = Fog::Mock.random_letters(7)
433
+ template_id = Fog.credentials[:ecloud_template_id] || Fog::Mock.random_numbers(7).to_i
434
+ ssh_key_id = Fog.credentials[:ecloud_ssh_key_id] || Fog::Mock.random_numbers(4).to_i
435
+ ssh_key_name = Fog.credentials[:ecloud_ssh_key_name] || "root"
436
+
437
+ environment = {
438
+ :id => environment_id,
439
+ :href => "/cloudapi/ecloud/environments/#{environment_id}",
440
+ :name => environment_name,
441
+ :type => "application/vnd.tmrk.cloud.environment"
442
+ }
443
+
444
+ organization = {
445
+ :href => "/cloudapi/ecloud/organizations/#{organization_id}",
446
+ :type => "application/vnd.tmrk.cloud.organization",
447
+ :name => organization_name,
448
+ :Links => {
449
+ :Link => [
450
+ Fog::Ecloud.keep(environment, :href, :name, :type),
451
+ {
452
+ :href => "/cloudapi/ecloud/admin/organizations/#{organization_id}",
453
+ :name => organization_name,
454
+ :type => "application/vnd.tmrk.cloud.admin.organization",
455
+ :rel => "alternate",
456
+ },
457
+ {
458
+ :href => "/cloudapi/ecloud/devicetags/organizations/#{organization_id}",
459
+ :type => "application/vnd.tmrk.cloud.deviceTag; type=collection",
460
+ :rel => "down",
461
+ },
462
+ {
463
+ :href => "/cloudapi/ecloud/alerts/organizations/#{organization_id}",
464
+ :type => "application/vnd.tmrk.cloud.alertLog",
465
+ :rel => "down",
466
+ },
467
+ ],
468
+ },
469
+ :Locations => {
470
+ :Location => [
471
+ {
472
+ :href => "/cloudapi/ecloud/locations/#{location_id}",
473
+ :name => organization_name,
474
+ :Catalog => {
475
+ :href => "/cloudapi/ecloud/admin/catalog/organizations/#{organization_id}/locations/#{location_id}",
476
+ :type => "application/vnd.tmrk.cloud.admin.catalogEntry; type=collection"
477
+ },
478
+ :Environments => { :Environment => [environment] }
479
+ }
480
+ ]
481
+ }
482
+ }
483
+ environment.merge!(
484
+ :Links => {
485
+ :Link => [Fog::Ecloud.keep(organization, :href, :name, :type)]
486
+ }
487
+ )
488
+
489
+ admin_organization = {
490
+ :id => organization_id,
491
+ :href => "/cloudapi/ecloud/admin/organizations/#{organization_id}",
492
+ :type => "application/vnd.tmrk.cloud.admin.organization",
493
+ :name => organization_name,
494
+ :Links => {
495
+ :Link => [
496
+ Fog::Ecloud.keep(organization, :href, :type, :name)
497
+ ],
498
+ },
499
+ :organization_id => organization_id,
500
+ }
501
+
502
+ compute_pool = {
503
+ :id => compute_pool_id,
504
+ :href => "/cloudapi/ecloud/computepools/#{compute_pool_id}",
505
+ :name => Fog::Mock.random_letters(12),
506
+ :type => "application/vnd.tmrk.cloud.computePool",
507
+ :environment_id => environment_id,
508
+ :Links => {
509
+ :Link => [
510
+ Fog::Ecloud.keep(organization, :href, :name, :type),
511
+ Fog::Ecloud.keep(environment, :href, :name, :type),
512
+ ]
513
+ }
514
+ }
515
+
516
+ public_ip = {
517
+ :id => public_ip_id,
518
+ :href => "/cloudapi/ecloud/publicips/#{public_ip_id}",
519
+ :name => public_ip,
520
+ :type => "application/vnd.tmrk.cloud.publicIp",
521
+ :IpType => "none",
522
+ :environment_id => environment_id,
523
+ :Links => {
524
+ :Link => [
525
+ Fog::Ecloud.keep(environment, :href, :name, :type),
526
+ ],
527
+ },
528
+ :InternetServices => {
529
+ :InternetService => [
530
+ ],
531
+ },
532
+ }
533
+
534
+ internet_service = {
535
+ :id => internet_service_id,
536
+ :href => "/cloudapi/ecloud/internetservices/#{internet_service_id}",
537
+ :name => Fog::Mock.random_letters(6),
538
+ :type => "application/vnd.tmrk.cloud.internetService",
539
+ :public_ip_id => public_ip_id,
540
+ :Links => {
541
+ :Link => [
542
+ Fog::Ecloud.keep(public_ip, :href, :name, :type),
543
+ ],
544
+ },
545
+ :NodeServices => {
546
+ :NodeService => [
547
+ ]
548
+ },
549
+ }
550
+
551
+ node_service = {
552
+ :id => node_service_id,
553
+ :href => "/cloudapi/ecloud/nodeservices/#{node_service_id}",
554
+ :name => Fog::Mock.random_letters(6),
555
+ :type => "application/vnd.tmrk.cloud.nodeService",
556
+ :internet_service_id => internet_service_id,
557
+ :Links => {
558
+ :Link => [
559
+ Fog::Ecloud.keep(internet_service, :href, :name, :type)
560
+ ],
561
+ },
562
+ }
563
+
564
+ internet_service[:NodeServices][:NodeService].push(node_service)
565
+ public_ip[:InternetServices][:InternetService].push(internet_service)
566
+
567
+ network = {
568
+ :id => network_id,
569
+ :href => "/cloudapi/ecloud/networks/#{network_id}",
570
+ :name => "#{network_ip}/#{Fog::Mock.random_numbers(2)}",
571
+ :type => "application/vnd.tmrk.cloud.network",
572
+ :Address => network_ip,
573
+ :NetworkType => "Dmz",
574
+ :BroadcastAddress => network_ip,
575
+ :GatewayAddress => network_ip,
576
+ :environment_id => environment_id,
577
+ :Links => {
578
+ :Link => [
579
+ Fog::Ecloud.keep(environment, :href, :name, :type),
580
+ ]
581
+ },
582
+ :IpAddresses => {
583
+ :IpAddress => [],
584
+ },
585
+ }
586
+
587
+ ip_address = {
588
+ :id => ip_address_id,
589
+ :href => "/cloudapi/ecloud/ipaddresses/networks/#{network_id}/#{ip_address_id}",
590
+ :name => ip_address_id,
591
+ :type => "application/vnd.tmrk.cloud.ipAddress",
592
+ :network_id => network_id,
593
+ :Links => {
594
+ :Link => [Fog::Ecloud.keep(network, :href, :name, :type)]
595
+ },
596
+ :Reserved => "false",
597
+ :Host => nil,
598
+ :DetectedOn => nil
599
+ }
600
+
601
+ ip_address2 = ip_address.dup.merge(:id => ip_address2_id, :href => "/cloudapi/ecloud/ipaddresses/networks/#{network_id}/#{ip_address2_id}", :name => ip_address2_id)
602
+
603
+ network[:IpAddresses][:IpAddress].push(ip_address).push(ip_address2)
604
+
605
+ short_name = "solaris10_64guest"
606
+ operating_system = {
607
+ :short_name => short_name,
608
+ :compute_pool_id => compute_pool_id,
609
+ :href => "/cloudapi/ecloud/operatingsystems/#{short_name}/computepools/#{compute_pool_id}",
610
+ :name => "Sun Solaris 10 (64-bit)",
611
+ :type => "application/vnd.tmrk.cloud.operatingSystem",
612
+ :FamilyName => "Solaris",
613
+ :Links => {
614
+ :Link => Fog::Ecloud.keep(compute_pool, :href, :name, :type),
615
+ },
616
+ :ConfigurationOptions => {
617
+ :Processor => {
618
+ :Minimum => "1",
619
+ :Maximum => "8",
620
+ :StepFactor => "1"
621
+ },
622
+ :Memory => {
623
+ :MinimumSize => {
624
+ :Unit => "MB",
625
+ :Value => "800"
626
+ },
627
+ :MaximumSize => {
628
+ :Unit => "MB",
629
+ :Value => "16384"
630
+ },
631
+ :StepFactor => {
632
+ :Unit => "MB",
633
+ :Value => "4"
634
+ }
635
+ },
636
+ :Disk => {
637
+ :Minimum => "1",
638
+ :Maximum => "15",
639
+ :SystemDisk => {
640
+ :ResourceCapacityRange => {
641
+ :MinimumSize => {
642
+ :Unit => "GB",
643
+ :Value => "1"
644
+ },
645
+ :MaximumSize => {
646
+ :Unit => "GB",
647
+ :Value => "512"
648
+ },
649
+ :StepFactor => {
650
+ :Unit => "GB",
651
+ :Value => "1"
652
+ }
653
+ },
654
+ :MonthlyCost => "0"
655
+ },
656
+ :DataDisk => {
657
+ :ResourceCapacityRange => {
658
+ :MinimumSize => {
659
+ :Unit => "GB",
660
+ :Value => "1"
661
+ },
662
+ :MaximumSize => {
663
+ :Unit => "GB",
664
+ :Value => "512"
665
+ },
666
+ :StepFactor => {
667
+ :Unit => "GB",
668
+ :Value => "1"
669
+ }
670
+ },
671
+ :MonthlyCost => "0"
672
+ }
673
+ },
674
+ :NetworkAdapter => {
675
+ :Minimum => "1",
676
+ :Maximum => "4",
677
+ :StepFactor => "1"
678
+ }
679
+ }
680
+ }
681
+
682
+ template = {
683
+ :id => template_id,
684
+ :href => "/cloudapi/ecloud/templates/#{template_id}/computepools/#{compute_pool_id}",
685
+ :type => "application/vnd.tmrk.cloud.template",
686
+ :name => "Sun Solaris 10 (x64)",
687
+ :compute_pool_id => compute_pool_id,
688
+ :OperatingSystem => Fog::Ecloud.keep(operating_system, :href, :name, :type),
689
+ :Memory => {
690
+ :MinimumSize => {
691
+ :Unit => "MB",
692
+ :Value => "800"
693
+ },
694
+ :MaximumSize => {
695
+ :Unit => "MB",
696
+ :Value => "16384"
697
+ },
698
+ :StepFactor => {
699
+ :Unit => "MB",
700
+ :Value => "4"
701
+ }
702
+ },
703
+ :Storage => {
704
+ :Size => {
705
+ :Unit => "GB",
706
+ :Value => "7"
707
+ }
708
+ },
709
+ :NetworkAdapters => "1",
710
+ :Links => {
711
+ :Link => [
712
+ Fog::Ecloud.keep(compute_pool, :href, :name, :type),
713
+ ]
714
+ }
715
+ }
716
+
717
+ operating_system_family = {
718
+ :id => operating_system_family_id,
719
+ :compute_pool_id => compute_pool_id,
720
+ :OperatingSystemFamily => {
721
+ :Name => "Linux",
722
+ :OperatingSystems => {
723
+ :OperatingSystem => [Fog::Ecloud.keep(operating_system, :href, :name, :type)],
724
+ }
725
+ },
726
+ :Links => {
727
+ :Link => [
728
+ Fog::Ecloud.keep(compute_pool, :href, :name, :type),
729
+ ]
730
+ }
731
+ }
732
+
733
+ ssh_key = {
734
+ :id => ssh_key_id,
735
+ :href => "/cloudapi/ecloud/admin/sshKeys/#{ssh_key_id}",
736
+ :name => ssh_key_name,
737
+ :admin_organization_id => organization_id,
738
+ :Links => {
739
+ :Link => [
740
+ Fog::Ecloud.keep(admin_organization, :href, :name, :type),
741
+ Fog::Ecloud.keep(organization, :href, :name, :type),
742
+ ]
743
+ },
744
+ :Default => "true",
745
+ :FingerPrint => Fog::Ecloud.mac_address
746
+ }
747
+
748
+ layout = {
749
+ :id => environment_id,
750
+ :href => "/cloudapi/ecloud/layout/environments/#{environment_id}",
751
+ :type => "application/vnd.tmrk.cloud.deviceLayout",
752
+ :Links => {
753
+ :Link => [
754
+ Fog::Ecloud.keep(environment, :name, :href, :type),
755
+ ],
756
+ },
757
+ :Rows => {
758
+ :Row => [
759
+ ],
760
+ },
761
+ :environment_id => environment_id
762
+ }
763
+
764
+ {
765
+ :compute_pools => { compute_pool_id => compute_pool },
766
+ :environments => { environment_id => environment },
767
+ :public_ips => { public_ip_id => public_ip },
768
+ :internet_services => { internet_service_id => internet_service },
769
+ :node_services => { node_service_id => node_service },
770
+ :networks => { network_id => network },
771
+ :organizations => { organization_id => organization },
772
+ :admin_organizations => { organization_id => admin_organization },
773
+ :operating_systems => { operating_system_id => operating_system },
774
+ :operating_system_families => { operating_system_family_id => operating_system_family },
775
+ :servers => {},
776
+ :tasks => {},
777
+ :templates => { template_id => template },
778
+ :ssh_keys => { ssh_key_id => ssh_key },
779
+ :detached_disks => {},
780
+ :template_href => (Fog.credentials[:ecloud_template_href] || "/cloudapi/ecloud/templates/#{template_id}/computepools/#{compute_pool_id}"),
781
+ :rows => {},
782
+ :groups => {},
783
+ :layouts => { environment_id => layout }
784
+ }
785
+ end
786
+ end
787
+ end
788
+
789
+ def self.reset
790
+ @data = nil
791
+ end
792
+
793
+ def initialize(options = {})
794
+ @base_path = "/cloudapi/ecloud"
795
+ @ecloud_api_key = options[:ecloud]
796
+ end
797
+
798
+ def data
799
+ self.class.data[@ecloud_api_key]
800
+ end
801
+
802
+ def reset_data
803
+ self.class.data.delete(@ecloud_api_key)
804
+ end
805
+
806
+ def response(params = {})
807
+ body = params[:body]
808
+ headers = {
809
+ "Content-Type" => "application/xml"
810
+ }.merge(params[:headers] || {})
811
+ status = params[:status] || 200
812
+
813
+ response = Excon::Response.new(:body => body, :headers => headers, :status => status)
814
+ if params.key?(:expects) && ![*params[:expects]].include?(response.status)
815
+ raise(Excon::Errors.status_error(params, response))
816
+ else response
817
+ end
818
+ end
819
+
820
+ def deep_copy(o)
821
+ Marshal.load(Marshal.dump(o))
822
+ end
823
+ end
824
+ end
825
+ end
826
+ end