fog 1.32.0 → 1.33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +59 -0
  3. data/Gemfile +1 -0
  4. data/Rakefile +4 -4
  5. data/fog.gemspec +3 -2
  6. data/lib/fog/linode/requests/compute/avail_datacenters.rb +8 -7
  7. data/lib/fog/openstack.rb +1 -0
  8. data/lib/fog/openstack/compute.rb +7 -1
  9. data/lib/fog/openstack/core.rb +28 -54
  10. data/lib/fog/openstack/identity.rb +1 -0
  11. data/lib/fog/openstack/identity_v3.rb +10 -9
  12. data/lib/fog/openstack/models/baremetal/chassis.rb +3 -14
  13. data/lib/fog/openstack/models/baremetal/chassis_collection.rb +5 -5
  14. data/lib/fog/openstack/models/baremetal/driver.rb +2 -8
  15. data/lib/fog/openstack/models/baremetal/drivers.rb +3 -5
  16. data/lib/fog/openstack/models/baremetal/node.rb +3 -14
  17. data/lib/fog/openstack/models/baremetal/nodes.rb +4 -4
  18. data/lib/fog/openstack/models/baremetal/port.rb +3 -14
  19. data/lib/fog/openstack/models/baremetal/ports.rb +4 -4
  20. data/lib/fog/openstack/models/collection.rb +45 -0
  21. data/lib/fog/openstack/models/compute/address.rb +2 -2
  22. data/lib/fog/openstack/models/compute/addresses.rb +3 -5
  23. data/lib/fog/openstack/models/compute/aggregate.rb +2 -8
  24. data/lib/fog/openstack/models/compute/aggregates.rb +3 -5
  25. data/lib/fog/openstack/models/compute/availability_zone.rb +14 -0
  26. data/lib/fog/openstack/models/compute/availability_zones.rb +22 -0
  27. data/lib/fog/openstack/models/compute/flavor.rb +2 -8
  28. data/lib/fog/openstack/models/compute/flavors.rb +6 -6
  29. data/lib/fog/openstack/models/compute/host.rb +1 -1
  30. data/lib/fog/openstack/models/compute/hosts.rb +4 -6
  31. data/lib/fog/openstack/models/compute/image.rb +2 -8
  32. data/lib/fog/openstack/models/compute/images.rb +4 -6
  33. data/lib/fog/openstack/models/compute/key_pair.rb +2 -2
  34. data/lib/fog/openstack/models/compute/key_pairs.rb +3 -4
  35. data/lib/fog/openstack/models/compute/metadata.rb +3 -2
  36. data/lib/fog/openstack/models/compute/metadatum.rb +2 -2
  37. data/lib/fog/openstack/models/compute/network.rb +2 -2
  38. data/lib/fog/openstack/models/compute/networks.rb +3 -2
  39. data/lib/fog/openstack/models/compute/security_group.rb +2 -2
  40. data/lib/fog/openstack/models/compute/security_group_rule.rb +2 -2
  41. data/lib/fog/openstack/models/compute/security_group_rules.rb +2 -2
  42. data/lib/fog/openstack/models/compute/security_groups.rb +3 -5
  43. data/lib/fog/openstack/models/compute/server.rb +20 -1
  44. data/lib/fog/openstack/models/compute/servers.rb +9 -5
  45. data/lib/fog/openstack/models/compute/service.rb +2 -8
  46. data/lib/fog/openstack/models/compute/services.rb +4 -4
  47. data/lib/fog/openstack/models/compute/snapshot.rb +2 -8
  48. data/lib/fog/openstack/models/compute/snapshots.rb +5 -5
  49. data/lib/fog/openstack/models/compute/tenant.rb +2 -2
  50. data/lib/fog/openstack/models/compute/tenants.rb +3 -4
  51. data/lib/fog/openstack/models/compute/volume.rb +2 -8
  52. data/lib/fog/openstack/models/compute/volumes.rb +5 -5
  53. data/lib/fog/openstack/models/identity_v2/ec2_credential.rb +3 -9
  54. data/lib/fog/openstack/models/identity_v2/ec2_credentials.rb +3 -5
  55. data/lib/fog/openstack/models/identity_v2/role.rb +3 -3
  56. data/lib/fog/openstack/models/identity_v2/roles.rb +3 -5
  57. data/lib/fog/openstack/models/identity_v2/tenant.rb +5 -9
  58. data/lib/fog/openstack/models/identity_v2/tenants.rb +3 -5
  59. data/lib/fog/openstack/models/identity_v2/user.rb +2 -8
  60. data/lib/fog/openstack/models/identity_v2/users.rb +3 -5
  61. data/lib/fog/openstack/models/identity_v3/domain.rb +5 -9
  62. data/lib/fog/openstack/models/identity_v3/domains.rb +3 -5
  63. data/lib/fog/openstack/models/identity_v3/endpoint.rb +5 -9
  64. data/lib/fog/openstack/models/identity_v3/endpoints.rb +3 -5
  65. data/lib/fog/openstack/models/identity_v3/group.rb +5 -9
  66. data/lib/fog/openstack/models/identity_v3/groups.rb +3 -5
  67. data/lib/fog/openstack/models/identity_v3/os_credential.rb +3 -3
  68. data/lib/fog/openstack/models/identity_v3/os_credentials.rb +3 -5
  69. data/lib/fog/openstack/models/identity_v3/policies.rb +3 -5
  70. data/lib/fog/openstack/models/identity_v3/policy.rb +5 -9
  71. data/lib/fog/openstack/models/identity_v3/project.rb +5 -8
  72. data/lib/fog/openstack/models/identity_v3/projects.rb +21 -10
  73. data/lib/fog/openstack/models/identity_v3/role.rb +3 -8
  74. data/lib/fog/openstack/models/identity_v3/role_assignment.rb +3 -3
  75. data/lib/fog/openstack/models/identity_v3/role_assignments.rb +3 -5
  76. data/lib/fog/openstack/models/identity_v3/roles.rb +3 -5
  77. data/lib/fog/openstack/models/identity_v3/service.rb +3 -3
  78. data/lib/fog/openstack/models/identity_v3/services.rb +3 -5
  79. data/lib/fog/openstack/models/identity_v3/token.rb +3 -3
  80. data/lib/fog/openstack/models/identity_v3/tokens.rb +3 -3
  81. data/lib/fog/openstack/models/identity_v3/user.rb +3 -9
  82. data/lib/fog/openstack/models/identity_v3/users.rb +3 -5
  83. data/lib/fog/openstack/models/image/image.rb +2 -13
  84. data/lib/fog/openstack/models/image/images.rb +5 -5
  85. data/lib/fog/openstack/models/metering/resource.rb +2 -7
  86. data/lib/fog/openstack/models/metering/resources.rb +3 -3
  87. data/lib/fog/openstack/models/model.rb +44 -0
  88. data/lib/fog/openstack/models/network/floating_ip.rb +2 -7
  89. data/lib/fog/openstack/models/network/floating_ips.rb +3 -5
  90. data/lib/fog/openstack/models/network/lb_health_monitor.rb +2 -12
  91. data/lib/fog/openstack/models/network/lb_health_monitors.rb +3 -5
  92. data/lib/fog/openstack/models/network/lb_member.rb +2 -12
  93. data/lib/fog/openstack/models/network/lb_members.rb +3 -5
  94. data/lib/fog/openstack/models/network/lb_pool.rb +2 -12
  95. data/lib/fog/openstack/models/network/lb_pools.rb +3 -5
  96. data/lib/fog/openstack/models/network/lb_vip.rb +2 -12
  97. data/lib/fog/openstack/models/network/lb_vips.rb +3 -5
  98. data/lib/fog/openstack/models/network/network.rb +2 -12
  99. data/lib/fog/openstack/models/network/networks.rb +3 -5
  100. data/lib/fog/openstack/models/network/port.rb +2 -13
  101. data/lib/fog/openstack/models/network/ports.rb +3 -5
  102. data/lib/fog/openstack/models/network/router.rb +2 -13
  103. data/lib/fog/openstack/models/network/routers.rb +3 -5
  104. data/lib/fog/openstack/models/network/security_group.rb +2 -2
  105. data/lib/fog/openstack/models/network/security_group_rule.rb +2 -2
  106. data/lib/fog/openstack/models/network/security_group_rules.rb +3 -5
  107. data/lib/fog/openstack/models/network/security_groups.rb +3 -5
  108. data/lib/fog/openstack/models/network/subnet.rb +3 -14
  109. data/lib/fog/openstack/models/network/subnets.rb +3 -5
  110. data/lib/fog/openstack/models/orchestration/event.rb +2 -2
  111. data/lib/fog/openstack/models/orchestration/events.rb +5 -7
  112. data/lib/fog/openstack/models/orchestration/resource.rb +2 -2
  113. data/lib/fog/openstack/models/orchestration/resource_schemas.rb +2 -2
  114. data/lib/fog/openstack/models/orchestration/resources.rb +3 -5
  115. data/lib/fog/openstack/models/orchestration/stack.rb +3 -7
  116. data/lib/fog/openstack/models/orchestration/stacks.rb +5 -5
  117. data/lib/fog/openstack/models/orchestration/template.rb +2 -2
  118. data/lib/fog/openstack/models/orchestration/templates.rb +1 -1
  119. data/lib/fog/openstack/models/planning/plan.rb +2 -13
  120. data/lib/fog/openstack/models/planning/plans.rb +3 -5
  121. data/lib/fog/openstack/models/planning/role.rb +2 -8
  122. data/lib/fog/openstack/models/planning/roles.rb +3 -6
  123. data/lib/fog/openstack/models/storage/directories.rb +4 -6
  124. data/lib/fog/openstack/models/storage/directory.rb +2 -2
  125. data/lib/fog/openstack/models/storage/file.rb +15 -2
  126. data/lib/fog/openstack/models/storage/files.rb +7 -8
  127. data/lib/fog/openstack/models/volume/availability_zone.rb +13 -0
  128. data/lib/fog/openstack/models/volume/availability_zones.rb +17 -0
  129. data/lib/fog/openstack/models/volume/transfer.rb +36 -0
  130. data/lib/fog/openstack/models/volume/transfers.rb +38 -0
  131. data/lib/fog/openstack/models/volume/volume.rb +9 -8
  132. data/lib/fog/openstack/models/volume/volume_type.rb +2 -8
  133. data/lib/fog/openstack/models/volume/volume_types.rb +3 -6
  134. data/lib/fog/openstack/models/volume/volumes.rb +5 -6
  135. data/lib/fog/openstack/requests/compute/list_servers.rb +8 -5
  136. data/lib/fog/openstack/requests/compute/list_servers_detail.rb +9 -6
  137. data/lib/fog/openstack/requests/compute/list_zones.rb +6 -5
  138. data/lib/fog/openstack/requests/compute/list_zones_detailed.rb +55 -0
  139. data/lib/fog/openstack/requests/compute/shelve_offload_server.rb +24 -0
  140. data/lib/fog/openstack/requests/compute/shelve_server.rb +24 -0
  141. data/lib/fog/openstack/requests/compute/unshelve_server.rb +24 -0
  142. data/lib/fog/openstack/requests/identity_v3/get_project.rb +2 -2
  143. data/lib/fog/openstack/requests/network/create_subnet.rb +1 -1
  144. data/lib/fog/openstack/requests/network/update_subnet.rb +8 -7
  145. data/lib/fog/openstack/requests/volume/accept_transfer.rb +24 -0
  146. data/lib/fog/openstack/requests/volume/create_transfer.rb +27 -0
  147. data/lib/fog/openstack/requests/volume/delete_transfer.rb +17 -0
  148. data/lib/fog/openstack/requests/volume/extend_volume.rb +25 -0
  149. data/lib/fog/openstack/requests/volume/get_transfer_details.rb +17 -0
  150. data/lib/fog/openstack/requests/volume/list_transfers.rb +18 -0
  151. data/lib/fog/openstack/requests/volume/list_transfers_detailed.rb +18 -0
  152. data/lib/fog/openstack/requests/volume/list_zones.rb +32 -0
  153. data/lib/fog/openstack/storage.rb +3 -1
  154. data/lib/fog/openstack/volume.rb +16 -0
  155. data/lib/fog/rackspace/examples/compute_v2/create_network.rb +1 -1
  156. data/lib/fog/vcloud_director/generators/compute/edge_gateway_service_configuration.rb +31 -30
  157. data/lib/fog/vcloud_director/models/compute/task.rb +2 -2
  158. data/lib/fog/version.rb +1 -1
  159. data/lib/fog/vsphere/compute.rb +1 -0
  160. data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +1 -1
  161. data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +4 -3
  162. data/lib/fog/vsphere/requests/compute/list_clusters.rb +1 -1
  163. data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +2 -2
  164. data/lib/fog/vsphere/requests/compute/vm_clone.rb +101 -30
  165. data/lib/fog/vsphere/requests/compute/vm_execute.rb +47 -0
  166. data/lib/tasks/changelog_task.rb +1 -0
  167. data/spec/fog/openstack/identity_v3/{idv3.yml → common_setup.yml} +0 -0
  168. data/spec/fog/openstack/identity_v3/idv3_project_hier_crud_list.yml +1394 -0
  169. data/spec/fog/openstack/identity_v3_spec.rb +255 -196
  170. data/spec/fog/openstack/network/common_setup.yml +131 -0
  171. data/spec/fog/openstack/network/subnets_crud.yml +140 -0
  172. data/spec/fog/openstack/network_spec.rb +43 -0
  173. data/spec/fog/openstack/shared_context.rb +98 -0
  174. data/spec/fog/openstack/volume/{volume_common_setup.yml → common_setup.yml} +0 -0
  175. data/spec/fog/openstack/volume/volume_extend.yml +762 -0
  176. data/spec/fog/openstack/volume/volume_transfer_and_accept.yml +1078 -0
  177. data/spec/fog/openstack/volume/volume_transfer_and_delete.yml +695 -0
  178. data/spec/fog/openstack/volume_spec.rb +232 -67
  179. data/tests/openstack/models/storage/file_tests.rb +26 -0
  180. data/tests/openstack/requests/compute/availability_zone_tests.rb +18 -0
  181. data/tests/openstack/requests/compute/server_tests.rb +12 -0
  182. data/tests/openstack/requests/network/subnet_tests.rb +2 -2
  183. data/tests/openstack/requests/volume/availability_zone_tests.rb +13 -0
  184. data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +2 -2
  185. metadata +61 -26
  186. data/lib/fog/dynect.rb +0 -1
  187. data/lib/fog/dynect/core.rb +0 -26
  188. data/lib/fog/dynect/dns.rb +0 -157
  189. data/lib/fog/dynect/models/dns/record.rb +0 -67
  190. data/lib/fog/dynect/models/dns/records.rb +0 -48
  191. data/lib/fog/dynect/models/dns/zone.rb +0 -56
  192. data/lib/fog/dynect/models/dns/zones.rb +0 -25
  193. data/lib/fog/dynect/requests/dns/delete_record.rb +0 -55
  194. data/lib/fog/dynect/requests/dns/delete_zone.rb +0 -41
  195. data/lib/fog/dynect/requests/dns/get_all_records.rb +0 -56
  196. data/lib/fog/dynect/requests/dns/get_node_list.rb +0 -55
  197. data/lib/fog/dynect/requests/dns/get_record.rb +0 -83
  198. data/lib/fog/dynect/requests/dns/get_zone.rb +0 -57
  199. data/lib/fog/dynect/requests/dns/post_record.rb +0 -71
  200. data/lib/fog/dynect/requests/dns/post_session.rb +0 -43
  201. data/lib/fog/dynect/requests/dns/post_zone.rb +0 -70
  202. data/lib/fog/dynect/requests/dns/put_record.rb +0 -76
  203. data/lib/fog/dynect/requests/dns/put_zone.rb +0 -76
  204. data/tests/dynect/requests/dns/dns_tests.rb +0 -258
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7801c7c007b8ade9b3db8b3adbcccce77483a544
4
- data.tar.gz: f4b0c047843cc79f845badafc9afeb2e9ba04167
3
+ metadata.gz: 54e5d06378a8bcb46784753de3c7fa8f8252e196
4
+ data.tar.gz: f3b2c0a9ae87d177341e3eff3b291a8e832eae02
5
5
  SHA512:
