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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class EMR
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/emr/run_job_flow'
|
|
7
|
+
|
|
8
|
+
# creates and starts running a new job flow
|
|
9
|
+
# http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_RunJobFlow.html
|
|
10
|
+
# ==== Parameters
|
|
11
|
+
# * AdditionalInfo <~String> - A JSON string for selecting additional features.
|
|
12
|
+
# * BootstrapActions <~Array> - A list of bootstrap actions that will be run before Hadoop is started on the cluster nodes.
|
|
13
|
+
# * 'Name'<~String> - The name of the bootstrap action
|
|
14
|
+
# * 'ScriptBootstrapAction'<~Array> - The script run by the bootstrap action
|
|
15
|
+
# * 'Args' <~Array> - A list of command line arguments to pass to the bootstrap action script
|
|
16
|
+
# * 'Path' <~String> - Location of the script to run during a bootstrap action. Can be either a location in Amazon S3 or on a local file system.
|
|
17
|
+
# * Instances <~Array> - A specification of the number and type of Amazon EC2 instances on which to run the job flow.
|
|
18
|
+
# * 'Ec2KeyName'<~String> - Specifies the name of the Amazon EC2 key pair that can be used to ssh to the master node as the user called "hadoop.
|
|
19
|
+
# * 'HadoopVersion'<~String> - "0.18" | "0.20" Specifies the Hadoop version for the job flow
|
|
20
|
+
# * 'InstanceCount'<~Integer> - The number of Amazon EC2 instances used to execute the job flow
|
|
21
|
+
# * 'InstanceGroups'<~Array> - Configuration for the job flow's instance groups
|
|
22
|
+
# * 'BidPrice' <~String> - Bid price for each Amazon EC2 instance in the instance group when launching nodes as Spot Instances, expressed in USD.
|
|
23
|
+
# * 'InstanceCount'<~Integer> - Target number of instances for the instance group
|
|
24
|
+
# * 'InstanceRole'<~String> - MASTER | CORE | TASK The role of the instance group in the cluster
|
|
25
|
+
# * 'InstanceType'<~String> - The Amazon EC2 instance type for all instances in the instance group
|
|
26
|
+
# * 'MarketType'<~String> - ON_DEMAND | SPOT Market type of the Amazon EC2 instances used to create a cluster node
|
|
27
|
+
# * 'Name'<~String> - Friendly name given to the instance group.
|
|
28
|
+
# * 'KeepJobFlowAliveWhenNoSteps' <~Boolean> - Specifies whether the job flow should terminate after completing all steps
|
|
29
|
+
# * 'MasterInstanceType'<~String> - The EC2 instance type of the master node
|
|
30
|
+
# * 'Placement'<~Array> - Specifies the Availability Zone the job flow will run in
|
|
31
|
+
# * 'AvailabilityZone' <~String> - The Amazon EC2 Availability Zone for the job flow.
|
|
32
|
+
# * 'SlaveInstanceType'<~String> - The EC2 instance type of the slave nodes
|
|
33
|
+
# * 'TerminationProtected'<~Boolean> - Specifies whether to lock the job flow to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job flow error
|
|
34
|
+
# * LogUri <~String> - Specifies the location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created
|
|
35
|
+
# * Name <~String> - The name of the job flow
|
|
36
|
+
# * Steps <~Array> - A list of steps to be executed by the job flow
|
|
37
|
+
# * 'ActionOnFailure'<~String> - TERMINATE_JOB_FLOW | CANCEL_AND_WAIT | CONTINUE Specifies the action to take if the job flow step fails
|
|
38
|
+
# * 'HadoopJarStep'<~Array> - Specifies the JAR file used for the job flow step
|
|
39
|
+
# * 'Args'<~String list> - A list of command line arguments passed to the JAR file's main function when executed.
|
|
40
|
+
# * 'Jar'<~String> - A path to a JAR file run during the step.
|
|
41
|
+
# * 'MainClass'<~String> - The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file
|
|
42
|
+
# * 'Properties'<~Array> - A list of Java properties that are set when the step runs. You can use these properties to pass key value pairs to your main function
|
|
43
|
+
# * 'Key'<~String> - The unique identifier of a key value pair
|
|
44
|
+
# * 'Value'<~String> - The value part of the identified key
|
|
45
|
+
# * 'Name'<~String> - The name of the job flow step
|
|
46
|
+
#
|
|
47
|
+
# ==== Returns
|
|
48
|
+
# * response<~Excon::Response>:
|
|
49
|
+
# * body<~Hash>:
|
|
50
|
+
def run_job_flow(name, options={})
|
|
51
|
+
|
|
52
|
+
if bootstrap_actions = options.delete('BootstrapActions')
|
|
53
|
+
options.merge!(Fog::AWS.serialize_keys('BootstrapActions', bootstrap_actions))
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
if instances = options.delete('Instances')
|
|
57
|
+
options.merge!(Fog::AWS.serialize_keys('Instances', instances))
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if steps = options.delete('Steps')
|
|
61
|
+
options.merge!(Fog::AWS.serialize_keys('Steps', steps))
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
request({
|
|
65
|
+
'Action' => 'RunJobFlow',
|
|
66
|
+
'Name' => name,
|
|
67
|
+
:parser => Fog::Parsers::AWS::EMR::RunJobFlow.new,
|
|
68
|
+
}.merge(options))
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def run_hive(name, options={})
|
|
72
|
+
steps = []
|
|
73
|
+
steps << {
|
|
74
|
+
'Name' => 'Setup Hive',
|
|
75
|
+
'HadoopJarStep' => {
|
|
76
|
+
'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
|
|
77
|
+
'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path', 's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive']},
|
|
78
|
+
'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
|
|
79
|
+
}
|
|
80
|
+
steps << {
|
|
81
|
+
'Name' => 'Install Hive Site Configuration',
|
|
82
|
+
'HadoopJarStep' => {
|
|
83
|
+
'Jar' => 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar',
|
|
84
|
+
'Args' => ['s3://us-east-1.elasticmapreduce/libs/hive/hive-script', '--base-path', 's3://us-east-1.elasticmapreduce/libs/hive/', '--install-hive-site', '--hive-site=s3://raybeam.okl/prod/hive/hive-site.xml']},
|
|
85
|
+
'ActionOnFailure' => 'TERMINATE_JOB_FLOW'
|
|
86
|
+
}
|
|
87
|
+
options['Steps'] = steps
|
|
88
|
+
|
|
89
|
+
if not options['Instances'].nil?
|
|
90
|
+
options['Instances']['KeepJobFlowAliveWhenNoSteps'] = true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
run_job_flow name, options
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
class Mock
|
|
98
|
+
|
|
99
|
+
def run_job_flow(db_name, options={})
|
|
100
|
+
Fog::Mock.not_implemented
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class EMR
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/emr/set_termination_protection'
|
|
7
|
+
|
|
8
|
+
# locks a job flow so the Amazon EC2 instances in the cluster cannot be terminated by user intervention.
|
|
9
|
+
# http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_SetTerminationProtection.html
|
|
10
|
+
# ==== Parameters
|
|
11
|
+
# * JobFlowIds <~String list> - list of strings that uniquely identify the job flows to protect
|
|
12
|
+
# * TerminationProtected <~Boolean> - indicates whether to protect the job flow
|
|
13
|
+
#
|
|
14
|
+
# ==== Returns
|
|
15
|
+
# * response<~Excon::Response>:
|
|
16
|
+
# * body<~Hash>
|
|
17
|
+
def set_termination_protection(is_protected, options={})
|
|
18
|
+
|
|
19
|
+
if job_ids = options.delete('JobFlowIds')
|
|
20
|
+
options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
|
|
21
|
+
end
|
|
22
|
+
request({
|
|
23
|
+
'Action' => 'SetTerminationProtection',
|
|
24
|
+
'TerminationProtected' => is_protected,
|
|
25
|
+
:parser => Fog::Parsers::AWS::EMR::SetTerminationProtection.new,
|
|
26
|
+
}.merge(options))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class Mock
|
|
31
|
+
|
|
32
|
+
def set_termination_protection(db_name, options={})
|
|
33
|
+
Fog::Mock.not_implemented
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Fog
|
|
2
|
+
module AWS
|
|
3
|
+
class EMR
|
|
4
|
+
class Real
|
|
5
|
+
|
|
6
|
+
require 'fog/aws/parsers/emr/terminate_job_flows'
|
|
7
|
+
|
|
8
|
+
# shuts a list of job flows down.
|
|
9
|
+
# http://docs.amazonwebservices.com/ElasticMapReduce/latest/API/API_TerminateJobFlows.html
|
|
10
|
+
# ==== Parameters
|
|
11
|
+
# * JobFlowIds <~String list> - list of strings that uniquely identify the job flows to protect
|
|
12
|
+
#
|
|
13
|
+
# ==== Returns
|
|
14
|
+
# * response<~Excon::Response>:
|
|
15
|
+
# * body<~Hash>
|
|
16
|
+
def terminate_job_flows(options={})
|
|
17
|
+
|
|
18
|
+
if job_ids = options.delete('JobFlowIds')
|
|
19
|
+
options.merge!(Fog::AWS.serialize_keys('JobFlowIds', job_ids))
|
|
20
|
+
end
|
|
21
|
+
request({
|
|
22
|
+
'Action' => 'TerminateJobFlows',
|
|
23
|
+
:parser => Fog::Parsers::AWS::EMR::TerminateJobFlows.new,
|
|
24
|
+
}.merge(options))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class Mock
|
|
29
|
+
|
|
30
|
+
def terminate_job_flows(db_name, options={})
|
|
31
|
+
Fog::Mock.not_implemented
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -18,10 +18,10 @@ module Fog
|
|
|
18
18
|
# ==== See Also
|
|
19
19
|
# http://docs.amazonwebservices.com/IAM/latest/APIReference/API_GetServerCertificate.html
|
|
20
20
|
#
|
|
21
|
-
def get_server_certificate(
|
|
21
|
+
def get_server_certificate(name)
|
|
22
22
|
request({
|
|
23
23
|
'Action' => 'GetServerCertificate',
|
|
24
|
-
'ServerCertificateName' =>
|
|
24
|
+
'ServerCertificateName' => name,
|
|
25
25
|
:parser => Fog::Parsers::AWS::IAM::UploadServerCertificate.new
|
|
26
26
|
})
|
|
27
27
|
end
|
|
@@ -29,18 +29,16 @@ module Fog
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
class Mock
|
|
32
|
-
def get_server_certificate(
|
|
33
|
-
raise Fog::AWS::IAM::NotFound unless self.data[:server_certificates]
|
|
32
|
+
def get_server_certificate(name)
|
|
33
|
+
raise Fog::AWS::IAM::NotFound unless certificate = self.data[:server_certificates][name]
|
|
34
34
|
|
|
35
35
|
response = Excon::Response.new
|
|
36
36
|
response.status = 200
|
|
37
37
|
response.body = {
|
|
38
|
-
'Certificate' =>
|
|
38
|
+
'Certificate' => certificate,
|
|
39
39
|
'RequestId' => Fog::AWS::Mock.request_id
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
self.data[:server_certificates]
|
|
43
|
-
|
|
44
42
|
response
|
|
45
43
|
end
|
|
46
44
|
end
|
|
@@ -52,6 +52,7 @@ module Fog
|
|
|
52
52
|
# Validate cert and key
|
|
53
53
|
begin
|
|
54
54
|
cert = OpenSSL::X509::Certificate.new(certificate)
|
|
55
|
+
chain = OpenSSL::X509::Certificate.new(options['CertificateChain']) if options['CertificateChain']
|
|
55
56
|
key = OpenSSL::PKey::RSA.new(private_key)
|
|
56
57
|
rescue OpenSSL::X509::CertificateError, OpenSSL::PKey::RSAError => e
|
|
57
58
|
message = if e.is_a?(OpenSSL::X509::CertificateError)
|
|
@@ -29,7 +29,7 @@ module Fog
|
|
|
29
29
|
# * 'RequestId'
|
|
30
30
|
def get_attributes(domain_name, item_name, options = {})
|
|
31
31
|
if options.is_a?(Array)
|
|
32
|
-
Fog::Logger.
|
|
32
|
+
Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
|
|
33
33
|
options = {'AttributeName' => options}
|
|
34
34
|
end
|
|
35
35
|
options['AttributeName'] ||= []
|
|
@@ -49,7 +49,7 @@ module Fog
|
|
|
49
49
|
|
|
50
50
|
def get_attributes(domain_name, item_name, options = {})
|
|
51
51
|
if options.is_a?(Array)
|
|
52
|
-
Fog::Logger.
|
|
52
|
+
Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
|
|
53
53
|
options['AttributeName'] ||= options if options.is_a?(Array)
|
|
54
54
|
end
|
|
55
55
|
options['AttributeName'] ||= []
|
|
@@ -23,7 +23,7 @@ module Fog
|
|
|
23
23
|
# * 'NextToken'<~String> - offset to start with if there are are more domains to list
|
|
24
24
|
def select(select_expression, options = {})
|
|
25
25
|
if options.is_a?(String)
|
|
26
|
-
Fog::Logger.
|
|
26
|
+
Fog::Logger.deprecation("get_attributes with string next_token param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
|
|
27
27
|
options = {'NextToken' => options}
|
|
28
28
|
end
|
|
29
29
|
options['NextToken'] ||= nil
|
|
@@ -18,7 +18,7 @@ module Fog
|
|
|
18
18
|
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/S3_QSAuth.html
|
|
19
19
|
|
|
20
20
|
def get_object_url(bucket_name, object_name, expires)
|
|
21
|
-
Fog::Logger.
|
|
21
|
+
Fog::Logger.deprecation("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
|
|
22
22
|
get_object_https_url(bucket_name, object_name, expires)
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ module Fog
|
|
|
27
27
|
class Mock # :nodoc:all
|
|
28
28
|
|
|
29
29
|
def get_object_url(bucket_name, object_name, expires)
|
|
30
|
-
Fog::Logger.
|
|
30
|
+
Fog::Logger.deprecation("Fog::Storage::AWS => #get_object_url is deprecated, use #get_object_https_url instead [light_black](#{caller.first})[/]")
|
|
31
31
|
get_object_https_url(bucket_name, object_name, expires)
|
|
32
32
|
end
|
|
33
33
|
|
|
@@ -1,44 +1,54 @@
|
|
|
1
1
|
module Fog
|
|
2
2
|
module Storage
|
|
3
3
|
class AWS
|
|
4
|
+
|
|
4
5
|
private
|
|
5
6
|
def self.hash_to_acl(acl)
|
|
6
|
-
data =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<Owner
|
|
10
|
-
<ID>#{acl['Owner']['ID']}</ID
|
|
11
|
-
<DisplayName>#{acl['Owner']['DisplayName']}</DisplayName
|
|
12
|
-
</Owner
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
data = "<AccessControlPolicy>\n"
|
|
8
|
+
|
|
9
|
+
if acl['Owner'] && (acl['Owner']['ID'] || acl['Owner']['DisplayName'])
|
|
10
|
+
data << " <Owner>\n"
|
|
11
|
+
data << " <ID>#{acl['Owner']['ID']}</ID>\n" if acl['Owner']['ID']
|
|
12
|
+
data << " <DisplayName>#{acl['Owner']['DisplayName']}</DisplayName>\n" if acl['Owner']['DisplayName']
|
|
13
|
+
data << " </Owner>\n"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
grants = [acl['AccessControlList']].flatten.compact
|
|
17
|
+
|
|
18
|
+
data << " <AccessControlList>\n" if grants.any?
|
|
19
|
+
grants.each do |grant|
|
|
17
20
|
data << " <Grant>\n"
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
grantee = grant['Grantee']
|
|
22
|
+
type = case
|
|
23
|
+
when grantee.has_key?('ID')
|
|
20
24
|
'CanonicalUser'
|
|
21
|
-
when
|
|
25
|
+
when grantee.has_key?('EmailAddress')
|
|
22
26
|
'AmazonCustomerByEmail'
|
|
23
|
-
when
|
|
27
|
+
when grantee.has_key?('URI')
|
|
24
28
|
'Group'
|
|
25
29
|
end
|
|
30
|
+
|
|
26
31
|
data << " <Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"#{type}\">\n"
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
case type
|
|
33
|
+
when 'CanonicalUser'
|
|
34
|
+
data << " <ID>#{grantee['ID']}</ID>\n" if grantee['ID']
|
|
35
|
+
data << " <DisplayName>#{grantee['DisplayName']}</DisplayName>\n" if grantee['DisplayName']
|
|
36
|
+
when 'AmazonCustomerByEmail'
|
|
37
|
+
data << " <EmailAddress>#{grantee['EmailAddress']}</EmailAddress>\n" if grantee['EmailAddress']
|
|
38
|
+
when 'Group'
|
|
39
|
+
data << " <URI>#{grantee['URI']}</URI>\n" if grantee['URI']
|
|
40
|
+
end
|
|
29
41
|
data << " </Grantee>\n"
|
|
30
42
|
data << " <Permission>#{grant['Permission']}</Permission>\n"
|
|
31
43
|
data << " </Grant>\n"
|
|
32
44
|
end
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</AccessControlPolicy>
|
|
38
|
-
DATA
|
|
45
|
+
data << " </AccessControlList>\n" if grants.any?
|
|
46
|
+
|
|
47
|
+
data << "</AccessControlPolicy>"
|
|
48
|
+
|
|
39
49
|
data
|
|
40
50
|
end
|
|
51
|
+
|
|
41
52
|
end
|
|
42
|
-
end
|
|
53
|
+
end
|
|
43
54
|
end
|
|
44
|
-
|
data/lib/fog/aws/ses.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Fog
|
|
|
40
40
|
#
|
|
41
41
|
# ==== Parameters
|
|
42
42
|
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
|
43
|
-
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1'
|
|
43
|
+
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
|
|
44
44
|
#
|
|
45
45
|
# ==== Returns
|
|
46
46
|
# * SES object with connection to AWS.
|
data/lib/fog/aws/simpledb.rb
CHANGED
data/lib/fog/aws/sns.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Fog
|
|
|
5
5
|
class SNS < Fog::Service
|
|
6
6
|
|
|
7
7
|
requires :aws_access_key_id, :aws_secret_access_key
|
|
8
|
-
recognizes :host, :path, :port, :scheme, :persistent
|
|
8
|
+
recognizes :host, :path, :port, :scheme, :persistent, :region
|
|
9
9
|
|
|
10
10
|
request_path 'fog/aws/requests/sns'
|
|
11
11
|
request :add_permission
|
|
@@ -65,6 +65,8 @@ module Fog
|
|
|
65
65
|
'sns.us-east-1.amazonaws.com'
|
|
66
66
|
when 'us-west-1'
|
|
67
67
|
'sns.us-west-1.amazonaws.com'
|
|
68
|
+
when 'us-west-2'
|
|
69
|
+
'sns.us-west-2.amazonaws.com'
|
|
68
70
|
else
|
|
69
71
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
|
70
72
|
end
|
data/lib/fog/aws/sqs.rb
CHANGED
|
@@ -40,7 +40,7 @@ module Fog
|
|
|
40
40
|
|
|
41
41
|
@region = options[:region] || 'us-east-1'
|
|
42
42
|
|
|
43
|
-
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1'].include?(@region)
|
|
43
|
+
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
|
|
44
44
|
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -71,7 +71,7 @@ module Fog
|
|
|
71
71
|
#
|
|
72
72
|
# ==== Parameters
|
|
73
73
|
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
|
74
|
-
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'ap-southeast-1']
|
|
74
|
+
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
|
|
75
75
|
#
|
|
76
76
|
# ==== Returns
|
|
77
77
|
# * SQS object with connection to AWS.
|
|
@@ -90,6 +90,8 @@ module Fog
|
|
|
90
90
|
'queue.amazonaws.com'
|
|
91
91
|
when 'us-west-1'
|
|
92
92
|
'us-west-1.queue.amazonaws.com'
|
|
93
|
+
when 'us-west-2'
|
|
94
|
+
'us-west-2.queue.amazonaws.com'
|
|
93
95
|
else
|
|
94
96
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
|
95
97
|
end
|
data/lib/fog/aws/storage.rb
CHANGED
|
@@ -76,7 +76,7 @@ module Fog
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def url(params, expires)
|
|
79
|
-
Fog::Logger.
|
|
79
|
+
Fog::Logger.deprecation("Fog::Storage::AWS => #url is deprecated, use #https_url instead [light_black](#{caller.first})[/]")
|
|
80
80
|
https_url(params, expires)
|
|
81
81
|
end
|
|
82
82
|
|
|
@@ -199,6 +199,8 @@ module Fog
|
|
|
199
199
|
's3.amazonaws.com'
|
|
200
200
|
when 'us-west-1'
|
|
201
201
|
's3-us-west-1.amazonaws.com'
|
|
202
|
+
when 'us-west-2'
|
|
203
|
+
's3-us-west-2.amazonaws.com'
|
|
202
204
|
else
|
|
203
205
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
|
204
206
|
end
|
|
@@ -229,7 +231,8 @@ module Fog
|
|
|
229
231
|
# :aws_secret_access_key in order to create a connection
|
|
230
232
|
#
|
|
231
233
|
# ==== Examples
|
|
232
|
-
# s3 =
|
|
234
|
+
# s3 = Fog::Storage.new(
|
|
235
|
+
# :provider => "AWS",
|
|
233
236
|
# :aws_access_key_id => your_aws_access_key_id,
|
|
234
237
|
# :aws_secret_access_key => your_aws_secret_access_key
|
|
235
238
|
# )
|
|
@@ -250,7 +253,11 @@ module Fog
|
|
|
250
253
|
if @endpoint = options[:endpoint]
|
|
251
254
|
endpoint = URI.parse(@endpoint)
|
|
252
255
|
@host = endpoint.host
|
|
253
|
-
@path = endpoint.path
|
|
256
|
+
@path = if endpoint.path.empty?
|
|
257
|
+
'/'
|
|
258
|
+
else
|
|
259
|
+
endpoint.path
|
|
260
|
+
end
|
|
254
261
|
@port = endpoint.port
|
|
255
262
|
@scheme = endpoint.scheme
|
|
256
263
|
else
|
|
@@ -266,6 +273,8 @@ module Fog
|
|
|
266
273
|
's3.amazonaws.com'
|
|
267
274
|
when 'us-west-1'
|
|
268
275
|
's3-us-west-1.amazonaws.com'
|
|
276
|
+
when 'us-west-2'
|
|
277
|
+
's3-us-west-2.amazonaws.com'
|
|
269
278
|
else
|
|
270
279
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
|
271
280
|
end
|