fog-storm_on_demand 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rubocop.yml +20 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +17 -0
  7. data/CONTRIBUTING.md +18 -0
  8. data/CONTRIBUTORS.md +15 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.md +20 -0
  11. data/README.md +38 -0
  12. data/Rakefile +11 -0
  13. data/fog-storm_on_demand.gemspec +34 -0
  14. data/gemfiles/Gemfile.1.9.2- +8 -0
  15. data/gemfiles/Gemfile.1.9.3+ +7 -0
  16. data/lib/fog/account/storm_on_demand.rb +51 -0
  17. data/lib/fog/account/storm_on_demand/models/token.rb +14 -0
  18. data/lib/fog/account/storm_on_demand/models/tokens.rb +14 -0
  19. data/lib/fog/account/storm_on_demand/requests/create_token.rb +14 -0
  20. data/lib/fog/account/storm_on_demand/requests/expire_token.rb +14 -0
  21. data/lib/fog/billing/storm_on_demand.rb +57 -0
  22. data/lib/fog/billing/storm_on_demand/models/invoice.rb +19 -0
  23. data/lib/fog/billing/storm_on_demand/models/invoices.rb +24 -0
  24. data/lib/fog/billing/storm_on_demand/models/payment.rb +8 -0
  25. data/lib/fog/billing/storm_on_demand/models/payments.rb +14 -0
  26. data/lib/fog/billing/storm_on_demand/requests/get_invoice.rb +14 -0
  27. data/lib/fog/billing/storm_on_demand/requests/list_invoices.rb +14 -0
  28. data/lib/fog/billing/storm_on_demand/requests/make_payment.rb +14 -0
  29. data/lib/fog/billing/storm_on_demand/requests/next_invoice.rb +14 -0
  30. data/lib/fog/bin/storm_on_demand.rb +29 -0
  31. data/lib/fog/compute/storm_on_demand.rb +115 -0
  32. data/lib/fog/compute/storm_on_demand/models/config.rb +31 -0
  33. data/lib/fog/compute/storm_on_demand/models/configs.rb +19 -0
  34. data/lib/fog/compute/storm_on_demand/models/image.rb +35 -0
  35. data/lib/fog/compute/storm_on_demand/models/images.rb +24 -0
  36. data/lib/fog/compute/storm_on_demand/models/notification.rb +25 -0
  37. data/lib/fog/compute/storm_on_demand/models/notifications.rb +24 -0
  38. data/lib/fog/compute/storm_on_demand/models/product.rb +31 -0
  39. data/lib/fog/compute/storm_on_demand/models/products.rb +22 -0
  40. data/lib/fog/compute/storm_on_demand/models/server.rb +87 -0
  41. data/lib/fog/compute/storm_on_demand/models/servers.rb +24 -0
  42. data/lib/fog/compute/storm_on_demand/models/template.rb +20 -0
  43. data/lib/fog/compute/storm_on_demand/models/templates.rb +19 -0
  44. data/lib/fog/compute/storm_on_demand/requests/clone_server.rb +14 -0
  45. data/lib/fog/compute/storm_on_demand/requests/create_image.rb +14 -0
  46. data/lib/fog/compute/storm_on_demand/requests/create_server.rb +14 -0
  47. data/lib/fog/compute/storm_on_demand/requests/current_notifications.rb +14 -0
  48. data/lib/fog/compute/storm_on_demand/requests/delete_image.rb +14 -0
  49. data/lib/fog/compute/storm_on_demand/requests/delete_server.rb +14 -0
  50. data/lib/fog/compute/storm_on_demand/requests/get_config_details.rb +14 -0
  51. data/lib/fog/compute/storm_on_demand/requests/get_image_details.rb +14 -0
  52. data/lib/fog/compute/storm_on_demand/requests/get_notification.rb +14 -0
  53. data/lib/fog/compute/storm_on_demand/requests/get_product.rb +14 -0
  54. data/lib/fog/compute/storm_on_demand/requests/get_product_code.rb +14 -0
  55. data/lib/fog/compute/storm_on_demand/requests/get_product_price.rb +14 -0
  56. data/lib/fog/compute/storm_on_demand/requests/get_product_starting_price.rb +14 -0
  57. data/lib/fog/compute/storm_on_demand/requests/get_server.rb +14 -0
  58. data/lib/fog/compute/storm_on_demand/requests/get_template_details.rb +14 -0
  59. data/lib/fog/compute/storm_on_demand/requests/list_configs.rb +14 -0
  60. data/lib/fog/compute/storm_on_demand/requests/list_images.rb +14 -0
  61. data/lib/fog/compute/storm_on_demand/requests/list_notifications.rb +14 -0
  62. data/lib/fog/compute/storm_on_demand/requests/list_products.rb +14 -0
  63. data/lib/fog/compute/storm_on_demand/requests/list_servers.rb +14 -0
  64. data/lib/fog/compute/storm_on_demand/requests/list_templates.rb +14 -0
  65. data/lib/fog/compute/storm_on_demand/requests/reboot_server.rb +14 -0
  66. data/lib/fog/compute/storm_on_demand/requests/resize_server.rb +14 -0
  67. data/lib/fog/compute/storm_on_demand/requests/resolve_notification.rb +14 -0
  68. data/lib/fog/compute/storm_on_demand/requests/restore_image.rb +14 -0
  69. data/lib/fog/compute/storm_on_demand/requests/restore_template.rb +14 -0
  70. data/lib/fog/compute/storm_on_demand/requests/server_history.rb +14 -0
  71. data/lib/fog/compute/storm_on_demand/requests/server_status.rb +14 -0
  72. data/lib/fog/compute/storm_on_demand/requests/shutdown_server.rb +14 -0
  73. data/lib/fog/compute/storm_on_demand/requests/start_server.rb +14 -0
  74. data/lib/fog/compute/storm_on_demand/requests/update_image.rb +14 -0
  75. data/lib/fog/compute/storm_on_demand/requests/update_server.rb +14 -0
  76. data/lib/fog/dns/storm_on_demand.rb +82 -0
  77. data/lib/fog/dns/storm_on_demand/models/domain.rb +25 -0
  78. data/lib/fog/dns/storm_on_demand/models/domains.rb +14 -0
  79. data/lib/fog/dns/storm_on_demand/models/record.rb +55 -0
  80. data/lib/fog/dns/storm_on_demand/models/records.rb +24 -0
  81. data/lib/fog/dns/storm_on_demand/models/reverse.rb +8 -0
  82. data/lib/fog/dns/storm_on_demand/models/reverses.rb +17 -0
  83. data/lib/fog/dns/storm_on_demand/models/zone.rb +32 -0
  84. data/lib/fog/dns/storm_on_demand/models/zones.rb +24 -0
  85. data/lib/fog/dns/storm_on_demand/requests/check_zone_delegation.rb +14 -0
  86. data/lib/fog/dns/storm_on_demand/requests/create_record.rb +14 -0
  87. data/lib/fog/dns/storm_on_demand/requests/create_record_region.rb +14 -0
  88. data/lib/fog/dns/storm_on_demand/requests/create_zone.rb +14 -0
  89. data/lib/fog/dns/storm_on_demand/requests/delete_record.rb +14 -0
  90. data/lib/fog/dns/storm_on_demand/requests/delete_record_region.rb +14 -0
  91. data/lib/fog/dns/storm_on_demand/requests/delete_reverse.rb +14 -0
  92. data/lib/fog/dns/storm_on_demand/requests/delete_zone.rb +14 -0
  93. data/lib/fog/dns/storm_on_demand/requests/get_record.rb +14 -0
  94. data/lib/fog/dns/storm_on_demand/requests/get_zone.rb +14 -0
  95. data/lib/fog/dns/storm_on_demand/requests/list_domains.rb +14 -0
  96. data/lib/fog/dns/storm_on_demand/requests/list_records.rb +14 -0
  97. data/lib/fog/dns/storm_on_demand/requests/list_zones.rb +14 -0
  98. data/lib/fog/dns/storm_on_demand/requests/renew_domain.rb +14 -0
  99. data/lib/fog/dns/storm_on_demand/requests/update_record.rb +14 -0
  100. data/lib/fog/dns/storm_on_demand/requests/update_record_region.rb +14 -0
  101. data/lib/fog/dns/storm_on_demand/requests/update_reverse.rb +14 -0
  102. data/lib/fog/dns/storm_on_demand/requests/update_zone.rb +14 -0
  103. data/lib/fog/monitoring/storm_on_demand.rb +65 -0
  104. data/lib/fog/monitoring/storm_on_demand/models/bandwidth.rb +14 -0
  105. data/lib/fog/monitoring/storm_on_demand/models/bandwidths.rb +18 -0
  106. data/lib/fog/monitoring/storm_on_demand/models/load.rb +14 -0
  107. data/lib/fog/monitoring/storm_on_demand/models/loads.rb +18 -0
  108. data/lib/fog/monitoring/storm_on_demand/models/monitor_service.rb +13 -0
  109. data/lib/fog/monitoring/storm_on_demand/models/monitor_services.rb +27 -0
  110. data/lib/fog/monitoring/storm_on_demand/requests/get_bandwidth_graph.rb +14 -0
  111. data/lib/fog/monitoring/storm_on_demand/requests/get_bandwidth_stats.rb +14 -0
  112. data/lib/fog/monitoring/storm_on_demand/requests/get_load_graph.rb +14 -0
  113. data/lib/fog/monitoring/storm_on_demand/requests/get_load_stats.rb +14 -0
  114. data/lib/fog/monitoring/storm_on_demand/requests/get_service.rb +14 -0
  115. data/lib/fog/monitoring/storm_on_demand/requests/get_service_status.rb +14 -0
  116. data/lib/fog/monitoring/storm_on_demand/requests/monitoring_ips.rb +14 -0
  117. data/lib/fog/monitoring/storm_on_demand/requests/update_service.rb +14 -0
  118. data/lib/fog/network/storm_on_demand.rb +115 -0
  119. data/lib/fog/network/storm_on_demand/models/balancer.rb +50 -0
  120. data/lib/fog/network/storm_on_demand/models/balancers.rb +37 -0
  121. data/lib/fog/network/storm_on_demand/models/firewall.rb +12 -0
  122. data/lib/fog/network/storm_on_demand/models/firewalls.rb +28 -0
  123. data/lib/fog/network/storm_on_demand/models/network_ip.rb +15 -0
  124. data/lib/fog/network/storm_on_demand/models/network_ips.rb +43 -0
  125. data/lib/fog/network/storm_on_demand/models/pool.rb +24 -0
  126. data/lib/fog/network/storm_on_demand/models/pools.rb +23 -0
  127. data/lib/fog/network/storm_on_demand/models/private_ip.rb +9 -0
  128. data/lib/fog/network/storm_on_demand/models/private_ips.rb +33 -0
  129. data/lib/fog/network/storm_on_demand/models/ruleset.rb +19 -0
  130. data/lib/fog/network/storm_on_demand/models/rulesets.rb +24 -0
  131. data/lib/fog/network/storm_on_demand/models/zone.rb +19 -0
  132. data/lib/fog/network/storm_on_demand/models/zones.rb +19 -0
  133. data/lib/fog/network/storm_on_demand/requests/add_balancer_node.rb +14 -0
  134. data/lib/fog/network/storm_on_demand/requests/add_balancer_service.rb +14 -0
  135. data/lib/fog/network/storm_on_demand/requests/add_ip_to_server.rb +14 -0
  136. data/lib/fog/network/storm_on_demand/requests/attach_server_to_private_ip.rb +14 -0
  137. data/lib/fog/network/storm_on_demand/requests/check_balancer_available.rb +14 -0
  138. data/lib/fog/network/storm_on_demand/requests/check_server_attached.rb +14 -0
  139. data/lib/fog/network/storm_on_demand/requests/create_balancer.rb +14 -0
  140. data/lib/fog/network/storm_on_demand/requests/create_pool.rb +14 -0
  141. data/lib/fog/network/storm_on_demand/requests/create_ruleset.rb +14 -0
  142. data/lib/fog/network/storm_on_demand/requests/delete_balancer.rb +14 -0
  143. data/lib/fog/network/storm_on_demand/requests/delete_pool.rb +14 -0
  144. data/lib/fog/network/storm_on_demand/requests/detach_server_from_private_ip.rb +14 -0
  145. data/lib/fog/network/storm_on_demand/requests/get_assignments.rb +14 -0
  146. data/lib/fog/network/storm_on_demand/requests/get_balancer_details.rb +14 -0
  147. data/lib/fog/network/storm_on_demand/requests/get_balancer_possible_nodes.rb +14 -0
  148. data/lib/fog/network/storm_on_demand/requests/get_balancer_strategies.rb +14 -0
  149. data/lib/fog/network/storm_on_demand/requests/get_firewall.rb +14 -0
  150. data/lib/fog/network/storm_on_demand/requests/get_firewall_basic_options.rb +14 -0
  151. data/lib/fog/network/storm_on_demand/requests/get_firewall_rules.rb +14 -0
  152. data/lib/fog/network/storm_on_demand/requests/get_ip_details.rb +14 -0
  153. data/lib/fog/network/storm_on_demand/requests/get_pool.rb +14 -0
  154. data/lib/fog/network/storm_on_demand/requests/get_private_ip.rb +14 -0
  155. data/lib/fog/network/storm_on_demand/requests/get_ruleset.rb +14 -0
  156. data/lib/fog/network/storm_on_demand/requests/get_zone.rb +14 -0
  157. data/lib/fog/network/storm_on_demand/requests/list_balancers.rb +14 -0
  158. data/lib/fog/network/storm_on_demand/requests/list_ip_public_accounts.rb +14 -0
  159. data/lib/fog/network/storm_on_demand/requests/list_network_ips.rb +14 -0
  160. data/lib/fog/network/storm_on_demand/requests/list_network_public_ips.rb +14 -0
  161. data/lib/fog/network/storm_on_demand/requests/list_private_ips.rb +14 -0
  162. data/lib/fog/network/storm_on_demand/requests/list_rulesets.rb +14 -0
  163. data/lib/fog/network/storm_on_demand/requests/list_zones.rb +14 -0
  164. data/lib/fog/network/storm_on_demand/requests/remove_balancer_node.rb +14 -0
  165. data/lib/fog/network/storm_on_demand/requests/remove_balancer_service.rb +14 -0
  166. data/lib/fog/network/storm_on_demand/requests/remove_ip_from_server.rb +14 -0
  167. data/lib/fog/network/storm_on_demand/requests/request_new_ips.rb +14 -0
  168. data/lib/fog/network/storm_on_demand/requests/set_default_zone.rb +14 -0
  169. data/lib/fog/network/storm_on_demand/requests/update_balancer.rb +14 -0
  170. data/lib/fog/network/storm_on_demand/requests/update_firewall.rb +14 -0
  171. data/lib/fog/network/storm_on_demand/requests/update_pool.rb +14 -0
  172. data/lib/fog/network/storm_on_demand/requests/update_ruleset.rb +14 -0
  173. data/lib/fog/storage/storm_on_demand.rb +62 -0
  174. data/lib/fog/storage/storm_on_demand/models/cluster.rb +11 -0
  175. data/lib/fog/storage/storm_on_demand/models/clusters.rb +14 -0
  176. data/lib/fog/storage/storm_on_demand/models/volume.rb +45 -0
  177. data/lib/fog/storage/storm_on_demand/models/volumes.rb +24 -0
  178. data/lib/fog/storage/storm_on_demand/requests/attach_volume_to_server.rb +14 -0
  179. data/lib/fog/storage/storm_on_demand/requests/create_volume.rb +14 -0
  180. data/lib/fog/storage/storm_on_demand/requests/delete_volume.rb +14 -0
  181. data/lib/fog/storage/storm_on_demand/requests/detach_volume_from_server.rb +14 -0
  182. data/lib/fog/storage/storm_on_demand/requests/get_volume.rb +14 -0
  183. data/lib/fog/storage/storm_on_demand/requests/list_clusters.rb +14 -0
  184. data/lib/fog/storage/storm_on_demand/requests/list_volumes.rb +14 -0
  185. data/lib/fog/storage/storm_on_demand/requests/resize_volume.rb +14 -0
  186. data/lib/fog/storage/storm_on_demand/requests/update_volume.rb +14 -0
  187. data/lib/fog/storm_on_demand.rb +57 -0
  188. data/lib/fog/storm_on_demand/shared.rb +53 -0
  189. data/lib/fog/storm_on_demand/version.rb +5 -0
  190. data/lib/fog/support/storm_on_demand.rb +63 -0
  191. data/lib/fog/support/storm_on_demand/models/alert.rb +10 -0
  192. data/lib/fog/support/storm_on_demand/models/alerts.rb +14 -0
  193. data/lib/fog/support/storm_on_demand/models/ticket.rb +64 -0
  194. data/lib/fog/support/storm_on_demand/models/tickets.rb +27 -0
  195. data/lib/fog/support/storm_on_demand/requests/add_feedback.rb +14 -0
  196. data/lib/fog/support/storm_on_demand/requests/add_transaction_feedback.rb +14 -0
  197. data/lib/fog/support/storm_on_demand/requests/authenticate.rb +14 -0
  198. data/lib/fog/support/storm_on_demand/requests/close_ticket.rb +14 -0
  199. data/lib/fog/support/storm_on_demand/requests/create_ticket.rb +14 -0
  200. data/lib/fog/support/storm_on_demand/requests/get_active_alert.rb +14 -0
  201. data/lib/fog/support/storm_on_demand/requests/get_ticket_details.rb +14 -0
  202. data/lib/fog/support/storm_on_demand/requests/list_ticket_types.rb +14 -0
  203. data/lib/fog/support/storm_on_demand/requests/list_tickets.rb +14 -0
  204. data/lib/fog/support/storm_on_demand/requests/reopen_ticket.rb +14 -0
  205. data/lib/fog/support/storm_on_demand/requests/reply_ticket.rb +14 -0
  206. data/lib/fog/vpn/storm_on_demand.rb +53 -0
  207. data/lib/fog/vpn/storm_on_demand/models/vpn.rb +22 -0
  208. data/lib/fog/vpn/storm_on_demand/models/vpns.rb +23 -0
  209. data/lib/fog/vpn/storm_on_demand/requests/create_vpn.rb +14 -0
  210. data/lib/fog/vpn/storm_on_demand/requests/get_vpn.rb +14 -0
  211. data/lib/fog/vpn/storm_on_demand/requests/list_vpn_users.rb +14 -0
  212. data/lib/fog/vpn/storm_on_demand/requests/update_vpn.rb +14 -0
  213. data/spec/minitest_helper.rb +31 -0
  214. metadata +371 -0
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Invoices < Fog::Collection
5
+ model Fog::Billing::StormOnDemand::Invoice
6
+
7
+ def all(options = {})
8
+ invoices = service.list_invoices(options).body['items']
9
+ load(invoices)
10
+ end
11
+
12
+ def get(invoice_id)
13
+ invoice = service.get_invoice(:id => invoice_id).body
14
+ new(invoice)
15
+ end
16
+
17
+ def next
18
+ invoice = service.next_invoice.body
19
+ new(invoice)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,8 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Payment < Fog::Model
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Payments < Fog::Collection
5
+ model Fog::Billing::StormOnDemand::Payment
6
+
7
+ def make(amount, card_code)
8
+ service.make_payment(:amount => amount,
9
+ :card_code => card_code).body['amount']
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Real
5
+ def get_invoice(options = {})
6
+ request(
7
+ :path => '/Billing/Invoice/details',
8
+ :body => Fog::JSON.encode(:params => options)
9
+ )
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Real
5
+ def list_invoices(options = {})
6
+ request(
7
+ :path => '/Billing/Invoice/list',
8
+ :body => Fog::JSON.encode(:params => options)
9
+ )
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Real
5
+ def make_payment(options = {})
6
+ request(
7
+ :path => '/Billing/Payment/make',
8
+ :body => Fog::JSON.encode(:params => options)
9
+ )
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Fog
2
+ module Billing
3
+ class StormOnDemand
4
+ class Real
5
+ def next_invoice(options = {})
6
+ request(
7
+ :path => '/Billing/Invoice/next',
8
+ :body => Fog::JSON.encode(:params => options)
9
+ )
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,29 @@
1
+ class StormOnDemand < Fog::Bin
2
+ class << self
3
+ def class_for(key)
4
+ case key
5
+ when :storm_on_demand
6
+ Fog::Compute::StormOnDemand
7
+ else
8
+ raise ArgumentError, "Unsupported #{self} service: #{key}"
9
+ end
10
+ end
11
+
12
+ def [](service)
13
+ @@connections ||= Hash.new do |hash, key|
14
+ hash[key] = case key
15
+ when :storm_on_demand
16
+ Fog::Logger.warning("StormOnDemand[:compute] is not recommended, use Compute[:stormondemand] for portability")
17
+ Fog::Compute.new(:provider => 'StormOnDemand')
18
+ else
19
+ raise ArgumentError, "Unrecognized service: #{key.inspect}"
20
+ end
21
+ end
22
+ @@connections[service]
23
+ end
24
+
25
+ def services
26
+ Fog::StormOnDemand.services
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,115 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand < Fog::Service
4
+ autoload :Config, 'fog/compute/storm_on_demand/models/config'
5
+ autoload :Configs, 'fog/compute/storm_on_demand/models/configs'
6
+ autoload :Image, 'fog/compute/storm_on_demand/models/image'
7
+ autoload :Images, 'fog/compute/storm_on_demand/models/images'
8
+ autoload :Notification, 'fog/compute/storm_on_demand/models/notification'
9
+ autoload :Notifications, 'fog/compute/storm_on_demand/models/notifications'
10
+ autoload :Product, 'fog/compute/storm_on_demand/models/product'
11
+ autoload :Products, 'fog/compute/storm_on_demand/models/products'
12
+ autoload :Server, 'fog/compute/storm_on_demand/models/server'
13
+ autoload :Servers, 'fog/compute/storm_on_demand/models/servers'
14
+ autoload :Template, 'fog/compute/storm_on_demand/models/template'
15
+ autoload :Templates, 'fog/compute/storm_on_demand/models/templates'
16
+
17
+ requires :storm_on_demand_username, :storm_on_demand_password
18
+ recognizes :storm_on_demand_auth_url
19
+
20
+ model_path 'fog/compute/storm_on_demand/models'
21
+ model :config
22
+ collection :configs
23
+ model :image
24
+ collection :images
25
+ model :server
26
+ collection :servers
27
+ model :template
28
+ collection :templates
29
+ model :product
30
+ collection :products
31
+ model :notification
32
+ collection :notifications
33
+
34
+ request_path 'fog/compute/storm_on_demand/requests'
35
+ request :clone_server
36
+ request :delete_server
37
+ request :reboot_server
38
+ request :list_servers
39
+ request :get_server
40
+ request :create_server
41
+ request :resize_server
42
+ request :server_history
43
+ request :shutdown_server
44
+ request :start_server
45
+ request :server_status
46
+ request :update_server
47
+
48
+ request :list_configs
49
+ request :get_config_details
50
+
51
+ request :list_templates
52
+ request :get_template_details
53
+ request :restore_template
54
+
55
+ request :list_images
56
+ request :create_image
57
+ request :delete_image
58
+ request :get_image_details
59
+ request :update_image
60
+ request :restore_image
61
+
62
+ request :get_product
63
+ request :get_product_code
64
+ request :list_products
65
+ request :get_product_price
66
+ request :get_product_starting_price
67
+
68
+ request :list_notifications
69
+ request :current_notifications
70
+ request :get_notification
71
+ request :resolve_notification
72
+
73
+ class Mock
74
+ def self.data
75
+ @data ||= Hash.new do |hash, key|
76
+ hash[key] = {
77
+ :last_modified => {
78
+ :images => {},
79
+ :servers => {}
80
+ },
81
+ :images => {},
82
+ :servers => {}
83
+ }
84
+ end
85
+ end
86
+
87
+ def self.reset
88
+ @data = nil
89
+ end
90
+
91
+ def self.reset_data(keys=data.keys)
92
+ for key in [*keys]
93
+ data.delete(key)
94
+ end
95
+ end
96
+
97
+ def initialize(options = {})
98
+ @storm_on_demand_username = options[:storm_on_demand_username]
99
+ end
100
+
101
+ def data
102
+ self.class.data[@storm_on_demand_username]
103
+ end
104
+
105
+ def reset_data
106
+ self.class.data.delete(@storm_on_demand_username)
107
+ end
108
+ end
109
+
110
+ class Real
111
+ include Fog::StormOnDemand::Shared
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Config < Fog::Model
5
+ identity :id
6
+
7
+ attribute :active
8
+ attribute :available
9
+ attribute :category
10
+ attribute :cpu_cores
11
+ attribute :cpu_count
12
+ attribute :cpu_hyperthreading
13
+ attribute :cpu_model
14
+ attribute :cpu_speed
15
+ attribute :description
16
+ attribute :disk
17
+ attribute :disk_count
18
+ attribute :disk_total
19
+ attribute :disk_type
20
+ attribute :featured
21
+ attribute :memory
22
+ attribute :raid_level
23
+ attribute :ram_available
24
+ attribute :ram_total
25
+ attribute :price
26
+ attribute :vcpu
27
+ attribute :zone_availability
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,19 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Configs < Fog::Collection
5
+ model Fog::Compute::StormOnDemand::Config
6
+
7
+ def all(options = {})
8
+ data = service.list_configs(options).body['items']
9
+ load(data)
10
+ end
11
+
12
+ def get(config_id)
13
+ data = service.get_config_details(:id => config_id).body
14
+ new(data)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,35 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Image < Fog::Model
5
+ identity :id
6
+ attribute :accnt
7
+ attribute :features
8
+ attribute :hv_type
9
+ attribute :name
10
+ attribute :source_hostname
11
+ attribute :source_uniq_id
12
+ attribute :template
13
+ attribute :template_description
14
+ attribute :time_taken
15
+
16
+ def destroy
17
+ requires :identity
18
+ service.delete_image(:id => identity)
19
+ true
20
+ end
21
+
22
+ def update(options = {})
23
+ requires :identity
24
+ service.update_image({:id => identity}.merge!(options)).body
25
+ end
26
+
27
+ def restore(options = {})
28
+ requires :identity
29
+ service.restore_image({:id => identity}.merge!(options))
30
+ true
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Images < Fog::Collection
5
+ model Fog::Compute::StormOnDemand::Image
6
+
7
+ def create(options = {})
8
+ service.create_image(options)
9
+ true
10
+ end
11
+
12
+ def get(image_id)
13
+ img = service.get_image_details(:id => image_id).body
14
+ new(img)
15
+ end
16
+
17
+ def all(options = {})
18
+ data = service.list_images(options).body['items']
19
+ load(data)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Notification < Fog::Model
5
+ identity :id
6
+ attribute :category
7
+ attribute :description
8
+ attribute :enddate
9
+ attribute :last_alert
10
+ attribute :modifieddate
11
+ attribute :resolved
12
+ attribute :severity
13
+ attribute :startdate
14
+ attribute :system
15
+ attribute :system_identifier
16
+ attribute :uniq_id
17
+
18
+ def resolve
19
+ requires :identity
20
+ service.resolve_notification(:id => identity).body
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Notifications < Fog::Collection
5
+ model Fog::Compute::StormOnDemand::Notification
6
+
7
+ def all(options = {})
8
+ data = service.list_notifications(options).body['items']
9
+ load(data)
10
+ end
11
+
12
+ def current(options = {})
13
+ data = service.current_notifications(options).body['items']
14
+ load(data)
15
+ end
16
+
17
+ def get(options)
18
+ data = service.get_notification(options).body
19
+ new(data)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,31 @@
1
+ module Fog
2
+ module Compute
3
+ class StormOnDemand
4
+ class Product < Fog::Model
5
+ identity :code
6
+ attribute :alias
7
+ attribute :capabilities
8
+ attribute :categories
9
+ attribute :cycle
10
+ attribute :default_price
11
+ attribute :description
12
+ attribute :features
13
+ attribute :options
14
+ attribute :parent_product
15
+ attribute :prices
16
+ attribute :related_product
17
+ attribute :series
18
+
19
+ def price(options)
20
+ requires :identity
21
+ service.get_product_price({:code => identity}.merge!(options)).body
22
+ end
23
+
24
+ def starting_price
25
+ requires :identity
26
+ service.get_product_starting_price(:code => identity).body['items']
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end