6
- metadata.gz: 444572699a31be8229aca465659aaabc11ddf16d81bfd103914561a82e11dc55f43ab57a2e254fd986eb53dbe4ef3b1f30dc9be25bc4ac09dded50eceb73dbc6
7
- data.tar.gz: e74522ce110047b1f7bdeb6e4ae263ff5854fd4741d6af224dbded8046543196d26986cbb6e5d7b33717ed1ef848abb9bfac5932ca52f13f6490a2b6cc6909ad
6
+ metadata.gz: 155cc3a6c109f0b7097c0a0a9576c77377b188c37b62137f0b17110659926695db1d8120765c55f75188a1dfef012ac62bc8bdaf5cf059451cb14551afbbe771
7
+ data.tar.gz: 9354b948a15c1b36c53b18b34f6abb74a01aad171494885dbd8f8f961432803f66b5a879ccb2de87d035365b435436fd29db5961a86153079cd7a654d765113b
@@ -1,3 +1,62 @@
1
+ ## 1.33.0 08/12/2015
2
+ *Hash* 514fb792da07e6c5beaf4b735ea944fa873483f0
3
+
4
+ Statistic | Value
5
+ ------------- | --------:
6
+ Collaborators | 2
7
+ Downloads | 11035171
8
+ Forks | 1472
9
+ Open Issues | 78
10
+ Watchers | 3573
11
+
12
+ **MVP!** Darren Hague
13
+
14
+ #### [Dynect]
15
+ * Extract Dynect DNS provider to fog-dynect. thanks Glenn Pratt
16
+
17
+ #### [misc]
18
+ * vCloud Director queued tasks should not count as "non_running". thanks Adam Leff
19
+ * Add execute request. thanks Alan Sebastian
20
+ * Fix comment: 5mins = 300s. thanks Andrew Langhorn
21
+ * Allow real OpenStack storage adapter to take :openstack_management_url option. thanks Danny Guinther
22
+ * [openstack][Storage] Added the delete_at and delete_after flags. thanks Francesco Vollero
23
+ * Vsphere - customizing interfaces and disks when cloning from template. thanks as
24
+ * Add support for multiple VPN tunnels. thanks Josh Myers
25
+ * Adding Openstack Collection base class. thanks Ladislav Smola
26
+ * Openstack Model base class. thanks Ladislav Smola
27
+ * Fog::OpenStack::Model base class for all openstack models. thanks Ladislav Smola
28
+ * Fog::OpenStack::Collection base class for all openstack collections. thanks Ladislav Smola
29
+ * OpenStack compute add full support of availability zones. thanks Ladislav Smola
30
+ * OpenStack servers list options fix. thanks Ladislav Smola
31
+ * Adding OpenStack volume availability_zones. thanks Ladislav Smola
32
+ * OpenStack compute add shelve related actions. thanks Ladislav Smola
33
+ * Add missing require of identitty v3. thanks Ladislav Smola
34
+ * update Linode avail_datacenters mock results. thanks Marques Johansson
35
+ * add extend_volume request to Fog::Volume::OpenStack. thanks Stefan Majewsky
36
+ * fucking 1.8.7. thanks Stefan Majewsky
37
+ * fix test run on JRuby. thanks Stefan Majewsky
38
+ * Use traverse to get resource pools, fixes #3579. thanks alan
39
+ * Fix nested folders in get virtual machine. thanks alan
40
+ * Intermediate foldes in DC/Cluster tree. thanks slivik
41
+
42
+ #### [openstack]
43
+ * Allow the auth_token to be overridden (e.g. with the admin token from keystone.conf). thanks Darren Hague
44
+ * Deal with Compute 'server details' returning null user_data. thanks Darren Hague
45
+ * Add support for hierarchical projects. thanks Darren Hague
46
+ * Add test for subnet creation. thanks Darren Hague
47
+ * Add tests for subtree_as_list and parents_as_list in hierarchical projects. thanks Darren Hague
48
+ * hierarchical projects: subtree_as_list and parents_as_list - set subtree and parents attributes as Array of Project instead of Array of Hash. thanks Darren Hague
49
+ * hierarchical projects: Add test to check that a newly added subproject appears in a top-level project's list. thanks Darren Hague
50
+ * Refactoring to avoid having to copy/paste openstack options to/from instance variables. thanks Darren Hague
51
+ * fix subnet update & create regarding to empty vanilla options, add allocation_pools option. thanks Maurice Schreiber
52
+ * mock create subnet array options. thanks Maurice Schreiber
53
+ * fix broken subnet test. thanks Maurice Schreiber
54
+ * reduce code duplication between specs. thanks Stefan Majewsky
55
+ * fix test run so that the volume_spec.rb is actually run. thanks Stefan Majewsky
56
+ * reduce code duplication in volume spec... thanks Stefan Majewsky
57
+ * add volume transfer models/requests. thanks Stefan Majewsky
58
+
59
+
1
60
  ## 1.32.0 07/02/2015
