fog 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/Gemfile.lock +11 -6
  2. data/changelog.txt +49 -0
  3. data/fog.gemspec +5 -4
  4. data/lib/fog.rb +1 -1
  5. data/lib/fog/aws/cloud_formation.rb +124 -0
  6. data/lib/fog/aws/elb.rb +4 -1
  7. data/lib/fog/aws/iam.rb +6 -0
  8. data/lib/fog/aws/parsers/cloud_formation/basic.rb +12 -0
  9. data/lib/fog/aws/parsers/cloud_formation/create_stack.rb +19 -0
  10. data/lib/fog/aws/parsers/cloud_formation/describe_stack_events.rb +31 -0
  11. data/lib/fog/aws/parsers/cloud_formation/describe_stack_resources.rb +31 -0
  12. data/lib/fog/aws/parsers/cloud_formation/describe_stacks.rb +72 -0
  13. data/lib/fog/aws/parsers/cloud_formation/get_template.rb +19 -0
  14. data/lib/fog/aws/parsers/cloud_formation/validate_template.rb +52 -0
  15. data/lib/fog/aws/parsers/iam/login_profile.rb +27 -0
  16. data/lib/fog/aws/parsers/iam/upload_server_certificate.rb +26 -0
  17. data/lib/fog/aws/parsers/rds/authorize_db_security_group_ingress.rb +38 -0
  18. data/lib/fog/aws/parsers/rds/create_db_instance.rb +34 -0
  19. data/lib/fog/aws/parsers/rds/create_db_instance_read_replica.rb +34 -0
  20. data/lib/fog/aws/parsers/rds/create_db_parameter_group.rb +35 -0
  21. data/lib/fog/aws/parsers/rds/create_db_security_group.rb +38 -0
  22. data/lib/fog/aws/parsers/rds/create_db_snapshot.rb +35 -0
  23. data/lib/fog/aws/parsers/rds/db_parser.rb +123 -0
  24. data/lib/fog/aws/parsers/rds/delete_db_instance.rb +35 -0
  25. data/lib/fog/aws/parsers/rds/delete_db_parameter_group.rb +27 -0
  26. data/lib/fog/aws/parsers/rds/delete_db_security_group.rb +33 -0
  27. data/lib/fog/aws/parsers/rds/delete_db_snapshot.rb +34 -0
  28. data/lib/fog/aws/parsers/rds/describe_db_instances.rb +36 -0
  29. data/lib/fog/aws/parsers/rds/describe_db_parameter_groups.rb +38 -0
  30. data/lib/fog/aws/parsers/rds/describe_db_parameters.rb +44 -0
  31. data/lib/fog/aws/parsers/rds/describe_db_security_groups.rb +39 -0
  32. data/lib/fog/aws/parsers/rds/describe_db_snapshots.rb +39 -0
  33. data/lib/fog/aws/parsers/rds/modify_db_instance.rb +34 -0
  34. data/lib/fog/aws/parsers/rds/modify_db_parameter_group.rb +28 -0
  35. data/lib/fog/aws/parsers/rds/reboot_db_instance.rb +35 -0
  36. data/lib/fog/aws/parsers/rds/restore_db_instance_from_db_snapshot.rb +34 -0
  37. data/lib/fog/aws/parsers/rds/restore_db_instance_to_point_in_time.rb +35 -0
  38. data/lib/fog/aws/parsers/rds/revoke_db_security_group_ingress.rb +39 -0
  39. data/lib/fog/aws/parsers/rds/security_group_parser.rb +39 -0
  40. data/lib/fog/aws/parsers/rds/snapshot_parser.rb +40 -0
  41. data/lib/fog/aws/rds.rb +161 -0
  42. data/lib/fog/aws/rds/models/parameter.rb +21 -0
  43. data/lib/fog/aws/rds/models/parameter_group.rb +36 -0
  44. data/lib/fog/aws/rds/models/parameter_groups.rb +27 -0
  45. data/lib/fog/aws/rds/models/parameters.rb +37 -0
  46. data/lib/fog/aws/rds/models/security_group.rb +73 -0
  47. data/lib/fog/aws/rds/models/security_groups.rb +43 -0
  48. data/lib/fog/aws/rds/models/server.rb +105 -0
  49. data/lib/fog/aws/rds/models/servers.rb +27 -0
  50. data/lib/fog/aws/rds/models/snapshot.rb +49 -0
  51. data/lib/fog/aws/rds/models/snapshots.rb +45 -0
  52. data/lib/fog/aws/requests/cloud_formation/create_stack.rb +71 -0
  53. data/lib/fog/aws/requests/cloud_formation/delete_stack.rb +30 -0
  54. data/lib/fog/aws/requests/cloud_formation/describe_stack_events.rb +44 -0
  55. data/lib/fog/aws/requests/cloud_formation/describe_stack_resources.rb +43 -0
  56. data/lib/fog/aws/requests/cloud_formation/describe_stacks.rb +42 -0
  57. data/lib/fog/aws/requests/cloud_formation/get_template.rb +32 -0
  58. data/lib/fog/aws/requests/cloud_formation/validate_template.rb +34 -0
  59. data/lib/fog/aws/requests/elb/create_load_balancer.rb +4 -0
  60. data/lib/fog/aws/requests/iam/create_login_profile.rb +36 -0
  61. data/lib/fog/aws/requests/iam/delete_login_profile.rb +31 -0
  62. data/lib/fog/aws/requests/iam/delete_server_certificate.rb +32 -0
  63. data/lib/fog/aws/requests/iam/get_login_profile.rb +35 -0
  64. data/lib/fog/aws/requests/iam/update_login_profile.rb +33 -0
  65. data/lib/fog/aws/requests/iam/upload_server_certificate.rb +45 -0
  66. data/lib/fog/aws/requests/rds/authorize_db_security_group_ingress.rb +43 -0
  67. data/lib/fog/aws/requests/rds/create_db_instance.rb +56 -0
  68. data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +42 -0
  69. data/lib/fog/aws/requests/rds/create_db_parameter_group.rb +41 -0
  70. data/lib/fog/aws/requests/rds/create_db_security_group.rb +37 -0
  71. data/lib/fog/aws/requests/rds/create_db_snapshot.rb +36 -0
  72. data/lib/fog/aws/requests/rds/delete_db_instance.rb +40 -0
  73. data/lib/fog/aws/requests/rds/delete_db_parameter_group.rb +36 -0
  74. data/lib/fog/aws/requests/rds/delete_db_security_group.rb +36 -0
  75. data/lib/fog/aws/requests/rds/delete_db_snapshot.rb +36 -0
  76. data/lib/fog/aws/requests/rds/describe_db_instances.rb +42 -0
  77. data/lib/fog/aws/requests/rds/describe_db_parameter_groups.rb +45 -0
  78. data/lib/fog/aws/requests/rds/describe_db_parameters.rb +46 -0
  79. data/lib/fog/aws/requests/rds/describe_db_security_groups.rb +39 -0
  80. data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +42 -0
  81. data/lib/fog/aws/requests/rds/modify_db_instance.rb +54 -0
  82. data/lib/fog/aws/requests/rds/modify_db_parameter_group.rb +55 -0
  83. data/lib/fog/aws/requests/rds/reboot_db_instance.rb +34 -0
  84. data/lib/fog/aws/requests/rds/restore_db_instance_from_db_snapshot.rb +34 -0
  85. data/lib/fog/aws/requests/rds/restore_db_instance_to_point_in_time.rb +35 -0
  86. data/lib/fog/aws/requests/rds/revoke_db_security_group_ingress.rb +44 -0
  87. data/lib/fog/aws/simpledb.rb +21 -7
  88. data/lib/fog/bin.rb +2 -1
  89. data/lib/fog/bin/aws.rb +8 -0
  90. data/lib/fog/bin/virtual_box.rb +52 -0
  91. data/lib/fog/cdn/aws.rb +9 -8
  92. data/lib/fog/cdn/rackspace.rb +6 -6
  93. data/lib/fog/cdn/requests/rackspace/post_container.rb +30 -0
  94. data/lib/fog/cdn/requests/rackspace/put_container.rb +1 -1
  95. data/lib/fog/compute.rb +6 -3
  96. data/lib/fog/compute/aws.rb +11 -7
  97. data/lib/fog/compute/bluebox.rb +5 -6
  98. data/lib/fog/compute/brightbox.rb +3 -0
  99. data/lib/fog/compute/go_grid.rb +5 -6
  100. data/lib/fog/compute/linode.rb +5 -6
  101. data/lib/fog/compute/models/aws/flavors.rb +19 -18
  102. data/lib/fog/compute/models/aws/server.rb +23 -0
  103. data/lib/fog/compute/models/aws/tag.rb +1 -1
  104. data/lib/fog/compute/models/brightbox/server.rb +7 -1
  105. data/lib/fog/compute/models/virtual_box/medium.rb +87 -0
  106. data/lib/fog/compute/models/virtual_box/medium_format.rb +34 -0
  107. data/lib/fog/compute/models/virtual_box/mediums.rb +32 -0
  108. data/lib/fog/compute/models/virtual_box/nat_engine.rb +65 -0
  109. data/lib/fog/compute/models/virtual_box/nat_redirect.rb +91 -0
  110. data/lib/fog/compute/models/virtual_box/nat_redirects.rb +41 -0
  111. data/lib/fog/compute/models/virtual_box/network_adapter.rb +82 -0
  112. data/lib/fog/compute/models/virtual_box/network_adapters.rb +42 -0
  113. data/lib/fog/compute/models/virtual_box/server.rb +241 -0
  114. data/lib/fog/compute/models/virtual_box/servers.rb +41 -0
  115. data/lib/fog/compute/models/virtual_box/storage_controller.rb +83 -0
  116. data/lib/fog/compute/models/virtual_box/storage_controllers.rb +38 -0
  117. data/lib/fog/compute/models/voxel/servers.rb +7 -6
  118. data/lib/fog/compute/new_servers.rb +5 -6
  119. data/lib/fog/compute/parsers/aws/monitor_unmonitor_instances.rb +35 -0
  120. data/lib/fog/compute/rackspace.rb +7 -7
  121. data/lib/fog/compute/requests/aws/delete_tags.rb +12 -9
  122. data/lib/fog/compute/requests/aws/monitor_instances.rb +52 -0
  123. data/lib/fog/compute/requests/aws/revoke_security_group_ingress.rb +24 -8
  124. data/lib/fog/compute/requests/aws/unmonitor_instances.rb +53 -0
  125. data/lib/fog/compute/requests/brightbox/activate_console_server.rb +20 -0
  126. data/lib/fog/compute/requests/brightbox/add_listeners_load_balancer.rb +20 -0
  127. data/lib/fog/compute/requests/brightbox/remove_listeners_load_balancer.rb +20 -0
  128. data/lib/fog/compute/slicehost.rb +5 -6
  129. data/lib/fog/compute/virtual_box.rb +48 -0
  130. data/lib/fog/compute/voxel.rb +30 -27
  131. data/lib/fog/core.rb +1 -0
  132. data/lib/fog/core/attributes.rb +3 -1
  133. data/lib/fog/core/collection.rb +2 -2
  134. data/lib/fog/core/credentials.rb +13 -3
  135. data/lib/fog/core/scp.rb +0 -4
  136. data/lib/fog/core/service.rb +0 -8
  137. data/lib/fog/core/ssh.rb +0 -4
  138. data/lib/fog/dns.rb +3 -3
  139. data/lib/fog/dns/aws.rb +8 -8
  140. data/lib/fog/dns/bluebox.rb +5 -7
  141. data/lib/fog/dns/dnsimple.rb +7 -7
  142. data/lib/fog/dns/linode.rb +5 -6
  143. data/lib/fog/dns/models/dnsimple/record.rb +11 -1
  144. data/lib/fog/dns/models/dnsimple/records.rb +7 -7
  145. data/lib/fog/dns/models/dnsimple/zones.rb +2 -1
  146. data/lib/fog/dns/requests/dnsimple/get_record.rb +34 -0
  147. data/lib/fog/dns/slicehost.rb +5 -6
  148. data/lib/fog/dns/zerigo.rb +5 -7
  149. data/lib/fog/providers.rb +2 -1
  150. data/lib/fog/providers/aws.rb +10 -8
  151. data/lib/fog/providers/virtual_box.rb +11 -0
  152. data/lib/fog/storage.rb +21 -0
  153. data/lib/fog/storage/aws.rb +16 -32
  154. data/lib/fog/storage/google.rb +6 -27
  155. data/lib/fog/storage/local.rb +7 -7
  156. data/lib/fog/storage/models/rackspace/directory.rb +1 -1
  157. data/lib/fog/storage/models/rackspace/file.rb +1 -0
  158. data/lib/fog/storage/rackspace.rb +5 -27
  159. data/lib/fog/storage/requests/aws/put_object.rb +2 -2
  160. data/lib/fog/storage/requests/aws/upload_part.rb +1 -1
  161. data/lib/fog/storage/requests/google/put_object.rb +2 -2
  162. data/lib/fog/storage/requests/rackspace/put_object.rb +1 -1
  163. data/tests/aws/requests/cloud_formation/stack_tests.rb +130 -0
  164. data/tests/aws/requests/iam/login_profile_tests.rb +64 -0
  165. data/tests/aws/requests/rds/helper.rb +169 -0
  166. data/tests/aws/requests/rds/instance_tests.rb +129 -0
  167. data/tests/aws/requests/rds/model_tests.rb +98 -0
  168. data/tests/aws/requests/rds/parameter_group_tests.rb +68 -0
  169. data/tests/aws/requests/rds/parameter_request_tests.rb +35 -0
  170. data/tests/compute/models/aws/server_monitor_tests.rb +47 -0
  171. data/tests/compute/models/server_tests.rb +7 -23
  172. data/tests/compute/parsers/aws/monitor_unmonitor_instances_tests.rb +49 -0
  173. data/tests/compute/requests/aws/security_group_tests.rb +69 -52
  174. data/tests/compute/requests/aws/tag_tests.rb +5 -5
  175. data/tests/compute/requests/brightbox/helper.rb +7 -6
  176. data/tests/compute/requests/brightbox/server_tests.rb +5 -0
  177. data/tests/compute/requests/voxel/server_tests.rb +2 -3
  178. data/tests/storage/requests/aws/bucket_tests.rb +10 -0
  179. metadata +148 -12
