lsaws 0.3.0 → 0.3.1
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/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: e2b87621670d3747c4c1b6cb9979c7401f7e736ceb8c257819a42dc31b190471
|
4
|
+
data.tar.gz: ab3227e58e62f14a718858242bd2cdd5ffd8f6a5f15acc38550605a01aea2352
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eeb107b1267e40dadb27fccb5dc619f53807410c68c3b85cda9c5e63e3c57da9ab731b422f1c236a0b3bc7a2701e4bffee989257676a9e3cff20cfc9ce2b07c
|
7
|
+
data.tar.gz: a725ba9efec0bf251516ca30a8841dac825ca3dacaf2adf00dcef453f2806e22d946512a6b4f6e70bb6f72547f2204e474065f623f86bc258e0a48624c8e9aef
|
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/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.1
|
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-02-
|
11
|
+
date: 2023-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|