awful 0.0.176 → 0.0.177

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb09a98546589a82ab29f1a6a6d3c1d00d255693
4
- data.tar.gz: 579d48770a87f9c77146754e4c1f8af47e75e9ca
3
+ metadata.gz: f64a6389e61a221feb7f96f0da90ca0a5c921432
4
+ data.tar.gz: ce136a17d9267b07296d93feb7fc235d92bd6609
5
5
  SHA512:
6
- metadata.gz: 7ad6bfca71d84555f7eaad7c59b051de1aced06ac82764010810f0f702f0bb865693a78c8bee74406cff28528bce3f68e789e36066bf93acd99b338633630a67
7
- data.tar.gz: 5c59e008d11a7e2829b9932a2d3126b221f883e18d5b1cac25d0a6d6eed1b601e8056ecbbf82e4fc0921d9d25686e323b168596e69f699e8c93077ac091ce5bb
6
+ metadata.gz: cec28d0a31b48f0c2abac9a105d3d4ec2d0ddeaa2ae35ec08ba2ea0585e5b030ca0d9ec866f61545798dd26990b288473341cc9fb348b4646c313ac48be3b12b
7
+ data.tar.gz: 3c528d461c246baf851df923936c1a3d007b3798829197fd05d352ea84640ef46a662d4da5ed569f42aa90b465dd4f0ca62b47bccd01e73fdb5bcd86f42edba7
@@ -111,6 +111,46 @@ module Awful
111
111
  dynamodb.create_table(params)
112
112
  end
113
113
 
114
+ desc 'gsi NAME', 'get global secondary indexes for table'
115
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
116
+ method_option :arn, aliases: '-a', type: :boolean, default: false, desc: 'list ARNs'
117
+ def gsi(name)
118
+ (dynamodb.describe_table(table_name: name).table.global_secondary_indexes || []).output do |list|
119
+ if options[:long]
120
+ print_table list.map { |i|
121
+ hash = i.key_schema.find{ |k| k.key_type == 'HASH' }&.attribute_name
122
+ range = i.key_schema.find{ |k| k.key_type == 'RANGE' }&.attribute_name
123
+ [i.index_name, color(i.index_status), hash, range, i.projection.projection_type,
124
+ i.provisioned_throughput.read_capacity_units, i.provisioned_throughput.write_capacity_units,
125
+ i.index_size_bytes, i.item_count]
126
+ }.sort
127
+ elsif options[:arn]
128
+ puts list.map(&:index_arn).sort
129
+ else
130
+ puts list.map(&:index_name).sort
131
+ end
132
+ end
133
+ end
134
+
135
+ desc 'lsi NAME', 'get local secondary indexes for table'
136
+ method_option :long, aliases: '-l', type: :boolean, default: false, desc: 'long listing'
137
+ method_option :arn, aliases: '-a', type: :boolean, default: false, desc: 'list ARNs'
138
+ def lsi(name)
139
+ (dynamodb.describe_table(table_name: name).table.local_secondary_indexes || []).output do |list|
140
+ if options[:long]
141
+ print_table list.map { |i|
142
+ hash = i.key_schema.find{ |k| k.key_type == 'HASH' }&.attribute_name
143
+ range = i.key_schema.find{ |k| k.key_type == 'RANGE' }&.attribute_name
144
+ [i.index_name, hash, range, i.projection.projection_type, i.index_size_bytes, i.item_count]
145
+ }.sort
146
+ elsif options[:arn]
147
+ puts list.map(&:index_arn).sort
148
+ else
149
+ puts list.map(&:index_name).sort
150
+ end
151
+ end
152
+ end
153
+
114
154
  desc 'throughput NAME', 'get or update provisioned throughput for table NAME'
115
155
  method_option :read_capacity_units, aliases: '-r', type: :numeric, default: nil, desc: 'Read capacity units'
116
156
  method_option :write_capacity_units, aliases: '-w', type: :numeric, default: nil, desc: 'Write capacity units'
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.176'
2
+ VERSION = '0.0.177'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.176
4
+ version: 0.0.177
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-07 00:00:00.000000000 Z
11
+ date: 2017-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler