ace-client-ext 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,6 +9,6 @@ task :vup do
9
9
  system "git push origin master"
10
10
  system "git push --tags"
11
11
  system "rake build"
12
- system "gem push pkg/barthes-#{version}.gem"
12
+ system "gem push pkg/ace-client-ext-#{version}.gem"
13
13
  end
14
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -0,0 +1,61 @@
1
+ module AceClient
2
+ module Niftycloud
3
+ module Rdb
4
+ def build_client(options={})
5
+ client = AceClient::Query2.new(options)
6
+ client.extend(AceClient::Niftycloud::Rdb)
7
+ client
8
+ end
9
+
10
+ def items(key)
11
+ response = self.action("Describe#{key}s", {})
12
+ [response["Describe#{key}sResponse"]["Describe#{key}sResult"]["#{key}s"][key]].flatten rescue []
13
+ end
14
+
15
+ {
16
+ :db_instances => 'DBInstance',
17
+ :db_security_groups => 'DBSecurityGroup',
18
+ :db_snapshots => 'DBSnapshot',
19
+ :db_parameter_groups => 'DBParameterGroup'
20
+ }.each do |method, key|
21
+ define_method(method) { items(key) }
22
+ end
23
+
24
+ def delete_db_instances
25
+ until db_instances.empty?
26
+ db_instances.each do |db_instance|
27
+ self.action('DeleteDBInstance', 'DBInstanceIdentifier' => db_instance['DBInstanceIdentifier'], 'SkipFinalSnapshot' => 'true')
28
+ end
29
+ sleep 5
30
+ end
31
+ end
32
+
33
+ def delete_db_security_groups
34
+ db_security_groups.each do |db_security_group|
35
+ self.action('DeleteDBSecurityGroup', 'DBSecurityGroupName' => db_security_group['DBSecurityGroupName'])
36
+ end
37
+ end
38
+
39
+ def delete_db_snapshots
40
+ db_snapshots.each do |db_snapshot|
41
+ self.action('DeleteDBSnapshot', 'DBSnapshotIdentifier' => db_snapshot['DBSnapshotIdentifier'])
42
+ end
43
+ end
44
+
45
+ def delete_db_parameter_groups
46
+ db_parameter_groups.each do |db_parameter_group|
47
+ self.action('DeleteDBParameterGroup', 'DBParameterGroupName' => db_parameter_group['DBParameterGroupName'])
48
+ end
49
+ end
50
+
51
+ def delete_resources
52
+ delete_db_instances
53
+ delete_db_security_groups
54
+ delete_db_snapshots
55
+ delete_db_parameter_groups
56
+ end
57
+
58
+ module_function :build_client
59
+ end
60
+ end
61
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-client-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-06 00:00:00.000000000 Z
12
+ date: 2014-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -58,6 +58,7 @@ files:
58
58
  - VERSION
59
59
  - ace-client-ext.gemspec
60
60
  - lib/ace-client/niftycloud/computing.rb
61
+ - lib/ace-client/niftycloud/rdb.rb
61
62
  homepage: ''
62
63
  licenses:
63
64
  - MIT
@@ -71,12 +72,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
72
  - - ! '>='
72
73
  - !ruby/object:Gem::Version
73
74
  version: '0'
75
+ segments:
76
+ - 0
77
+ hash: -2982474083306149947
74
78
  required_rubygems_version: !ruby/object:Gem::Requirement
75
79
  none: false
76
80
  requirements:
77
81
  - - ! '>='
78
82
  - !ruby/object:Gem::Version
79
83
  version: '0'
84
+ segments:
85
+ - 0
86
+ hash: -2982474083306149947
80
87
  requirements: []
81
88
  rubyforge_project:
82
89
  rubygems_version: 1.8.24