fog-cosmic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (440) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ci.yml +29 -0
  3. data/.gitignore +18 -0
  4. data/.travis.yml +7 -0
  5. data/CHANGELOG.md +8 -0
  6. data/CONTRIBUTORS.md +2 -0
  7. data/Gemfile +4 -0
  8. data/Gemfile.lock +49 -0
  9. data/LICENSE.md +21 -0
  10. data/README.md +44 -0
  11. data/Rakefile +10 -0
  12. data/fog-cosmic.gemspec +32 -0
  13. data/lib/fog/cosmic.rb +45 -0
  14. data/lib/fog/cosmic/compute.rb +861 -0
  15. data/lib/fog/cosmic/models/compute/address.rb +17 -0
  16. data/lib/fog/cosmic/models/compute/disk_offering.rb +44 -0
  17. data/lib/fog/cosmic/models/compute/disk_offerings.rb +24 -0
  18. data/lib/fog/cosmic/models/compute/egress_firewall_rule.rb +38 -0
  19. data/lib/fog/cosmic/models/compute/egress_firewall_rules.rb +25 -0
  20. data/lib/fog/cosmic/models/compute/firewall_rule.rb +24 -0
  21. data/lib/fog/cosmic/models/compute/firewall_rules.rb +25 -0
  22. data/lib/fog/cosmic/models/compute/flavor.rb +36 -0
  23. data/lib/fog/cosmic/models/compute/flavors.rb +25 -0
  24. data/lib/fog/cosmic/models/compute/image.rb +72 -0
  25. data/lib/fog/cosmic/models/compute/images.rb +37 -0
  26. data/lib/fog/cosmic/models/compute/job.rb +51 -0
  27. data/lib/fog/cosmic/models/compute/jobs.rb +25 -0
  28. data/lib/fog/cosmic/models/compute/network.rb +73 -0
  29. data/lib/fog/cosmic/models/compute/network_offering.rb +25 -0
  30. data/lib/fog/cosmic/models/compute/network_offerings.rb +39 -0
  31. data/lib/fog/cosmic/models/compute/networks.rb +38 -0
  32. data/lib/fog/cosmic/models/compute/port_forwarding_rule.rb +25 -0
  33. data/lib/fog/cosmic/models/compute/port_forwarding_rules.rb +25 -0
  34. data/lib/fog/cosmic/models/compute/project.rb +58 -0
  35. data/lib/fog/cosmic/models/compute/projects.rb +39 -0
  36. data/lib/fog/cosmic/models/compute/public_ip_address.rb +96 -0
  37. data/lib/fog/cosmic/models/compute/public_ip_addresses.rb +27 -0
  38. data/lib/fog/cosmic/models/compute/server.rb +151 -0
  39. data/lib/fog/cosmic/models/compute/servers.rb +39 -0
  40. data/lib/fog/cosmic/models/compute/snapshot.rb +46 -0
  41. data/lib/fog/cosmic/models/compute/snapshots.rb +23 -0
  42. data/lib/fog/cosmic/models/compute/volume.rb +121 -0
  43. data/lib/fog/cosmic/models/compute/volumes.rb +26 -0
  44. data/lib/fog/cosmic/models/compute/zone.rb +36 -0
  45. data/lib/fog/cosmic/models/compute/zones.rb +29 -0
  46. data/lib/fog/cosmic/requests/compute/activate_project.rb +25 -0
  47. data/lib/fog/cosmic/requests/compute/add_account_to_project.rb +25 -0
  48. data/lib/fog/cosmic/requests/compute/add_cluster.rb +29 -0
  49. data/lib/fog/cosmic/requests/compute/add_guest_os.rb +26 -0
  50. data/lib/fog/cosmic/requests/compute/add_guest_os_mapping.rb +27 -0
  51. data/lib/fog/cosmic/requests/compute/add_host.rb +30 -0
  52. data/lib/fog/cosmic/requests/compute/add_image_store.rb +25 -0
  53. data/lib/fog/cosmic/requests/compute/add_ip_to_nic.rb +25 -0
  54. data/lib/fog/cosmic/requests/compute/add_ldap_configuration.rb +26 -0
  55. data/lib/fog/cosmic/requests/compute/add_network_device.rb +24 -0
  56. data/lib/fog/cosmic/requests/compute/add_network_service_provider.rb +26 -0
  57. data/lib/fog/cosmic/requests/compute/add_nic_to_virtual_machine.rb +26 -0
  58. data/lib/fog/cosmic/requests/compute/add_nicira_nvp_device.rb +29 -0
  59. data/lib/fog/cosmic/requests/compute/add_region.rb +27 -0
  60. data/lib/fog/cosmic/requests/compute/add_resource_detail.rb +27 -0
  61. data/lib/fog/cosmic/requests/compute/add_secondary_storage.rb +25 -0
  62. data/lib/fog/cosmic/requests/compute/add_traffic_type.rb +26 -0
  63. data/lib/fog/cosmic/requests/compute/add_vpn_user.rb +26 -0
  64. data/lib/fog/cosmic/requests/compute/archive_alerts.rb +24 -0
  65. data/lib/fog/cosmic/requests/compute/archive_events.rb +24 -0
  66. data/lib/fog/cosmic/requests/compute/assign_cert_to_load_balancer.rb +26 -0
  67. data/lib/fog/cosmic/requests/compute/assign_to_load_balancer_rule.rb +25 -0
  68. data/lib/fog/cosmic/requests/compute/assign_virtual_machine.rb +27 -0
  69. data/lib/fog/cosmic/requests/compute/associate_ip_address.rb +55 -0
  70. data/lib/fog/cosmic/requests/compute/attach_iso.rb +26 -0
  71. data/lib/fog/cosmic/requests/compute/attach_volume.rb +76 -0
  72. data/lib/fog/cosmic/requests/compute/cancel_host_maintenance.rb +25 -0
  73. data/lib/fog/cosmic/requests/compute/cancel_storage_maintenance.rb +25 -0
  74. data/lib/fog/cosmic/requests/compute/change_service_for_router.rb +26 -0
  75. data/lib/fog/cosmic/requests/compute/change_service_for_system_vm.rb +26 -0
  76. data/lib/fog/cosmic/requests/compute/change_service_for_virtual_machine.rb +26 -0
  77. data/lib/fog/cosmic/requests/compute/clean_vmreservations.rb +24 -0
  78. data/lib/fog/cosmic/requests/compute/configure_virtual_router_element.rb +26 -0
  79. data/lib/fog/cosmic/requests/compute/copy_iso.rb +26 -0
  80. data/lib/fog/cosmic/requests/compute/copy_template.rb +26 -0
  81. data/lib/fog/cosmic/requests/compute/create_account.rb +30 -0
  82. data/lib/fog/cosmic/requests/compute/create_affinity_group.rb +26 -0
  83. data/lib/fog/cosmic/requests/compute/create_disk_offering.rb +56 -0
  84. data/lib/fog/cosmic/requests/compute/create_domain.rb +25 -0
  85. data/lib/fog/cosmic/requests/compute/create_egress_firewall_rule.rb +44 -0
  86. data/lib/fog/cosmic/requests/compute/create_firewall_rule.rb +48 -0
  87. data/lib/fog/cosmic/requests/compute/create_instance_group.rb +25 -0
  88. data/lib/fog/cosmic/requests/compute/create_ip_forwarding_rule.rb +27 -0
  89. data/lib/fog/cosmic/requests/compute/create_lb_health_check_policy.rb +25 -0
  90. data/lib/fog/cosmic/requests/compute/create_lb_stickiness_policy.rb +27 -0
  91. data/lib/fog/cosmic/requests/compute/create_load_balancer_rule.rb +28 -0
  92. data/lib/fog/cosmic/requests/compute/create_network.rb +30 -0
  93. data/lib/fog/cosmic/requests/compute/create_network_acl.rb +25 -0
  94. data/lib/fog/cosmic/requests/compute/create_network_acl_list.rb +26 -0
  95. data/lib/fog/cosmic/requests/compute/create_network_offering.rb +55 -0
  96. data/lib/fog/cosmic/requests/compute/create_physical_network.rb +26 -0
  97. data/lib/fog/cosmic/requests/compute/create_pod.rb +29 -0
  98. data/lib/fog/cosmic/requests/compute/create_port_forwarding_rule.rb +55 -0
  99. data/lib/fog/cosmic/requests/compute/create_private_gateway.rb +29 -0
  100. data/lib/fog/cosmic/requests/compute/create_project.rb +26 -0
  101. data/lib/fog/cosmic/requests/compute/create_remote_access_vpn.rb +25 -0
  102. data/lib/fog/cosmic/requests/compute/create_secondary_staging_store.rb +25 -0
  103. data/lib/fog/cosmic/requests/compute/create_service_offering.rb +55 -0
  104. data/lib/fog/cosmic/requests/compute/create_snapshot.rb +48 -0
  105. data/lib/fog/cosmic/requests/compute/create_ssh_key_pair.rb +27 -0
  106. data/lib/fog/cosmic/requests/compute/create_static_route.rb +26 -0
  107. data/lib/fog/cosmic/requests/compute/create_storage_network_ip_range.rb +28 -0
  108. data/lib/fog/cosmic/requests/compute/create_storage_pool.rb +27 -0
  109. data/lib/fog/cosmic/requests/compute/create_tags.rb +27 -0
  110. data/lib/fog/cosmic/requests/compute/create_template.rb +27 -0
  111. data/lib/fog/cosmic/requests/compute/create_user.rb +30 -0
  112. data/lib/fog/cosmic/requests/compute/create_virtual_router_element.rb +25 -0
  113. data/lib/fog/cosmic/requests/compute/create_vlan_ip_range.rb +24 -0
  114. data/lib/fog/cosmic/requests/compute/create_vm_snapshot.rb +25 -0
  115. data/lib/fog/cosmic/requests/compute/create_volume.rb +69 -0
  116. data/lib/fog/cosmic/requests/compute/create_vpc.rb +29 -0
  117. data/lib/fog/cosmic/requests/compute/create_vpcoffering.rb +27 -0
  118. data/lib/fog/cosmic/requests/compute/create_vpn_connection.rb +26 -0
  119. data/lib/fog/cosmic/requests/compute/create_vpn_customer_gateway.rb +29 -0
  120. data/lib/fog/cosmic/requests/compute/create_vpn_gateway.rb +25 -0
  121. data/lib/fog/cosmic/requests/compute/create_zone.rb +28 -0
  122. data/lib/fog/cosmic/requests/compute/dedicate_cluster.rb +26 -0
  123. data/lib/fog/cosmic/requests/compute/dedicate_guest_vlan_range.rb +28 -0
  124. data/lib/fog/cosmic/requests/compute/dedicate_host.rb +26 -0
  125. data/lib/fog/cosmic/requests/compute/dedicate_pod.rb +26 -0
  126. data/lib/fog/cosmic/requests/compute/dedicate_public_ip_range.rb +27 -0
  127. data/lib/fog/cosmic/requests/compute/dedicate_zone.rb +26 -0
  128. data/lib/fog/cosmic/requests/compute/delete_account.rb +25 -0
  129. data/lib/fog/cosmic/requests/compute/delete_account_from_project.rb +26 -0
  130. data/lib/fog/cosmic/requests/compute/delete_affinity_group.rb +24 -0
  131. data/lib/fog/cosmic/requests/compute/delete_alerts.rb +24 -0
  132. data/lib/fog/cosmic/requests/compute/delete_cluster.rb +25 -0
  133. data/lib/fog/cosmic/requests/compute/delete_disk_offering.rb +33 -0
  134. data/lib/fog/cosmic/requests/compute/delete_domain.rb +25 -0
  135. data/lib/fog/cosmic/requests/compute/delete_egress_firewall_rule.rb +34 -0
  136. data/lib/fog/cosmic/requests/compute/delete_events.rb +24 -0
  137. data/lib/fog/cosmic/requests/compute/delete_firewall_rule.rb +34 -0
  138. data/lib/fog/cosmic/requests/compute/delete_host.rb +25 -0
  139. data/lib/fog/cosmic/requests/compute/delete_image_store.rb +25 -0
  140. data/lib/fog/cosmic/requests/compute/delete_instance_group.rb +25 -0
  141. data/lib/fog/cosmic/requests/compute/delete_ip_forwarding_rule.rb +25 -0
  142. data/lib/fog/cosmic/requests/compute/delete_iso.rb +25 -0
  143. data/lib/fog/cosmic/requests/compute/delete_lb_health_check_policy.rb +25 -0
  144. data/lib/fog/cosmic/requests/compute/delete_lb_stickiness_policy.rb +25 -0
  145. data/lib/fog/cosmic/requests/compute/delete_ldap_configuration.rb +25 -0
  146. data/lib/fog/cosmic/requests/compute/delete_load_balancer_rule.rb +25 -0
  147. data/lib/fog/cosmic/requests/compute/delete_network.rb +25 -0
  148. data/lib/fog/cosmic/requests/compute/delete_network_acl.rb +25 -0
  149. data/lib/fog/cosmic/requests/compute/delete_network_acl_list.rb +25 -0
  150. data/lib/fog/cosmic/requests/compute/delete_network_device.rb +25 -0
  151. data/lib/fog/cosmic/requests/compute/delete_network_offering.rb +34 -0
  152. data/lib/fog/cosmic/requests/compute/delete_network_service_provider.rb +25 -0
  153. data/lib/fog/cosmic/requests/compute/delete_nicira_nvp_device.rb +25 -0
  154. data/lib/fog/cosmic/requests/compute/delete_physical_network.rb +25 -0
  155. data/lib/fog/cosmic/requests/compute/delete_pod.rb +25 -0
  156. data/lib/fog/cosmic/requests/compute/delete_port_forwarding_rule.rb +25 -0
  157. data/lib/fog/cosmic/requests/compute/delete_private_gateway.rb +25 -0
  158. data/lib/fog/cosmic/requests/compute/delete_project.rb +25 -0
  159. data/lib/fog/cosmic/requests/compute/delete_project_invitation.rb +25 -0
  160. data/lib/fog/cosmic/requests/compute/delete_remote_access_vpn.rb +25 -0
  161. data/lib/fog/cosmic/requests/compute/delete_secondary_staging_store.rb +25 -0
  162. data/lib/fog/cosmic/requests/compute/delete_service_offering.rb +34 -0
  163. data/lib/fog/cosmic/requests/compute/delete_snapshot.rb +61 -0
  164. data/lib/fog/cosmic/requests/compute/delete_ssh_key_pair.rb +27 -0
  165. data/lib/fog/cosmic/requests/compute/delete_ssl_cert.rb +25 -0
  166. data/lib/fog/cosmic/requests/compute/delete_static_route.rb +25 -0
  167. data/lib/fog/cosmic/requests/compute/delete_storage_network_ip_range.rb +25 -0
  168. data/lib/fog/cosmic/requests/compute/delete_storage_pool.rb +25 -0
  169. data/lib/fog/cosmic/requests/compute/delete_tags.rb +26 -0
  170. data/lib/fog/cosmic/requests/compute/delete_template.rb +25 -0
  171. data/lib/fog/cosmic/requests/compute/delete_traffic_type.rb +25 -0
  172. data/lib/fog/cosmic/requests/compute/delete_user.rb +25 -0
  173. data/lib/fog/cosmic/requests/compute/delete_vlan_ip_range.rb +25 -0
  174. data/lib/fog/cosmic/requests/compute/delete_vm_snapshot.rb +25 -0
  175. data/lib/fog/cosmic/requests/compute/delete_volume.rb +45 -0
  176. data/lib/fog/cosmic/requests/compute/delete_vpc.rb +25 -0
  177. data/lib/fog/cosmic/requests/compute/delete_vpcoffering.rb +25 -0
  178. data/lib/fog/cosmic/requests/compute/delete_vpn_connection.rb +25 -0
  179. data/lib/fog/cosmic/requests/compute/delete_vpn_customer_gateway.rb +25 -0
  180. data/lib/fog/cosmic/requests/compute/delete_vpn_gateway.rb +25 -0
  181. data/lib/fog/cosmic/requests/compute/delete_zone.rb +25 -0
  182. data/lib/fog/cosmic/requests/compute/deploy_virtual_machine.rb +127 -0
  183. data/lib/fog/cosmic/requests/compute/destroy_router.rb +25 -0
  184. data/lib/fog/cosmic/requests/compute/destroy_system_vm.rb +25 -0
  185. data/lib/fog/cosmic/requests/compute/destroy_virtual_machine.rb +54 -0
  186. data/lib/fog/cosmic/requests/compute/detach_iso.rb +25 -0
  187. data/lib/fog/cosmic/requests/compute/detach_volume.rb +64 -0
  188. data/lib/fog/cosmic/requests/compute/disable_account.rb +25 -0
  189. data/lib/fog/cosmic/requests/compute/disable_static_nat.rb +51 -0
  190. data/lib/fog/cosmic/requests/compute/disable_user.rb +25 -0
  191. data/lib/fog/cosmic/requests/compute/disassociate_ip_address.rb +35 -0
  192. data/lib/fog/cosmic/requests/compute/enable_account.rb +24 -0
  193. data/lib/fog/cosmic/requests/compute/enable_static_nat.rb +69 -0
  194. data/lib/fog/cosmic/requests/compute/enable_storage_maintenance.rb +25 -0
  195. data/lib/fog/cosmic/requests/compute/enable_user.rb +25 -0
  196. data/lib/fog/cosmic/requests/compute/expunge_virtual_machine.rb +25 -0
  197. data/lib/fog/cosmic/requests/compute/extract_iso.rb +26 -0
  198. data/lib/fog/cosmic/requests/compute/extract_template.rb +65 -0
  199. data/lib/fog/cosmic/requests/compute/extract_volume.rb +27 -0
  200. data/lib/fog/cosmic/requests/compute/find_hosts_for_migration.rb +25 -0
  201. data/lib/fog/cosmic/requests/compute/find_storage_pools_for_migration.rb +25 -0
  202. data/lib/fog/cosmic/requests/compute/generate_alert.rb +27 -0
  203. data/lib/fog/cosmic/requests/compute/get_api_limit.rb +24 -0
  204. data/lib/fog/cosmic/requests/compute/get_cloud_identifier.rb +25 -0
  205. data/lib/fog/cosmic/requests/compute/get_user.rb +25 -0
  206. data/lib/fog/cosmic/requests/compute/get_virtual_machine_user_data.rb +25 -0
  207. data/lib/fog/cosmic/requests/compute/get_vm_password.rb +25 -0
  208. data/lib/fog/cosmic/requests/compute/import_ldap_users.rb +25 -0
  209. data/lib/fog/cosmic/requests/compute/ldap_create_account.rb +26 -0
  210. data/lib/fog/cosmic/requests/compute/list_accounts.rb +24 -0
  211. data/lib/fog/cosmic/requests/compute/list_affinity_group_types.rb +24 -0
  212. data/lib/fog/cosmic/requests/compute/list_affinity_groups.rb +24 -0
  213. data/lib/fog/cosmic/requests/compute/list_alerts.rb +24 -0
  214. data/lib/fog/cosmic/requests/compute/list_apis.rb +24 -0
  215. data/lib/fog/cosmic/requests/compute/list_async_jobs.rb +36 -0
  216. data/lib/fog/cosmic/requests/compute/list_capabilities.rb +24 -0
  217. data/lib/fog/cosmic/requests/compute/list_capacity.rb +24 -0
  218. data/lib/fog/cosmic/requests/compute/list_clusters.rb +24 -0
  219. data/lib/fog/cosmic/requests/compute/list_configurations.rb +24 -0
  220. data/lib/fog/cosmic/requests/compute/list_dedicated_clusters.rb +24 -0
  221. data/lib/fog/cosmic/requests/compute/list_dedicated_guest_vlan_ranges.rb +24 -0
  222. data/lib/fog/cosmic/requests/compute/list_dedicated_hosts.rb +24 -0
  223. data/lib/fog/cosmic/requests/compute/list_dedicated_pods.rb +24 -0
  224. data/lib/fog/cosmic/requests/compute/list_dedicated_zones.rb +24 -0
  225. data/lib/fog/cosmic/requests/compute/list_deployment_planners.rb +24 -0
  226. data/lib/fog/cosmic/requests/compute/list_disk_offerings.rb +32 -0
  227. data/lib/fog/cosmic/requests/compute/list_domain_children.rb +24 -0
  228. data/lib/fog/cosmic/requests/compute/list_domains.rb +24 -0
  229. data/lib/fog/cosmic/requests/compute/list_egress_firewall_rules.rb +35 -0
  230. data/lib/fog/cosmic/requests/compute/list_event_types.rb +24 -0
  231. data/lib/fog/cosmic/requests/compute/list_events.rb +24 -0
  232. data/lib/fog/cosmic/requests/compute/list_firewall_rules.rb +35 -0
  233. data/lib/fog/cosmic/requests/compute/list_guest_os_mapping.rb +24 -0
  234. data/lib/fog/cosmic/requests/compute/list_hosts.rb +24 -0
  235. data/lib/fog/cosmic/requests/compute/list_hypervisor_capabilities.rb +24 -0
  236. data/lib/fog/cosmic/requests/compute/list_hypervisors.rb +24 -0
  237. data/lib/fog/cosmic/requests/compute/list_image_stores.rb +24 -0
  238. data/lib/fog/cosmic/requests/compute/list_instance_groups.rb +24 -0
  239. data/lib/fog/cosmic/requests/compute/list_ip_forwarding_rules.rb +24 -0
  240. data/lib/fog/cosmic/requests/compute/list_iso_permissions.rb +25 -0
  241. data/lib/fog/cosmic/requests/compute/list_isos.rb +24 -0
  242. data/lib/fog/cosmic/requests/compute/list_lb_health_check_policies.rb +24 -0
  243. data/lib/fog/cosmic/requests/compute/list_lb_stickiness_policies.rb +24 -0
  244. data/lib/fog/cosmic/requests/compute/list_ldap_configurations.rb +24 -0
  245. data/lib/fog/cosmic/requests/compute/list_ldap_users.rb +24 -0
  246. data/lib/fog/cosmic/requests/compute/list_load_balancer_rule_instances.rb +25 -0
  247. data/lib/fog/cosmic/requests/compute/list_load_balancer_rules.rb +24 -0
  248. data/lib/fog/cosmic/requests/compute/list_network_acl_lists.rb +24 -0
  249. data/lib/fog/cosmic/requests/compute/list_network_acls.rb +24 -0
  250. data/lib/fog/cosmic/requests/compute/list_network_device.rb +24 -0
  251. data/lib/fog/cosmic/requests/compute/list_network_isolation_methods.rb +24 -0
  252. data/lib/fog/cosmic/requests/compute/list_network_offerings.rb +31 -0
  253. data/lib/fog/cosmic/requests/compute/list_network_service_providers.rb +24 -0
  254. data/lib/fog/cosmic/requests/compute/list_networks.rb +28 -0
  255. data/lib/fog/cosmic/requests/compute/list_nicira_nvp_device_networks.rb +25 -0
  256. data/lib/fog/cosmic/requests/compute/list_nicira_nvp_devices.rb +24 -0
  257. data/lib/fog/cosmic/requests/compute/list_nics.rb +25 -0
  258. data/lib/fog/cosmic/requests/compute/list_os_categories.rb +24 -0
  259. data/lib/fog/cosmic/requests/compute/list_os_types.rb +32 -0
  260. data/lib/fog/cosmic/requests/compute/list_physical_networks.rb +24 -0
  261. data/lib/fog/cosmic/requests/compute/list_pods.rb +24 -0
  262. data/lib/fog/cosmic/requests/compute/list_port_forwarding_rules.rb +40 -0
  263. data/lib/fog/cosmic/requests/compute/list_private_gateways.rb +24 -0
  264. data/lib/fog/cosmic/requests/compute/list_project_accounts.rb +25 -0
  265. data/lib/fog/cosmic/requests/compute/list_project_invitations.rb +24 -0
  266. data/lib/fog/cosmic/requests/compute/list_projects.rb +24 -0
  267. data/lib/fog/cosmic/requests/compute/list_public_ip_addresses.rb +45 -0
  268. data/lib/fog/cosmic/requests/compute/list_regions.rb +24 -0
  269. data/lib/fog/cosmic/requests/compute/list_remote_access_vpns.rb +24 -0
  270. data/lib/fog/cosmic/requests/compute/list_resource_details.rb +25 -0
  271. data/lib/fog/cosmic/requests/compute/list_resource_limits.rb +24 -0
  272. data/lib/fog/cosmic/requests/compute/list_routers.rb +24 -0
  273. data/lib/fog/cosmic/requests/compute/list_secondary_staging_stores.rb +24 -0
  274. data/lib/fog/cosmic/requests/compute/list_service_offerings.rb +44 -0
  275. data/lib/fog/cosmic/requests/compute/list_snapshots.rb +43 -0
  276. data/lib/fog/cosmic/requests/compute/list_ssh_key_pairs.rb +26 -0
  277. data/lib/fog/cosmic/requests/compute/list_ssl_certs.rb +24 -0
  278. data/lib/fog/cosmic/requests/compute/list_static_routes.rb +24 -0
  279. data/lib/fog/cosmic/requests/compute/list_storage_network_ip_range.rb +24 -0
  280. data/lib/fog/cosmic/requests/compute/list_storage_pools.rb +24 -0
  281. data/lib/fog/cosmic/requests/compute/list_storage_providers.rb +25 -0
  282. data/lib/fog/cosmic/requests/compute/list_supported_network_services.rb +24 -0
  283. data/lib/fog/cosmic/requests/compute/list_system_vms.rb +24 -0
  284. data/lib/fog/cosmic/requests/compute/list_tags.rb +24 -0
  285. data/lib/fog/cosmic/requests/compute/list_template_permissions.rb +25 -0
  286. data/lib/fog/cosmic/requests/compute/list_templates.rb +42 -0
  287. data/lib/fog/cosmic/requests/compute/list_traffic_types.rb +25 -0
  288. data/lib/fog/cosmic/requests/compute/list_users.rb +24 -0
  289. data/lib/fog/cosmic/requests/compute/list_virtual_machines.rb +32 -0
  290. data/lib/fog/cosmic/requests/compute/list_virtual_router_elements.rb +24 -0
  291. data/lib/fog/cosmic/requests/compute/list_vlan_ip_ranges.rb +24 -0
  292. data/lib/fog/cosmic/requests/compute/list_vm_snapshot.rb +26 -0
  293. data/lib/fog/cosmic/requests/compute/list_volumes.rb +43 -0
  294. data/lib/fog/cosmic/requests/compute/list_vpc_offerings.rb +24 -0
  295. data/lib/fog/cosmic/requests/compute/list_vpcs.rb +24 -0
  296. data/lib/fog/cosmic/requests/compute/list_vpn_connections.rb +24 -0
  297. data/lib/fog/cosmic/requests/compute/list_vpn_customer_gateways.rb +24 -0
  298. data/lib/fog/cosmic/requests/compute/list_vpn_gateways.rb +24 -0
  299. data/lib/fog/cosmic/requests/compute/list_vpn_users.rb +24 -0
  300. data/lib/fog/cosmic/requests/compute/list_zones.rb +37 -0
  301. data/lib/fog/cosmic/requests/compute/lock_account.rb +26 -0
  302. data/lib/fog/cosmic/requests/compute/lock_user.rb +25 -0
  303. data/lib/fog/cosmic/requests/compute/mark_default_zone_for_account.rb +27 -0
  304. data/lib/fog/cosmic/requests/compute/migrate_system_vm.rb +26 -0
  305. data/lib/fog/cosmic/requests/compute/migrate_virtual_machine.rb +25 -0
  306. data/lib/fog/cosmic/requests/compute/migrate_virtual_machine_with_volume.rb +26 -0
  307. data/lib/fog/cosmic/requests/compute/migrate_volume.rb +26 -0
  308. data/lib/fog/cosmic/requests/compute/prepare_host_for_maintenance.rb +25 -0
  309. data/lib/fog/cosmic/requests/compute/prepare_template.rb +26 -0
  310. data/lib/fog/cosmic/requests/compute/query_async_job_result.rb +38 -0
  311. data/lib/fog/cosmic/requests/compute/reboot_router.rb +25 -0
  312. data/lib/fog/cosmic/requests/compute/reboot_system_vm.rb +25 -0
  313. data/lib/fog/cosmic/requests/compute/reboot_virtual_machine.rb +35 -0
  314. data/lib/fog/cosmic/requests/compute/reconnect_host.rb +25 -0
  315. data/lib/fog/cosmic/requests/compute/recover_virtual_machine.rb +25 -0
  316. data/lib/fog/cosmic/requests/compute/register_iso.rb +28 -0
  317. data/lib/fog/cosmic/requests/compute/register_ssh_key_pair.rb +28 -0
  318. data/lib/fog/cosmic/requests/compute/register_template.rb +45 -0
  319. data/lib/fog/cosmic/requests/compute/register_user_keys.rb +25 -0
  320. data/lib/fog/cosmic/requests/compute/release_dedicated_cluster.rb +25 -0
  321. data/lib/fog/cosmic/requests/compute/release_dedicated_guest_vlan_range.rb +25 -0
  322. data/lib/fog/cosmic/requests/compute/release_dedicated_host.rb +25 -0
  323. data/lib/fog/cosmic/requests/compute/release_dedicated_pod.rb +25 -0
  324. data/lib/fog/cosmic/requests/compute/release_dedicated_zone.rb +25 -0
  325. data/lib/fog/cosmic/requests/compute/release_host_reservation.rb +25 -0
  326. data/lib/fog/cosmic/requests/compute/release_public_ip_range.rb +25 -0
  327. data/lib/fog/cosmic/requests/compute/remove_cert_from_load_balancer.rb +25 -0
  328. data/lib/fog/cosmic/requests/compute/remove_from_load_balancer_rule.rb +25 -0
  329. data/lib/fog/cosmic/requests/compute/remove_guest_os.rb +25 -0
  330. data/lib/fog/cosmic/requests/compute/remove_guest_os_mapping.rb +25 -0
  331. data/lib/fog/cosmic/requests/compute/remove_ip_from_nic.rb +25 -0
  332. data/lib/fog/cosmic/requests/compute/remove_nic_from_virtual_machine.rb +26 -0
  333. data/lib/fog/cosmic/requests/compute/remove_region.rb +25 -0
  334. data/lib/fog/cosmic/requests/compute/remove_resource_detail.rb +26 -0
  335. data/lib/fog/cosmic/requests/compute/remove_vpn_user.rb +25 -0
  336. data/lib/fog/cosmic/requests/compute/replace_network_acl_list.rb +25 -0
  337. data/lib/fog/cosmic/requests/compute/reset_api_limit.rb +24 -0
  338. data/lib/fog/cosmic/requests/compute/reset_password_for_virtual_machine.rb +25 -0
  339. data/lib/fog/cosmic/requests/compute/reset_ssh_key_for_virtual_machine.rb +28 -0
  340. data/lib/fog/cosmic/requests/compute/reset_vpn_connection.rb +25 -0
  341. data/lib/fog/cosmic/requests/compute/resize_volume.rb +25 -0
  342. data/lib/fog/cosmic/requests/compute/restart_network.rb +25 -0
  343. data/lib/fog/cosmic/requests/compute/restart_vpc.rb +25 -0
  344. data/lib/fog/cosmic/requests/compute/restore_virtual_machine.rb +25 -0
  345. data/lib/fog/cosmic/requests/compute/revert_snapshot.rb +25 -0
  346. data/lib/fog/cosmic/requests/compute/revert_to_vm_snapshot.rb +25 -0
  347. data/lib/fog/cosmic/requests/compute/scale_system_vm.rb +26 -0
  348. data/lib/fog/cosmic/requests/compute/scale_virtual_machine.rb +26 -0
  349. data/lib/fog/cosmic/requests/compute/start_router.rb +25 -0
  350. data/lib/fog/cosmic/requests/compute/start_system_vm.rb +25 -0
  351. data/lib/fog/cosmic/requests/compute/start_virtual_machine.rb +25 -0
  352. data/lib/fog/cosmic/requests/compute/stop_router.rb +25 -0
  353. data/lib/fog/cosmic/requests/compute/stop_system_vm.rb +25 -0
  354. data/lib/fog/cosmic/requests/compute/stop_virtual_machine.rb +25 -0
  355. data/lib/fog/cosmic/requests/compute/suspend_project.rb +25 -0
  356. data/lib/fog/cosmic/requests/compute/update_account.rb +25 -0
  357. data/lib/fog/cosmic/requests/compute/update_cluster.rb +25 -0
  358. data/lib/fog/cosmic/requests/compute/update_configuration.rb +25 -0
  359. data/lib/fog/cosmic/requests/compute/update_default_nic_for_virtual_machine.rb +26 -0
  360. data/lib/fog/cosmic/requests/compute/update_disk_offering.rb +25 -0
  361. data/lib/fog/cosmic/requests/compute/update_domain.rb +25 -0
  362. data/lib/fog/cosmic/requests/compute/update_egress_firewall_rule.rb +25 -0
  363. data/lib/fog/cosmic/requests/compute/update_firewall_rule.rb +25 -0
  364. data/lib/fog/cosmic/requests/compute/update_guest_os.rb +26 -0
  365. data/lib/fog/cosmic/requests/compute/update_guest_os_mapping.rb +26 -0
  366. data/lib/fog/cosmic/requests/compute/update_host.rb +25 -0
  367. data/lib/fog/cosmic/requests/compute/update_host_password.rb +26 -0
  368. data/lib/fog/cosmic/requests/compute/update_hypervisor_capabilities.rb +24 -0
  369. data/lib/fog/cosmic/requests/compute/update_instance_group.rb +25 -0
  370. data/lib/fog/cosmic/requests/compute/update_ip_address.rb +25 -0
  371. data/lib/fog/cosmic/requests/compute/update_iso.rb +25 -0
  372. data/lib/fog/cosmic/requests/compute/update_iso_permissions.rb +25 -0
  373. data/lib/fog/cosmic/requests/compute/update_lb_health_check_policy.rb +25 -0
  374. data/lib/fog/cosmic/requests/compute/update_lb_stickiness_policy.rb +25 -0
  375. data/lib/fog/cosmic/requests/compute/update_load_balancer_rule.rb +25 -0
  376. data/lib/fog/cosmic/requests/compute/update_network.rb +25 -0
  377. data/lib/fog/cosmic/requests/compute/update_network_acl_item.rb +25 -0
  378. data/lib/fog/cosmic/requests/compute/update_network_acl_list.rb +25 -0
  379. data/lib/fog/cosmic/requests/compute/update_network_offering.rb +24 -0
  380. data/lib/fog/cosmic/requests/compute/update_network_service_provider.rb +25 -0
  381. data/lib/fog/cosmic/requests/compute/update_physical_network.rb +25 -0
  382. data/lib/fog/cosmic/requests/compute/update_pod.rb +25 -0
  383. data/lib/fog/cosmic/requests/compute/update_port_forwarding_rule.rb +25 -0
  384. data/lib/fog/cosmic/requests/compute/update_project.rb +25 -0
  385. data/lib/fog/cosmic/requests/compute/update_project_invitation.rb +25 -0
  386. data/lib/fog/cosmic/requests/compute/update_region.rb +25 -0
  387. data/lib/fog/cosmic/requests/compute/update_remote_access_vpn.rb +25 -0
  388. data/lib/fog/cosmic/requests/compute/update_resource_count.rb +25 -0
  389. data/lib/fog/cosmic/requests/compute/update_resource_limit.rb +25 -0
  390. data/lib/fog/cosmic/requests/compute/update_service_offering.rb +25 -0
  391. data/lib/fog/cosmic/requests/compute/update_storage_network_ip_range.rb +25 -0
  392. data/lib/fog/cosmic/requests/compute/update_storage_pool.rb +25 -0
  393. data/lib/fog/cosmic/requests/compute/update_template.rb +25 -0
  394. data/lib/fog/cosmic/requests/compute/update_template_permissions.rb +25 -0
  395. data/lib/fog/cosmic/requests/compute/update_user.rb +25 -0
  396. data/lib/fog/cosmic/requests/compute/update_virtual_machine.rb +25 -0
  397. data/lib/fog/cosmic/requests/compute/update_vm_affinity_group.rb +25 -0
  398. data/lib/fog/cosmic/requests/compute/update_volume.rb +24 -0
  399. data/lib/fog/cosmic/requests/compute/update_vpc.rb +25 -0
  400. data/lib/fog/cosmic/requests/compute/update_vpcoffering.rb +25 -0
  401. data/lib/fog/cosmic/requests/compute/update_vpn_connection.rb +25 -0
  402. data/lib/fog/cosmic/requests/compute/update_vpn_customer_gateway.rb +30 -0
  403. data/lib/fog/cosmic/requests/compute/update_vpn_gateway.rb +25 -0
  404. data/lib/fog/cosmic/requests/compute/update_zone.rb +25 -0
  405. data/lib/fog/cosmic/requests/compute/upgrade_router_template.rb +24 -0
  406. data/lib/fog/cosmic/requests/compute/upload_custom_certificate.rb +26 -0
  407. data/lib/fog/cosmic/requests/compute/upload_ssl_cert.rb +26 -0
  408. data/lib/fog/cosmic/requests/compute/upload_volume.rb +30 -0
  409. data/lib/fog/cosmic/version.rb +5 -0
  410. data/tests/compute/models/disk_offering_tests.rb +7 -0
  411. data/tests/compute/models/egress_firewall_rule_tests.rb +9 -0
  412. data/tests/compute/models/public_ip_address_tests.rb +42 -0
  413. data/tests/compute/models/public_ip_addresses_tests.rb +3 -0
  414. data/tests/compute/models/server_tests.rb +20 -0
  415. data/tests/compute/models/snapshot_tests.rb +17 -0
  416. data/tests/compute/models/volume_tests.rb +46 -0
  417. data/tests/compute/models/volumes_tests.rb +14 -0
  418. data/tests/helper.rb +5 -0
  419. data/tests/helpers/collection_helper.rb +91 -0
  420. data/tests/helpers/formats_helper.rb +98 -0
  421. data/tests/helpers/mock_helper.rb +20 -0
  422. data/tests/helpers/model_helper.rb +31 -0
  423. data/tests/helpers/responds_to_helper.rb +11 -0
  424. data/tests/helpers/succeeds_helper.rb +9 -0
  425. data/tests/requests/disk_offering_tests.rb +29 -0
  426. data/tests/requests/egress_firewall_rule_tests.rb +25 -0
  427. data/tests/requests/firewall_rule_tests.rb +29 -0
  428. data/tests/requests/network_offering_tests.rb +32 -0
  429. data/tests/requests/os_type_tests.rb +37 -0
  430. data/tests/requests/port_forwarding_rule_tests.rb +33 -0
  431. data/tests/requests/public_ip_address_tests.rb +38 -0
  432. data/tests/requests/service_offering_tests.rb +31 -0
  433. data/tests/requests/snapshot_tests.rb +32 -0
  434. data/tests/requests/ssh_key_pair_tests.rb +23 -0
  435. data/tests/requests/template_tests.rb +52 -0
  436. data/tests/requests/virtual_machine_tests.rb +66 -0
  437. data/tests/requests/volume_tests.rb +47 -0
  438. data/tests/requests/zone_tests.rb +32 -0
  439. data/tests/signed_params_tests.rb +12 -0
  440. metadata +583 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 41b5619b6492fd4d7ce738f939a367c03a49be653f6df2daabdf28387cdccf6a