@@ -0,0 +1,39 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/describe_db_security_groups'
7
+
8
+ # Describe all or specified db snapshots
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/index.html?API_DescribeDBSecurityGroups.html
10
+ # ==== Parameters
11
+ # * DBSecurityGroupName <~String> - The name of the DB Security Group to return details for.
12
+ # * Marker <~String> - An optional marker provided in the previous DescribeDBInstances request
13
+ # * MaxRecords <~Integer> - Max number of records to return (between 20 and 100)
14
+ # Only one of DBInstanceIdentifier or DBSnapshotIdentifier can be specified
15
+ # ==== Returns
16
+ # * response<~Excon::Response>:
17
+ # * body<~Hash>:
18
+ def describe_db_security_groups(opts={})
19
+ opts = {'DBSecurityGroupName' => opts} if opts.is_a?(String)
20
+
21
+ request({
22
+ 'Action' => 'DescribeDBSecurityGroups',
23
+ :parser => Fog::Parsers::AWS::RDS::DescribeDBSecurityGroups.new
24
+ }.merge(opts))
25
+ end
26
+
27
+ end
28
+
29
+ class Mock
30
+
31
+ def describe_db_security_group(opts={})
32
+ Fog::Mock.not_implemented
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ end
39
+
@@ -0,0 +1,42 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/describe_db_snapshots'
7
+
8
+ # Describe all or specified db snapshots
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DescribeDBSnapshots.html
10
+ # ==== Parameters
11
+ # * DBInstanceIdentifier <~String> - ID of instance to retrieve information for. if absent information for all instances is returned
12
+ # * DBSnapshotIdentifier <~String> - ID of snapshot to retrieve information for. if absent information for all snapshots is returned
13
+ # * Marker <~String> - An optional marker provided in the previous DescribeDBInstances request
14
+ # * MaxRecords <~Integer> - Max number of records to return (between 20 and 100)
15
+ # Only one of DBInstanceIdentifier or DBSnapshotIdentifier can be specified
16
+ # ==== Returns
17
+ # * response<~Excon::Response>:
18
+ # * body<~Hash>:
19
+ def describe_db_snapshots(opts={})
20
+ params = {}
21
+ params['DBInstanceIdentifier'] = opts[:identifier] if opts[:identifier]
22
+ params['DBSnapshotIdentifier'] = opts[:snapshot_id] if opts[:snapshot_id]
23
+ params['Marker'] = opts[:marker] if opts[:marker]
24
+ params['MaxRecords'] = opts[:max_records] if opts[:max_records]
25
+ request({
26
+ 'Action' => 'DescribeDBSnapshots',
27
+ :parser => Fog::Parsers::AWS::RDS::DescribeDBSnapshots.new
28
+ }.merge(params))
29
+ end
30
+
31
+ end
32
+
33
+ class Mock
34
+
35
+ def describe_db_snapshots(opts={})
36
+ Fog::Mock.not_implemented
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,54 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/modify_db_instance'
7
+
8
+ # modifies a database instance
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html
10
+ # ==== Parameters
11
+ # * DBInstanceIdentifier <~String> - name of the db instance to modify
12
+ # * ApplyImmediately <~Boolean> - whether to apply the changes immediately or wait for the next maintenance window
13
+ #
14
+ # * AllocatedStorage <~Integer> Storage space, in GB
15
+ # * AllowMajorVersionUpgrade <~Boolean> Must be set to true if EngineVersion specifies a different major version
16
+ # * AutoMinorVersionUpgrade <~Boolean> Indicates that minor version upgrades will be applied automatically to the DB Instance during the maintenance window
17
+ # * BackupRetentionPeriod <~Integer> 0-8 The number of days to retain automated backups.
18
+ # * DBInstanceClass <~String> The new compute and memory capacity of the DB Instanc
19
+ # * DBParameterGroupName <~String> The name of the DB Parameter Group to apply to this DB Instance
20
+ # * DBSecurityGroups <~Array> A list of DB Security Groups to authorize on this DB Instance
21
+ # * EngineVersion <~String> The version number of the database engine to upgrade to.
22
+ # * MasterUserPassword <~String> The new password for the DB Instance master user
23
+ # * MultiAZ <~Boolean> Specifies if the DB Instance is a Multi-AZ deployment
24
+ # * PreferredBackupWindow <~String> The daily time range during which automated backups are created if automated backups are enabled
25
+ # * PreferredMaintenanceWindow <~String> The weekly time range (in UTC) during which system maintenance can occur, which may result in an outage
26
+ # ==== Returns
27
+ # * response<~Excon::Response>:
28
+ # * body<~Hash>:
29
+ def modify_db_instance(db_name, apply_immediately, options={})
30
+
31
+ if security_groups = options.delete('DBSecurityGroups')
32
+ options.merge!(AWS.indexed_param('DBSecurityGroups.member.%d', [*security_groups]))
33
+ end
34
+
35
+ request({
36
+ 'Action' => 'ModifyDBInstance',
37
+ 'DBInstanceIdentifier' => db_name,
38
+ 'ApplyImmediately' => apply_immediately,
39
+ :parser => Fog::Parsers::AWS::RDS::ModifyDBInstance.new,
40
+ }.merge(options))
41
+ end
42
+
43
+ end
44
+
45
+ class Mock
46
+
47
+ def modify_db_instance(db_name, apply_immediately, options={})
48
+ Fog::Mock.not_implemented
49
+ end
50
+
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,55 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/modify_db_parameter_group'
7
+
8
+ # modifies a database parameter group
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_ModifyDBParameterGroup.html
10
+ # ==== Parameters
11
+ # * DBParameterGroupName <~String> - name of the parameter group
12
+ # * Parameters<~Array> - Array of up to 20 Hashes describing parameters to set
13
+ # * 'ParameterName'<~String> - parameter name.
14
+ # * 'ParameterValue'<~String> - new paremeter value
15
+ # * 'ApplyMethod'<~String> - immediate | pending-reboot whether to set the parameter immediately or not (may require an instance restart)
16
+ #
17
+ # ==== Returns
18
+ # * response<~Excon::Response>:
19
+ # * body<~Hash>:
20
+ def modify_db_parameter_group(group_name, parameters)
21
+
22
+ parameter_names = []
23
+ parameter_values = []
24
+ parameter_apply_methods = []
25
+
26
+ parameters.each do |parameter|
27
+ parameter_names.push(parameter['ParameterName'])
28
+ parameter_values.push(parameter['ParameterValue'])
29
+ parameter_apply_methods.push(parameter['ApplyMethod'])
30
+ end
31
+ params = {}
32
+ params.merge!(AWS.indexed_param('Parameters.member.%d.ParameterName', parameter_names))
33
+ params.merge!(AWS.indexed_param('Parameters.member.%d.ParameterValue', parameter_values))
34
+ params.merge!(AWS.indexed_param('Parameters.member.%d.ApplyMethod', parameter_apply_methods))
35
+
36
+ request({
37
+ 'Action' => 'ModifyDBParameterGroup',
38
+ 'DBParameterGroupName' => group_name,
39
+
40
+ :parser => Fog::Parsers::AWS::RDS::ModifyDbParameterGroup.new
41
+ }.merge(params))
42
+ end
43
+
44
+ end
45
+
46
+ class Mock
47
+
48
+ def modify_db_parameter_group(group_name, parameters)
49
+ Fog::Mock.not_implemented
50
+ end
51
+
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,34 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/reboot_db_instance'
7
+
8
+ # reboots a database instance
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_RebootDBInstance.html
10
+ # ==== Parameters
11
+ # * DBInstanceIdentifier <~String> - name of the db instance to reboot
12
+ # ==== Returns
13
+ # * response<~Excon::Response>:
14
+ # * body<~Hash>:
15
+ def reboot_db_instance(instance_identifier)
16
+ request({
17
+ 'Action' => 'RebootDBInstance',
18
+ 'DBInstanceIdentifier' => instance_identifier,
19
+ :parser => Fog::Parsers::AWS::RDS::RebootDBInstance.new,
20
+ })
21
+ end
22
+
23
+ end
24
+
25
+ class Mock
26
+
27
+ def reboot_db_instance(instance_identifier)
28
+ Fog::Mock.not_implemented
29
+ end
30
+
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/restore_db_instance_from_db_snapshot'
7
+
8
+ # Restores a DB Instance from a DB Snapshot
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/index.html?API_RestoreDBInstanceFromDBSnapshot.html
10
+ # ==== Returns
11
+ # * response<~Excon::Response>:
12
+ # * body<~Hash>:
13
+ def restore_db_instance_from_db_snapshot(snapshot_id, db_name, opts={})
14
+ request({
15
+ 'Action' => 'RestoreDBInstanceFromDBSnapshot',
16
+ 'DBSnapshotIdentifier' => snapshot_id,
17
+ 'DBInstanceIdentifier' => db_name,
18
+ :parser => Fog::Parsers::AWS::RDS::RestoreDBInstanceFromDBSnapshot.new,
19
+ }.merge(opts))
20
+ end
21
+
22
+ end
23
+
24
+ class Mock
25
+
26
+ def restore_db_instance_from_db_snapshot(snapshot_id, db_id, options={})
27
+ Fog::Mock.not_implemented
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
34
+
@@ -0,0 +1,35 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/restore_db_instance_to_point_in_time'
7
+
8
+ # Restores a DB Instance to a point in time
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/index.html?API_RestoreDBInstanceToPointInTime.html
10
+ # ==== Returns
11
+ # * response<~Excon::Response>:
12
+ # * body<~Hash>:
13
+ def restore_db_instance_to_point_in_time(source_db_name, target_db_name, opts={})
14
+ request({
15
+ 'Action' => 'RestoreDBInstanceToPointInTime',
16
+ 'SourceDBInstanceIdentifier' => source_db_name,
17
+ 'TargetDBInstanceIdentifier' => target_db_name,
18
+ :parser => Fog::Parsers::AWS::RDS::RestoreDBInstanceToPointInTime.new,
19
+ }.merge(opts))
20
+ end
21
+
22
+ end
23
+
24
+ class Mock
25
+
26
+ def restore_db_instance_to_point_in_time(source_db_name, target_db_name, opts={})
27
+ Fog::Mock.not_implemented
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+
@@ -0,0 +1,44 @@
1
+ module Fog
2
+ module AWS
3
+ class RDS
4
+ class Real
5
+
6
+ require 'fog/aws/parsers/rds/revoke_db_security_group_ingress'
7
+
8
+ # revokes a db security group ingress
9
+ # http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/index.html?API_RevokeDBSecurityGroupIngress.html
10
+ # ==== Parameters
11
+ # * CIDRIP <~String> - The IP range to revoke
12
+ # * DBSecurityGroupName <~String> - The name for the DB Security Group.
13
+ # * EC2SecurityGroupName <~String> - Name of the EC2 Security Group to revoke.
14
+ # * EC2SecurityGroupOwnerId <~String> - AWS Account Number of the owner of the security group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value.
15
+ # ==== Returns
16
+ # * response<~Excon::Response>:
17
+ # * body<~Hash>:
18
+ def revoke_db_security_group_ingress(name, opts={})
19
+ unless opts.key?('CIDRIP') || (opts.key?('EC2SecurityGroupName') && opts.key?('EC2SecurityGroupOwnerId'))
20
+ raise ArgumentError, 'Must specify CIDRIP, or both EC2SecurityGroupName and EC2SecurityGroupOwnerId'
21
+ end
22
+
23
+ request({
24
+ 'Action' => 'RevokeDBSecurityGroupIngress',
25
+ :parser => Fog::Parsers::AWS::RDS::RevokeDBSecurityGroupIngress.new,
26
+ 'DBSecurityGroupName' => name
27
+ }.merge(opts))
28
+
29
+ end
30
+
31
+ end
32
+
33
+ class Mock
34
+
35
+ def revoke_db_security_group_ingress(name, opts = {})
36
+ Fog::Mock.not_implemented
37
+ end
38
+
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+
@@ -26,14 +26,13 @@ module Fog
26
26
  end
