def generate_sdk(ctx, sdk_type, stage, outdir):
# type: (click.Context, str, str, str) -> None
factory = ctx.obj['factory'] # type: CLIFactory
config = factory.create_config_obj(stage)
session = factory.create_botocore_session()
client = TypedAWSClient(session)
deployed = config.deployed_resources(stage)
if deployed is None:
click.echo("Could not find API ID, has this application "
"been deployed?", err=True)
raise click.Abort()
else:
rest_api_id = deployed.rest_api_id
api_gateway_stage = deployed.api_gateway_stage
client.download_sdk(rest_api_id, outdir,
api_gateway_stage=api_gateway_stage,
sdk_type=sdk_type)
评论列表
文章目录