4
+ data.tar.gz: a06ca33c2e27d733a39e4a54bee0d215dbdbeebae37c3ceeddf3b7e198ea092b
5
+ SHA512:
6
+ metadata.gz: ec769ac9a3b9b6265cc9e21c84bad761db9399d5bb13d0d8690473715e9a3529ffbc172994cf3b62c66996e0363eed3191b908d1f662e328f1cb17111a461494
7
+ data.tar.gz: 76657e35a5746851f1b9b46eebfe9ed1c56420b09edaeb66adafdc1b5a55eeb34c6567a9719375ad14ad08c24e2a8e7dd05f626fcc5188865a2030f0a77106f1
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: CI
3
+
4
+ on:
5
+ pull_request:
6
+
7
+ jobs:
8
+ rake:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout
12
+ uses: actions/checkout@v2
13
+ - name: Set up Ruby 2.6
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ ruby-version: '2.6.x'
17
+ - name: Setup cache
18
+ uses: actions/cache@v1
19
+ with:
20
+ path: vendor/bundle
21
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
22
+ restore-keys: |
23
+ ${{ runner.os }}-gems-
24
+ - name: Unit test
25
+ run: |
26
+ gem install bundler
27
+ bundle config path vendor/bundle
28
+ bundle install --jobs 4 --retry 3
29
+ bundle exec rake
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /pkg/
5
+ /spec/reports/
6
+ /spec/examples.txt
7
+ /tests/.fog
8
+ .fog
9
+ /.yardoc/
10
+ /_yardoc/
11
+ /doc/
12
+ /rdoc/
13
+ /.bundle/
14
+ /vendor/bundle
15
+ /lib/bundler/man/
16
+ .ruby-version
17
+ .ruby-gemset
18
+ .rvmrc
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.5
7
+ before_install: gem update bundler
@@ -0,0 +1,8 @@
1
+ # Fog::Cosmic
2
+
3
+ This file is used to list changes made in each version of the `fog-cosmic` gem.
4
+
5
+ ## 0.1.0 (2020-02-25)
6
+
7
+ - Forked gem from [fog/fog-cloudstack](https://github.com/fog/fog-cloudstack) and renamed to Fog::Cosmic
8
+ - Removed functionality no longer supported by the [Cosmic API](http://apidoc.mcc.schubergphilis.com)
@@ -0,0 +1,2 @@
1
+ * cloud.ca <infra@cloud.ca>
2
+ * Wesley Beary <geemus@gmail.com>
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in fog-cosmic.gemspec
4
+ gemspec
@@ -0,0 +1,49 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fog-cosmic (0.1.0)
5
+ fog-core (~> 2.1)
6
+ fog-json (~> 1.1)
7
+ fog-xml (~> 0.1)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ builder (3.2.4)
13
+ excon (0.72.0)
14
+ fog-core (2.2.0)
15
+ builder
16
+ excon (~> 0.71)
17
+ formatador (~> 0.2)
18
+ mime-types
19
+ fog-json (1.2.0)
20
+ fog-core
21
+ multi_json (~> 1.10)
22
+ fog-xml (0.1.3)
23
+ fog-core
24
+ nokogiri (>= 1.5.11, < 2.0.0)
25
+ formatador (0.2.5)
26
+ mime-types (3.3.1)
27
+ mime-types-data (~> 3.2015)
28
+ mime-types-data (3.2019.1009)
29
+ mini_portile2 (2.4.0)
30
+ multi_json (1.14.1)
31
+ nokogiri (1.10.8)
32
+ mini_portile2 (~> 2.4.0)
33
+ rake (10.5.0)
34
+ rubyzip (1.3.0)
35
+ shindo (0.3.8)
36
+ formatador (>= 0.1.1)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ bundler (~> 2.0)
43
+ fog-cosmic!
44
+ rake (~> 10.0)
45
+ rubyzip (~> 1.3.0)
46
+ shindo (~> 0.3)
47
+
48
+ BUNDLED WITH
49
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 [CONTRIBUTORS.md](https://github.com/fog/fog-cloudstack/blob/master/CONTRIBUTORS.md)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ # Fog::Cosmic
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'fog-cosmic'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ ```shell
14
+ bundle
15
+ ```
16
+
17
+ Or install it yourself as:
18
+
19
+
20
+ ```shell
21
+ gem install fog-cosmic
22
+ ```
23
+
24
+ ## Development
25
+
26
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
27
+
28
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
29
+
30
+ ## Contributing
31
+
32
+ 1. Fork it (<http://github.com/MissionCriticalCloud/fog-cosmic/fork>)
33
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
34
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
35
+ 4. Push to the branch (`git push origin my-new-feature`)
36
+ 5. Create new Pull Request
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
+
42
+ ## Original work
43
+
44
+ This gem is a fork of [fog/fog-cloudstack](https://github.com/fog/fog-cloudstack) and wouldn't exist without it. It has been modified to remove API methods no longer supported by Cosmic and adds Cosmic API methods not supported by CloudStack.
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ task :default => :test
4
+
5
+ mock = ENV['FOG_MOCK'] || 'true'
6
+ task :test do
7
+ Bundler.with_unbundled_env do
8
+ sh("export FOG_MOCK=#{mock} && bundle exec shindont")
9
+ end
10
+ end
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fog/cosmic/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'fog-cosmic'
8
+ spec.version = Fog::Cosmic::VERSION
9
+ spec.authors = ['cloud.ca', 'geemus (Wesley Beary)', 'Stephen Hoekstra']
10
+ spec.email = ['infra@cloud.ca', 'geemus@gmail.com', 'shoekstra@schubergphilis.com']
11
+
12
+ spec.summary = %q{Module for the 'fog' gem to support Cosmic}
13
+ spec.description = %q{Module for the 'fog' gem to support Cosmic}
14
+ spec.homepage = 'https://github.com/MissionCriticalCloud/fog-cosmic'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.required_ruby_version = '>=2.0.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 2.0'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rubyzip', '~> 1.3.0'
27
+ spec.add_development_dependency 'shindo', '~> 0.3'
28
+
29
+ spec.add_dependency 'fog-core', '~> 2.1'
30
+ spec.add_dependency 'fog-json', '~> 1.1'
31
+ spec.add_dependency 'fog-xml', '~> 0.1'
32
+ end
@@ -0,0 +1,45 @@
1
+ require 'fog/core'
2
+ require 'fog/json'
3
+ require 'fog/xml'
4
+ require 'uri'
5
+
6
+ module Fog
7
+ module Cosmic
8
+ autoload :Compute, File.expand_path('../cosmic/compute', __FILE__)
9
+
10
+ extend Fog::Provider
11
+
12
+ service(:compute, 'Compute')
13
+
14
+ @@digest = OpenSSL::Digest.new('sha1')
15
+
16
+ def self.escape(string)
17
+ string = CGI::escape(string)
18
+ string = string.gsub("+","%20")
19
+ string = string.gsub("~","%7E")
20
+ # Escaped asterisk will cause malformed request
21
+ string = string.gsub("%2A","*")
22
+ string
23
+ end
24
+
25
+ def self.signed_params(key,params)
26
+ query = params.map{|k,v| [k.to_s, v]}.sort.map{|c| "#{c[0]}=#{escape(c[1].to_s)}"}.join('&').downcase
27
+
28
+ signed_string = Base64.encode64(OpenSSL::HMAC.digest(@@digest,key,query)).strip
29
+
30
+ signed_string
31
+ end
32
+
33
+ def self.uuid
34
+ [8,4,4,4,12].map{|i| Fog::Mock.random_hex(i)}.join("-")
35
+ end
36
+
37
+ def self.ip_address
38
+ 4.times.map{ Fog::Mock.random_numbers(3) }.join(".")
39
+ end
40
+
41
+ def self.mac_address
42
+ 6.times.map{ Fog::Mock.random_numbers(2) }.join(":")
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,861 @@
1
+ require 'digest/md5'
2
+
3
+ module Fog
4
+ module Cosmic
5
+ class Compute < Fog::Service
6
+
7
+ class BadRequest < Fog::Cosmic::Compute::Error; end
8
+ class Unauthorized < Fog::Cosmic::Compute::Error; end
9
+
10
+ requires :cosmic_host
11
+
12
+ recognizes :cosmic_api_key, :cosmic_secret_access_key, :cosmic_session_key, :cosmic_session_id,
13
+ :cosmic_port, :cosmic_path, :cosmic_scheme, :cosmic_persistent, :cosmic_project_id
14
+
15
+ model_path 'fog/cosmic/models/compute'
16
+ request_path 'fog/cosmic/requests/compute'
17
+
18
+ model :address
19
+ model :disk_offering
20
+ collection :disk_offerings
21
+ model :egress_firewall_rule
22
+ collection :egress_firewall_rules
23
+ model :firewall_rule
24
+ collection :firewall_rules
25
+ model :flavor
26
+ collection :flavors
27
+ model :image
28
+ collection :images
29
+ model :job
30
+ collection :jobs
31
+ model :network
32
+ collection :networks
33
+ model :network_offering
34
+ collection :network_offerings
35
+ model :public_ip_address
36
+ collection :public_ip_addresses
37
+ model :port_forwarding_rule
38
+ collection :port_forwarding_rules
39
+ model :project
40
+ collection :projects
41
+ model :server
42
+ collection :servers
43
+ model :volume
44
+ collection :volumes
45
+ model :snapshot
46
+ collection :snapshots
47
+ model :zone
48
+ collection :zones
49
+
50
+ request :activate_project
51
+ request :add_account_to_project
52
+ request :add_cluster
53
+ request :add_guest_os
54
+ request :add_guest_os_mapping
55
+ request :add_host
56
+ request :add_image_store
57
+ request :add_ip_to_nic
58
+ request :add_network_device
59
+ request :add_network_service_provider
60
+ request :add_nic_to_virtual_machine
61
+ request :add_nicira_nvp_device
62
+ request :add_region
63
+ request :add_resource_detail
64
+ request :add_secondary_storage
65
+ request :add_traffic_type
66
+ request :add_vpn_user
67
+ request :archive_alerts
68
+ request :archive_events
69
+ request :assign_cert_to_load_balancer
70
+ request :assign_to_load_balancer_rule
71
+ request :assign_virtual_machine
72
+ request :associate_ip_address
73
+ request :attach_iso
74
+ request :attach_volume
75
+ request :cancel_host_maintenance
76
+ request :cancel_storage_maintenance
77
+ request :change_service_for_router
78
+ request :change_service_for_system_vm
79
+ request :change_service_for_virtual_machine
80
+ request :clean_vmreservations
81
+ request :configure_virtual_router_element
82
+ request :copy_iso
83
+ request :copy_template
84
+ request :create_account
85
+ request :create_affinity_group
86
+ request :create_disk_offering
87
+ request :create_domain
88
+ request :create_egress_firewall_rule
89
+ request :create_firewall_rule
90
+ request :create_instance_group
91
+ request :create_ip_forwarding_rule
92
+ request :create_lb_health_check_policy
93
+ request :create_lb_stickiness_policy
94
+ request :create_network
95
+ request :create_network_acl
96
+ request :create_network_acl_list
97
+ request :create_network_offering
98
+ request :create_physical_network
99
+ request :create_pod
100
+ request :create_port_forwarding_rule
101
+ request :create_private_gateway
102
+ request :create_project
103
+ request :create_remote_access_vpn
104
+ request :create_secondary_staging_store
105
+ request :create_service_offering
106
+ request :create_snapshot
107
+ request :create_ssh_key_pair
108
+ request :create_static_route
109
+ request :create_storage_network_ip_range
110
+ request :create_storage_pool
111
+ request :create_tags
112
+ request :create_template
113
+ request :create_user
114
+ request :create_virtual_router_element
115
+ request :create_vlan_ip_range
116
+ request :create_vm_snapshot
117
+ request :create_volume
118
+ request :create_vpc
119
+ request :create_vpcoffering
120
+ request :create_vpn_connection
121
+ request :create_vpn_customer_gateway
122
+ request :create_vpn_gateway
123
+ request :create_zone
124
+ request :dedicate_cluster
125
+ request :dedicate_guest_vlan_range
126
+ request :dedicate_host
127
+ request :dedicate_pod
128
+ request :dedicate_public_ip_range
129
+ request :dedicate_zone
130
+ request :delete_account
131
+ request :delete_account_from_project
132
+ request :delete_affinity_group
133
+ request :delete_alerts
134
+ request :delete_cluster
135
+ request :delete_disk_offering
136
+ request :delete_domain
137
+ request :delete_egress_firewall_rule
138
+ request :delete_events
139
+ request :delete_firewall_rule
140
+ request :delete_host
141
+ request :delete_image_store
142
+ request :delete_instance_group
143
+ request :delete_ip_forwarding_rule
144
+ request :delete_iso
145
+ request :delete_lb_health_check_policy
146
+ request :delete_lb_stickiness_policy
147
+ request :delete_network
148
+ request :delete_network_acl
149
+ request :delete_network_acl_list
150
+ request :delete_network_device
151
+ request :delete_network_offering
152
+ request :delete_network_service_provider
153
+ request :delete_nicira_nvp_device
154
+ request :delete_physical_network
155
+ request :delete_pod
156
+ request :delete_port_forwarding_rule
157
+ request :delete_private_gateway
158
+ request :delete_project
159
+ request :delete_project_invitation
160
+ request :delete_remote_access_vpn
161
+ request :delete_secondary_staging_store
162
+ request :delete_service_offering
163
+ request :delete_snapshot
164
+ request :delete_ssh_key_pair
165
+ request :delete_ssl_cert
166
+ request :delete_static_route
167
+ request :delete_storage_network_ip_range
168
+ request :delete_storage_pool
169
+ request :delete_tags
170
+ request :delete_template
171
+ request :delete_traffic_type
172
+ request :delete_user
173
+ request :delete_vlan_ip_range
174
+ request :delete_vm_snapshot
175
+ request :delete_volume
176
+ request :delete_vpc
177
+ request :delete_vpcoffering
178
+ request :delete_vpn_connection
179
+ request :delete_vpn_customer_gateway
180
+ request :delete_vpn_gateway
181
+ request :delete_zone
182
+ request :deploy_virtual_machine
183
+ request :destroy_router
184
+ request :destroy_system_vm
185
+ request :destroy_virtual_machine
186
+ request :detach_iso
187
+ request :detach_volume
188
+ request :disable_account
189
+ request :disable_static_nat
190
+ request :disable_user
191
+ request :disassociate_ip_address
192
+ request :enable_account
193
+ request :enable_static_nat
194
+ request :enable_storage_maintenance
195
+ request :enable_user
196
+ request :expunge_virtual_machine
197
+ request :extract_iso
198
+ request :extract_template
199
+ request :extract_volume
200
+ request :find_hosts_for_migration
201
+ request :find_storage_pools_for_migration
202
+ request :generate_alert
203
+ request :get_api_limit
204
+ request :get_cloud_identifier
205
+ request :get_user
206
+ request :get_virtual_machine_user_data
207
+ request :get_vm_password
208
+ request :import_ldap_users
209
+ request :ldap_create_account
210
+ request :list_accounts
211
+ request :list_affinity_group_types
212
+ request :list_affinity_groups
213
+ request :list_alerts
214
+ request :list_apis
215
+ request :list_async_jobs
216
+ request :list_capabilities
217
+ request :list_capacity
218
+ request :list_clusters
219
+ request :list_configurations
220
+ request :list_dedicated_clusters
221
+ request :list_dedicated_guest_vlan_ranges
222
+ request :list_dedicated_hosts
223
+ request :list_dedicated_pods
224
+ request :list_dedicated_zones
225
+ request :list_deployment_planners
226
+ request :list_disk_offerings
227
+ request :list_domain_children
228
+ request :list_domains
229
+ request :list_egress_firewall_rules
230
+ request :list_event_types
231
+ request :list_events
232
+ request :list_firewall_rules
233
+ request :list_guest_os_mapping
234
+ request :list_hosts
235
+ request :list_hypervisor_capabilities
236
+ request :list_hypervisors
237
+ request :list_image_stores
238
+ request :list_instance_groups
239
+ request :list_ip_forwarding_rules
240
+ request :list_iso_permissions
241
+ request :list_isos
242
+ request :list_lb_health_check_policies
243
+ request :list_lb_stickiness_policies
244
+ request :list_ldap_users
245
+ request :list_load_balancer_rule_instances
246
+ request :list_load_balancer_rules
247
+ request :list_network_acl_lists
248
+ request :list_network_acls
249
+ request :list_network_device
250
+ request :list_network_isolation_methods
251
+ request :list_network_offerings
252
+ request :list_network_service_providers
253
+ request :list_networks
254
+ request :list_nicira_nvp_device_networks
255
+ request :list_nicira_nvp_devices
256
+ request :list_nics
257
+ request :list_os_categories
258
+ request :list_os_types
259
+ request :list_physical_networks
260
+ request :list_pods
261
+ request :list_port_forwarding_rules
262
+ request :list_private_gateways
263
+ request :list_project_accounts
264
+ request :list_project_invitations
265
+ request :list_projects
266
+ request :list_public_ip_addresses
267
+ request :list_regions
268
+ request :list_remote_access_vpns
269
+ request :list_resource_details
270
+ request :list_resource_limits
271
+ request :list_routers
272
+ request :list_secondary_staging_stores
273
+ request :list_service_offerings
274
+ request :list_snapshots
275
+ request :list_ssh_key_pairs
276
+ request :list_ssl_certs
277
+ request :list_static_routes
278
+ request :list_storage_network_ip_range
279
+ request :list_storage_pools
280
+ request :list_storage_providers
281
+ request :list_supported_network_services
282
+ request :list_system_vms
283
+ request :list_tags
284
+ request :list_template_permissions
285
+ request :list_templates
286
+ request :list_traffic_types
287
+ request :list_users
288
+ request :list_virtual_machines
289
+ request :list_virtual_router_elements
290
+ request :list_vlan_ip_ranges
291
+ request :list_vm_snapshot
292
+ request :list_volumes
293
+ request :list_vpc_offerings
294
+ request :list_vpcs
295
+ request :list_vpn_connections
296
+ request :list_vpn_customer_gateways
297
+ request :list_vpn_gateways
298
+ request :list_vpn_users
299
+ request :list_zones
300
+ request :lock_account
301
+ request :lock_user
302
+ request :mark_default_zone_for_account
303
+ request :migrate_system_vm
304
+ request :migrate_virtual_machine
305
+ request :migrate_virtual_machine_with_volume
306
+ request :migrate_volume
307
+ request :prepare_host_for_maintenance
308
+ request :prepare_template
309
+ request :query_async_job_result
310
+ request :reboot_router
311
+ request :reboot_system_vm
312
+ request :reboot_virtual_machine
313
+ request :reconnect_host
314
+ request :recover_virtual_machine
315
+ request :register_iso
316
+ request :register_ssh_key_pair
317
+ request :register_template
318
+ request :register_user_keys
319
+ request :release_dedicated_cluster
320
+ request :release_dedicated_guest_vlan_range
321
+ request :release_dedicated_host
322
+ request :release_dedicated_pod
323
+ request :release_dedicated_zone
324
+ request :release_host_reservation
325
+ request :release_public_ip_range
326
+ request :remove_cert_from_load_balancer
327
+ request :remove_from_load_balancer_rule
328
+ request :remove_guest_os
329
+ request :remove_guest_os_mapping
330
+ request :remove_ip_from_nic
331
+ request :remove_nic_from_virtual_machine
332
+ request :remove_region
333
+ request :remove_resource_detail
334
+ request :remove_vpn_user
335
+ request :replace_network_acl_list
336
+ request :reset_api_limit
337
+ request :reset_password_for_virtual_machine
338
+ request :reset_ssh_key_for_virtual_machine
339
+ request :reset_vpn_connection
340
+ request :resize_volume
341
+ request :restart_network
342
+ request :restart_vpc
343
+ request :restore_virtual_machine
344
+ request :revert_snapshot
345
+ request :revert_to_vm_snapshot
346
+ request :scale_system_vm
347
+ request :scale_virtual_machine
348
+ request :start_router
349
+ request :start_system_vm
350
+ request :start_virtual_machine
351
+ request :stop_router
352
+ request :stop_system_vm
353
+ request :stop_virtual_machine
354
+ request :suspend_project
355
+ request :update_account
356
+ request :update_cluster
357
+ request :update_configuration
358
+ request :update_default_nic_for_virtual_machine
359
+ request :update_disk_offering
360
+ request :update_domain
361
+ request :update_egress_firewall_rule
362
+ request :update_firewall_rule
363
+ request :update_guest_os
364
+ request :update_guest_os_mapping
365
+ request :update_host
366
+ request :update_host_password
367
+ request :update_hypervisor_capabilities
368
+ request :update_instance_group
369
+ request :update_ip_address
370
+ request :update_iso
371
+ request :update_iso_permissions
372
+ request :update_lb_health_check_policy
373
+ request :update_lb_stickiness_policy
374
+ request :update_network
375
+ request :update_network_acl_item
376
+ request :update_network_acl_list
377
+ request :update_network_offering
378
+ request :update_network_service_provider
379
+ request :update_physical_network
380
+ request :update_pod
381
+ request :update_port_forwarding_rule
382
+ request :update_project
383
+ request :update_project_invitation
384
+ request :update_region
385
+ request :update_remote_access_vpn
386
+ request :update_resource_count
387
+ request :update_resource_limit
388
+ request :update_service_offering
389
+ request :update_storage_network_ip_range
390
+ request :update_storage_pool
391
+ request :update_template
392
+ request :update_template_permissions
393
+ request :update_user
394
+ request :update_virtual_machine
395
+ request :update_vm_affinity_group
396
+ request :update_volume
397
+ request :update_vpc
398
+ request :update_vpcoffering
399
+ request :update_vpn_connection
400
+ request :update_vpn_customer_gateway
401
+ request :update_vpn_gateway
402
+ request :update_zone
403
+ request :upgrade_router_template
404
+ request :upload_custom_certificate
405
+ request :upload_ssl_cert
406
+ request :upload_volume
407
+
408
+
409
+ class Real
410
+
411
+ def initialize(options={})
412
+ @cosmic_api_key = options[:cosmic_api_key]
413
+ @cosmic_secret_access_key = options[:cosmic_secret_access_key]
414
+ @cosmic_session_id = options[:cosmic_session_id]
415
+ @cosmic_session_key = options[:cosmic_session_key]
416
+ @cosmic_project_id = options[:cosmic_project_id]
417
+ @host = options[:cosmic_host]
418
+ @path = options[:cosmic_path] || '/client/api'
419
+ @port = options[:cosmic_port] || 443
420
+ @scheme = options[:cosmic_scheme] || 'https'
421
+ @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", options[:cosmic_persistent], {:ssl_verify_peer => false})
422
+ end
423
+
424
+ def reload
425
+ @connection.reset
426
+ end
427
+
428
+ def login(username,password,domain)
429
+ response = issue_request({
430
+ 'response' => 'json',
431
+ 'command' => 'login',
432
+ 'username' => username,
433
+ 'password' => Digest::MD5.hexdigest(password),
434
+ 'domain' => domain
435
+ })
436
+
437
+ # Parse response cookies to retrive JSESSIONID token
438
+ cookies = CGI::Cookie.parse(response.headers['Set-Cookie'])
439
+ sessionid = cookies['JSESSIONID'].first
440
+
441
+ # Decode the login response
442
+ response = Fog::JSON.decode(response.body)
443
+
444
+ user = response['loginresponse']
445
+ user.merge!('sessionid' => sessionid)
446
+
447
+ @cosmic_session_id = user['sessionid']
448
+ @cosmic_session_key = user['sessionkey']
449
+
450
+ user
451
+ end
452
+
453
+ def request(params)
454
+ params.reject!{|k,v| v.nil?}
455
+
456
+ params.merge!('response' => 'json')
457
+
458
+ if has_session?
459
+ params, headers = authorize_session(params)
460
+ elsif has_keys?
461
+ params, headers = authorize_api_keys(params)
462
+ end
463
+
464
+ response = issue_request(params,headers)
465
+ response = Fog::JSON.decode(response.body) unless response.body.empty?
466
+ response
467
+ end
468
+
469
+ private
470
+ def has_session?
471
+ @cosmic_session_id && @cosmic_session_key
472
+ end
473
+
474
+ def has_keys?
475
+ @cosmic_api_key && @cosmic_secret_access_key
476
+ end
477
+
478
+ def authorize_session(params)
479
+ # set the session id cookie for the request
480
+ headers = {'Cookie' => "JSESSIONID=#{@cosmic_session_id};"}
481
+ # set the sesion key for the request, params are not signed using session auth
482
+ params.merge!('sessionkey' => @cosmic_session_key)
483
+
484
+ return params, headers
485
+ end
486
+
487
+ def authorize_api_keys(params)
488
+ headers = {}
489
+ # merge the api key into the params
490
+ params.merge!('apiKey' => @cosmic_api_key)
491
+ # sign the request parameters
492
+ signature = Fog::Cosmic.signed_params(@cosmic_secret_access_key,params)
493
+ # merge signature into request param
494
+ params.merge!({'signature' => signature})
495
+
496
+ return params, headers
497
+ end
498
+
499
+ def issue_request(params={},headers={},method='GET',expects=200)
500
+ begin
501
+ @connection.request({
502
+ :query => params,
503
+ :headers => headers,
504
+ :method => method,
505
+ :expects => expects
506
+ })
507
+
508
+ rescue Excon::Errors::HTTPStatusError => error
509
+ error_response = Fog::JSON.decode(error.response.body)
510
+
511
+ error_code = error_response.values.first['errorcode']
512
+ error_text = error_response.values.first['errortext']
513
+
514
+ case error_code
515
+ when 401
516
+ raise Fog::Cosmic::Compute::Unauthorized, error_text
517
+ when 431
518
+ raise Fog::Cosmic::Compute::BadRequest, error_text
519
+ else
520
+ raise Fog::Cosmic::Compute::Error, error_text
521
+ end
522
+ end
523
+
524
+ end
525
+ end # Real
526
+
527
+ class Mock
528
+ def initialize(options={})
529
+ @cosmic_api_key = options[:cosmic_api_key]
530
+ @cosmic_project_id = Fog.credentials[:cosmic_project_id] || Fog::Cosmic.uuid
531
+ end
532
+
533
+ def self.data
534
+ @data ||= begin
535
+ zone_id = Fog.credentials[:cosmic_zone_id] || Fog::Cosmic.uuid
536
+ image_id = Fog.credentials[:cosmic_template_id] || Fog::Cosmic.uuid
537
+ flavor_id = Fog.credentials[:cosmic_service_offering_id] || Fog::Cosmic.uuid
538
+ network_id = (Array(Fog.credentials[:cosmic_network_ids]) || [Fog::Cosmic.uuid]).first
539
+ domain_name = "exampleorg"
540
+ account_id, user_id, domain_id = Fog::Cosmic.uuid, Fog::Cosmic.uuid, Fog::Cosmic.uuid
541
+ domain = {
542
+ "id" => domain_id,
543
+ "name" => domain_name,
544
+ "level" => 1,
545
+ "parentdomainid" => Fog::Cosmic.uuid,
546
+ "parentdomainname" => "ROOT",
547
+ "haschild" => false,
548
+ "path" => "ROOT/accountname"
549
+ }
550
+ user = {
551
+ "id" => user_id,
552
+ "username" => "username",
553
+ "firstname" => "Bob",
554
+ "lastname" => "Lastname",
555
+ "email" => "email@example.com",
556
+ "created" => "2012-05-14T16:25:17-0500",
557
+ "state" => "enabled",
558
+ "account" => "accountname",
559
+ "accounttype" => 2,
560
+ "domainid" => domain_id,
561
+ "domain" => domain_name,
562
+ "apikey" => Fog::Cosmic.uuid,
563
+ "secretkey" => Fog::Cosmic.uuid
564
+ }
565
+ {
566
+ :users => { user_id => user },
567
+ :networks => { network_id => {
568
+ "id" => network_id,
569
+ "name" => "10.56.23.0/26",
570
+ "displaytext" => "10.56.23.0/26",
571
+ "broadcastdomaintype" => "Vlan",
572
+ "traffictype" => "Guest",
573
+ "gateway" => "10.56.23.1",
574
+ "netmask" => "255.255.255.192",
575
+ "cidr" => "10.56.23.0/26",
576
+ "zoneid" => zone_id,
577
+ "zonename" => "zone-00",
578
+ "networkofferingid" => "af0c9bd5-a1b2-4ad0-bf4b-d6fa9b1b9d5b",
579
+ "networkofferingname" => "DefaultSharedNetworkOffering",
580
+ "networkofferingdisplaytext" => "Offering for Shared networks",
581
+ "networkofferingavailability" => "Optional",
582
+ "issystem" => false,
583
+ "state" => "Setup",
584
+ "related" => "86bbc9fc-d92e-49db-9fdc-296189090017",
585
+ "broadcasturi" => "vlan://800",
586
+ "dns1" => "10.0.80.11",
587
+ "type" => "Shared",
588
+ "vlan" => "800",
589
+ "acltype" => "Domain",
590
+ "subdomainaccess" => true,
591
+ "domainid" => domain_id,
592
+ "domain" => "ROOT",
593
+ "service" => [
594
+ {"name" => "UserData"},
595
+ {"name" => "Dhcp"},
596
+ {
597
+ "name" => "Dns",
598
+ "capability" => [
599
+ {
600
+ "name" => "AllowDnsSuffixModification",
601
+ "value" => "true",
602
+ "canchooseservicecapability" => false
603
+ }
604
+ ]
605
+ }],
606
+ "networkdomain" => "cs1cloud.internal",
607
+ "physicalnetworkid" => "8f4627c5-1fdd-4504-8a92-f61b4e9cb3e3",
608
+ "restartrequired" => false,
609
+ "specifyipranges" => true}
610
+ },
611
+ :public_ip_addresses => { "0e276270-7950-4483-bf21-3dc897dbe08a" => {
612
+ "id" => "0e276270-7950-4483-bf21-3dc897dbe08a",
613
+ "ipaddress" => "192.168.200.2",
614
+ "allocated" => "2014-11-26T22:32:39+0000",
615
+ "zoneid" => "0e276270-7950-4483-bf21-3dc897dbe08a",
616
+ "zonename" => "Toronto",
617
+ "issourcenat" => false,
618
+ "projectid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
619
+ "project" => "TestProject",
620
+ "domainid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
621
+ "domain" => "TestDomain",
622
+ "forvirtualnetwork" => true,
623
+ "isstaticnat" => false,
624
+ "issystem" => false,
625
+ "associatednetworkid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
626
+ "associatednetworkname" => "TestNetwork",
627
+ "networkid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
628
+ "state" => "Allocated",
629
+ "physicalnetworkid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
630
+ "tags" => []
631
+ }},
632
+ :zones => { zone_id => {
633
+ "id" => zone_id,
634
+ "name" => "zone-00",
635
+ "domainid" => 1,
636
+ "domainname" => "ROOT",
637
+ "networktype" => "Advanced",
638
+ "allocationstate" => "Enabled",
639
+ "zonetoken" => Fog::Cosmic.uuid,
640
+ "dhcpprovider" => "VirtualRouter"}},
641
+ :images => { image_id => {
642
+ "id" => image_id,
643
+ "name" => "CentOS 5.6(64-bit) no GUI (XenServer)",
644
+ "displaytext" => "CentOS 5.6(64-bit) no GUI (XenServer)",
645
+ "ispublic" => true,
646
+ "created" => "2012-05-09T15:29:33-0500",
647
+ "isready" => true,
648
+ "passwordenabled" => false,
649
+ "format" => "VHD",
650
+ "isfeatured" => true,
651
+ "crossZones" => true,
652
+ "ostypeid" => "a6a6694a-18f5-4765-8418-2b7a5f37cd0f",
653
+ "ostypename" => "CentOS 5.3 (64-bit)",
654
+ "account" => "system",
655
+ "zoneid" => zone_id,
656
+ "zonename" => "zone-00",
657
+ "status" => "Download Complete",
658
+ "size" => 21474836480,
659
+ "templatetype" => "BUILTIN",
660
+ "domain" => "ROOT",
661
+ "domainid" => "6023b6fe-5bef-4358-bc76-9f4e75afa52f",
662
+ "isextractable" => true,
663
+ "checksum" => "905cec879afd9c9d22ecc8036131a180",
664
+ "hypervisor" => "Xen"
665
+ }},
666
+ :flavors => { flavor_id => {
667
+ "id" => flavor_id,
668
+ "name" => "Medium Instance",
669
+ "displaytext" => "Medium Instance",
670
+ "cpunumber" => 1,
671
+ "cpuspeed" => 1000,
672
+ "memory" => 1024,
673
+ "created" => "2012-05-09T14:48:36-0500",
674
+ "storagetype" => "shared",
675
+ "offerha" => false,
676
+ "limitcpuuse" => false,
677
+ "issystem" => false,
678
+ "defaultuse" => false
679
+ }},
680
+ :accounts => { account_id => {
681
+ "id" => account_id,
682
+ "name" => "accountname",
683
+ "accounttype" => 2,
684
+ "domainid" => domain_id,
685
+ "domain" => domain_name,
686
+ "receivedbytes" => 0,
687
+ "sentbytes" => 0,
688
+ "vmlimit" => "Unlimited",
689
+ "vmtotal" => 0,
690
+ "vmavailable" => "Unlimited",
691
+ "iplimit" => "Unlimited",
692
+ "iptotal" => 0,
693
+ "ipavailable" => "Unlimited",
694
+ "volumelimit" => "Unlimited",
695
+ "volumetotal" => 0,
696
+ "volumeavailable" => "Unlimited",
697
+ "snapshotlimit" => "Unlimited",
698
+ "snapshottotal" => 0,
699
+ "snapshotavailable" => "Unlimited",
700
+ "templatelimit" => "Unlimited",
701
+ "templatetotal" => 0,
702
+ "templateavailable" => "Unlimited",
703
+ "vmstopped" => 0,
704
+ "vmrunning" => 0,
705
+ "projectlimit" => "Unlimited",
706
+ "projecttotal" => 1,
707
+ "projectavailable" => "Unlimited",
708
+ "networklimit" => "Unlimited",
709
+ "networktotal" => 0,
710
+ "networkavailable" => "Unlimited",
711
+ "state" => "enabled",
712
+ "user" => [user]}
713
+ },
714
+ :domains => {domain_id => domain},
715
+ :servers => {},
716
+ :jobs => {},
717
+ :volumes => {
718
+ "89198f7c-0245-aa1d-136a-c5f479ef9db7" => {
719
+ "id"=> "89198f7c-0245-aa1d-136a-c5f479ef9db7",
720
+ "name"=>"test volume",
721
+ "zoneid"=> zone_id,
722
+ "zonename"=>"zone-00",
723
+ "type"=>"DATADISK",
724
+ "deviceid"=>1,
725
+ "virtualmachineid"=> "51dcffee-5f9f-29a4-acee-2717e1a3656b",
726
+ "vmname"=>"i-2824-11621-VM",
727
+ "vmdisplayname"=>"test vm",
728
+ "vmstate"=>"Running",
729
+ "size"=>17179869184,
730
+ "created"=>"2013-04-16T12:33:41+0000",
731
+ "state"=>"Ready",
732
+ "account"=> 'accountname',
733
+ "domainid"=> domain_id,
734
+ "domain"=> domain_name,
735
+ "storagetype"=>"shared",
736
+ "hypervisor"=>"KVM",
737
+ "diskofferingid"=> "cc4de87d-672d-4353-abb5-6a8a4c0abf59",
738
+ "diskofferingname"=>"Small Disk",
739
+ "diskofferingdisplaytext"=>"Small Disk [16GB Disk]",
740
+ "storage"=>"ps1",
741
+ "attached"=>"2013-04-16T12:34:07+0000",
742
+ "destroyed"=>false,
743
+ "isextractable"=>false
744
+ },
745
+ },
746
+ :snapshots => {},
747
+ :disk_offerings => {
748
+ "cc4de87d-672d-4353-abb5-6a8a4c0abf59" => {
749
+ "id" => "cc4de87d-672d-4353-abb5-6a8a4c0abf59",
750
+ "domainid" => domain_id,
751
+ "domain" => domain_name,
752
+ "name" => "Small Disk",
753
+ "displaytext" => "Small Disk [16GB Disk]",
754
+ "disksize" => 16,
755
+ "created" => "2013-02-21T03:12:520300",
756
+ "iscustomized" => false,
757
+ "storagetype" => "shared"
758
+ },
759
+ "d5deeb0c-de03-4ebf-820a-dc74221bcaeb" => {
760
+ "id" => "d5deeb0c-de03-4ebf-820a-dc74221bcaeb",
761
+ "domainid" => domain_id,
762
+ "domain" => domain_name,
763
+ "name" => "Medium Disk",
764
+ "displaytext" => "Medium Disk [32GB Disk]",
765
+ "disksize" => 32,
766
+ "created" => "2013-02-21T03:12:520300",
767
+ "iscustomized" => false,
768
+ "storagetype" => "shared"
769
+ }
770
+ },
771
+ :network_offerings => {
772
+ "cc4de87d-672d-4353-abb5-6a8a4c0abf59" => {
773
+ "id" => "cc4de87d-672d-4353-abb5-6a8a4c0abf59",
774
+ "name" => "Shared Network",
775
+ "displaytext" => "Shared Network",
776
+ "traffictype" => "Guest",
777
+ "isdefault" => true,
778
+ "specifyvlan" => true,
779
+ "conservemode" => true,
780
+ "specifyipranges" => true,
781
+ "availability" => "Optional",
782
+ "networkrate" => 200,
783
+ "state" => "Enabled",
784
+ "guestiptype" => "Shared",
785
+ "serviceofferingid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1"
786
+ }
787
+ },
788
+ :firewall_rules => {
789
+ "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1" => {
790
+ "id"=> "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
791
+ "protocol"=> "tcp",
792
+ "startport" => "443",
793
+ "endport" => "443",
794
+ "ipaddressid" => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
795
+ "networkid"=> "31c4b26e-4be9-11e4-8304-00163e5b5f54",
796
+ "ipaddress" => "192.168.200.1",
797
+ "state" => "Active",
798
+ "cidrlist" => "255.255.255.0/24",
799
+ "tags" => []
800
+ }
801
+ },
802
+ :egress_firewall_rules => {
803
+ "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1" => {
804
+ "id"=>"f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
805
+ "protocol"=>"tcp",
806
+ "networkid"=> "31c4b26e-4be9-11e4-8304-00163e5b5f54",
807
+ "state"=>"Active",
808
+ "cidrlist"=>"10.2.1.0/24",
809
+ "tags"=>[]
810
+ }
811
+ },
812
+ :port_forwarding_rules => {
813
+ "8f4627c5-1fdd-4504-8a92-f61b4e9cb3e3" => {
814
+ 'id' => "8f4627c5-1fdd-4504-8a92-f61b4e9cb3e3",
815
+ 'privateport' => "25",
816
+ 'privateendport' => "25",
817
+ 'protocol' => "tcp",
818
+ 'publicport' => "25",
819
+ 'publicendport' => "25",
820
+ 'virtualmachineid' => "8f4627c5-1fdd-4504-8a92-f61b4e9cb3e3",
821
+ 'virtualmachinename' => "LoadBalancer",
822
+ 'virtualmachinedisplayname' => "LoadBalancer",
823
+ 'ipaddressid' => "f1f1f1f1-f1f1-f1f1-f1f1-f1f1f1f1f1",
824
+ 'ipaddress' => "192.168.200.200",
825
+ 'state' => "Active",
826
+ 'cidrlist' => "",
827
+ 'tags' => []
828
+ }
829
+ },
830
+ :os_types => {
831
+ "51ef854d-279e-4e68-9059-74980fd7b29b" => {
832
+ "id" => "51ef854d-279e-4e68-9059-74980fd7b29b",
833
+ "oscategoryid" => "56f67279-e082-45c3-a01c-d290d6cd4ce2",
834
+ "description" => "Asianux 3(32-bit)"
835
+ },
836
+ "daf124c8-95d8-4756-8e1c-1871b073babb" => {
837
+ "id" => "daf124c8-95d8-4756-8e1c-1871b073babb",
838
+ "oscategoryid" => "56f67279-e082-45c3-a01c-d290d6cd4ce2",
839
+ "description" => "Asianux 3(64-bit)"
840
+ }
841
+ }
842
+ }
843
+ end
844
+ end
845
+
846
+ def self.reset
847
+ @data = nil
848
+ end
849
+
850
+ def data
851
+ self.class.data
852
+ end
853
+
854
+ def reset_data
855
+ self.class.data.delete(@cosmic_api_key)
856
+ end
857
+
858
+ end
859
+ end # Compute
860
+ end # Cosmic
861
+ end # Fog