ec2ctl 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2e08c5db7580a3b3be676e4974d7186c98eacbe
4
- data.tar.gz: 15c9f9525fc194337ec5ece48ae94fe05cc7282b
3
+ metadata.gz: c1f3627da0332ac03286a6ef7512e7cd4962939d
4
+ data.tar.gz: af12cc4e425a03feccc4cd9f57c740d133a1267d
5
5
  SHA512:
6
- metadata.gz: 68f22cba95a82b4069cc33fef991cd92d01a52f49857f7f2971b78895b7eac3fcbe56b1fc013b23d77900014f18371e20d25e42c6b87ed6169774cb11391026f
7
- data.tar.gz: 8ffc388529bd49ed70573cd2f107e2446cd0a4999c919a048eeb4ee0ac48de5f64c0a05a9153580a2102eca572f97ee7af85c8424994bf8db63a54803c823c23
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
 
@@ -1,3 +1,3 @@
1
1
  module EC2Ctl
2
- VERSION = "0.9.6"
2
+ VERSION = "0.9.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2ctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoriki Yamaguchi