awspec 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/awspec/helper/type.rb +1 -1
- data/lib/awspec/type/ebs.rb +37 -0
- data/lib/awspec/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f32e82baf76c33ca5593fa4e208835fb156855
|
4
|
+
data.tar.gz: 1d874fc92873428cb5bd3ea4669088c035f061c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20cb4c38567ea51ad2b752d63be0b177d6a1c08cf8eb12fd68d76f5f314fead66f2f87c80673fe4969a35bea15e5b364f0991a93ca576a6ce5e3acd297ed0b23
|
7
|
+
data.tar.gz: 5ac15fe44483c9d1dfdd2516beaba709a3b46446b9e2167a85f25db6f3308bf999fe630a6f948c0f5c2985e793d9d9aa43676f8c5206ec905ef6a8e80eee1f3e
|
data/README.md
CHANGED
@@ -87,10 +87,10 @@ $ awspec generate ec2 vpc-ab123cde >> spec/ec2_spec.rb
|
|
87
87
|
- [x] Auto Scaling Group (`auto_scaling_group`)
|
88
88
|
- [x] Subnet (`subnet`)
|
89
89
|
- [x] RouteTable (`route_table`)
|
90
|
+
- [x] EBS Volume
|
90
91
|
|
91
92
|
### Next..
|
92
93
|
|
93
|
-
- [ ] EBS Volume
|
94
94
|
- [ ] IAM
|
95
95
|
- ...
|
96
96
|
|
data/lib/awspec/helper/type.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
module Awspec::Type
|
2
|
+
class Ebs < Base
|
3
|
+
attr_reader :volume
|
4
|
+
|
5
|
+
def initialize(id)
|
6
|
+
super
|
7
|
+
@volume = find_ebs(id)
|
8
|
+
@id = @volume[:volume_id] if @volume
|
9
|
+
end
|
10
|
+
|
11
|
+
states = %w(
|
12
|
+
creating available in-use deleting deleted error
|
13
|
+
)
|
14
|
+
|
15
|
+
states.each do |state|
|
16
|
+
define_method state.tr('-', '_') + '?' do
|
17
|
+
@volume[:state] == state
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def method_missing(name)
|
22
|
+
describe = name.to_sym
|
23
|
+
if @volume.members.include?(describe)
|
24
|
+
@volume[describe]
|
25
|
+
else
|
26
|
+
super
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def attached_to?(instance_id)
|
31
|
+
instance = find_ec2(instance_id)
|
32
|
+
return false unless instance
|
33
|
+
return false unless @volume[:attachments]
|
34
|
+
@volume[:attachments][0][:instance_id] == instance[:instance_id] && @volume[:attachments][0][:state] == 'attached'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/awspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k1LoW
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- lib/awspec/setup.rb
|
173
173
|
- lib/awspec/type/auto_scaling_group.rb
|
174
174
|
- lib/awspec/type/base.rb
|
175
|
+
- lib/awspec/type/ebs.rb
|
175
176
|
- lib/awspec/type/ec2.rb
|
176
177
|
- lib/awspec/type/rds.rb
|
177
178
|
- lib/awspec/type/rds_db_parameter_group.rb
|