2
61
  *Hash* 3339ba764f099c1fab8c989510c427ac65dabeca
3
62
 
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ group :development, :test do
4
4
  # This is here because gemspec doesn't support require: false
5
5
  gem "netrc", :require => false
6
6
  gem "octokit", :require => false
7
+ gem 'rspec', :require => false
7
8
  end
8
9
 
9
10
  gemspec
data/Rakefile CHANGED
@@ -54,7 +54,7 @@ end
54
54
 
55
55
  GEM_NAME = "#{name}"
56
56
  task :default => :test
57
- task :travis => ['test', 'test:travis', 'test:openstack_idv3']
57
+ task :travis => ['test', 'test:travis', 'test:openstack_specs']
58
58
 
59
59
  Rake::TestTask.new do |t|
60
60
  t.pattern = File.join("spec", "**", "*_spec.rb")
@@ -63,10 +63,10 @@ end
63
63
 
64
64
  namespace :test do
65
65
  mock = ENV['FOG_MOCK'] || 'true'
66
- task :openstack_idv3 do
67
- sh("export FOG_MOCK=false && bundle exec rspec spec/fog/openstack/identity_v3_spec.rb")
66
+ task :openstack_specs do
67
+ sh("export FOG_MOCK=false && bundle exec rspec spec/fog/openstack/*_spec.rb")
68
68
  end