27
27
  end
28
28
 
29
- def self.reset_data(keys=data.keys)
30
- for key in [*keys]
31
- data.delete(key)
32
- end
33
- end
34
-
35
29
  def initialize(options={})
36
30
  @aws_access_key_id = options[:aws_access_key_id]
31
+ reset_data
32
+ end
33
+
34
+ def reset_data
35
+ self.class.data.delete(@aws_access_key_id)
37
36
  @data = self.class.data[@aws_access_key_id]
38
37
  end
39
38
 
@@ -64,8 +63,23 @@ module Fog
64
63
  @aws_access_key_id = options[:aws_access_key_id]
65
64
  @aws_secret_access_key = options[:aws_secret_access_key]
66
65
  @hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
67
- @host = options[:host] || 'sdb.amazonaws.com'
68
66
  @nil_string = options[:nil_string]|| 'nil'
67
+
68
+ options[:region] ||= 'us-east-1'
69
+ @host = options[:host] || case options[:region]
70
+ when 'ap-northeast-1'
71
+ 'sdb.ap-northeast-1.amazonaws.com'
72
+ when 'ap-southeast-1'
73
+ 'sdb.ap-southeast-1.amazonaws.com'
74
+ when 'eu-west-1'
75
+ 'sdb.eu-west-1.amazonaws.com'
76
+ when 'us-east-1'
77
+ 'sdb.amazonaws.com'
78
+ when 'us-west-1'
79
+ 'sdb.us-west-1.amazonaws.com'
80
+ else
81
+ raise ArgumentError, "Unknown region: #{options[:region].inspect}"
82
+ end
69
83
  @path = options[:path] || '/'
