fog 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -6,7 +6,7 @@ module Fog
|
|
6
6
|
class SpotInstanceRequests < Fog::Parsers::Base
|
7
7
|
|
8
8
|
def reset
|
9
|
-
@block_device_mapping =
|
9
|
+
@block_device_mapping = {}
|
10
10
|
@context = []
|
11
11
|
@contexts = ['blockDeviceMapping', 'groupSet']
|
12
12
|
@spot_instance_request = { 'launchSpecification' => { 'blockDeviceMapping' => [], 'groupSet' => [] } }
|
@@ -42,7 +42,7 @@ module Fog
|
|
42
42
|
when 'item'
|
43
43
|
case @context.last
|
44
44
|
when 'blockDeviceMapping'
|
45
|
-
@
|
45
|
+
@spot_instance_request['launchSpecification']['blockDeviceMapping'] << @block_device_mapping
|
46
46
|
@block_device_mapping = {}
|
47
47
|
when nil
|
48
48
|
@response['spotInstanceRequestSet'] << @spot_instance_request
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module EMR
|
5
|
+
|
6
|
+
class AddInstanceGroups < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def start_element(name, attrs = [])
|
9
|
+
super
|
10
|
+
case name
|
11
|
+
when 'InstanceGroupIds'
|
12
|
+
@response['InstanceGroupIds'] = []
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def end_element(name)
|
17
|
+
case name
|
18
|
+
when 'JobFlowId'
|
19
|
+
@response[name] = value
|
20
|
+
when 'member'
|
21
|
+
@response['InstanceGroupIds'] << value
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module EMR
|
5
|
+
|
6
|
+
class DescribeJobFlows < Fog::Parsers::Base
|
7
|
+
|
8
|
+
def reset
|
9
|
+
@context = []
|
10
|
+
@contexts = ['BootstrapActions', 'ExecutionStatusDetail', 'Instances', 'Steps', 'InstanceGroups', 'Args']
|
11
|
+
|
12
|
+
@response = { 'JobFlows' => [] }
|
13
|
+
@bootstrap_actions = {'ScriptBootstrapActionConfig' => {'Args' => []}}
|
14
|
+
@instance = { 'InstanceGroups' => [], 'Placement' => {}}
|
15
|
+
@step = {
|
16
|
+
'ExecutionStatusDetail' => {},
|
17
|
+
'StepConfig' => {
|
18
|
+
'HadoopJarStepConfig' => {
|
19
|
+
'Args' => [],
|
20
|
+
'Properties' => []
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
@flow = {'Instances' => [], 'ExecutionStatusDetail' => {}, 'BootstrapActions' => [], 'Steps' => []}
|
25
|
+
@instance_group_detail = {}
|
26
|
+
@execution_status_detail = {}
|
27
|
+
end
|
28
|
+
|
29
|
+
def start_element(name, attrs = [])
|
30
|
+
super
|
31
|
+
if @contexts.include?(name)
|
32
|
+
@context.push(name)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def end_element(name)
|
37
|
+
if @context.last == 'BootstrapActions'
|
38
|
+
case name
|
39
|
+
when 'Name'
|
40
|
+
@bootstrap_actions[name] = value
|
41
|
+
when 'Path'
|
42
|
+
@bootstrap_actions['ScriptBootstrapActionConfig'][name] = value
|
43
|
+
when 'BootstrapActions'
|
44
|
+
@flow['BootstrapActions'] = @bootstrap_actions
|
45
|
+
@bootstrap_actions = {'ScriptBootstrapActionConfig' => {'Args' => []}}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if @context.last == 'ExecutionStatusDetail'
|
50
|
+
case name
|
51
|
+
when 'CreationDateTime', 'EndDateTime', 'LastStateChangeReason',
|
52
|
+
'ReadyDateTime', 'StartDateTime', 'State'
|
53
|
+
@execution_status_detail[name] = value
|
54
|
+
when 'ExecutionStatusDetail'
|
55
|
+
if @context.include?('Steps')
|
56
|
+
@step['ExecutionStatusDetail'] = @execution_status_detail
|
57
|
+
else
|
58
|
+
@flow['ExecutionStatusDetail'] = @execution_status_detail
|
59
|
+
end
|
60
|
+
@execution_status_detail = {}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if @context.last == 'Instances'
|
65
|
+
case name
|
66
|
+
when 'AvailabilityZone'
|
67
|
+
@instance['Placement'][name] = value
|
68
|
+
when 'Ec2KeyName', 'HadoopVersion', 'InstanceCount', 'KeepJobFlowAliveWhenNoSteps',
|
69
|
+
'MasterInstanceId', 'MasterInstanceType', 'MasterPublicDnsName', 'NormalizedInstanceHours',
|
70
|
+
'SlaveInstanceType', 'TerminationProtected'
|
71
|
+
@instance[name] = value
|
72
|
+
when 'member'
|
73
|
+
@instance['InstanceGroups'] << @instance_group_detail
|
74
|
+
@instance_group_detail = {}
|
75
|
+
when 'Instances'
|
76
|
+
@flow['Instances'] = @instance
|
77
|
+
@instance = { 'InstanceGroups' => [], 'Placement' => {}}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
if @context.last == 'InstanceGroups'
|
82
|
+
case name
|
83
|
+
when 'member'
|
84
|
+
@instance['InstanceGroups'] << @instance_group_detail
|
85
|
+
@instance_group_detail = {}
|
86
|
+
else
|
87
|
+
@instance_group_detail[name] = value
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
if @context.last == 'Args'
|
92
|
+
if name == 'member'
|
93
|
+
if @context.include?('Steps')
|
94
|
+
@step['StepConfig']['HadoopJarStepConfig']['Args'] << value.strip
|
95
|
+
else
|
96
|
+
@bootstrap_actions['ScriptBootstrapActionConfig']['Args'] << value
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
if @context.last == 'Steps'
|
102
|
+
case name
|
103
|
+
when 'ActionOnFailure', 'Name'
|
104
|
+
@step[name] = value
|
105
|
+
when 'Jar', 'MainClass'
|
106
|
+
@step['StepConfig']['HadoopJarStepConfig'][name] = value
|
107
|
+
when 'member'
|
108
|
+
@flow['Steps'] << @step
|
109
|
+
@step = {
|
110
|
+
'ExecutionStatusDetail' => {},
|
111
|
+
'StepConfig' => {
|
112
|
+
'HadoopJarStepConfig' => {
|
113
|
+
'Args' => [],
|
114
|
+
'Properties' => []
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
if @context.empty?
|
122
|
+
case name
|
123
|
+
when 'AmiVersion', 'JobFlowId', 'LogUri', 'Name'
|
124
|
+
@flow[name] = value
|
125
|
+
when 'member'
|
126
|
+
@response['JobFlows'] << @flow
|
127
|
+
@flow = {'Instances' => [], 'ExecutionStatusDetail' => {}, 'BootstrapActions' => [], 'Steps' => []}
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
if @context.last == name
|
132
|
+
@context.pop
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Fog
|
2
|
+
module Parsers
|
3
|
+
module AWS
|
4
|
+
module EMR
|
5
|
+
|
6
|
+
class RunJobFlow < Fog::Parsers::Base
|
7
|
+
def end_element(name)
|
8
|
+
case name
|
9
|
+
when 'JobFlowId'
|
10
|
+
@response[name] = value
|
11
|
+
when 'RequestId'
|
12
|
+
@response[name] = value
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/fog/aws/rds.rb
CHANGED
@@ -79,7 +79,7 @@ module Fog
|
|
79
79
|
#
|
80
80
|
# ==== Parameters
|
81
81
|
# * options<~Hash> - config arguments for connection. Defaults to {}.
|
82
|
-
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1'
|
82
|
+
# * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1', 'us-west-2', 'ap-southeast-1']
|
83
83
|
#
|
84
84
|
# ==== Returns
|
85
85
|
# * ELB object with connection to AWS.
|
@@ -101,6 +101,8 @@ module Fog
|
|
101
101
|
'rds.us-east-1.amazonaws.com'
|
102
102
|
when 'us-west-1'
|
103
103
|
'rds.us-west-1.amazonaws.com'
|
104
|
+
when 'us-west-2'
|
105
|
+
'rds.us-west-2.amazonaws.com'
|
104
106
|
else
|
105
107
|
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
106
108
|
end
|
@@ -17,6 +17,8 @@ module Fog
|
|
17
17
|
# * NotificationARNs<~Array>: List of SNS topics to publish events to
|
18
18
|
# * Parameters<~Hash>: Hash of providers to supply to template
|
19
19
|
# * TimeoutInMinutes<~Integer>: Minutes to wait before status is set to CREATE_FAILED
|
20
|
+
# * Capabilities<~Array>: List of capabilties the stack is granted. Currently CAPABILITY_IAM
|
21
|
+
# for allowing the creation of IAM resources
|
20
22
|
#
|
21
23
|
# ==== Returns
|
22
24
|
# * response<~Excon::Response>:
|
@@ -58,6 +60,10 @@ module Fog
|
|
58
60
|
if options['TimeoutInMinutes']
|
59
61
|
params['TimeoutInMinutes'] = options['TimeoutInMinutes']
|
60
62
|
end
|
63
|
+
|
64
|
+
if options['Capabilities']
|
65
|
+
params.merge!(Fog::AWS.indexed_param("Capabilities.member", [*options['Capabilities']]))
|
66
|
+
end
|
61
67
|
|
62
68
|
request({
|
63
69
|
'Action' => 'CreateStack',
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class CloudFormation
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/cloud_formation/update_stack'
|
7
|
+
|
8
|
+
# Update a stack
|
9
|
+
#
|
10
|
+
# ==== Parameters
|
11
|
+
# * stack_name<~String>: name of the stack to update
|
12
|
+
# * options<~Hash>:
|
13
|
+
# * TemplateBody<~String>: structure containing the template body
|
14
|
+
# or (one of the two Template parameters is required)
|
15
|
+
# * TemplateURL<~String>: URL of file containing the template body
|
16
|
+
# * Parameters<~Hash>: Hash of providers to supply to template
|
17
|
+
# * Capabilities<~Array>: List of capabilties the stack is granted. Currently CAPABILITY_IAM
|
18
|
+
# for allowing the creation of IAM resources
|
19
|
+
#
|
20
|
+
# ==== Returns
|
21
|
+
# * response<~Excon::Response>:
|
22
|
+
# * body<~Hash>:
|
23
|
+
# * 'StackId'<~String> - Id of the stack being updated
|
24
|
+
#
|
25
|
+
# ==== See Also
|
26
|
+
# http://docs.amazonwebservices.com/AWSCloudFormation/latest/APIReference/API_UpdateStack.html
|
27
|
+
#
|
28
|
+
def update_stack(stack_name, options = {})
|
29
|
+
params = {
|
30
|
+
'StackName' => stack_name,
|
31
|
+
}
|
32
|
+
|
33
|
+
if options['Parameters']
|
34
|
+
options['Parameters'].keys.each_with_index do |key, index|
|
35
|
+
index += 1 # params are 1-indexed
|
36
|
+
params.merge!({
|
37
|
+
"Parameters.member.#{index}.ParameterKey" => key,
|
38
|
+
"Parameters.member.#{index}.ParameterValue" => options['Parameters'][key]
|
39
|
+
})
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
if options['TemplateBody']
|
44
|
+
params['TemplateBody'] = options['TemplateBody']
|
45
|
+
elsif options['TemplateURL']
|
46
|
+
params['TemplateURL'] = options['TemplateURL']
|
47
|
+
end
|
48
|
+
|
49
|
+
if options['Capabilities']
|
50
|
+
params.merge!(Fog::AWS.indexed_param("Capabilities.member", [*options['Capabilities']]))
|
51
|
+
end
|
52
|
+
|
53
|
+
request({
|
54
|
+
'Action' => 'UpdateStack',
|
55
|
+
:parser => Fog::Parsers::AWS::CloudFormation::UpdateStack.new
|
56
|
+
}.merge!(params))
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class CloudWatch
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/cloud_watch/delete_alarms'
|
7
|
+
|
8
|
+
# Delete a list of alarms
|
9
|
+
# ==== Options
|
10
|
+
# * AlarmNames<~Array>: A list of alarms to be deleted
|
11
|
+
#
|
12
|
+
# ==== Returns
|
13
|
+
# * response<~Excon::Response>:
|
14
|
+
#
|
15
|
+
# ==== See Also
|
16
|
+
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/index.html?API_DeleteAlarms.html
|
17
|
+
#
|
18
|
+
|
19
|
+
def delete_alarms(alarm_names)
|
20
|
+
options = {}
|
21
|
+
options.merge!(AWS.indexed_param('AlarmNames.member.%d', [*alarm_names]))
|
22
|
+
request({
|
23
|
+
'Action' => 'DeleteAlarms',
|
24
|
+
:parser => Fog::Parsers::AWS::CloudWatch::DeleteAlarms.new
|
25
|
+
}.merge(options))
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Fog
|
2
|
+
module AWS
|
3
|
+
class CloudWatch
|
4
|
+
class Real
|
5
|
+
|
6
|
+
require 'fog/aws/parsers/cloud_watch/describe_alarm_history'
|
7
|
+
|
8
|
+
# Retrieves history for the specified alarm
|
9
|
+
# ==== Options
|
10
|
+
# * AlarmName<~String>: The name of the alarm
|
11
|
+
# * EndDate<~DateTime>: The ending date to retrieve alarm history
|
12
|
+
# * HistoryItemType<~String>: The type of alarm histories to retrieve
|
13
|
+
# * MaxRecords<~Integer>: The maximum number of alarm history records to retrieve
|
14
|
+
# * NextToken<~String> The token returned by a previous call to indicate that there is more data available
|
15
|
+
# * StartData<~DateTime>: The starting date to retrieve alarm history
|
16
|
+
#
|
17
|
+
# ==== Returns
|
18
|
+
# * response<~Excon::Response>:
|
19
|
+
#
|
20
|
+
# ==== See Also
|
21
|
+
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/index.html?API_DescribeAlarmHistory.html
|
22
|
+
#
|
23
|
+
|
24
|
+
def describe_alarm_history(options={})
|
25
|
+
request({
|
26
|
+
'Action' => 'DescribeAlarmHistory',
|
27
|
+
:parser => Fog::Parsers::AWS::CloudWatch::DescribeAlarmHistory.new
|
28
|
+
}.merge(options))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|