69
- task :travis => [:openstack_idv3] do
69
+ task :travis => [:openstack_specs] do
70
70
  sh("export FOG_MOCK=#{mock} && bundle exec shindont")
71
71
  end
72
72
  task :vsphere do
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  ## If your rubyforge_project name is different, then edit it and comment out
12
12
  ## the sub! line in the Rakefile
13
13
  s.name = "fog"
14
- s.version = "1.32.0"
15
- s.date = "2015-07-02"
14
+ s.version = "1.33.0"
15
+ s.date = "2015-08-12"
16
16
  s.rubyforge_project = "fog"
17
17
 
18
18
  ## Make sure your summary is short. The description may be as long
@@ -55,6 +55,7 @@ Gem::Specification.new do |s|
55
55
  s.add_dependency("fog-atmos")
56
56
  s.add_dependency("fog-aws", ">= 0.6.0")
57
57
  s.add_dependency("fog-brightbox", "~> 0.4")
58
+ s.add_dependency("fog-dynect")
58
59
  s.add_dependency("fog-ecloud", "= 0.1.1")
59
60
  s.add_dependency("fog-google", ">= 0.0.2")
60
61
  s.add_dependency("fog-local")
@@ -24,13 +24,14 @@ module Fog
24
24
  response.body = {
25
25
  "ERRORARRAY" => [],
26
26
  "DATA" => [
27
- { "LOCATION" => "Dallas, TX, USA", "DATACENTERID" => 2 },
28
- { "LOCATION" => "Fremont, CA, USA", "DATACENTERID" => 3 },
29
- { "LOCATION" => "Atlanta, GA, USA", "DATACENTERID" => 4 },
30
- { "LOCATION" => "Newark, NJ, USA", "DATACENTERID" => 6 },
31
- { "LOCATION" => "London, England, UK", "DATACENTERID" => 7 },
32
- { "LOCATION" => "Tokyo, JP", "DATACENTERID" => 8 },
33
- { "LOCATION" => "Singapore, SGP", "DATACENTERID" => 9 },
27
+ { "LOCATION" => "Dallas, TX, USA", "DATACENTERID" => 2, "ABBR" => "dallas" },
28
+ { "LOCATION" => "Fremont, CA, USA", "DATACENTERID" => 3, "ABBR" => "fremont" },
29
+ { "LOCATION" => "Atlanta, GA, USA", "DATACENTERID" => 4, "ABBR" => "atlanta" },
30
+ { "LOCATION" => "Newark, NJ, USA", "DATACENTERID" => 6, "ABBR" => "newark" },
31
+ { "LOCATION" => "London, England, UK", "DATACENTERID" => 7, "ABBR" => "london" },
32
+ { "LOCATION" => "Tokyo, JP", "DATACENTERID" => 8, "ABBR" => "tokyo" },
33
+ { "LOCATION" => "Singapore, SGP", "DATACENTERID" => 9, "ABBR" => "singapore" },
34
+ { "LOCATION" => "Frankfurt, DE", "DATACENTERID" => 10, "ABBR" => "frankfurt" },
34
35
  ],
35
36
  "ACTION" => "avail.datacenters"
36
37
  }
