fog 1.35.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +50 -0
- data/fog.gemspec +6 -6
- data/lib/fog/digitalocean/models/compute/server.rb +0 -1
- data/lib/fog/digitalocean/requests/compute_v2/create_ssh_key.rb +10 -8
- data/lib/fog/digitalocean/requests/compute_v2/delete_ssh_key.rb +5 -1
- data/lib/fog/digitalocean/requests/compute_v2/list_ssh_keys.rb +6 -1
- data/lib/fog/glesys/models/compute/server.rb +0 -1
- data/lib/fog/joyent/compute.rb +6 -1
- data/lib/fog/linode/compute.rb +3 -0
- data/lib/fog/linode/models/compute/data_center.rb +1 -0
- data/lib/fog/linode/models/compute/flavor.rb +3 -0
- data/lib/fog/linode/models/compute/flavors.rb +8 -1
- data/lib/fog/linode/models/compute/image.rb +2 -0
- data/lib/fog/linode/models/compute/images.rb +2 -1
- data/lib/fog/linode/models/compute/kernel.rb +3 -0
- data/lib/fog/linode/models/compute/kernels.rb +14 -8
- data/lib/fog/linode/models/compute/node_balancer_flavor.rb +13 -0
- data/lib/fog/linode/models/compute/node_balancer_flavors.rb +27 -0
- data/lib/fog/linode/requests/compute/avail_kernels.rb +17 -18
- data/lib/fog/linode/requests/compute/avail_linodeplans.rb +4 -2
- data/lib/fog/linode/requests/compute/avail_nodebalancers.rb +42 -0
- data/lib/fog/linode/requests/compute/avail_stackscripts.rb +6 -11
- data/lib/fog/openstack/core.rb +22 -21
- data/lib/fog/openstack/models/baremetal/nodes.rb +1 -1
- data/lib/fog/openstack/models/identity_v3/domain.rb +6 -0
- data/lib/fog/openstack/models/identity_v3/domains.rb +19 -4
- data/lib/fog/openstack/models/identity_v3/project.rb +10 -0
- data/lib/fog/openstack/models/identity_v3/projects.rb +16 -3
- data/lib/fog/openstack/models/identity_v3/tokens.rb +1 -0
- data/lib/fog/openstack/models/storage/file.rb +9 -0
- data/lib/fog/openstack/requests/baremetal/delete_node.rb +1 -1
- data/lib/fog/rackspace/requests/load_balancers/create_node.rb +1 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +8 -0
- data/lib/fog/vsphere/models/compute/network.rb +1 -0
- data/lib/fog/vsphere/models/compute/process.rb +18 -0
- data/lib/fog/vsphere/models/compute/server.rb +29 -0
- data/lib/fog/vsphere/models/compute/snapshot.rb +35 -0
- data/lib/fog/vsphere/models/compute/snapshots.rb +27 -0
- data/lib/fog/vsphere/requests/compute/create_vm.rb +65 -2
- data/lib/fog/vsphere/requests/compute/list_child_snapshots.rb +71 -0
- data/lib/fog/vsphere/requests/compute/list_networks.rb +5 -4
- data/lib/fog/vsphere/requests/compute/list_processes.rb +41 -0
- data/lib/fog/vsphere/requests/compute/list_vm_snapshots.rb +66 -0
- data/lib/fog/vsphere/requests/compute/revert_to_snapshot.rb +30 -0
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +2 -5
- data/lib/fog/vsphere/requests/compute/vm_take_snapshot.rb +37 -0
- data/lib/tasks/changelog_task.rb +1 -0
- data/spec/fog/openstack/identity_v3/authv3_a.yml +18 -18
- data/spec/fog/openstack/identity_v3/authv3_b.yml +18 -18
- data/spec/fog/openstack/identity_v3/authv3_c.yml +293 -55
- data/spec/fog/openstack/identity_v3/authv3_token.yml +89 -89
- data/spec/fog/openstack/identity_v3/authv3_unscoped.yml +325 -222
- data/spec/fog/openstack/identity_v3/authv3_unscoped_reauth.yml +587 -111
- data/spec/fog/openstack/identity_v3/common_setup.yml +30 -30
- data/spec/fog/openstack/identity_v3/idv3_credential.yml +17 -17
- data/spec/fog/openstack/identity_v3/idv3_credential_crud.yml +343 -106
- data/spec/fog/openstack/identity_v3/idv3_domain.yml +27 -122
- data/spec/fog/openstack/identity_v3/idv3_domain_crud.yml +75 -128
- data/spec/fog/openstack/identity_v3/idv3_domain_group_roles_mutation.yml +141 -141
- data/spec/fog/openstack/identity_v3/idv3_domain_roles_mutation.yml +326 -86
- data/spec/fog/openstack/identity_v3/idv3_endpoint.yml +221 -221
- data/spec/fog/openstack/identity_v3/idv3_endpoints_crud.yml +314 -314
- data/spec/fog/openstack/identity_v3/idv3_group_crud_mutation.yml +191 -188
- data/spec/fog/openstack/identity_v3/idv3_policy.yml +23 -23
- data/spec/fog/openstack/identity_v3/idv3_policy_crud.yml +67 -67
- data/spec/fog/openstack/identity_v3/idv3_project.yml +267 -161
- data/spec/fog/openstack/identity_v3/idv3_project_crud.yml +70 -145
- data/spec/fog/openstack/identity_v3/idv3_project_group_user_roles_mutation.yml +195 -243
- data/spec/fog/openstack/identity_v3/idv3_project_hier_crud_list.yml +203 -553
- data/spec/fog/openstack/identity_v3/idv3_role.yml +49 -49
- data/spec/fog/openstack/identity_v3/idv3_role_crud.yml +92 -92
- data/spec/fog/openstack/identity_v3/idv3_service.yml +61 -61
- data/spec/fog/openstack/identity_v3/idv3_services_crud.yml +111 -111
- data/spec/fog/openstack/identity_v3/idv3_token.yml +84 -84
- data/spec/fog/openstack/identity_v3/idv3_user_crud.yml +140 -125
- data/spec/fog/openstack/identity_v3/idv3_users.yml +98 -78
- data/spec/fog/openstack/network/common_setup.yml +84 -75
- data/spec/fog/openstack/network/subnets_crud.yml +75 -35
- data/spec/fog/openstack/shared_context.rb +5 -1
- data/tests/helper.rb +1 -0
- data/tests/linode/requests/compute/datacenter_tests.rb +2 -1
- data/tests/linode/requests/compute/kernel_tests.rb +2 -10
- data/tests/linode/requests/compute/linodeplans_tests.rb +10 -7
- data/tests/linode/requests/compute/nodebalancers_tests.rb +20 -0
- data/tests/openstack/models/storage/file_tests.rb +29 -0
- data/tests/rackspace/requests/load_balancers/node_tests.rb +7 -0
- data/tests/vsphere/models/compute/server_tests.rb +27 -1
- data/tests/vsphere/requests/compute/list_child_snapshots_tests.rb +10 -0
- data/tests/vsphere/requests/compute/list_vm_snapshots_tests.rb +10 -0
- data/tests/vsphere/requests/compute/revert_to_snapshot_tests.rb +15 -0
- data/tests/vsphere/requests/compute/vm_take_snapshot_tests.rb +19 -0
- metadata +41 -16
- data/spec/fog/openstack/identity_v3/authv3_project.yml +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9cedf56d775bede91d6a668e2f9914ca6c70ba0
|
4
|
+
data.tar.gz: 520ffb04055ee86be3f87d1b235e70e362cb1d58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b58ecca0b95feb6a2a25295c3f218fc08b8f4f4cb198d4b6048684300ee74b4270e1ce666449c1974cca1b3fdaf1654a9408976bd21000228d5e061dbb1b8f0b
|
7
|
+
data.tar.gz: b0f5b97ad7da4e7926305cd71ca9f13bdfa94ea68f0c82a9cb65a8ffa882585320ee747d3544d18f089de4319f990170c5e10eca9820ba5bc4b0c16e7ad7eba2
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,53 @@
|
|
1
|
+
## 1.36.0 11/16/2015
|
2
|
+
*Hash* e7cd19696284633d4363993e2e3fda41384b7d58
|
3
|
+
|
4
|
+
Statistic | Value
|
5
|
+
------------- | --------:
|
6
|
+
Collaborators | 2
|
7
|
+
Downloads | 12793379
|
8
|
+
Forks | 1517
|
9
|
+
Open Issues | 92
|
10
|
+
Watchers | 3689
|
11
|
+
|
12
|
+
**MVP!** Phil Ross
|
13
|
+
|
14
|
+
#### [misc]
|
15
|
+
* added content-encoding meta-data. thanks ller
|
16
|
+
* version for fog-aliyun added in fog.gemspec. thanks Daniyal Shah
|
17
|
+
* Digital Ocean V2 call to create an ssh key returns a 201 on success: https://developers.digitalocean.com/documentation/v2/#create-a-new-key. thanks Dave Benvenuti
|
18
|
+
* improve mocks to more closely match real ssh key endpoint functionality. thanks Dave Benvenuti
|
19
|
+
* Fix issue when creating virtual machines with more than 7 disks. thanks Francois Herbert
|
20
|
+
* Fix distributed port group switches support for cloning with multiple networks. thanks as
|
21
|
+
* Extract virtualswitch parameter to the network model. thanks as
|
22
|
+
* fix openstack baremetal node delete. thanks Jason Montleon
|
23
|
+
* Fixed issue with OpenStack Auth v2. thanks ller
|
24
|
+
* Fix set node type for Rackspace load balancer. thanks Pablo Porto
|
25
|
+
* Add abbr attribute to Linode DataCenter. thanks Phil Ross
|
26
|
+
* Add created_at and requires_pvops_kernel to Linode Image model. thanks Phil Ross
|
27
|
+
* Update the Linode avail_kernels request and Kernel model. thanks Phil Ross
|
28
|
+
* Update the Linode avail_linodeplans request and Flavor model. thanks Phil Ross
|
29
|
+
* Add support for the Linode avail.nodebalancers API call. thanks Phil Ross
|
30
|
+
* Fix the signature of the Linode avail_stackscripts mock. thanks Phil Ross
|
31
|
+
* Use options on the all method to filter Linode kernels. thanks Phil Ross
|
32
|
+
* fix method call name in openstack node destroy so that it will work. thanks Stephen Herr
|
33
|
+
* vsphere: allow setting of boot order when using api > 5.0. thanks Timo Goebel
|
34
|
+
* Revert "temporarily relax ruby version constraint". thanks geemus
|
35
|
+
* make net/ssh require optional. thanks geemus
|
36
|
+
* re-add 1.9 to travis config. thanks geemus
|
37
|
+
* limit to 1.9 compat fog-google. thanks geemus
|
38
|
+
* 1.8 compatibility for pre 2 release. thanks geemus
|
39
|
+
|
40
|
+
#### [openstack]
|
41
|
+
* Basic caching support for auth tokens, domains & projects. thanks Darren Hague
|
42
|
+
* Re-record VCRs, plus some light refactoring. thanks Darren Hague
|
43
|
+
|
44
|
+
#### [vsphere]
|
45
|
+
* add support for taking snapshot. thanks Ivo Reznicek
|
46
|
+
* support for snapshot list and revert. thanks Ivo Reznicek
|
47
|
+
* support for listing processes in guest OS. thanks Ivo Reznicek
|
48
|
+
* Prefer Class#name to Class#to_s. thanks Kevin Menard
|
49
|
+
|
50
|
+
|
1
51
|
## 1.35.0 10/20/2015
|
2
52
|
*Hash* 4444f3287454a4281ead73fa24aa1b93d5d23a39
|
3
53
|
|
data/fog.gemspec
CHANGED
@@ -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.
|
15
|
-
s.date = "2015-
|
14
|
+
s.version = "1.36.0"
|
15
|
+
s.date = "2015-11-16"
|
16
16
|
s.rubyforge_project = "fog"
|
17
17
|
|
18
18
|
## Make sure your summary is short. The description may be as long
|
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
|
|
49
49
|
s.add_dependency("fog-xml", "~> 0.1.1")
|
50
50
|
|
51
51
|
s.add_dependency("ipaddress", "~> 0.5")
|
52
|
-
s.add_dependency("nokogiri")
|
52
|
+
s.add_dependency("nokogiri", "~> 1.5", ">= 1.5.11")
|
53
53
|
|
54
54
|
# Modular providers (please keep sorted)
|
55
55
|
s.add_dependency("fog-atmos")
|
@@ -57,7 +57,7 @@ Gem::Specification.new do |s|
|
|
57
57
|
s.add_dependency("fog-brightbox", "~> 0.4")
|
58
58
|
s.add_dependency("fog-dynect", "~> 0.0.2")
|
59
59
|
s.add_dependency("fog-ecloud", "~> 0.1")
|
60
|
-
s.add_dependency("fog-google", "
|
60
|
+
s.add_dependency("fog-google", "<= 0.1.0")
|
61
61
|
s.add_dependency("fog-local")
|
62
62
|
s.add_dependency("fog-powerdns", ">= 0.1.1")
|
63
63
|
s.add_dependency("fog-profitbricks")
|
@@ -71,7 +71,7 @@ Gem::Specification.new do |s|
|
|
71
71
|
s.add_dependency("fog-vmfusion")
|
72
72
|
s.add_dependency("fog-voxel")
|
73
73
|
s.add_dependency("fog-xenserver")
|
74
|
-
s.add_dependency("fog-aliyun")
|
74
|
+
s.add_dependency("fog-aliyun",">= 0.1.0")
|
75
75
|
|
76
76
|
s.add_development_dependency("docker-api", ">= 1.13.6")
|
77
77
|
s.add_development_dependency("fission")
|
@@ -90,7 +90,7 @@ Gem::Specification.new do |s|
|
|
90
90
|
s.add_development_dependency("rspec-core")
|
91
91
|
s.add_development_dependency("rspec-expectations")
|
92
92
|
s.add_development_dependency("vcr")
|
93
|
-
s.add_development_dependency("webmock")
|
93
|
+
s.add_development_dependency("webmock","~>1.22.2")
|
94
94
|
|
95
95
|
s.files = `git ls-files`.split("\n")
|
96
96
|
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")
|
@@ -13,7 +13,7 @@ module Fog
|
|
13
13
|
encoded_body = Fog::JSON.encode(create_options)
|
14
14
|
|
15
15
|
request(
|
16
|
-
:expects => [
|
16
|
+
:expects => [201],
|
17
17
|
:headers => {
|
18
18
|
'Content-Type' => "application/json; charset=UTF-8",
|
19
19
|
},
|
@@ -28,15 +28,17 @@ module Fog
|
|
28
28
|
class Mock
|
29
29
|
def create_ssh_key(name, public_key)
|
30
30
|
response = Excon::Response.new
|
31
|
-
response.status =
|
31
|
+
response.status = 201
|
32
|
+
|
33
|
+
data[:ssh_keys] << {
|
34
|
+
"id" => Fog::Mock.random_numbers(6).to_i,
|
35
|
+
"fingerprint" => (["00"] * 16).join(':'),
|
36
|
+
"public_key" => public_key,
|
37
|
+
"name" => name
|
38
|
+
}
|
32
39
|
|
33
40
|
response.body ={
|
34
|
-
'ssh_key' =>
|
35
|
-
'id' => 512190,
|
36
|
-
'fingerprint' => "3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa",
|
37
|
-
'public_key' => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example",
|
38
|
-
'name' => "My SSH Public Key"
|
39
|
-
}
|
41
|
+
'ssh_key' => data[:ssh_keys].last
|
40
42
|
}
|
41
43
|
|
42
44
|
response
|
@@ -17,7 +17,11 @@ module Fog
|
|
17
17
|
|
18
18
|
# noinspection RubyStringKeysInHashInspection
|
19
19
|
class Mock
|
20
|
-
def delete_ssh_key(
|
20
|
+
def delete_ssh_key(id)
|
21
|
+
self.data[:ssh_keys].select! do |key|
|
22
|
+
key["id"] != id
|
23
|
+
end
|
24
|
+
|
21
25
|
response = Excon::Response.new
|
22
26
|
response.status = 204
|
23
27
|
response
|
@@ -17,10 +17,15 @@ module Fog
|
|
17
17
|
response = Excon::Response.new
|
18
18
|
response.status = 200
|
19
19
|
response.body = {
|
20
|
+
"ssh_keys" => data[:ssh_keys],
|
21
|
+
"links" => {},
|
22
|
+
"meta" => {
|
23
|
+
"total" => data[:ssh_keys].count
|
24
|
+
}
|
20
25
|
}
|
21
26
|
response
|
22
27
|
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
26
|
-
end
|
31
|
+
end
|
data/lib/fog/joyent/compute.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'fog/joyent/core'
|
2
2
|
require 'fog/joyent/errors'
|
3
|
-
require 'net/ssh'
|
4
3
|
|
5
4
|
module Fog
|
6
5
|
module Compute
|
@@ -126,6 +125,12 @@ module Fog
|
|
126
125
|
end
|
127
126
|
|
128
127
|
if options[:joyent_keyname]
|
128
|
+
begin
|
129
|
+
require "net/ssh"
|
130
|
+
rescue LoadError
|
131
|
+
Fog::Logger.warning("'net/ssh' missing, please install and try again.")
|
132
|
+
exit(1)
|
133
|
+
end
|
129
134
|
@joyent_keyname = options[:joyent_keyname]
|
130
135
|
@joyent_keyphrase = options[:joyent_keyphrase]
|
131
136
|
@key_manager = Net::SSH::Authentication::KeyManager.new(nil, {
|
data/lib/fog/linode/compute.rb
CHANGED
@@ -23,12 +23,15 @@ module Fog
|
|
23
23
|
collection :ips
|
24
24
|
model :disk
|
25
25
|
collection :disks
|
26
|
+
model :node_balancer_flavor
|
27
|
+
collection :node_balancer_flavors
|
26
28
|
|
27
29
|
request_path 'fog/linode/requests/compute'
|
28
30
|
request :avail_datacenters
|
29
31
|
request :avail_distributions
|
30
32
|
request :avail_kernels
|
31
33
|
request :avail_linodeplans
|
34
|
+
request :avail_nodebalancers
|
32
35
|
request :avail_stackscripts
|
33
36
|
request :linode_disk_create
|
34
37
|
request :linode_disk_list
|
@@ -8,8 +8,11 @@ module Fog
|
|
8
8
|
attribute :disk
|
9
9
|
attribute :name
|
10
10
|
attribute :ram
|
11
|
+
attribute :transfer
|
11
12
|
attribute :price
|
13
|
+
attribute :price_hourly
|
12
14
|
attribute :cores
|
15
|
+
attribute :available
|
13
16
|
|
14
17
|
def bits
|
15
18
|
0 # these are determined by images you select not the hardware
|
@@ -24,7 +24,14 @@ module Fog
|
|
24
24
|
|
25
25
|
def map_flavor(flavor)
|
26
26
|
flavor = flavor.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v }
|
27
|
-
flavor.merge! :id => flavor[:planid], :name => flavor[:label]
|
27
|
+
flavor.merge! :id => flavor[:planid], :name => flavor[:label],
|
28
|
+
:transfer => flavor[:xfer], :price_hourly => flavor[:hourly],
|
29
|
+
:available => map_available(flavor[:avail])
|
30
|
+
end
|
31
|
+
|
32
|
+
def map_available(available)
|
33
|
+
return nil unless available
|
34
|
+
available.each_with_object({}) { |(k, v), h| h[k.to_i] = v }
|
28
35
|
end
|
29
36
|
end
|
30
37
|
end
|
@@ -25,7 +25,8 @@ module Fog
|
|
25
25
|
def map_image(image)
|
26
26
|
image = image.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v }
|
27
27
|
image.merge!(:id => image[:distributionid], :name => image[:label], :image_size => image[:minimagesize],
|
28
|
-
:
|
28
|
+
:requires_pvops_kernel => image[:requirespvopskernel], :bits => ((image[:is64bit] == 1) ? 64 : 32 ),
|
29
|
+
:created_at => image[:create_dt])
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -7,24 +7,30 @@ module Fog
|
|
7
7
|
class Kernels < Fog::Collection
|
8
8
|
model Fog::Compute::Linode::Kernel
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
# Returns an Array of the available kernels.
|
11
|
+
#
|
12
|
+
# The list of kernels can be filtered by support for KVM or Xen by
|
13
|
+
# specifying kvm: true or xen: true respectively as options.
|
14
|
+
def all(options={})
|
15
|
+
[[:kvm, :isKVM], [:xen, :isXen]].each do |type, param|
|
16
|
+
options[param] = options[type] ? 1 : 0 if options.has_key?(type)
|
17
|
+
end
|
18
|
+
load kernels(options)
|
12
19
|
end
|
13
20
|
|
14
21
|
def get(id)
|
15
|
-
new kernels
|
16
|
-
rescue Fog::Compute::Linode::NotFound
|
17
|
-
nil
|
22
|
+
new kernels.select {|kernel| kernel[:id] == id }.first
|
18
23
|
end
|
19
24
|
|
20
25
|
private
|
21
|
-
def kernels(
|
22
|
-
service.avail_kernels(
|
26
|
+
def kernels(options={})
|
27
|
+
service.avail_kernels(options).body['DATA'].map { |kernel| map_kernel kernel }
|
23
28
|
end
|
24
29
|
|
25
30
|
def map_kernel(kernel)
|
26
31
|
kernel = kernel.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v }
|
27
|
-
kernel.merge! :id => kernel[:kernelid], :name => kernel[:label]
|
32
|
+
kernel.merge! :id => kernel[:kernelid], :name => kernel[:label],
|
33
|
+
:is_xen => kernel[:isxen], :is_kvm => kernel[:iskvm], :is_pvops => kernel[:ispvops]
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'fog/core/collection'
|
2
|
+
require 'fog/linode/models/compute/node_balancer_flavor'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Compute
|
6
|
+
class Linode
|
7
|
+
class NodeBalancerFlavors < Fog::Collection
|
8
|
+
model Fog::Compute::Linode::NodeBalancerFlavor
|
9
|
+
|
10
|
+
def all
|
11
|
+
load node_balancer_flavors
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
def node_balancer_flavors
|
16
|
+
service.avail_nodebalancers.body['DATA'].map { |node_balancer_flavor| map_node_balancer_flavor node_balancer_flavor }
|
17
|
+
end
|
18
|
+
|
19
|
+
def map_node_balancer_flavor(node_balancer_flavor)
|
20
|
+
node_balancer_flavor = node_balancer_flavor.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v }
|
21
|
+
node_balancer_flavor.merge! :price_monthly => node_balancer_flavor[:monthly],
|
22
|
+
:price_hourly => node_balancer_flavor[:hourly]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -5,27 +5,30 @@ module Fog
|
|
5
5
|
# Get available kernels
|
6
6
|
#
|
7
7
|
# ==== Parameters
|
8
|
-
# *
|
8
|
+
# * options<~Hash>
|
9
|
+
# * isXen<~Boolean> Show or hide Xen compatible kernels
|
10
|
+
# * isKVM<~Boolean> Show or hide KVM compatible kernels
|
9
11
|
#
|
10
12
|
# ==== Returns
|
11
13
|
# * response<~Excon::Response>:
|
12
14
|
# * body<~Array>:
|
13
15
|
# TODO: docs
|
14
|
-
def avail_kernels(
|
15
|
-
|
16
|
-
|
17
|
-
options.merge!(:kernelId => kernel_id)
|
18
|
-
end
|
16
|
+
def avail_kernels(options={})
|
17
|
+
# avail.kernels used to accept a kernelId parameter (now removed)
|
18
|
+
raise Fog::Errors::Error.new('avail_kernels no longer accepts a kernelId parameter') unless !options || options.is_a?(Hash)
|
19
19
|
request(
|
20
20
|
:expects => 200,
|
21
21
|
:method => 'GET',
|
22
|
-
:query => { :api_action => 'avail.kernels' }.merge!(options)
|
22
|
+
:query => { :api_action => 'avail.kernels' }.merge!(options || {})
|
23
23
|
)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
class Mock
|
28
|
-
def avail_kernels(
|
28
|
+
def avail_kernels(options={})
|
29
|
+
# avail.kernels used to accept a kernelId parameter (now removed)
|
30
|
+
raise Fog::Errors::Error.new('avail_kernels no longer accepts a kernelId parameter') unless !options || options.is_a?(Hash)
|
31
|
+
|
29
32
|
response = Excon::Response.new
|
30
33
|
response.status = 200
|
31
34
|
|
@@ -33,17 +36,12 @@ module Fog
|
|
33
36
|
"ERRORARRAY" => [],
|
34
37
|
"ACTION" => "avail.kernels"
|
35
38
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
mock_kernels = []
|
41
|
-
10.times do
|
42
|
-
kernel_id = rand(1..200)
|
43
|
-
mock_kernels << create_mock_kernel(kernel_id)
|
44
|
-
end
|
45
|
-
response.body = body.merge("DATA" => mock_kernels)
|
39
|
+
mock_kernels = []
|
40
|
+
10.times do
|
41
|
+
kernel_id = rand(1..200)
|
42
|
+
mock_kernels << create_mock_kernel(kernel_id)
|
46
43
|
end
|
44
|
+
response.body = body.merge("DATA" => mock_kernels)
|
47
45
|
response
|
48
46
|
end
|
49
47
|
|
@@ -53,6 +51,7 @@ module Fog
|
|
53
51
|
{
|
54
52
|
"ISPVOPS" => 1,
|
55
53
|
"ISXEN" => 1,
|
54
|
+
"ISKVM" => 1,
|
56
55
|
"KERNELID" => kernel_id,
|
57
56
|
"LABEL" => "Latest 3.0 (3.0.18-linode43)"
|
58
57
|
}
|