70
84
  @port = options[:port] || 443
71
85
  @scheme = options[:scheme] || 'https'
@@ -56,6 +56,7 @@ end
56
56
  require 'fog/bin/aws'
57
57
  require 'fog/bin/bluebox'
58
58
  require 'fog/bin/brightbox'
59
+ require 'fog/bin/dnsimple'
59
60
  require 'fog/bin/ecloud'
60
61
  require 'fog/bin/go_grid'
61
62
  require 'fog/bin/google'
@@ -65,6 +66,6 @@ require 'fog/bin/new_servers'
65
66
  require 'fog/bin/rackspace'
66
67
  require 'fog/bin/slicehost'
67
68
  require 'fog/bin/terremark'
69
+ require 'fog/bin/virtual_box'
68
70
  require 'fog/bin/voxel'
69
71
  require 'fog/bin/zerigo'
70
- require 'fog/bin/dnsimple'
@@ -5,6 +5,8 @@ class AWS < Fog::Bin
5
5
  case key
6
6
  when :cdn
7
7
  Fog::AWS::CDN
8
+ when :cloud_formation
9
+ Fog::AWS::CloudFormation
8
10
  when :compute
9
11
  Fog::AWS::Compute
10
12
  when :dns
@@ -19,6 +21,8 @@ class AWS < Fog::Bin
19
21
  Fog::AWS::SES