@@ -1,5 +1,6 @@
1
1
  require 'fog/openstack/compute'
2
2
  require 'fog/openstack/identity_v2'
3
+ require 'fog/openstack/identity_v3'
3
4
  require 'fog/openstack/image'
4
5
  require 'fog/openstack/metering'
5
6
  require 'fog/openstack/network'
@@ -19,6 +19,8 @@ module Fog
19
19
  model_path 'fog/openstack/models/compute'
20
20
  model :aggregate
21
21
  collection :aggregates
22
+ model :availability_zone
23
+ collection :availability_zones
22
24
  model :server
23
25
  collection :servers
24
26
  model :service
@@ -62,7 +64,7 @@ module Fog
62
64
  request :add_aggregate_host
63
65
  request :remove_aggregate_host
64
66
  request :delete_aggregate
65
-
67
+
66
68
  # Server CRUD
67
69
  request :list_servers
68
70
  request :list_servers_detail
@@ -94,6 +96,9 @@ module Fog
94
96
  request :reset_server_state
95
97
  request :add_security_group
96
98
  request :remove_security_group
99
+ request :shelve_server
100
+ request :unshelve_server
101
+ request :shelve_offload_server
97
102
 
98
103
  # Server Extenstions
99
104
  request :get_console_output
@@ -208,6 +213,7 @@ module Fog
208
213
 
209
214
  # Zones
210
215
  request :list_zones
216
+ request :list_zones_detailed
211
217
 
212
218
  class Mock
213
219
  attr_reader :auth_token
@@ -40,6 +40,8 @@ module Fog
40
40
  new_error
41
41
  end
42
42
  end
43
+
44
+ class InterfaceNotImplemented < Fog::Errors::Error; end
43
45
  end
44
46
 
45
47
  service(:compute , 'Compute')
@@ -57,6 +59,7 @@ module Fog
57
59
  attr_reader :auth_token
58
60
  attr_reader :auth_token_expiration
59
61
  attr_reader :current_user
62
+ attr_reader :current_user_id
60
63
  attr_reader :current_tenant
61
64
  attr_reader :openstack_domain_name
62
65
  attr_reader :openstack_user_domain
@@ -66,38 +69,19 @@ module Fog
66
69
  attr_reader :openstack_project_domain_id
67
70
 
68
71
  def initialize_identity options
69
- @openstack_auth_token = options[:openstack_auth_token]
70
- @auth_token ||= options[:openstack_auth_token]
71
- @openstack_identity_public_endpoint = options[:openstack_identity_endpoint]
72
-
73
- @openstack_username = options[:openstack_username]
74
- @openstack_userid = options[:openstack_userid]
75
-
76
- @openstack_domain_name = options[:openstack_domain_name]
77
- @openstack_user_domain = options[:openstack_user_domain]
78
- @openstack_project_domain = options[:openstack_project_domain]
79
- @openstack_domain_id = options[:openstack_domain_id]
80
- @openstack_user_domain_id = options[:openstack_user_domain_id]
81
- @openstack_project_domain_id = options[:openstack_project_domain_id]
72
+ # Create @openstack_* instance variables from all :openstack_* options
73
+ options.select{|x|x.to_s.start_with? 'openstack'}.each do |openstack_param, value|
74
+ instance_variable_set "@#{openstack_param}".to_sym, value
75
+ end
82
76
 
