lsaws 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +82 -0
- data/README.md.tpl +26 -0
- data/lib/lsaws/cli.rb +5 -0
- data/lib/lsaws/lister.rb +12 -10
- data/lib/lsaws/sdk_parser.rb +1 -1
- data/lib/lsaws/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aad0a270ff6f86c2380696c6d5df0a941dc9e64ea789ea7d99b5ec8786ff005
|
4
|
+
data.tar.gz: 187651ccda2390371bd17314a3a13c2960861fb3110832df5a9feaf78af339d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03341e7595945218b09c480160cd94144baae61a1bcf872cf289ca5aea91e668e65aea340009f5a1cbb1d3934ab0b569dfcc5980070ac5d30267dcc61a9254df
|
7
|
+
data.tar.gz: 8c5a2ab1f38b8d4564625bcaf5b201ee9cbf263fc4828f0f071d6d652532840527825ae3a99b3ab76fdcf4bfaddcf5db605842af3cdbcfb214bc42bf8863e4e6
|
data/README.md
CHANGED
@@ -23,6 +23,88 @@ User-friendly AWS resources listing tool
|
|
23
23
|
-A, --all List all entity types within SDK
|
24
24
|
|
25
25
|
|
26
|
+
### Listing installed SDKs
|
27
|
+
|
28
|
+
# lsaws -L
|
29
|
+
|
30
|
+
accessanalyzer
|
31
|
+
account
|
32
|
+
acm
|
33
|
+
acmpca
|
34
|
+
alexaforbusiness
|
35
|
+
amplify
|
36
|
+
amplifybackend
|
37
|
+
amplifyuibuilder
|
38
|
+
apigateway
|
39
|
+
apigatewaymanagementapi
|
40
|
+
apigatewayv2
|
41
|
+
appconfig
|
42
|
+
appconfigdata
|
43
|
+
appflow
|
44
|
+
appintegrationsservice
|
45
|
+
applicationautoscaling
|
46
|
+
applicationcostprofiler
|
47
|
+
applicationdiscoveryservice
|
48
|
+
applicationinsights
|
49
|
+
appmesh
|
50
|
+
appregistry
|
51
|
+
apprunner
|
52
|
+
appstream
|
53
|
+
appsync
|
54
|
+
arczonalshift
|
55
|
+
...
|
56
|
+
|
57
|
+
|
58
|
+
### Listing listable entities from EC2 sdk
|
59
|
+
|
60
|
+
# lsaws ec2 -L
|
61
|
+
|
62
|
+
account_attributes
|
63
|
+
address_transfers
|
64
|
+
addresses
|
65
|
+
availability_zones
|
66
|
+
aws_network_performance_metric_subscriptions
|
67
|
+
bundle_tasks
|
68
|
+
capacity_reservation_fleets
|
69
|
+
capacity_reservations
|
70
|
+
carrier_gateways
|
71
|
+
classic_link_instances
|
72
|
+
client_vpn_endpoints
|
73
|
+
coip_pools
|
74
|
+
conversion_tasks
|
75
|
+
customer_gateways
|
76
|
+
dhcp_options
|
77
|
+
egress_only_internet_gateways
|
78
|
+
elastic_gpus
|
79
|
+
export_image_tasks
|
80
|
+
export_tasks
|
81
|
+
fast_launch_images
|
82
|
+
fast_snapshot_restores
|
83
|
+
fleets
|
84
|
+
flow_logs
|
85
|
+
fpga_images
|
86
|
+
host_reservation_offerings
|
87
|
+
...
|
88
|
+
|
89
|
+
|
90
|
+
### Listing EC2 instances
|
91
|
+
|
92
|
+
# lsaws ec2
|
93
|
+
|
94
|
+
┌─────────────────────┬─────────────┬───────────────────────┬────────────────────┬─────────────────────────┐
|
95
|
+
│ instance_id │ name │ vpc_id │ private_ip_address │ launch_time │
|
96
|
+
├─────────────────────┼─────────────┼───────────────────────┼────────────────────┼─────────────────────────┤
|
97
|
+
│ i-1234567890abcdef0 │ my-instance │ vpc-1234567890abcdef0 │ 10-0-0-157 │ 2022-11-15 10:48:59 UTC │
|
98
|
+
└─────────────────────┴─────────────┴───────────────────────┴────────────────────┴─────────────────────────┘
|
99
|
+
|
100
|
+
### Listing specific columns of EC2 images as json-stream
|
101
|
+
|
102
|
+
# lsaws ec2 images -c image_id,creation_date -o js
|
103
|
+
|
104
|
+
{"image_id":"ami-1234e6197567838b4","creation_date":"2023-01-11T13:02:00.000Z"}
|
105
|
+
{"image_id":"ami-1234f58a167898416","creation_date":"2023-01-11T02:02:00.000Z"}
|
106
|
+
{"image_id":"ami-12341a1fd567897a8","creation_date":"2023-01-01T01:02:00.000Z"}
|
107
|
+
|
26
108
|
## License
|
27
109
|
|
28
110
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/README.md.tpl
CHANGED
@@ -6,6 +6,32 @@ User-friendly AWS resources listing tool
|
|
6
6
|
|
7
7
|
% lsaws
|
8
8
|
|
9
|
+
### Listing installed SDKs
|
10
|
+
|
11
|
+
% lsaws -L
|
12
|
+
|
13
|
+
### Listing listable entities from EC2 sdk
|
14
|
+
|
15
|
+
% lsaws ec2 -L
|
16
|
+
|
17
|
+
### Listing EC2 instances
|
18
|
+
|
19
|
+
# lsaws ec2
|
20
|
+
|
21
|
+
┌─────────────────────┬─────────────┬───────────────────────┬────────────────────┬─────────────────────────┐
|
22
|
+
│ instance_id │ name │ vpc_id │ private_ip_address │ launch_time │
|
23
|
+
├─────────────────────┼─────────────┼───────────────────────┼────────────────────┼─────────────────────────┤
|
24
|
+
│ i-1234567890abcdef0 │ my-instance │ vpc-1234567890abcdef0 │ 10-0-0-157 │ 2022-11-15 10:48:59 UTC │
|
25
|
+
└─────────────────────┴─────────────┴───────────────────────┴────────────────────┴─────────────────────────┘
|
26
|
+
|
27
|
+
### Listing specific columns of EC2 images as json-stream
|
28
|
+
|
29
|
+
# lsaws ec2 images -c image_id,creation_date -o js
|
30
|
+
|
31
|
+
{"image_id":"ami-0245e6197bf3138b4","creation_date":"2023-01-19T12:03:38.000Z"}
|
32
|
+
{"image_id":"ami-0bc3f58a172118416","creation_date":"2023-01-20T09:37:32.000Z"}
|
33
|
+
{"image_id":"ami-07e71a1fdf49957a8","creation_date":"2023-02-01T02:06:29.000Z"}
|
34
|
+
|
9
35
|
## License
|
10
36
|
|
11
37
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/lsaws/cli.rb
CHANGED
@@ -29,6 +29,11 @@ module Lsaws
|
|
29
29
|
OptionParser.new do |opt|
|
30
30
|
opt.banner = "Usage: lsaws [options] <sdk> [entity_type]"
|
31
31
|
|
32
|
+
opt.on("-p", "--profile PROFILE", "AWS profile") do |o|
|
33
|
+
@options[:profile] = o
|
34
|
+
ENV['AWS_PROFILE'] = o
|
35
|
+
end
|
36
|
+
|
32
37
|
opt.on("-o", "--output FMT", SUPPORTED_FORMATS, "Format: #{SUPPORTED_FORMATS.join("/")}") do |f|
|
33
38
|
@options[:format] = f.to_sym
|
34
39
|
end
|
data/lib/lsaws/lister.rb
CHANGED
@@ -15,6 +15,17 @@ module Lsaws
|
|
15
15
|
@options[:max_width] = nil if @options[:max_width].to_i.zero?
|
16
16
|
end
|
17
17
|
|
18
|
+
def _abort_with_list(sdk, type)
|
19
|
+
if type == "default"
|
20
|
+
warn "[!] no default entity type set for #{sdk.inspect} SDK"
|
21
|
+
else
|
22
|
+
warn "[!] #{sdk.inspect} SDK does not have #{type.inspect} entity type"
|
23
|
+
end
|
24
|
+
puts "Known entity types are:"
|
25
|
+
list_entity_types(sdk)
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
|
18
29
|
def _prepare_entities(sdk, type, &block)
|
19
30
|
edef = Lsaws.config.dig(sdk, type)
|
20
31
|
return _prepare_entities(sdk, edef, &block) if edef.is_a?(String) # redirect like 'default' -> 'instances'
|
@@ -34,16 +45,7 @@ module Lsaws
|
|
34
45
|
client_class = edef["client_class"] || sdkp.client_class_name
|
35
46
|
client = Kernel.const_get(client_class).new
|
36
47
|
method_name = edef["method"] || sdkp.etype2method(type)
|
37
|
-
unless
|
38
|
-
if type == "default"
|
39
|
-
warn "[!] no default entity type set for #{sdk.inspect} SDK"
|
40
|
-
else
|
41
|
-
warn "[!] #{sdk.inspect} SDK does not have #{type.inspect} entity type"
|
42
|
-
end
|
43
|
-
puts "Known entity types are:"
|
44
|
-
list_entity_types(sdk)
|
45
|
-
exit 1
|
46
|
-
end
|
48
|
+
_abort_with_list(sdk, type) unless method_name
|
47
49
|
warn "[d] #{method_name} #{params}" if @options[:debug]
|
48
50
|
results = client.send(method_name, params)
|
49
51
|
|
data/lib/lsaws/sdk_parser.rb
CHANGED
data/lib/lsaws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lsaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "Zed" Zaikin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|