| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Amazon::API::Botocore::Pod; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
23
|
use strict; |
|
|
3
|
|
|
|
|
11
|
|
|
|
3
|
|
|
|
|
94
|
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
92
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
18
|
use parent qw{ Exporter }; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
163
|
use Pod::Usage; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
264
|
|
|
9
|
3
|
|
|
3
|
|
22
|
use Pod::Find qw(pod_where); |
|
|
3
|
|
|
|
|
10
|
|
|
|
3
|
|
|
|
|
504
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw{ pod }; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '2.0.10'; ## no critic (RequireInterpolationOfMetachars) |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
######################################################################## |
|
16
|
|
|
|
|
|
|
sub pod { |
|
17
|
|
|
|
|
|
|
######################################################################## |
|
18
|
0
|
|
|
0
|
0
|
|
my ($exit_val) = @_; |
|
19
|
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return pod2usage( |
|
21
|
|
|
|
|
|
|
-exitval => $exit_val, |
|
22
|
|
|
|
|
|
|
-input => pod_where( { -inc => 1 }, __PACKAGE__ ), |
|
23
|
|
|
|
|
|
|
-output => \*STDOUT, |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
## no critic (RequirePackageMatchesPodName) |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=pod |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Amazon::API::Botocore - Automagic AWS API class generator |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
amazon-api options command |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Options |
|
44
|
|
|
|
|
|
|
------- |
|
45
|
|
|
|
|
|
|
--botocore-path, -b path to git botocore project, default: . or $BOTOCORE_PATH |
|
46
|
|
|
|
|
|
|
--help, -h help |
|
47
|
|
|
|
|
|
|
--module-name, -m module name suffix, Example: Route53 (see Notes below) |
|
48
|
|
|
|
|
|
|
--output-path, -o path for output, - for STDOUT |
|
49
|
|
|
|
|
|
|
--pager, --nopager turn pager on or off, default is on |
|
50
|
|
|
|
|
|
|
--pod, --nopod generate pod, default is on |
|
51
|
|
|
|
|
|
|
--service, -s Botocore API service, Example: route53 |
|
52
|
|
|
|
|
|
|
--tidy, -t perltidy output, default is true, use --no-tidy to disable |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Commands |
|
55
|
|
|
|
|
|
|
-------- |
|
56
|
|
|
|
|
|
|
describe dump the Botocore metadata for a service |
|
57
|
|
|
|
|
|
|
create-stub(s) create the Amazon::API::{service-name} from the Botocore |
|
58
|
|
|
|
|
|
|
metadata |
|
59
|
|
|
|
|
|
|
create-shape(s) create the Amazon::API::Botocore::Shape objects from the |
|
60
|
|
|
|
|
|
|
Botocore metadata |
|
61
|
|
|
|
|
|
|
help method|shape show help for method or shape |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Notes |
|
64
|
|
|
|
|
|
|
----- |
|
65
|
|
|
|
|
|
|
1. By default the API class created for a service will be named |
|
66
|
|
|
|
|
|
|
Amazon::API::{service-name}. "service-name" will be derived from |
|
67
|
|
|
|
|
|
|
the service option (-s) using the following rules: |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
a. upper case all letters in service name if the length of the |
|
70
|
|
|
|
|
|
|
name is 3 (i.e SNS, SQS, etc.) |
|
71
|
|
|
|
|
|
|
b. upper case the first letter if the the length > 3 |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
* if you don't like these rules, use the -m option to change the name ;-) |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
2. The current working directory will be used as the root directory |
|
76
|
|
|
|
|
|
|
for creating the API and shape classes. Use the -o option to create |
|
77
|
|
|
|
|
|
|
the API in a different directory.s Directories will be created if |
|
78
|
|
|
|
|
|
|
they do not exist. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
3. Use this script to get help for specific APIs, methods |
|
81
|
|
|
|
|
|
|
or shapes. |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
amazon-api -s sqs help |
|
84
|
|
|
|
|
|
|
amazon-api -s sqs help CreateQueue |
|
85
|
|
|
|
|
|
|
amazon-api -s sqs help CreateQueueRequest |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
4. Dump the entire Botocore description for an API |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
amazon-api -s sqs describe |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
5. Don't like our pod? |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
amazon-api -s sqs describe | jq -r .sqs.operations.CreateQueue |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
See also - perldoc Amazon::API::Botocore::Pod |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Generates Perl classes for Amazon APIs from Botocore specfications. |
|
100
|
|
|
|
|
|
|
These classes are typically used to invoke specific AWS APIs. For |
|
101
|
|
|
|
|
|
|
example: |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
my $rt53 = Amazon::API::Route53->new; |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
my $hosted_zone = $rt53->ListHostedZones; |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
print Dumper([$hosted_zones]); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
See L<Amazon::API> for more details. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 NOTES |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
First build the project from either the GitHub repository or CPAN. |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
I<Note that building the project from the GitHub repository requires |
|
116
|
|
|
|
|
|
|
additional tooling you may not have in your environment. See |
|
117
|
|
|
|
|
|
|
L<README-BUILD.md|https://github.com/rlauer6/perl-Amazon-API/blob/master/README-BUILD.md> |
|
118
|
|
|
|
|
|
|
for more details.> |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Assuming you have built the L<Amazon::API> project... |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
git clone https://github.com/rlauer6/perl-Amazon-API.git |
|
123
|
|
|
|
|
|
|
export PROJECT_HOME="$(pwd)/perl-Amazon-API" |
|
124
|
|
|
|
|
|
|
cd $PROJECT_HOME |
|
125
|
|
|
|
|
|
|
./bootstrap |
|
126
|
|
|
|
|
|
|
./configure && make && make install |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
or installed L<Amazon::API> from CPAN... |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
cpanm -v Amazon::API |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
...now clone the Botocore repository. |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
git clone https://github.com/boto/botocore.git |
|
135
|
|
|
|
|
|
|
export BOTOCORE_PATH=$(pwd)/botocore |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
...and now generate the API class and its data classes (shapes) |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
amazon-api -s sqs create-stubs |
|
140
|
|
|
|
|
|
|
amazon-api -s sqs create-shapes |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
...get some help |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
amazon-api -s sqs help |
|
145
|
|
|
|
|
|
|
amazon-api -s sqs help CreateQueue |
|
146
|
|
|
|
|
|
|
amazon-api -s sqs help CreateQueueRequest |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 METHODS AND SUBROUTINES |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
No public methods are exported by this class. It's a modulino! |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 AUTHOR |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Rob Lauer - <rlauer6@comcast.net> |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 SEE OTHER |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
L<Amazon::API>, L<Amazon::API::Botocore::Pod>, L<Amazon::API::Botocore::Shape> |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |