fog 1.0.0 → 1.1.0
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/README.rdoc +2 -9
- data/Rakefile +3 -2
- data/docs/_layouts/default.html +13 -13
- data/docs/about/contributing.markdown +1 -1
- data/docs/about/getting_started.markdown +28 -3
- data/docs/dns/index.markdown +4 -4
- data/docs/index.markdown +2 -10
- data/docs/public/css/fog.css +14 -1
- data/docs/storage/index.markdown +2 -2
- data/fog.gemspec +6 -5
- data/lib/fog.rb +1 -1
- data/lib/fog/aws.rb +26 -1
- data/lib/fog/aws/auto_scaling.rb +3 -1
- data/lib/fog/aws/cloud_formation.rb +3 -0
- data/lib/fog/aws/cloud_watch.rb +17 -1
- data/lib/fog/aws/compute.rb +50 -18
- data/lib/fog/aws/elb.rb +4 -2
- data/lib/fog/aws/emr.rb +133 -0
- data/lib/fog/aws/models/cloud_watch/alarm.rb +12 -0
- data/lib/fog/aws/models/cloud_watch/alarm_data.rb +39 -0
- data/lib/fog/aws/models/cloud_watch/alarm_datum.rb +66 -0
- data/lib/fog/aws/models/cloud_watch/alarm_histories.rb +18 -0
- data/lib/fog/aws/models/cloud_watch/alarm_history.rb +16 -0
- data/lib/fog/aws/models/cloud_watch/alarms.rb +30 -0
- data/lib/fog/aws/models/compute/addresses.rb +1 -1
- data/lib/fog/aws/models/compute/key_pairs.rb +1 -1
- data/lib/fog/aws/models/compute/security_groups.rb +1 -1
- data/lib/fog/aws/models/compute/server.rb +4 -2
- data/lib/fog/aws/models/compute/servers.rb +1 -1
- data/lib/fog/aws/models/compute/snapshots.rb +1 -1
- data/lib/fog/aws/models/compute/spot_request.rb +21 -4
- data/lib/fog/aws/models/compute/spot_requests.rb +45 -1
- data/lib/fog/aws/models/compute/volumes.rb +1 -1
- data/lib/fog/aws/models/elb/load_balancer.rb +2 -0
- data/lib/fog/aws/models/storage/file.rb +1 -1
- data/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +0 -1
- data/lib/fog/aws/parsers/cloud_formation/update_stack.rb +19 -0
- data/lib/fog/aws/parsers/cloud_watch/delete_alarms.rb +26 -0
- data/lib/fog/aws/parsers/cloud_watch/describe_alarm_history.rb +40 -0
- data/lib/fog/aws/parsers/cloud_watch/describe_alarms.rb +73 -0
- data/lib/fog/aws/parsers/cloud_watch/describe_alarms_for_metric.rb +71 -0
- data/lib/fog/aws/parsers/cloud_watch/disable_alarm_actions.rb +26 -0
- data/lib/fog/aws/parsers/cloud_watch/enable_alarm_actions.rb +26 -0
- data/lib/fog/aws/parsers/cloud_watch/get_metric_statistics.rb +1 -0
- data/lib/fog/aws/parsers/cloud_watch/put_metric_alarm.rb +26 -0
- data/lib/fog/aws/parsers/cloud_watch/set_alarm_state.rb +26 -0
- data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +2 -2
- data/lib/fog/aws/parsers/emr/add_instance_groups.rb +28 -0
- data/lib/fog/aws/parsers/emr/add_job_flow_steps.rb +17 -0
- data/lib/fog/aws/parsers/emr/describe_job_flows.rb +140 -0
- data/lib/fog/aws/parsers/emr/modify_instance_groups.rb +17 -0
- data/lib/fog/aws/parsers/emr/run_job_flow.rb +19 -0
- data/lib/fog/aws/parsers/emr/set_termination_protection.rb +17 -0
- data/lib/fog/aws/parsers/emr/terminate_job_flows.rb +17 -0
- data/lib/fog/aws/rds.rb +3 -1
- data/lib/fog/aws/requests/cloud_formation/create_stack.rb +6 -0
- data/lib/fog/aws/requests/cloud_formation/update_stack.rb +62 -0
- data/lib/fog/aws/requests/cloud_watch/delete_alarms.rb +30 -0
- data/lib/fog/aws/requests/cloud_watch/describe_alarm_history.rb +33 -0
- data/lib/fog/aws/requests/cloud_watch/describe_alarms.rb +38 -0
- data/lib/fog/aws/requests/cloud_watch/describe_alarms_for_metric.rb +39 -0
- data/lib/fog/aws/requests/cloud_watch/disable_alarm_actions.rb +30 -0
- data/lib/fog/aws/requests/cloud_watch/enable_alarm_actions.rb +30 -0
- data/lib/fog/aws/requests/cloud_watch/put_metric_alarm.rb +84 -0
- data/lib/fog/aws/requests/cloud_watch/set_alarm_state.rb +31 -0
- data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +141 -36
- data/lib/fog/aws/requests/compute/create_snapshot.rb +2 -3
- data/lib/fog/aws/requests/compute/create_tags.rb +5 -3
- data/lib/fog/aws/requests/compute/create_volume.rb +0 -1
- data/lib/fog/aws/requests/compute/delete_security_group.rb +25 -0
- data/lib/fog/aws/requests/compute/delete_tags.rb +3 -4
- data/lib/fog/aws/requests/compute/describe_addresses.rb +2 -2
- data/lib/fog/aws/requests/compute/describe_availability_zones.rb +5 -2
- data/lib/fog/aws/requests/compute/describe_images.rb +6 -9
- data/lib/fog/aws/requests/compute/describe_instances.rb +17 -8
- data/lib/fog/aws/requests/compute/describe_key_pairs.rb +2 -2
- data/lib/fog/aws/requests/compute/describe_regions.rb +2 -2
- data/lib/fog/aws/requests/compute/describe_reserved_instances.rb +1 -1
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
- data/lib/fog/aws/requests/compute/describe_snapshots.rb +7 -5
- data/lib/fog/aws/requests/compute/describe_volumes.rb +5 -4
- data/lib/fog/aws/requests/compute/modify_image_attribute.rb +32 -0
- data/lib/fog/aws/requests/compute/modify_instance_attribute.rb +1 -1
- data/lib/fog/aws/requests/compute/purchase_reserved_instances_offering.rb +1 -1
- data/lib/fog/aws/requests/compute/register_image.rb +0 -1
- data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +41 -29
- data/lib/fog/aws/requests/compute/run_instances.rb +1 -2
- data/lib/fog/aws/requests/elb/create_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/create_load_balancer_listeners.rb +1 -1
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +1 -1
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +2 -2
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +3 -3
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +2 -2
- data/lib/fog/aws/requests/emr/add_instance_groups.rb +46 -0
- data/lib/fog/aws/requests/emr/add_job_flow_steps.rb +49 -0
- data/lib/fog/aws/requests/emr/describe_job_flows.rb +108 -0
- data/lib/fog/aws/requests/emr/modify_instance_groups.rb +40 -0
- data/lib/fog/aws/requests/emr/run_job_flow.rb +106 -0
- data/lib/fog/aws/requests/emr/set_termination_protection.rb +39 -0
- data/lib/fog/aws/requests/emr/terminate_job_flows.rb +37 -0
- data/lib/fog/aws/requests/iam/get_server_certificate.rb +5 -7
- data/lib/fog/aws/requests/iam/upload_server_certificate.rb +1 -0
- data/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
- data/lib/fog/aws/requests/simpledb/select.rb +1 -1
- data/lib/fog/aws/requests/storage/copy_object.rb +1 -1
- data/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
- data/lib/fog/aws/requests/storage/hash_to_acl.rb +35 -25
- data/lib/fog/aws/ses.rb +1 -1
- data/lib/fog/aws/simpledb.rb +2 -0
- data/lib/fog/aws/sns.rb +3 -1
- data/lib/fog/aws/sqs.rb +4 -2
- data/lib/fog/aws/storage.rb +12 -3
- data/lib/fog/bin.rb +1 -1
- data/lib/fog/bin/aws.rb +8 -4
- data/lib/fog/bin/bluebox.rb +2 -2
- data/lib/fog/bin/brightbox.rb +1 -1
- data/lib/fog/bin/dnsimple.rb +1 -1
- data/lib/fog/bin/dnsmadeeasy.rb +1 -1
- data/lib/fog/bin/ecloud.rb +1 -1
- data/lib/fog/bin/glesys.rb +1 -1
- data/lib/fog/bin/go_grid.rb +1 -1
- data/lib/fog/bin/google.rb +1 -1
- data/lib/fog/bin/libvirt.rb +1 -1
- data/lib/fog/bin/linode.rb +2 -2
- data/lib/fog/bin/local.rb +1 -1
- data/lib/fog/bin/new_servers.rb +1 -1
- data/lib/fog/bin/ninefold.rb +2 -2
- data/lib/fog/bin/openstack.rb +1 -1
- data/lib/fog/bin/rackspace.rb +3 -3
- data/lib/fog/bin/slicehost.rb +1 -1
- data/lib/fog/bin/stormondemand.rb +1 -1
- data/lib/fog/bin/virtual_box.rb +1 -1
- data/lib/fog/bin/vmfusion.rb +1 -1
- data/lib/fog/bin/voxel.rb +1 -1
- data/lib/fog/bin/zerigo.rb +1 -1
- data/lib/fog/brightbox/models/compute/account.rb +1 -1
- data/lib/fog/compute/models/server.rb +1 -2
- data/lib/fog/core/attributes.rb +5 -5
- data/lib/fog/core/connection.rb +1 -1
- data/lib/fog/core/deprecation.rb +2 -2
- data/lib/fog/core/logger.rb +8 -3
- data/lib/fog/core/mock.rb +4 -0
- data/lib/fog/core/provider.rb +7 -2
- data/lib/fog/core/service.rb +8 -2
- data/lib/fog/dnsmadeeasy/models/dns/record.rb +3 -2
- data/lib/fog/dynect/dns.rb +25 -3
- data/lib/fog/ecloud/compute.rb +2 -6
- data/lib/fog/go_grid/requests/compute/grid_server_power.rb +1 -1
- data/lib/fog/google/models/storage/file.rb +1 -1
- data/lib/fog/google/requests/storage/get_object_url.rb +2 -2
- data/lib/fog/google/storage.rb +1 -1
- data/lib/fog/libvirt/models/compute/uri.rb +7 -3
- data/lib/fog/linode/models/compute/server.rb +10 -0
- data/lib/fog/ninefold/models/storage/file.rb +8 -6
- data/lib/fog/ninefold/models/storage/files.rb +3 -2
- data/lib/fog/ninefold/requests/storage/head_namespace.rb +20 -0
- data/lib/fog/ninefold/storage.rb +4 -2
- data/lib/fog/openstack.rb +4 -3
- data/lib/fog/openstack/compute.rb +8 -5
- data/lib/fog/openstack/models/compute/server.rb +10 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +6 -8
- data/lib/fog/rackspace/load_balancers.rb +1 -0
- data/lib/fog/rackspace/models/dns/callback.rb +1 -1
- data/lib/fog/rackspace/models/dns/record.rb +1 -1
- data/lib/fog/rackspace/models/dns/zone.rb +1 -1
- data/lib/fog/slicehost/dns.rb +1 -0
- data/lib/fog/slicehost/models/dns/record.rb +7 -3
- data/lib/fog/slicehost/models/dns/zone.rb +1 -1
- data/lib/fog/slicehost/parsers/dns/create_record.rb +8 -2
- data/lib/fog/slicehost/parsers/dns/get_record.rb +17 -5
- data/lib/fog/slicehost/parsers/dns/get_records.rb +10 -2
- data/lib/fog/slicehost/requests/dns/get_record.rb +1 -1
- data/lib/fog/slicehost/requests/dns/get_records.rb +7 -8
- data/lib/fog/slicehost/requests/dns/update_record.rb +43 -0
- data/lib/fog/storm_on_demand/models/compute/balancers.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/configs.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/images.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/servers.rb +1 -1
- data/lib/fog/storm_on_demand/models/compute/templates.rb +1 -1
- data/lib/fog/terremark/vcloud.rb +1 -1
- data/lib/fog/vsphere/compute.rb +40 -23
- data/lib/fog/vsphere/models/compute/server.rb +1 -0
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +36 -4
- data/lib/fog/zerigo/dns.rb +14 -3
- data/lib/fog/zerigo/models/dns/record.rb +1 -1
- data/lib/fog/zerigo/models/dns/records.rb +5 -0
- data/lib/fog/zerigo/models/dns/zones.rb +2 -2
- data/lib/fog/zerigo/requests/dns/count_hosts.rb +20 -1
- data/lib/fog/zerigo/requests/dns/count_zones.rb +12 -1
- data/lib/fog/zerigo/requests/dns/create_host.rb +67 -1
- data/lib/fog/zerigo/requests/dns/create_zone.rb +44 -1
- data/lib/fog/zerigo/requests/dns/delete_host.rb +19 -0
- data/lib/fog/zerigo/requests/dns/delete_zone.rb +17 -0
- data/lib/fog/zerigo/requests/dns/find_hosts.rb +22 -1
- data/lib/fog/zerigo/requests/dns/get_host.rb +18 -1
- data/lib/fog/zerigo/requests/dns/get_zone.rb +19 -2
- data/lib/fog/zerigo/requests/dns/get_zone_stats.rb +23 -0
- data/lib/fog/zerigo/requests/dns/list_hosts.rb +20 -1
- data/lib/fog/zerigo/requests/dns/list_zones.rb +15 -0
- data/lib/fog/zerigo/requests/dns/update_host.rb +20 -1
- data/lib/fog/zerigo/requests/dns/update_zone.rb +20 -1
- data/tests/aws/models/cloud_watch/alarm_data_tests.rb +42 -0
- data/tests/aws/models/cloud_watch/alarm_history_tests.rb +22 -0
- data/tests/aws/models/compute/security_group_tests.rb +15 -10
- data/tests/aws/models/elb/model_tests.rb +4 -4
- data/tests/aws/requests/cloud_formation/stack_tests.rb +14 -0
- data/tests/aws/requests/cloud_watch/list_metrics_test.rb +5 -5
- data/tests/aws/requests/compute/image_tests.rb +33 -2
- data/tests/aws/requests/compute/instance_tests.rb +16 -1
- data/tests/aws/requests/compute/security_group_tests.rb +251 -32
- data/tests/aws/requests/compute/tag_tests.rb +42 -2
- data/tests/aws/requests/emr/helper.rb +172 -0
- data/tests/aws/requests/emr/instance_group_tests.rb +106 -0
- data/tests/aws/requests/emr/job_flow_tests.rb +88 -0
- data/tests/aws/requests/iam/server_certificate_tests.rb +20 -7
- data/tests/aws/requests/storage/bucket_tests.rb +82 -54
- data/tests/aws/requests/storage/hash_to_acl_tests.rb +173 -0
- data/tests/aws/requests/storage/object_tests.rb +44 -24
- data/tests/brightbox/requests/compute/helper.rb +15 -6
- data/tests/core/attribute_tests.rb +29 -0
- data/tests/core/mocking_tests.rb +60 -0
- data/tests/dns/models/record_tests.rb +4 -2
- data/tests/dns/models/records_tests.rb +4 -2
- data/tests/dns/models/zone_tests.rb +3 -1
- data/tests/dns/models/zones_tests.rb +4 -2
- data/tests/helper.rb +4 -0
- data/tests/rackspace/requests/dns/dns_tests.rb +16 -12
- data/tests/rackspace/requests/dns/records_tests.rb +13 -11
- data/tests/slicehost/requests/dns/dns_tests.rb +58 -11
- data/tests/vsphere/compute_tests.rb +18 -10
- data/tests/vsphere/requests/compute/vm_clone_tests.rb +1 -1
- metadata +214 -221
data/lib/fog/bin.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Fog
|
|
|
4
4
|
class << self
|
|
5
5
|
|
|
6
6
|
def available_providers
|
|
7
|
-
@available_providers ||=
|
|
7
|
+
@available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).available?}.sort
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
end
|
data/lib/fog/bin/aws.rb
CHANGED
|
@@ -19,6 +19,8 @@ class AWS < Fog::Bin
|
|
|
19
19
|
Fog::AWS::Elasticache
|
|
20
20
|
when :elb
|
|
21
21
|
Fog::AWS::ELB
|
|
22
|
+
when :emr
|
|
23
|
+
Fog::AWS::EMR
|
|
22
24
|
when :iam
|
|
23
25
|
Fog::AWS::IAM
|
|
24
26
|
when :sdb, :simpledb
|
|
@@ -47,22 +49,24 @@ class AWS < Fog::Bin
|
|
|
47
49
|
when :auto_scaling
|
|
48
50
|
Fog::AWS::AutoScaling.new
|
|
49
51
|
when :cdn
|
|
50
|
-
Fog::Logger.warning("AWS[:cdn] is
|
|
52
|
+
Fog::Logger.warning("AWS[:cdn] is not recommended, use CDN[:aws] for portability")
|
|
51
53
|
Fog::CDN.new(:provider => 'AWS')
|
|
52
54
|
when :cloud_formation
|
|
53
55
|
Fog::AWS::CloudFormation.new
|
|
54
56
|
when :cloud_watch
|
|
55
57
|
Fog::AWS::CloudWatch.new
|
|
56
58
|
when :compute
|
|
57
|
-
Fog::Logger.warning("AWS[:compute] is
|
|
59
|
+
Fog::Logger.warning("AWS[:compute] is not recommended, use Comptue[:aws] for portability")
|
|
58
60
|
Fog::Compute.new(:provider => 'AWS')
|
|
59
61
|
when :dns
|
|
60
|
-
Fog::Logger.warning("AWS[:dns] is
|
|
62
|
+
Fog::Logger.warning("AWS[:dns] is not recommended, use DNS[:aws] for portability")
|
|
61
63
|
Fog::DNS.new(:provider => 'AWS')
|
|
62
64
|
when :elasticache
|
|
63
65
|
Fog::AWS::Elasticache.new
|
|
64
66
|
when :elb
|
|
65
67
|
Fog::AWS::ELB.new
|
|
68
|
+
when :emr
|
|
69
|
+
Fog::AWS::EMR.new
|
|
66
70
|
when :iam
|
|
67
71
|
Fog::AWS::IAM.new
|
|
68
72
|
when :rds
|
|
@@ -76,7 +80,7 @@ class AWS < Fog::Bin
|
|
|
76
80
|
when :sqs
|
|
77
81
|
Fog::AWS::SQS.new
|
|
78
82
|
when :storage
|
|
79
|
-
Fog::Logger.warning("AWS[:storage] is
|
|
83
|
+
Fog::Logger.warning("AWS[:storage] is not recommended, use Storage[:aws] for portability")
|
|
80
84
|
Fog::Storage.new(:provider => 'AWS')
|
|
81
85
|
when :sns
|
|
82
86
|
Fog::AWS::SNS.new
|
data/lib/fog/bin/bluebox.rb
CHANGED
|
@@ -16,10 +16,10 @@ class Bluebox < Fog::Bin
|
|
|
16
16
|
@@connections ||= Hash.new do |hash, key|
|
|
17
17
|
hash[key] = case key
|
|
18
18
|
when :compute
|
|
19
|
-
Fog::Logger.warning("Bluebox[:compute] is
|
|
19
|
+
Fog::Logger.warning("Bluebox[:compute] is not recommended, use Compute[:bluebox] for portability")
|
|
20
20
|
Fog::Compute.new(:provider => 'Bluebox')
|
|
21
21
|
when :dns
|
|
22
|
-
Fog::Logger.warning("Bluebox[:
|
|
22
|
+
Fog::Logger.warning("Bluebox[:dns] is not recommended, use DNS[:bluebox] for portability")
|
|
23
23
|
Fog::DNS.new(:provider => 'Bluebox')
|
|
24
24
|
else
|
|
25
25
|
raise ArgumentError, "Unrecognized service: #{service}"
|
data/lib/fog/bin/brightbox.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Brightbox < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("Brightbox[:compute] is
|
|
17
|
+
Fog::Logger.warning("Brightbox[:compute] is not recommended, use Compute[:brightbox] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Brightbox')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/dnsimple.rb
CHANGED
|
@@ -14,7 +14,7 @@ class DNSimple < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :dns
|
|
17
|
-
Fog::Logger.warning("DNSimple[:dns] is
|
|
17
|
+
Fog::Logger.warning("DNSimple[:dns] is not recommended, use DNS[:dnsimple] for portability")
|
|
18
18
|
Fog::DNS.new(:provider => 'DNSimple')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/dnsmadeeasy.rb
CHANGED
|
@@ -14,7 +14,7 @@ class DNSMadeEasy < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :dns
|
|
17
|
-
Fog::Logger.warning("DNSMadeEasy[:dns] is
|
|
17
|
+
Fog::Logger.warning("DNSMadeEasy[:dns] is not recommended, use DNS[:dnsmadeeasy] for portability")
|
|
18
18
|
Fog::DNS.new(:provider => 'DNSMadeEasy')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/ecloud.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Ecloud < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("Ecloud[:compute] is
|
|
17
|
+
Fog::Logger.warning("Ecloud[:compute] is not recommended, use Compute[:ecloud] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Ecloud')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/glesys.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Glesys < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
|
|
17
|
+
Fog::Logger.warning("Glesys[:compute] is not recommended, use Compute[:glesys] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Glesys')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{service}"
|
data/lib/fog/bin/go_grid.rb
CHANGED
|
@@ -14,7 +14,7 @@ class GoGrid < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("GoGrid[:compute] is
|
|
17
|
+
Fog::Logger.warning("GoGrid[:compute] is not recommended, use Compute[:gogrid] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'GoGrid')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/google.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Google < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :storage
|
|
17
|
-
Fog::Logger.warning("Google[:storage] is
|
|
17
|
+
Fog::Logger.warning("Google[:storage] is not recommended, use Storage[:google] for portability")
|
|
18
18
|
Fog::Storage.new(:provider => 'Google')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/libvirt.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Libvirt # deviates from other bin stuff to accomodate gem
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("Libvirt[:compute] is
|
|
17
|
+
Fog::Logger.warning("Libvirt[:compute] is not recommended, use Compute[:libvirt] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Libvirt')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/linode.rb
CHANGED
|
@@ -16,10 +16,10 @@ class Linode < Fog::Bin
|
|
|
16
16
|
@@connections ||= Hash.new do |hash, key|
|
|
17
17
|
hash[key] = case key
|
|
18
18
|
when :compute
|
|
19
|
-
Fog::Logger.warning("Linode[:compute] is
|
|
19
|
+
Fog::Logger.warning("Linode[:compute] is not recommended, use Compute[:linode] for portability")
|
|
20
20
|
Fog::Compute.new(:provider => 'Linode')
|
|
21
21
|
when :dns
|
|
22
|
-
Fog::Logger.warning("Linode[:
|
|
22
|
+
Fog::Logger.warning("Linode[:dns] is not recommended, use DNS[:linode] for portability")
|
|
23
23
|
Fog::DNS.new(:provider => 'Linode')
|
|
24
24
|
else
|
|
25
25
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/local.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Local < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :storage
|
|
17
|
-
Fog::Logger.warning("Local[:storage] is
|
|
17
|
+
Fog::Logger.warning("Local[:storage] is not recommended, use Storage[:local] for portability")
|
|
18
18
|
Fog::Storage.new(:provider => 'Local')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/new_servers.rb
CHANGED
|
@@ -14,7 +14,7 @@ class NewServers < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("NewServers[:compute] is
|
|
17
|
+
Fog::Logger.warning("NewServers[:compute] is not recommended, use Compute[:newservers] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'NewServers')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/ninefold.rb
CHANGED
|
@@ -16,10 +16,10 @@ class Ninefold < Fog::Bin
|
|
|
16
16
|
@@connections ||= Hash.new do |hash, key|
|
|
17
17
|
hash[key] = case key
|
|
18
18
|
when :compute
|
|
19
|
-
Fog::Logger.warning("Ninefold[:compute] is
|
|
19
|
+
Fog::Logger.warning("Ninefold[:compute] is not recommended, use Compute[:ninefold] for portability")
|
|
20
20
|
Fog::Compute.new(:provider => 'Ninefold')
|
|
21
21
|
when :storage
|
|
22
|
-
Fog::Logger.warning("Ninefold[:storage] is
|
|
22
|
+
Fog::Logger.warning("Ninefold[:storage] is not recommended, use Storage[:ninefold] for portability")
|
|
23
23
|
Fog::Storage.new(:provider => 'Ninefold')
|
|
24
24
|
else
|
|
25
25
|
raise ArgumentError, "Unrecognized service: #{service}"
|
data/lib/fog/bin/openstack.rb
CHANGED
|
@@ -14,7 +14,7 @@ class OpenStack < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("OpenStack[:compute] is
|
|
17
|
+
Fog::Logger.warning("OpenStack[:compute] is not recommended, use Compute[:rackspace] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'OpenStack')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/rackspace.rb
CHANGED
|
@@ -22,17 +22,17 @@ class Rackspace < Fog::Bin
|
|
|
22
22
|
@@connections ||= Hash.new do |hash, key|
|
|
23
23
|
hash[key] = case key
|
|
24
24
|
when :cdn
|
|
25
|
-
Fog::Logger.warning("Rackspace[:cdn] is
|
|
25
|
+
Fog::Logger.warning("Rackspace[:cdn] is not recommended, use CDN[:rackspace] for portability")
|
|
26
26
|
Fog::CDN.new(:provider => 'Rackspace')
|
|
27
27
|
when :compute
|
|
28
|
-
Fog::Logger.warning("Rackspace[:compute] is
|
|
28
|
+
Fog::Logger.warning("Rackspace[:compute] is not recommended, use Compute[:rackspace] for portability")
|
|
29
29
|
Fog::Compute.new(:provider => 'Rackspace')
|
|
30
30
|
when :dns
|
|
31
31
|
Fog::DNS.new(:provider => 'Rackspace')
|
|
32
32
|
when :load_balancers
|
|
33
33
|
Fog::Rackspace::LoadBalancers.new
|
|
34
34
|
when :storage
|
|
35
|
-
Fog::Logger.warning("Rackspace[:storage] is
|
|
35
|
+
Fog::Logger.warning("Rackspace[:storage] is not recommended, use Storage[:rackspace] for portability")
|
|
36
36
|
Fog::Storage.new(:provider => 'Rackspace')
|
|
37
37
|
else
|
|
38
38
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/slicehost.rb
CHANGED
|
@@ -16,7 +16,7 @@ class Slicehost < Fog::Bin
|
|
|
16
16
|
@@connections ||= Hash.new do |hash, key|
|
|
17
17
|
hash[key] = case key
|
|
18
18
|
when :compute
|
|
19
|
-
Fog::Logger.warning("Slicehost[:compute] is
|
|
19
|
+
Fog::Logger.warning("Slicehost[:compute] is not recommended, use Compute[:slicehost] for portability")
|
|
20
20
|
Fog::Compute.new(:provider => 'Slicehost')
|
|
21
21
|
when :dns
|
|
22
22
|
Fog::Logger.warning("Slicehost[:dns] is deprecated, use Storage[:slicehost] instead")
|
|
@@ -14,7 +14,7 @@ class StormOnDemand < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("StormOnDemand[:compute] is
|
|
17
|
+
Fog::Logger.warning("StormOnDemand[:compute] is not recommended, use Compute[:stormondemand] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'StormOnDemand')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/virtual_box.rb
CHANGED
|
@@ -14,7 +14,7 @@ module VirtualBox # deviates from other bin stuff to accomodate gem
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("VirtualBox[:compute] is
|
|
17
|
+
Fog::Logger.warning("VirtualBox[:compute] is not recommended, use Compute[:virtualbox] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'VirtualBox')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/vmfusion.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Vmfusion # deviates from other bin stuff to accomodate gem
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("Vmfusion[:compute] is
|
|
17
|
+
Fog::Logger.warning("Vmfusion[:compute] is not recommended, use Compute[:vmfusion] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Vmfusion')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/voxel.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Voxel < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :compute
|
|
17
|
-
Fog::Logger.warning("Voxel[:
|
|
17
|
+
Fog::Logger.warning("Voxel[:comupte] is not recommended, use Compute[:voxel]] for portability")
|
|
18
18
|
Fog::Compute.new(:provider => 'Voxel')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
data/lib/fog/bin/zerigo.rb
CHANGED
|
@@ -14,7 +14,7 @@ class Zerigo < Fog::Bin
|
|
|
14
14
|
@@connections ||= Hash.new do |hash, key|
|
|
15
15
|
hash[key] = case key
|
|
16
16
|
when :dns
|
|
17
|
-
Fog::Logger.warning("Zerigo[:dns] is
|
|
17
|
+
Fog::Logger.warning("Zerigo[:dns] is not recommended, use DNS[:zerigo] for portability")
|
|
18
18
|
Fog::DNS.new(:provider => 'Zerigo')
|
|
19
19
|
else
|
|
20
20
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
|
@@ -13,11 +13,10 @@ module Fog
|
|
|
13
13
|
Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def ssh(commands)
|
|
16
|
+
def ssh(commands, options={})
|
|
17
17
|
require 'net/ssh'
|
|
18
18
|
requires :public_ip_address, :username
|
|
19
19
|
|
|
20
|
-
options = {}
|
|
21
20
|
options[:key_data] = [private_key] if private_key
|
|
22
21
|
Fog::SSH.new(public_ip_address, username, options).run(commands)
|
|
23
22
|
end
|
data/lib/fog/core/attributes.rb
CHANGED
|
@@ -25,9 +25,9 @@ module Fog
|
|
|
25
25
|
class_eval <<-EOS, __FILE__, __LINE__
|
|
26
26
|
def #{name}=(new_#{name})
|
|
27
27
|
attributes[:#{name}] = case new_#{name}
|
|
28
|
-
when 'true'
|
|
28
|
+
when true,'true'
|
|
29
29
|
true
|
|
30
|
-
when 'false'
|
|
30
|
+
when false,'false'
|
|
31
31
|
false
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -71,8 +71,8 @@ module Fog
|
|
|
71
71
|
class_eval <<-EOS, __FILE__, __LINE__
|
|
72
72
|
def #{name}=(new_data)
|
|
73
73
|
if new_data.is_a?(Hash)
|
|
74
|
-
if new_data.has_key?(
|
|
75
|
-
attributes[:#{name}] = new_data[
|
|
74
|
+
if new_data.has_key?(:'#{squash}')
|
|
75
|
+
attributes[:#{name}] = new_data[:'#{squash}']
|
|
76
76
|
elsif new_data.has_key?("#{squash}")
|
|
77
77
|
attributes[:#{name}] = new_data["#{squash}"]
|
|
78
78
|
else
|
|
@@ -142,7 +142,7 @@ module Fog
|
|
|
142
142
|
unless self.class.ignored_attributes.include?(key)
|
|
143
143
|
if aliased_key = self.class.aliases[key]
|
|
144
144
|
send("#{aliased_key}=", value)
|
|
145
|
-
elsif (
|
|
145
|
+
elsif self.respond_to?("#{key}=",true)
|
|
146
146
|
send("#{key}=", value)
|
|
147
147
|
else
|
|
148
148
|
attributes[key] = value
|
data/lib/fog/core/connection.rb
CHANGED
data/lib/fog/core/deprecation.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Fog
|
|
|
4
4
|
def deprecate(older, newer)
|
|
5
5
|
module_eval <<-EOS, __FILE__, __LINE__
|
|
6
6
|
def #{older}(*args)
|
|
7
|
-
Fog::Logger.
|
|
7
|
+
Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
|
|
8
8
|
send(:#{newer}, *args)
|
|
9
9
|
end
|
|
10
10
|
EOS
|
|
@@ -13,7 +13,7 @@ module Fog
|
|
|
13
13
|
def self_deprecate(older, newer)
|
|
14
14
|
module_eval <<-EOS, __FILE__, __LINE__
|
|
15
15
|
def self.#{older}(*args)
|
|
16
|
-
Fog::Logger.
|
|
16
|
+
Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
|
|
17
17
|
send(:#{newer}, *args)
|
|
18
18
|
end
|
|
19
19
|
EOS
|
data/lib/fog/core/logger.rb
CHANGED
|
@@ -2,7 +2,8 @@ module Fog
|
|
|
2
2
|
class Logger
|
|
3
3
|
|
|
4
4
|
@channels = {
|
|
5
|
-
:
|
|
5
|
+
:deprecation => ::STDOUT,
|
|
6
|
+
:warning => ::STDOUT
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
def self.[](channel)
|
|
@@ -14,11 +15,15 @@ module Fog
|
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
def self.debug(message)
|
|
17
|
-
self.write(:debug, "[light_black][DEBUG] #{message}[/]")
|
|
18
|
+
self.write(:debug, "[light_black][DEBUG] #{message}[/]\n")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.deprecation(message)
|
|
22
|
+
self.write(:deprecation, "[yellow][DEPRECATION] #{message}[/]\n")
|
|
18
23
|
end
|
|
19
24
|
|
|
20
25
|
def self.warning(message)
|
|
21
|
-
self.write(:warning, "[yellow][WARNING] #{message}[/]")
|
|
26
|
+
self.write(:warning, "[yellow][WARNING] #{message}[/]\n")
|
|
22
27
|
end
|
|
23
28
|
|
|
24
29
|
def self.write(key, value)
|
data/lib/fog/core/mock.rb
CHANGED
data/lib/fog/core/provider.rb
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
module Fog
|
|
2
2
|
|
|
3
3
|
def self.providers
|
|
4
|
-
@providers ||=
|
|
4
|
+
@providers ||= {}
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.providers=(new_providers)
|
|
8
|
+
@providers = new_providers
|
|
5
9
|
end
|
|
6
10
|
|
|
7
11
|
module Provider
|
|
8
12
|
|
|
9
13
|
def self.extended(base)
|
|
10
|
-
|
|
14
|
+
provider = base.to_s.split('::').last
|
|
15
|
+
Fog.providers[provider.downcase.to_sym] = provider
|
|
11
16
|
end
|
|
12
17
|
|
|
13
18
|
def [](service_key)
|
data/lib/fog/core/service.rb
CHANGED
|
@@ -172,11 +172,17 @@ module Fog
|
|
|
172
172
|
end
|
|
173
173
|
|
|
174
174
|
def recognized
|
|
175
|
-
@recognized ||= []
|
|
175
|
+
@recognized ||= [:connection_options]
|
|
176
176
|
end
|
|
177
177
|
|
|
178
178
|
def validate_options(options)
|
|
179
|
-
|
|
179
|
+
keys = []
|
|
180
|
+
for key, value in options
|
|
181
|
+
unless value.nil?
|
|
182
|
+
keys << key
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
missing = requirements - keys
|
|
180
186
|
unless missing.empty?
|
|
181
187
|
raise ArgumentError, "Missing required arguments: #{missing.join(', ')}"
|
|
182
188
|
end
|