83
- @openstack_project_name = options[:openstack_project_name]
84
- @openstack_tenant = options[:openstack_tenant]
85
- @openstack_tenant_id = options[:openstack_tenant_id]
77
+ @auth_token ||= options[:openstack_auth_token]
86
78
 
87
79
  @openstack_auth_uri = URI.parse(options[:openstack_auth_url])
88
-
89
- @openstack_management_url = options[:openstack_management_url]
90
-
91
80
  @openstack_must_reauthenticate = false
92
-
93
81
  @openstack_endpoint_type = options[:openstack_endpoint_type] || 'publicURL'
94
- @openstack_region = options[:openstack_region]
95
82
 
96
83
  unless @auth_token
97
84
  missing_credentials = Array.new
98
- @openstack_api_key = options[:openstack_api_key]
99
- @openstack_username = options[:openstack_username]
100
- @openstack_userid = options[:openstack_userid]
101
85
 
102
86
  missing_credentials << :openstack_api_key unless @openstack_api_key
103
87
  unless @openstack_username || @openstack_userid
@@ -107,55 +91,45 @@ module Fog
107
91
  end
108
92
 
109
93
  @current_user = options[:current_user]
94
+ @current_user_id = options[:current_user_id]
110
95
  @current_tenant = options[:current_tenant]
111
96
 
112
97
  end
113
98
 
114
99
  def credentials
115
- { :provider => 'openstack',
116
- :openstack_domain_name => @openstack_domain_name,
117
- :openstack_user_domain => @openstack_user_domain,
118
- :openstack_project_domain => @openstack_project_domain,
119
- :openstack_domain_id => @openstack_domain_id,
120
- :openstack_user_domain_id => @openstack_user_domain_id,
121
- :openstack_project_domain_id => @openstack_project_domain_id,
100
+ options = { :provider => 'openstack',
122
101
  :openstack_auth_url => @openstack_auth_uri.to_s,
123
102
  :openstack_auth_token => @auth_token,
124
- :openstack_management_url => @openstack_management_url,
125
103
  :openstack_identity_endpoint => @openstack_identity_public_endpoint,
126
- :openstack_region => @openstack_region,
127
104
  :current_user => @current_user,
105
+ :current_user_id => @current_user_id,
128
106
  :current_tenant => @current_tenant }
107
+ openstack_options.merge options
129
108
  end
130
109
 
131
110
  private
111
+
112
+ def openstack_options
113
+ options={}
114
+ # Create a hash of (:openstack_*, value) of all the @openstack_* instance variables
115
+ self.instance_variables.select{|x|x.to_s.start_with? '@openstack'}.each do |openstack_param|
116
+ option_name = openstack_param.to_s[1..-1]
117
+ options[option_name.to_sym] = instance_variable_get openstack_param
118
+ end
119
+ options
120
+ end
121
+
132
122
  def authenticate
133
123
  if !@openstack_management_url || @openstack_must_reauthenticate
134
- options = {
135
- :openstack_tenant => @openstack_tenant,
136
- :openstack_tenant_id => @openstack_tenant_id,
137
- :openstack_api_key => @openstack_api_key,
138
- :openstack_username => @openstack_username,
139
- :openstack_userid => @openstack_userid,
140
- :openstack_user_domain => @openstack_user_domain,
141
- :openstack_project_domain => @openstack_project_domain,
142
- :openstack_user_domain_id => @openstack_user_domain_id,
143
- :openstack_project_domain_id => @openstack_project_domain_id,
144
- :openstack_domain_name => @openstack_domain_name,
145
- :openstack_project_name => @openstack_project_name,
146
- :openstack_domain_id => @openstack_domain_id,
147
- :openstack_project_id => @openstack_project_id,
148
- :openstack_auth_uri => @openstack_auth_uri,
149
- :openstack_auth_token => @openstack_must_reauthenticate ? nil : @openstack_auth_token,
150
- :openstack_service_type => @openstack_service_type,
151
- :openstack_service_name => @openstack_service_name,
152
- :openstack_endpoint_type => @openstack_endpoint_type,
153
- :openstack_region => @openstack_region
154
- }
124
+
125
+ options = openstack_options
126
+
127
+ options[:openstack_auth_token] = @openstack_must_reauthenticate ? nil : @openstack_auth_token
155
128
 
156
129
  credentials = Fog::OpenStack.authenticate(options, @connection_options)
157
130
 
158
131
  @current_user = credentials[:user]
132
+ @current_user_id = credentials[:current_user_id]
159
133
  @current_tenant = credentials[:tenant]
160
134
 
161
135
  @openstack_must_reauthenticate = false
@@ -44,6 +44,7 @@ module Fog
44
44
  credentials = Fog::OpenStack.authenticate(options, @connection_options)
45
45
 
46
46
  @current_user = credentials[:user]
47
+ @current_user_id = credentials[:current_user_id]
47
48
  @current_tenant = credentials[:tenant]
48
49
 
49
50
  @openstack_must_reauthenticate = false
@@ -13,7 +13,7 @@ module Fog
13
13
  :openstack_user_domain, :openstack_project_domain,
14
14
  :openstack_user_domain_id, :openstack_project_domain_id,
15
15
  :openstack_api_key, :openstack_current_user_id, :openstack_userid, :openstack_username,
16
- :current_user, :current_tenant,
16
+ :current_user, :current_user_id, :current_tenant,
17
17
  :provider
18
18
 
19
19
  model_path 'fog/openstack/models/identity_v3'
@@ -149,9 +149,10 @@ module Fog
149
149
 
150
150
  class Real
151
151
  attr_reader :current_user
152
+ attr_reader :current_user_id
152
153
  attr_reader :current_tenant
153
154
  attr_reader :unscoped_token
154
- attr_reader :auth_token
155
+ attr_accessor :auth_token
155
156
 
156
157
  include Fog::Identity::OpenStack::Common
157
158
  include Fog::OpenStack::Core
@@ -182,13 +183,13 @@ module Fog
182
183
  retried = false
183
184
  begin
184
185
  response = @connection.request(params.merge({
185
- :headers => {
186
- 'Content-Type' => 'application/json',
187
- 'Accept' => 'application/json',
188
- 'X-Auth-Token' => @auth_token
189
- }.merge!(params[:headers] || {}),
190
- :path => "#{@path}/#{params[:path]}" #,
191
- }))
186
+ :headers => params.fetch(:headers,{}).merge({
187
+ 'Content-Type' => 'application/json',
188
+ 'Accept' => 'application/json',
189
+ 'X-Auth-Token' => @auth_token
190
+ }),
191
+ :path => "#{@path}/#{params[:path]}"
192
+ }))
192
193
  rescue Excon::Errors::Unauthorized => error
