fog-maestrodev 1.18.0.20131209091424 → 1.18.0.20131218202447
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/CONTRIBUTING.md +22 -0
- data/LICENSE.md +20 -0
- data/README.md +29 -42
- data/fog.gemspec +3 -3
- data/lib/fog/aws/compute.rb +1 -0
- data/lib/fog/aws/models/compute/subnet.rb +4 -0
- data/lib/fog/aws/models/compute/vpc.rb +5 -0
- data/lib/fog/aws/models/rds/server.rb +2 -0
- data/lib/fog/aws/models/storage/file.rb +2 -2
- data/lib/fog/aws/parsers/compute/assign_private_ip_addresses.rb +25 -0
- data/lib/fog/aws/requests/compute/assign_private_ip_addresses.rb +60 -0
- data/lib/fog/aws/requests/compute/describe_subnets.rb +8 -0
- data/lib/fog/aws/requests/compute/describe_vpcs.rb +8 -0
- data/lib/fog/cloudstack.rb +1 -1
- data/lib/fog/core/connection.rb +1 -2
- data/lib/fog/core/hmac.rb +3 -3
- data/lib/fog/core/mock.rb +2 -2
- data/lib/fog/core/wait_for.rb +1 -1
- data/lib/fog/core/{timeout.rb → wait_for_defaults.rb} +10 -0
- data/lib/fog/core.rb +1 -1
- data/lib/fog/google/compute.rb +19 -11
- data/lib/fog/google/examples/create.rb +12 -1
- data/lib/fog/google/examples/eric-fail.rb +13 -2
- data/lib/fog/google/examples/image_create.rb +0 -1
- data/lib/fog/google/examples/launch_micro_instance.rb +1 -2
- data/lib/fog/google/examples/metadata.rb +14 -2
- data/lib/fog/google/examples/network.rb +13 -2
- data/lib/fog/google/models/compute/disk.rb +10 -8
- data/lib/fog/google/models/compute/image.rb +8 -3
- data/lib/fog/google/models/compute/server.rb +19 -4
- data/lib/fog/google/models/compute/servers.rb +25 -9
- data/lib/fog/google/requests/compute/insert_disk.rb +6 -3
- data/lib/fog/google/requests/compute/insert_image.rb +1 -5
- data/lib/fog/google/requests/compute/insert_server.rb +8 -21
- data/lib/fog/openstack/compute.rb +3 -0
- data/lib/fog/openstack/models/compute/host.rb +1 -0
- data/lib/fog/openstack/models/compute/security_group.rb +18 -4
- data/lib/fog/openstack/models/compute/security_group_rule.rb +32 -0
- data/lib/fog/openstack/models/compute/security_group_rules.rb +22 -0
- data/lib/fog/openstack/network.rb +33 -3
- data/lib/fog/openstack/requests/compute/create_security_group.rb +3 -3
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +12 -5
- data/lib/fog/openstack/requests/compute/delete_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_security_group_rule.rb +2 -0
- data/lib/fog/openstack/requests/compute/get_security_group.rb +14 -24
- data/lib/fog/openstack/requests/compute/get_security_group_rule.rb +38 -0
- data/lib/fog/openstack/requests/compute/list_hosts.rb +3 -3
- data/lib/fog/openstack/volume.rb +3 -1
- data/lib/fog/rackspace/docs/auto_scale.md +9 -9
- data/lib/fog/rackspace/docs/getting_started.md +1 -0
- data/lib/fog/rackspace/docs/queues.md +312 -0
- data/lib/fog/vcloud_director/README.md +2 -0
- data/lib/fog/vcloud_director/compute.rb +78 -8
- data/lib/fog/vcloud_director/generators/compute/org_vdc_network.rb +91 -0
- data/lib/fog/vcloud_director/generators/compute/vapp.rb +30 -0
- data/lib/fog/vcloud_director/models/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/parsers/compute/vm_customization.rb +2 -0
- data/lib/fog/vcloud_director/requests/compute/delete_network.rb +64 -0
- data/lib/fog/vcloud_director/requests/compute/get_execute_query.rb +433 -333
- data/lib/fog/vcloud_director/requests/compute/get_vapp_metadata.rb +3 -1
- data/lib/fog/vcloud_director/requests/compute/post_attach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb +83 -0
- data/lib/fog/vcloud_director/requests/compute/post_detach_disk.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_eject_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/post_insert_cd_rom.rb +1 -1
- data/lib/fog/vcloud_director/requests/compute/put_guest_customization_section_vapp.rb +1 -0
- data/lib/fog/vcloud_director/requests/compute/put_vapp_name_and_description.rb +37 -0
- data/lib/fog/vsphere/models/compute/server.rb +1 -1
- data/lib/fog/xenserver/compute.rb +35 -0
- data/lib/fog/xenserver/models/compute/blob.rb +22 -0
- data/lib/fog/xenserver/models/compute/blobs.rb +25 -0
- data/lib/fog/xenserver/models/compute/bond.rb +23 -0
- data/lib/fog/xenserver/models/compute/bonds.rb +25 -0
- data/lib/fog/xenserver/models/compute/console.rb +3 -1
- data/lib/fog/xenserver/models/compute/crash_dump.rb +19 -0
- data/lib/fog/xenserver/models/compute/crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/dr_task.rb +17 -0
- data/lib/fog/xenserver/models/compute/dr_tasks.rb +25 -0
- data/lib/fog/xenserver/models/compute/gpu_group.rb +22 -0
- data/lib/fog/xenserver/models/compute/gpu_groups.rb +25 -0
- data/lib/fog/xenserver/models/compute/guest_metrics.rb +2 -1
- data/lib/fog/xenserver/models/compute/host.rb +41 -8
- data/lib/fog/xenserver/models/compute/host_cpu.rb +2 -1
- data/lib/fog/xenserver/models/compute/host_crash_dump.rb +20 -0
- data/lib/fog/xenserver/models/compute/host_crash_dumps.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/host_patch.rb +25 -0
- data/lib/fog/xenserver/models/compute/host_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/network.rb +7 -6
- data/lib/fog/xenserver/models/compute/pbd.rb +3 -1
- data/lib/fog/xenserver/models/compute/pci.rb +22 -0
- data/lib/fog/xenserver/models/compute/pcis.rb +25 -0
- data/lib/fog/xenserver/models/compute/pgpu.rb +20 -0
- data/lib/fog/xenserver/models/compute/pgpus.rb +25 -0
- data/lib/fog/xenserver/models/compute/pif.rb +19 -8
- data/lib/fog/xenserver/models/compute/pif_metrics.rb +28 -0
- data/lib/fog/xenserver/models/compute/pifs_metrics.rb +25 -0
- data/lib/fog/xenserver/models/compute/pool.rb +18 -1
- data/lib/fog/xenserver/models/compute/pool_patch.rb +24 -0
- data/lib/fog/xenserver/models/compute/pool_patchs.rb +25 -0
- data/lib/fog/xenserver/models/compute/role.rb +19 -0
- data/lib/fog/xenserver/models/compute/roles.rb +25 -0
- data/lib/fog/xenserver/models/compute/server.rb +59 -26
- data/lib/fog/xenserver/models/compute/server_appliance.rb +21 -0
- data/lib/fog/xenserver/models/compute/server_appliances.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_manager.rb +28 -0
- data/lib/fog/xenserver/models/compute/storage_managers.rb +25 -0
- data/lib/fog/xenserver/models/compute/storage_repository.rb +4 -1
- data/lib/fog/xenserver/models/compute/tunnel.rb +20 -0
- data/lib/fog/xenserver/models/compute/tunnels.rb +25 -0
- data/lib/fog/xenserver/models/compute/vbd.rb +3 -2
- data/lib/fog/xenserver/models/compute/vbd_metrics.rb +1 -1
- data/lib/fog/xenserver/models/compute/vdi.rb +4 -1
- data/lib/fog/xenserver/models/compute/vif.rb +11 -2
- data/lib/fog/xenserver/models/compute/vlan.rb +2 -1
- data/lib/fog/xenserver/models/compute/vmpp.rb +35 -0
- data/lib/fog/xenserver/models/compute/vmpps.rb +25 -0
- data/lib/fog/xenserver/models/compute/vtpm.rb +18 -0
- data/lib/fog/xenserver/models/compute/vtpms.rb +25 -0
- data/tests/aws/requests/compute/assign_private_ip_tests.rb +52 -0
- data/tests/google/models/compute/servers_tests.rb +12 -1
- data/tests/google/requests/compute/image_tests.rb +0 -1
- data/tests/helpers/mock_helper.rb +1 -1
- data/tests/openstack/models/compute/security_group_tests.rb +54 -0
- data/tests/openstack/requests/compute/security_group_tests.rb +22 -20
- data/tests/openstack/requests/network/network_tests.rb +8 -8
- data/tests/vcloud_director/requests/compute/edge_gateway_tests.rb +17 -8
- data/tests/vcloud_director/requests/compute/network_tests.rb +25 -1
- data/tests/vcloud_director/requests/compute/query_tests.rb +67 -2
- metadata +125 -132
- checksums.yaml +0 -15
data/.gitignore
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
## Getting Involved
|
2
|
+
|
3
|
+
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
|
4
|
+
|
5
|
+
### Coding
|
6
|
+
|
7
|
+
* Pick a task:
|
8
|
+
* Offer feedback on open [pull requests](https://github.com/fog/fog/pulls).
|
9
|
+
* Review open [issues](https://github.com/fog/fog/issues) for things to help on.
|
10
|
+
* [Create an issue](https://github.com/fog/fog/issues/new) to start a discussion on additions or features.
|
11
|
+
* Fork the project, add your changes and tests to cover them in a topic branch.
|
12
|
+
* Commit your changes and rebase against `fog/fog` to ensure everything is up to date.
|
13
|
+
* [Submit a pull request](https://github.com/fog/fog/compare/)
|
14
|
+
|
15
|
+
### Non-Coding
|
16
|
+
|
17
|
+
* Offer feedback on open [issues](https://github.com/fog/fog/issues).
|
18
|
+
* Write and help edit [documentation](https://github.com/fog/fog.github.com).
|
19
|
+
* Translate [documentation](https://github.com/fog/fog.github.com) in to other languages.
|
20
|
+
* Organize or volunteer at events.
|
21
|
+
* [Donate](https://www.gittip.com/geemus/)
|
22
|
+
* Discuss other ideas for contribution with [geemus](mailto:geemus+fog@gmail.com).
|
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 [geemus (Wesley Beary)](http://github.com/geemus)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -169,45 +169,32 @@ spec.add_dependency 'fog', '~> 1.16'
|
|
169
169
|
[semver]: http://semver.org/
|
170
170
|
[pvc]: http://guides.rubygems.org/patterns/
|
171
171
|
|
172
|
-
##
|
173
|
-
|
174
|
-
*
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
* [
|
188
|
-
* [
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
permit persons to whom the Software is furnished to do so, subject to
|
202
|
-
the following conditions:
|
203
|
-
|
204
|
-
The above copyright notice and this permission notice shall be
|
205
|
-
included in all copies or substantial portions of the Software.
|
206
|
-
|
207
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
208
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
209
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
210
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
211
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
212
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
213
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
172
|
+
## Getting Help
|
173
|
+
|
174
|
+
* [General Documentation](http://fog.io).
|
175
|
+
* [Provider Specific Documentation](http://fog.io/about/provider_documentation.html).
|
176
|
+
* Ask specific questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/fog)
|
177
|
+
* Report bugs and discuss potential features in [Github issues](https://github.com/fog/fog/issues).
|
178
|
+
|
179
|
+
## Getting Involved
|
180
|
+
|
181
|
+
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
|
182
|
+
|
183
|
+
### Coding
|
184
|
+
|
185
|
+
* Pick a task:
|
186
|
+
* Offer feedback on open [pull requests](https://github.com/fog/fog/pulls).
|
187
|
+
* Review open [issues](https://github.com/fog/fog/issues) for things to help on.
|
188
|
+
* [Create an issue](https://github.com/fog/fog/issues/new) to start a discussion on additions or features.
|
189
|
+
* Fork the project, add your changes and tests to cover them in a topic branch.
|
190
|
+
* Commit your changes and rebase against `fog/fog` to ensure everything is up to date.
|
191
|
+
* [Submit a pull request](https://github.com/fog/fog/compare/)
|
192
|
+
|
193
|
+
### Non-Coding
|
194
|
+
|
195
|
+
* Offer feedback on open [issues](https://github.com/fog/fog/issues).
|
196
|
+
* Write and help edit [documentation](https://github.com/fog/fog.github.com).
|
197
|
+
* Translate [documentation](https://github.com/fog/fog.github.com) in to other languages.
|
198
|
+
* Organize or volunteer at events.
|
199
|
+
* [Donate](https://www.gittip.com/geemus/)
|
200
|
+
* Discuss other ideas for contribution with [geemus](mailto:geemus+fog@gmail.com).
|
data/fog.gemspec
CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
## If your rubyforge_project name is different, then edit it and comment out
|
7
7
|
## the sub! line in the Rakefile
|
8
8
|
s.name = 'fog-maestrodev'
|
9
|
-
s.version = '1.18.0.
|
10
|
-
s.date = '2013-12-
|
9
|
+
s.version = '1.18.0.20131218202447'
|
10
|
+
s.date = '2013-12-18'
|
11
11
|
s.rubyforge_project = 'fog'
|
12
12
|
|
13
13
|
## Make sure your summary is short. The description may be as long
|
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
|
|
42
42
|
## List your runtime dependencies here. Runtime dependencies are those
|
43
43
|
## that are needed for an end user to actually USE your code.
|
44
44
|
s.add_dependency('builder')
|
45
|
-
s.add_dependency('excon', '~>0.
|
45
|
+
s.add_dependency('excon', '~>0.31.0')
|
46
46
|
s.add_dependency('formatador', '~>0.2.0')
|
47
47
|
s.add_dependency('multi_json', '~>1.0')
|
48
48
|
s.add_dependency('mime-types')
|
data/lib/fog/aws/compute.rb
CHANGED
@@ -11,6 +11,7 @@ module Fog
|
|
11
11
|
attribute :engine_version, :aliases => 'EngineVersion'
|
12
12
|
attribute :state, :aliases => 'DBInstanceStatus'
|
13
13
|
attribute :allocated_storage, :aliases => 'AllocatedStorage', :type => :integer
|
14
|
+
attribute :iops, :aliases => 'Iops'
|
14
15
|
attribute :availability_zone , :aliases => 'AvailabilityZone'
|
15
16
|
attribute :flavor_id, :aliases => 'DBInstanceClass'
|
16
17
|
attribute :endpoint, :aliases => 'Endpoint'
|
@@ -116,6 +117,7 @@ module Fog
|
|
116
117
|
'Port' => port || attributes['Port'],
|
117
118
|
'Engine' => engine,
|
118
119
|
'EngineVersion' => engine_version,
|
120
|
+
'Iops' => iops,
|
119
121
|
'MasterUsername' => master_username,
|
120
122
|
'MasterUserPassword' => password || attributes['MasterUserPassword'],
|
121
123
|
'PreferredMaintenanceWindow' => preferred_maintenance_window,
|
@@ -33,13 +33,13 @@ module Fog
|
|
33
33
|
|
34
34
|
# Set file's access control list (ACL).
|
35
35
|
#
|
36
|
-
# valid acls: private, public-read, public-read-write, authenticated-read
|
36
|
+
# valid acls: private, public-read, public-read-write, authenticated-read, bucket-owner-read, bucket-owner-full-control
|
37
37
|
#
|
38
38
|
# @param [String] new_acl one of valid options
|
39
39
|
# @return [String] @acl
|
40
40
|
#
|
41
41
|
def acl=(new_acl)
|
42
|
-
valid_acls = ['private', 'public-read', 'public-read-write', 'authenticated-read']
|
42
|
+
valid_acls = ['private', 'public-read', 'public-read-write', 'authenticated-read', 'bucket-owner-read', 'bucket-owner-full-control']
|
43
43
|
unless valid_acls.include?(new_acl)
|
44
44
|
raise ArgumentError.new("acl must be one of [#{valid_acls.join(', ')}]")
|
45
45
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module Compute
|
4
|
+
module AWS
|
5
|
+
|
6
|
+
class AssignPrivateIpAddresses < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def end_element(name)
|
9
|
+
case name
|
10
|
+
when 'requestId'
|
11
|
+
@response[name] = value
|
12
|
+
when 'return'
|
13
|
+
if value == 'true'
|
14
|
+
@response[name] = true
|
15
|
+
else
|
16
|
+
@response[name] = false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Fog
|
2
|
+
module Compute
|
3
|
+
class AWS
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/compute/assign_private_ip_addresses'
|
7
|
+
|
8
|
+
# Assigns one or more secondary private IP addresses to the specified network interface.
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * NetworkInterfaceId<~String> - The ID of the network interface
|
12
|
+
# * PrivateIpAddresses<~Array> - One or more IP addresses to be assigned as a secondary private IP address (conditional)
|
13
|
+
# * SecondaryPrivateIpAddressCount<~String> - The number of secondary IP addresses to assign (conditional)
|
14
|
+
# * AllowReassignment<~Boolean> - Whether to reassign an IP address
|
15
|
+
# ==== Returns
|
16
|
+
# * response<~Excon::Response>:
|
17
|
+
# * body<~Hash>:
|
18
|
+
# * 'requestId'<~String> - The ID of the request.
|
19
|
+
# * 'return'<~Boolean> - success?
|
20
|
+
#
|
21
|
+
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AssignPrivateIpAddresses.html]
|
22
|
+
def assign_private_ip_addresses(network_interface_id, options={})
|
23
|
+
|
24
|
+
if options['PrivateIpAddresses'] && options['SecondaryPrivateIpAddressCount']
|
25
|
+
raise Fog::Compute::AWS::Error.new("You may specify secondaryPrivateIpAddressCount or specific secondary private IP addresses, but not both.")
|
26
|
+
end
|
27
|
+
|
28
|
+
if private_ip_addresses = options.delete('PrivateIpAddresses')
|
29
|
+
options.merge!(Fog::AWS.indexed_param('PrivateIpAddress.%d', [*private_ip_addresses]))
|
30
|
+
end
|
31
|
+
|
32
|
+
request({
|
33
|
+
'Action' => 'AssignPrivateIpAddresses',
|
34
|
+
'NetworkInterfaceId' => network_interface_id,
|
35
|
+
:parser => Fog::Parsers::Compute::AWS::AssignPrivateIpAddresses.new
|
36
|
+
}.merge(options))
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
class Mock
|
42
|
+
|
43
|
+
def assign_private_ip_addresses(network_interface_id, options={})
|
44
|
+
if options['PrivateIpAddresses'] && options['SecondaryPrivateIpAddressCount']
|
45
|
+
raise Fog::Compute::AWS::Error.new("You may specify secondaryPrivateIpAddressCount or specific secondary private IP addresses, but not both.")
|
46
|
+
end
|
47
|
+
|
48
|
+
response = Excon::Response.new
|
49
|
+
response.status = 200
|
50
|
+
response.body = {
|
51
|
+
'requestId' => Fog::AWS::Mock.request_id,
|
52
|
+
'return' => true
|
53
|
+
}
|
54
|
+
response
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -46,6 +46,14 @@ module Fog
|
|
46
46
|
def describe_subnets(filters = {})
|
47
47
|
subnets = self.data[:subnets]
|
48
48
|
|
49
|
+
# Transition from pending to available
|
50
|
+
subnets.each do |subnet|
|
51
|
+
case subnet['state']
|
52
|
+
when 'pending'
|
53
|
+
subnet['state'] = 'available'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
49
57
|
if filters['subnet-id']
|
50
58
|
subnets = subnets.reject {|subnet| subnet['subnetId'] != filters['subnet-id']}
|
51
59
|
end
|
@@ -43,6 +43,14 @@ module Fog
|
|
43
43
|
def describe_vpcs(filters = {})
|
44
44
|
vpcs = self.data[:vpcs]
|
45
45
|
|
46
|
+
# Transition from pending to available
|
47
|
+
vpcs.each do |vpc|
|
48
|
+
case vpc['state']
|
49
|
+
when 'pending'
|
50
|
+
vpc['state'] = 'available'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
46
54
|
if filters['vpc-id']
|
47
55
|
vpcs = vpcs.reject {|vpc| vpc['vpcId'] != filters['vpc-id']}
|
48
56
|
end
|
data/lib/fog/cloudstack.rb
CHANGED
data/lib/fog/core/connection.rb
CHANGED
@@ -30,8 +30,8 @@ module Fog
|
|
30
30
|
end
|
31
31
|
params[:headers] ||= {}
|
32
32
|
params[:headers]['User-Agent'] ||= "fog/#{Fog::VERSION}"
|
33
|
+
params.merge!(:persistent => params.fetch(:persistent, persistent))
|
33
34
|
@excon = Excon.new(url, params)
|
34
|
-
@persistent = persistent
|
35
35
|
end
|
36
36
|
|
37
37
|
# Makes a request using the connection using Excon
|
@@ -53,7 +53,6 @@ module Fog
|
|
53
53
|
# @raise [Excon::Errors::SocketError]
|
54
54
|
#
|
55
55
|
def request(params, &block)
|
56
|
-
reset unless @persistent
|
57
56
|
@excon.request(params, &block)
|
58
57
|
end
|
59
58
|
|
data/lib/fog/core/hmac.rb
CHANGED
@@ -18,7 +18,7 @@ module Fog
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def setup_sha1
|
21
|
-
@digest = OpenSSL::Digest
|
21
|
+
@digest = OpenSSL::Digest.new('sha1')
|
22
22
|
@signer = lambda do |data|
|
23
23
|
OpenSSL::HMAC.digest(@digest, @key, data)
|
24
24
|
end
|
@@ -26,7 +26,7 @@ module Fog
|
|
26
26
|
|
27
27
|
def setup_sha256
|
28
28
|
begin
|
29
|
-
@digest = OpenSSL::Digest
|
29
|
+
@digest = OpenSSL::Digest.new('sha256')
|
30
30
|
@signer = lambda do |data|
|
31
31
|
OpenSSL::HMAC.digest(@digest, @key, data)
|
32
32
|
end
|
@@ -45,4 +45,4 @@ module Fog
|
|
45
45
|
end
|
46
46
|
|
47
47
|
end
|
48
|
-
end
|
48
|
+
end
|
data/lib/fog/core/mock.rb
CHANGED
@@ -30,8 +30,8 @@ module Fog
|
|
30
30
|
@delay = new_delay
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.not_implemented
|
34
|
-
raise Fog::Errors::MockNotImplemented.new(
|
33
|
+
def self.not_implemented(message = 'Contributions welcome!')
|
34
|
+
raise Fog::Errors::MockNotImplemented.new(message)
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.random_ip(opts = {:version => :v4})
|
data/lib/fog/core/wait_for.rb
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
module Fog
|
2
|
+
@interval = 1
|
3
|
+
def self.interval
|
4
|
+
@interval
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.interval=(interval)
|
8
|
+
raise ArgumentError, "interval must be non-negative" unless interval >= 0
|
9
|
+
@interval = interval
|
10
|
+
end
|
11
|
+
|
2
12
|
@timeout = 600
|
3
13
|
def self.timeout
|
4
14
|
@timeout
|
data/lib/fog/core.rb
CHANGED
@@ -28,8 +28,8 @@ require 'fog/core/service'
|
|
28
28
|
require 'fog/core/ssh'
|
29
29
|
require 'fog/core/scp'
|
30
30
|
require 'fog/core/time'
|
31
|
-
require 'fog/core/timeout'
|
32
31
|
require 'fog/core/wait_for'
|
32
|
+
require 'fog/core/wait_for_defaults'
|
33
33
|
require 'fog/core/class_from_string'
|
34
34
|
require 'fog/core/uuid'
|
35
35
|
|
data/lib/fog/google/compute.rb
CHANGED
@@ -76,7 +76,7 @@ module Fog
|
|
76
76
|
|
77
77
|
def shared_initialize(options = {})
|
78
78
|
@project = options[:google_project]
|
79
|
-
@api_version = '
|
79
|
+
@api_version = 'v1'
|
80
80
|
end
|
81
81
|
|
82
82
|
def build_excon_response(body, status=200)
|
@@ -99,12 +99,14 @@ module Fog
|
|
99
99
|
|
100
100
|
def backoff_if_unfound(&block)
|
101
101
|
retries_remaining = 10
|
102
|
+
sleep_time = 0.1
|
102
103
|
begin
|
103
104
|
result = block.call
|
104
105
|
rescue Exception => msg
|
105
106
|
if msg.to_s.include? 'was not found' and retries_remaining > 0
|
106
107
|
retries_remaining -= 1
|
107
|
-
sleep
|
108
|
+
sleep sleep_time
|
109
|
+
sleep_time *= 1.6
|
108
110
|
retry
|
109
111
|
else
|
110
112
|
raise msg
|
@@ -142,7 +144,6 @@ module Fog
|
|
142
144
|
"name" => "centos-6-2-v20120621",
|
143
145
|
"description" => "CentOS 6.2; Created Thu, 21 Jun 2012 14:22:21 +0000",
|
144
146
|
"sourceType" => "RAW",
|
145
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-20120621",
|
146
147
|
"rawDisk" => {
|
147
148
|
"containerType" => "TAR",
|
148
149
|
"source" => ""
|
@@ -161,7 +162,6 @@ module Fog
|
|
161
162
|
"name" => "centos-6-v20120912",
|
162
163
|
"description" => "CentOS 6; Created Wed, 12 Sep 2012 00:00:00 +0000",
|
163
164
|
"sourceType" => "RAW",
|
164
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20120912",
|
165
165
|
"rawDisk" => {
|
166
166
|
"containerType" => "TAR",
|
167
167
|
"source" => ""
|
@@ -180,7 +180,6 @@ module Fog
|
|
180
180
|
"name" => "centos-6-v20121106",
|
181
181
|
"description" => "SCSI-enabled CentOS 6; Created Tue, 06 Nov 2012 00:00:00 +0000",
|
182
182
|
"sourceType" => "RAW",
|
183
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20121106",
|
184
183
|
"rawDisk" => {
|
185
184
|
"containerType" => "TAR",
|
186
185
|
"source" => ""
|
@@ -200,7 +199,6 @@ module Fog
|
|
200
199
|
"name" => "debian-6-squeeze-v20130816",
|
201
200
|
"description" => "Debian GNU/Linux 6.0.7 (squeeze) built on 2013-08-16",
|
202
201
|
"sourceType" => "RAW",
|
203
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
204
202
|
"rawDisk" => {
|
205
203
|
"containerType" => "TAR",
|
206
204
|
"source" => ""
|
@@ -215,7 +213,6 @@ module Fog
|
|
215
213
|
"name" => "debian-7-wheezy-v20130816",
|
216
214
|
"description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-08-16",
|
217
215
|
"sourceType" => "RAW",
|
218
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
219
216
|
"rawDisk" => {
|
220
217
|
"containerType" => "TAR",
|
221
218
|
"source" => ""
|
@@ -230,12 +227,26 @@ module Fog
|
|
230
227
|
"name" => "debian-7-wheezy-v20131014",
|
231
228
|
"description" => "Debian GNU/Linux 7.1 (wheezy) built on 2013-10-14",
|
232
229
|
"sourceType" => "RAW",
|
233
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
234
230
|
"rawDisk" => {
|
235
231
|
"containerType" => "TAR",
|
236
232
|
"source" => ""
|
237
233
|
},
|
238
234
|
"status" => "READY"
|
235
|
+
},
|
236
|
+
"debian-7-wheezy-v20131120" => {
|
237
|
+
"kind" => "compute#image",
|
238
|
+
"selfLink" => "https://www.googleapis.com/compute/#{api_version}/projects/debian-cloud/global/images/debian-7-wheezy-v20131120",
|
239
|
+
"id" => "17312518942796567788",
|
240
|
+
"creationTimestamp" => "2013-11-25T15:17:00.436-08:00",
|
241
|
+
"name" => "debian-7-wheezy-v20131120",
|
242
|
+
"description" => "Debian GNU/Linux 7.2 (wheezy) built on 2013-11-20",
|
243
|
+
"sourceType" => "RAW",
|
244
|
+
"rawDisk" => {
|
245
|
+
"containerType" => "TAR",
|
246
|
+
"source" => ""
|
247
|
+
},
|
248
|
+
"status" => "READY",
|
249
|
+
"archiveSizeBytes" => "341857472"
|
239
250
|
}
|
240
251
|
}
|
241
252
|
}
|
@@ -250,7 +261,6 @@ module Fog
|
|
250
261
|
"name" => "centos-6-v20130813",
|
251
262
|
"description" => "SCSI-enabled CentOS 6; Created Tue, 13 Aug 2013 00:00:00 +0000",
|
252
263
|
"sourceType" => "RAW",
|
253
|
-
"preferredKernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
254
264
|
"rawDisk" => {
|
255
265
|
"containerType" => "TAR",
|
256
266
|
"source" => ""
|
@@ -271,8 +281,6 @@ module Fog
|
|
271
281
|
"name" => "fog-1380196541",
|
272
282
|
"tags" => { "fingerprint" => "42WmSpB8rSM=" },
|
273
283
|
"machineType" => "https://www.googleapis.com/compute/#{api_version}/projects/#{key}/zones/us-central1-a/machineTypes/n1-standard-1",
|
274
|
-
"image" => "https://www.googleapis.com/compute/#{api_version}/projects/centos-cloud/global/images/centos-6-v20130813",
|
275
|
-
"kernel" => "https://www.googleapis.com/compute/#{api_version}/projects/google/global/kernels/gce-v20130813",
|
276
284
|
"canIpForward" => false,
|
277
285
|
"networkInterfaces" => [
|
278
286
|
{
|
@@ -1,9 +1,20 @@
|
|
1
1
|
def test
|
2
2
|
connection = Fog::Compute.new({ :provider => "Google" })
|
3
3
|
|
4
|
+
name = "fog-smoke-test-#{Time.now.to_i}"
|
5
|
+
|
6
|
+
disk = connection.disks.create({
|
7
|
+
:name => name,
|
8
|
+
:size_gb => 10,
|
9
|
+
:zone_name => 'us-central1-a',
|
10
|
+
:source_image => 'debian-7-wheezy-v20131120',
|
11
|
+
})
|
12
|
+
|
13
|
+
disk.wait_for { disk.ready? }
|
14
|
+
|
4
15
|
server = connection.servers.create(defaults = {
|
5
16
|
:name => "fog-smoke-test-#{Time.now.to_i}",
|
6
|
-
:
|
17
|
+
:disks => [disk],
|
7
18
|
:machine_type => "n1-standard-1",
|
8
19
|
:zone_name => "us-central1-a",
|
9
20
|
:private_key_path => File.expand_path("~/.ssh/id_rsa"),
|
@@ -1,9 +1,20 @@
|
|
1
1
|
def test
|
2
2
|
connection = Fog::Compute.new({ :provider => "Google" })
|
3
3
|
|
4
|
+
name = "fog-smoke-test-#{Time.now.to_i}"
|
5
|
+
|
6
|
+
disk = connection.disks.create({
|
7
|
+
:name => name,
|
8
|
+
:size_gb => 10,
|
9
|
+
:zone_name => 'us-central1-a',
|
10
|
+
:source_image => 'debian-7-wheezy-v20131120',
|
11
|
+
})
|
12
|
+
|
13
|
+
disk.wait_for { disk.ready? }
|
14
|
+
|
4
15
|
server = connection.servers.create(defaults = {
|
5
|
-
:name =>
|
6
|
-
:
|
16
|
+
:name => name,
|
17
|
+
:disks => [disk],
|
7
18
|
:machine_type => "n1-standard-1",
|
8
19
|
:zone_name => "us-central1-a",
|
9
20
|
:private_key_path => File.expand_path("~/.ssh/id_rsa"),
|
@@ -1,8 +1,20 @@
|
|
1
1
|
def test
|
2
2
|
connection = Fog::Compute.new({ :provider => "Google" })
|
3
|
+
|
4
|
+
name = "fog-smoke-test-#{Time.now.to_i}"
|
5
|
+
|
6
|
+
disk = connection.disks.create({
|
7
|
+
:name => name,
|
8
|
+
:size_gb => 10,
|
9
|
+
:zone_name => 'us-central1-a',
|
10
|
+
:source_image => 'debian-7-wheezy-v20131120',
|
11
|
+
})
|
12
|
+
|
13
|
+
disk.wait_for { disk.ready? }
|
14
|
+
|
3
15
|
server = connection.servers.create(defaults = {
|
4
|
-
:name =>
|
5
|
-
:
|
16
|
+
:name => name,
|
17
|
+
:disks => [disk],
|
6
18
|
:machine_type => "n1-standard-1",
|
7
19
|
:zone_name => "us-central1-a",
|
8
20
|
:private_key_path => File.expand_path("~/.ssh/id_rsa"),
|