NAME

Amazon::API::Botocore - Automagic AWS API class generator

SYNOPSIS

amazon-api options command

OPTIONS

--botocore-path, -b  path to git botocore project, default: . or $BOTOCORE_PATH
--help, -h           help
--module-name, -m    module name suffix, Example: Route53 (see Notes below)
--output-path, -o    path for output, - for STDOUT
--pager, --nopager   turn pager on or off, default is on
--pod, --nopod       generate pod, default is on
--service, -s        Botocore API service, Example: route53
--tidy, -t           perltidy output, default is true, use --no-tidy to disable

Commands

describe           dump the Botocore metadata for a service
create-stub(s)     create the Amazon::API::{service-name} from the Botocore
                   metadata
create-shape(s)    create the Amazon::API::Botocore::Shape objects from the
                   Botocore metadata
help method|shape  show help for method or shape

Notes

1. By default the API class created for a service will be named Amazon::API::{service-name}.

"service-name" will be derived from the service option (-s) using the following rules:

  • upper case all letters in service name if the length of the name is 3 (i.e SNS, SQS, etc.)

  • upper case the first letter if the the length > 3

If you don't like these rules, use the -m option to change the name ;-)

2. The current working directory will be used as the root directory for creating the API and shape classes.

Use the -o option to create the API in a different directory.s Directories will be created if they do not exist.

3. Use this script to get help for specific APIs, methods or shapes.
amazon-api -s sqs help
amazon-api -s sqs help CreateQueue
amazon-api -s sqs help CreateQueueRequest

Note that if you created a custom name for your API module (example: SecretsManager), then use the API module short name for the service.

amazon-api -s SecretsManager help GetSecretValue
4. Dump the entire Botocore description for an API
amazon-api -s sqs describe
5. Don't like our pod?
amazon-api -s sqs describe | jq -r .sqs.operations.CreateQueue

See also - perldoc Amazon::API::Botocore::Pod

DESCRIPTION

Generates Perl classes for Amazon APIs from Botocore specfications. These classes are typically used to invoke specific AWS APIs. For example:

my $rt53 = Amazon::API::Route53->new;

my $hosted_zone = $rt53->ListHostedZones;

print Dumper([hosted_zones => $hosted_zones]);

See Amazon::API for more details.

NOTES

First build the project from either the GitHub repository or by installing from CPAN with cpanm.

Note that building the project from the GitHub repository requires additional tooling you may not have in your environment. See README-BUILD.md for more details.

Assuming you have built the Amazon::API project...

git clone https://github.com/rlauer6/perl-Amazon-API.git
export PROJECT_HOME="$(pwd)/perl-Amazon-API"
cd $PROJECT_HOME
./bootstrap
./configure && make && make install

or installed Amazon::API from CPAN...

cpanm -v Amazon::API

...now clone the Botocore repository.

git clone https://github.com/boto/botocore.git
export BOTOCORE_PATH=$(pwd)/botocore

...and now generate the API class and its data classes (shapes)

amazon-api -s sqs create-stubs
amazon-api -s sqs create-shapes

...get some help

amazon-api -s sqs help
amazon-api -s sqs help CreateQueue
amazon-api -s sqs help CreateQueueRequest

METHODS AND SUBROUTINES

No public methods are exported by this class. It's a modulino!

AUTHOR

Rob Lauer - <rlauer6@comcast.net>

SEE OTHER

Amazon::API, Amazon::API::Botocore::Pod, Amazon::API::Botocore::Shape