20
22
  when :eu_storage, :storage
21
23
  Fog::AWS::Storage
24
+ when :rds
25
+ Fog::AWS::RDS
22
26
  else
23
27
  # @todo Replace most instances of ArgumentError with NotImplementedError
24
28
  # @todo For a list of widely supported Exceptions, see:
@@ -32,6 +36,8 @@ class AWS < Fog::Bin
32
36
  hash[key] = case key
33
37
  when :cdn
34
38
  Fog::CDN.new(:provider => 'AWS')
39
+ when :cloud_formation
40
+ Fog::AWS::CloudFormation.new
35
41
  when :compute
36
42
  Fog::Compute.new(:provider => 'AWS')
37
43
  when :dns
@@ -40,6 +46,8 @@ class AWS < Fog::Bin
40
46
  Fog::AWS::ELB.new
41
47
  when :iam
42
48
  Fog::AWS::IAM.new
49
+ when :rds
50
+ Fog::AWS::RDS.new
43
51
  when :eu_storage
44
52
  Fog::Storage.new(:provider => 'AWS', :region => 'eu-west-1')
45
53
  when :sdb, :simpledb
@@ -0,0 +1,52 @@
1
+ module VirtualBox # deviates from other bin stuff to accomodate gem
2
+ class << self
3
+
4
+ def class_for(key)
5
+ case key
6
+ when :compute
7
+ Fog::VirtualBox::Compute
8
+ else
9
+ raise ArgumentError, "Unrecognized service: #{key}"
10
+ end
11
+ end
12
+
13
+ def [](service)
14
+ @@connections ||= Hash.new do |hash, key|
15
+ hash[key] = case key
16
+ when :compute
17
+ Fog::Compute.new(:provider => 'VirtualBox')
18
+ else
19
+ raise ArgumentError, "Unrecognized service: #{key.inspect}"
20
+ end
21
+ end
22
+ @@connections[service]
23
+ end
24
+
25
+ def available?
26
+ availability = !Gem.source_index.find_name('virtualbox').empty?
27
+ if availability
28
+ for service in services
29
+ for collection in self.class_for(service).collections
30
+ unless self.respond_to?(collection)
31
+ self.class_eval <<-EOS, __FILE__, __LINE__
32
+ def self.#{collection}
33
+ self[:#{service}].#{collection}
34
+ end
35
+ EOS
36
+ end
37
+ end
38
+ end
39
+ end
40
+ availability
41
+ end
42
+
43
+ def collections
44
+ services.map {|service| self[service].collections}.flatten.sort_by {|service| service.to_s}
45
+ end
46
+
47
+ def services
48
+ Fog::VirtualBox.services
49
+ end
50
+
51
+ end
52
+ end