193
194
  raise if retried
194
195
  retried = true
@@ -1,9 +1,9 @@
1
- require 'fog/core/model'
1
+ require 'fog/openstack/models/model'
2
2
 
3
3
  module Fog
4
4
  module Baremetal
5
5
  class OpenStack
6
- class Chassis < Fog::Model
6
+ class Chassis < Fog::OpenStack::Model
7
7
  identity :uuid
8
8
 
9
9
  attribute :description
@@ -14,17 +14,6 @@ module Fog
14
14
  attribute :updated_at
15
15
  attribute :extra
16
16
 
17
- def initialize(attributes)
18
- # Old 'connection' is renamed as service and should be used instead
19
- prepare_service_value(attributes)
20
- super
21
- end
22
-
23
- def save
24
- requires :description
25
- identity ? update : create
26
- end
27
-
28
17
  def create
29
18
  requires :description
30
19
  merge_attributes(service.create_chassis(self.attributes).body)
@@ -32,7 +21,7 @@ module Fog
32
21
  end
33
22
 
34
23
  def update(patch=nil)
35
- requires :uuid
24
+ requires :uuid, :description
36
25
  if patch
37
26
  merge_attributes(service.patch_chassis(uuid, patch).body)
38
27
  else
@@ -1,24 +1,24 @@
1
- require 'fog/core/collection'
1
+ require 'fog/openstack/models/collection'
2
2
  require 'fog/openstack/models/baremetal/chassis'
3
3
 
4
4
  module Fog
5
5
  module Baremetal
6
6
  class OpenStack
7
- class ChassisCollection < Fog::Collection
7
+ class ChassisCollection < Fog::OpenStack::Collection
8
8
  model Fog::Baremetal::OpenStack::Chassis
9
9
 
10
10
  def all(options = {})
11
- load(service.list_chassis_detailed(options).body['chassis'])
11
+ load_response(service.list_chassis_detailed(options), 'chassis')
12
12
  end
13
13
 
14
14
  def summary(options = {})
15
- load(service.list_chassis(options).body['chassis'])
15
+ load_response(service.list_chassis(options), 'chassis')
16
16
  end
17
17
 
18
18
  def details(options = {})
19
19
  Fog::Logger.deprecation("Calling OpenStack[:baremetal].chassis_collection.details will be removed, "\
20
20
  " call .chassis_collection.all for detailed list.")
21
- load(service.list_chassis_detailed(options).body['chassis'])
21
+ all(options)
22
22
  end
23
23
 
24
24
  def find_by_uuid(uuid)