NAME

amzn-api - create and describe Amazon::API service classes from Botocore

SYNOPSIS

amzn-api [options] command [arguments]

# generate an Amazon::API::S3 stub in the current directory
amzn-api -b /path/to/botocore create-stub s3

# dump a service's normalized Botocore description as JSON
amzn-api describe-service sqs

# list every service, or one field of one service
amzn-api list-services
amzn-api list-services sqs --filter protocol

DESCRIPTION

Amazon::API::CLI is the modulino behind the amzn-api command. It provides the commands used to generate Amazon::API service classes from a Botocore checkout and to inspect the Botocore metadata those classes are built from. It composes Amazon::API::Role::Botocore, Amazon::API::Role::Services, and Amazon::API::Role::ModuleNames.

Most users will only use create-stub (and occasionally describe-service or list-services) to produce and inspect a service class. The create-module-names and create-services commands are maintenance commands used to regenerate the metadata artifacts that Amazon::API ships (botocore-metadata.api and services.api); they are not part of ordinary use.

Commands

create-stub [service]

Generate an Amazon::API::<Service> stub -- the .pm plus its .api.gz metadata image -- into --output-path (default: the current directory). The service may be given as an argument or via --service; the module suffix is taken from --module-name or resolved automatically from the service name. This is the command that produces a usable service class.

amzn-api -b /path/to/botocore create-stub s3
describe-service service|all

Print the normalized Botocore description for a service as pretty JSON, or for every service when given all.

list-services [service]

Print the discovered service index as JSON. Given a service name, print just that entry -- or a single field of it when --filter is supplied. Services are read from --botocore-path, or, when none is given, from the botocore-metadata.api registry shipped with Amazon::API.

get-module-name service

Print the Amazon::API module suffix for a service, e.g. sts yields STS.

create-module-names

Maintenance command. Rebuild the botocore-metadata.api registry (the service-to-module-name and metadata map) into --output-path. Used to regenerate the metadata Amazon::API ships; not normally run by end users.

create-services

Maintenance command. Rebuild the services.api registry (per-service protocol and content-type data) into --output-path -- file name from --file, default services.api, with --limit capping the number processed. Like create-module-names, this produces a shipped artifact and is not part of ordinary use.

Options

-b, --botocore-path=path

Path to the Botocore checkout (the directory containing botocore/). Defaults to the current directory or $BOTOCORE_PATH.

-o, --output-path=path

Directory for generated output. Defaults to the current directory.

-s, --service=name

Service name, as an alternative to passing it as an argument.

-m, --module-name=name

Override the Amazon::API module suffix used by create-stub.

--filter=key

With list-services, print only the named field of a service entry rather than the whole entry.

-f, --file=name

Output file name for create-services (default services.api).

-l, --limit=n

Cap the number of services processed by create-services.

--metadata, --nometadata

Include decoded service metadata when building a registry. On by default.

-P, --pager, --nopager

Page long output. On by default.

-h, --help

Print usage.

LICENSE AND COPYRIGHT

This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.

SEE ALSO

Amazon::API, Amazon::API::Help, Amazon::API::Role::Botocore