ec2-instance 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ec2-instance.rb +17 -0
- metadata +12 -5
data/lib/ec2-instance.rb
CHANGED
@@ -7,6 +7,23 @@ module AWS
|
|
7
7
|
module EC2
|
8
8
|
class Base
|
9
9
|
|
10
|
+
#
|
11
|
+
# Returns an array of instance ids which have a running or pending status
|
12
|
+
#
|
13
|
+
def active_instance_id_list
|
14
|
+
instances = []
|
15
|
+
|
16
|
+
parse_instance_set(self.describe_instances).each do |instance|
|
17
|
+
status = instance["instancesSet"]["item"].first["instanceState"]["name"]
|
18
|
+
|
19
|
+
if status == "running" || status == "pending"
|
20
|
+
instances.push instance["instancesSet"]["item"].first["instanceId"]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
return instances
|
25
|
+
end
|
26
|
+
|
10
27
|
#
|
11
28
|
# Return the launch time of this machine.
|
12
29
|
#
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ec2-instance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Robert Berry
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-11 00:00:00 -07:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: amazon-ec2
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -40,7 +43,7 @@ extra_rdoc_files: []
|
|
40
43
|
files:
|
41
44
|
- lib/ec2-instance.rb
|
42
45
|
- README
|
43
|
-
has_rdoc:
|
46
|
+
has_rdoc: true
|
44
47
|
homepage: http://github.com/bdigital/ec2-instance
|
45
48
|
licenses: []
|
46
49
|
|
@@ -50,23 +53,27 @@ rdoc_options: []
|
|
50
53
|
require_paths:
|
51
54
|
- lib
|
52
55
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
53
57
|
requirements:
|
54
58
|
- - ">="
|
55
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
56
61
|
segments:
|
57
62
|
- 0
|
58
63
|
version: "0"
|
59
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
60
66
|
requirements:
|
61
67
|
- - ">="
|
62
68
|
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
63
70
|
segments:
|
64
71
|
- 0
|
65
72
|
version: "0"
|
66
73
|
requirements: []
|
67
74
|
|
68
75
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.3.
|
76
|
+
rubygems_version: 1.3.7
|
70
77
|
signing_key:
|
71
78
|
specification_version: 3
|
72
79
|
summary: Extension for amazon-ec2 gem for instance operations
|