ec2ctl 0.9.6 → 0.9.7
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.
- checksums.yaml +4 -4
- data/lib/ec2ctl/cli.rb +1 -0
- data/lib/ec2ctl/client.rb +5 -1
- data/lib/ec2ctl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f3627da0332ac03286a6ef7512e7cd4962939d
|
4
|
+
data.tar.gz: af12cc4e425a03feccc4cd9f57c740d133a1267d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be33c3f39923e42a43585419974eae0ff18c1e04cf1290da2d04ccd4fe660dccb724fd89c4f8d8e79fcdd7cd404158535d8d9591706b44d0629e7f42c82fe0e
|
7
|
+
data.tar.gz: 2ee01d8a31be5a245f504f47d8e389c20cf086a05365d0587555bfb3515c112603e9889a514a5517cd16758bc0f79e208b90ff2eb1a5a723156c1fa659e11c16
|
data/lib/ec2ctl/cli.rb
CHANGED
@@ -38,6 +38,7 @@ module EC2Ctl
|
|
38
38
|
c.option "-a", "--attributes KEY1,KEY2...", Array, "(Optional) The instance attribute keys to display."
|
39
39
|
c.option "-C", "--count", "(Optional) Display instance attribute stats."
|
40
40
|
c.option "--platform-type Linux|Windows", String, "(Optional) Platform type: `Linux` or `Windows`. Default is `Linux`."
|
41
|
+
c.option "-S", "--sort KEY", String, "(Optional) Sort instances by this attribute."
|
41
42
|
|
42
43
|
c.action do |args, options|
|
43
44
|
handle_options c, options
|
data/lib/ec2ctl/client.rb
CHANGED
@@ -43,7 +43,8 @@ module EC2Ctl
|
|
43
43
|
filters: [],
|
44
44
|
attributes: [],
|
45
45
|
search: [],
|
46
|
-
count: false
|
46
|
+
count: false,
|
47
|
+
sort: nil
|
47
48
|
)
|
48
49
|
@logger = logger
|
49
50
|
|
@@ -75,6 +76,7 @@ module EC2Ctl
|
|
75
76
|
@attributes = attributes
|
76
77
|
@search = search
|
77
78
|
@count = count
|
79
|
+
@sort = sort
|
78
80
|
|
79
81
|
if @load_balancer_name
|
80
82
|
@elb_instance_ids = elb_instance_states.map(&:instance_id).select do |instance_id|
|
@@ -569,6 +571,8 @@ module EC2Ctl
|
|
569
571
|
end
|
570
572
|
end
|
571
573
|
|
574
|
+
@ec2_instances.sort_by! {|i| query_instance_attribute(i, @sort)} if @sort
|
575
|
+
|
572
576
|
@ec2_instances
|
573
577
|
end
|
574
578
|
|
data/lib/ec2ctl/version.rb
CHANGED