ace-client-ext 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 335588cc2fa2b3a147e2c764d6cff8881080e555
4
+ data.tar.gz: 6647088a850fc4b4390225cc267c5d9a7b076158
5
+ SHA512:
6
+ metadata.gz: 83d285420750d2af3489b6e82731dc026e936ce5061c427c6929304b2b3ca4a02870d2e9942181db5d6dedafac9333510f0170f60a2faaebdaf6fed0a7f50f6d
7
+ data.tar.gz: e7894f6091fcb8fc12ec06afcc40959bf54c2b8f339d677a5d6ea0236e75ff8c9f8d2bde1e27f43c84fec0a2d764d58cc90f730c477030c8463f40a6407815af
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
@@ -0,0 +1,51 @@
1
+ module AceClient
2
+ module Niftycloud
3
+ module Nas
4
+ def build_client(options={})
5
+ client = AceClient::Query2.new(options)
6
+ client.extend(AceClient::Niftycloud::Nas)
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
+ :nas_instances => 'NASInstance',
17
+ :nas_security_groups => 'NASSecurityGroup'
18
+ }.each do |method, key|
19
+ define_method(method) { items(key) }
20
+ end
21
+
22
+ def delete_nas_instances
23
+ nas_instances.each do |nas_instance|
24
+ self.action('DeleteNASInstance', 'NASInstanceIdentifier' => nas_instance['NASInstanceIdentifier'])
25
+ end
26
+ timeout(60*60) do
27
+ until nas_instances.empty?
28
+ if nas_instances.any? {|nas_instance| nas_instance['NASInstanceStatus'] == 'failed' }
29
+ failed = nas_instances.select {|nas_instance| nas_instance['NASInstanceStatus'] == 'failed' }
30
+ raise "NASInstance #{failed.map {|f| f['NASInstanceIdentifier'] }.join(',')} is failed"
31
+ end
32
+ sleep 5
33
+ end
34
+ end
35
+ end
36
+
37
+ def delete_nas_security_groups
38
+ nas_security_groups.each do |nas_security_group|
39
+ self.action('DeleteNASSecurityGroup', 'NASSecurityGroupName' => nas_security_group['NASSecurityGroupName'])
40
+ end
41
+ end
42
+
43
+ def delete_resources
44
+ delete_nas_instances
45
+ delete_nas_security_groups
46
+ end
47
+
48
+ module_function :build_client
49
+ end
50
+ end
51
+ end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-client-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
5
- prerelease:
4
+ version: 0.0.11
6
5
  platform: ruby
7
6
  authors:
8
7
  - tily
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.7'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.7'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '10.0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '10.0'
46
41
  description: extensions for ace-client
@@ -50,7 +45,7 @@ executables: []
50
45
  extensions: []
51
46
  extra_rdoc_files: []
52
47
  files:
53
- - .gitignore
48
+ - ".gitignore"
54
49
  - Gemfile
55
50
  - LICENSE.txt
56
51
  - README.md
@@ -58,36 +53,30 @@ files:
58
53
  - VERSION
59
54
  - ace-client-ext.gemspec
60
55
  - lib/ace-client/niftycloud/computing.rb
56
+ - lib/ace-client/niftycloud/nas.rb
61
57
  - lib/ace-client/niftycloud/rdb.rb
62
58
  homepage: ''
63
59
  licenses:
64
60
  - MIT
61
+ metadata: {}
65
62
  post_install_message:
66
63
  rdoc_options: []
67
64
  require_paths:
68
65
  - lib
69
66
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
67
  requirements:
72
- - - ! '>='
68
+ - - ">="
73
69
  - !ruby/object:Gem::Version
74
70
  version: '0'
75
- segments:
76
- - 0
77
- hash: 1039737418316215338
78
71
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
72
  requirements:
81
- - - ! '>='
73
+ - - ">="
82
74
  - !ruby/object:Gem::Version
83
75
  version: '0'
84
- segments:
85
- - 0
86
- hash: 1039737418316215338
87
76
  requirements: []
88
77
  rubyforge_project:
89
- rubygems_version: 1.8.24
78
+ rubygems_version: 2.6.10
90
79
  signing_key:
91
- specification_version: 3
80
+ specification_version: 4
92
81
  summary: extensions for ace-client
93
82
  test_files: []