diff --git a/.changes/1.4.3.json b/.changes/1.4.3.json new file mode 100644 index 0000000..bbcd10c --- /dev/null +++ b/.changes/1.4.3.json @@ -0,0 +1,12 @@ +[ + { + "category": "``s3``", + "description": "Add ability to disable thread use with ``use_threads`` option", + "type": "feature" + }, + { + "category": "Resource", + "description": "Fix resource hashing.", + "type": "bugfix" + } +] \ No newline at end of file diff --git a/.changes/1.4.5.json b/.changes/1.4.5.json new file mode 100644 index 0000000..97b45ac --- /dev/null +++ b/.changes/1.4.5.json @@ -0,0 +1,7 @@ +[ + { + "category": "s3", + "description": "Add a LifecycleConfiguration resource to resolve issues with the existing Lifecycle resource.", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.4.6.json b/.changes/1.4.6.json new file mode 100644 index 0000000..85f2013 --- /dev/null +++ b/.changes/1.4.6.json @@ -0,0 +1,7 @@ +[ + { + "category": "Logging", + "description": "Switch log levels from INFO to DEBUG (`#1208 `__)", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.4.7.json b/.changes/1.4.7.json new file mode 100644 index 0000000..a0750d4 --- /dev/null +++ b/.changes/1.4.7.json @@ -0,0 +1,7 @@ +[ + { + "category": "``botocore``", + "description": "Raised minor version dependency for botocore", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.4.8.json b/.changes/1.4.8.json new file mode 100644 index 0000000..a0750d4 --- /dev/null +++ b/.changes/1.4.8.json @@ -0,0 +1,7 @@ +[ + { + "category": "``botocore``", + "description": "Raised minor version dependency for botocore", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.5.0.json b/.changes/1.5.0.json new file mode 100644 index 0000000..4d6b1ce --- /dev/null +++ b/.changes/1.5.0.json @@ -0,0 +1,27 @@ +[ + { + "category": "Filters", + "description": "Fixes a bug where parameters passed to resource collections could be mutated after the collections were created.", + "type": "bugfix" + }, + { + "category": "``ses``", + "description": "[``botocore``] Update ses client to latest version", + "type": "api-change" + }, + { + "category": "credentials", + "description": "[``botocore``] Moved the JSONFileCache from the CLI into botocore so that it can be used without importing from the cli.", + "type": "enhancement" + }, + { + "category": "``botocore`` dependency", + "description": "Update dependency strategy to always take a floor on the most recent version of ``botocore``. This means whenever there is a release of ``botocore``, ``boto3`` will release as well to account for the new version of ``botocore``.", + "type": "feature" + }, + { + "category": "``apigateway``", + "description": "[``botocore``] Update apigateway client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.1.json b/.changes/1.5.1.json new file mode 100644 index 0000000..cd90a3e --- /dev/null +++ b/.changes/1.5.1.json @@ -0,0 +1,7 @@ +[ + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.10.json b/.changes/1.5.10.json new file mode 100644 index 0000000..b1ded20 --- /dev/null +++ b/.changes/1.5.10.json @@ -0,0 +1,17 @@ +[ + { + "category": "``route53``", + "description": "[``botocore``] Update route53 client to latest version", + "type": "api-change" + }, + { + "category": "``discovery``", + "description": "[``botocore``] Update discovery client to latest version", + "type": "api-change" + }, + { + "category": "``codedeploy``", + "description": "[``botocore``] Update codedeploy client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.11.json b/.changes/1.5.11.json new file mode 100644 index 0000000..62a792b --- /dev/null +++ b/.changes/1.5.11.json @@ -0,0 +1,7 @@ +[ + { + "category": "``ds``", + "description": "[``botocore``] Update ds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.12.json b/.changes/1.5.12.json new file mode 100644 index 0000000..1e4b88e --- /dev/null +++ b/.changes/1.5.12.json @@ -0,0 +1,7 @@ +[ + { + "category": "``kms``", + "description": "[``botocore``] Update kms client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.13.json b/.changes/1.5.13.json new file mode 100644 index 0000000..78b682f --- /dev/null +++ b/.changes/1.5.13.json @@ -0,0 +1,22 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``elbv2``", + "description": "[``botocore``] Update elbv2 client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``elb``", + "description": "[``botocore``] Update elb client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.14.json b/.changes/1.5.14.json new file mode 100644 index 0000000..5b3e60f --- /dev/null +++ b/.changes/1.5.14.json @@ -0,0 +1,7 @@ +[ + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.15.json b/.changes/1.5.15.json new file mode 100644 index 0000000..c5736cb --- /dev/null +++ b/.changes/1.5.15.json @@ -0,0 +1,12 @@ +[ + { + "category": "``lambda``", + "description": "[``botocore``] Update lambda client to latest version", + "type": "api-change" + }, + { + "category": "cloudformation get_template template body ordering", + "description": "[``botocore``] fixes boto/boto3`#1378 `__", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.5.16.json b/.changes/1.5.16.json new file mode 100644 index 0000000..96ad966 --- /dev/null +++ b/.changes/1.5.16.json @@ -0,0 +1,17 @@ +[ + { + "category": "``application-autoscaling``", + "description": "[``botocore``] Update application-autoscaling client to latest version", + "type": "api-change" + }, + { + "category": "``autoscaling-plans``", + "description": "[``botocore``] Update autoscaling-plans client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.17.json b/.changes/1.5.17.json new file mode 100644 index 0000000..ed5b79f --- /dev/null +++ b/.changes/1.5.17.json @@ -0,0 +1,12 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``autoscaling-plans``", + "description": "[``botocore``] Update autoscaling-plans client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.18.json b/.changes/1.5.18.json new file mode 100644 index 0000000..7239659 --- /dev/null +++ b/.changes/1.5.18.json @@ -0,0 +1,7 @@ +[ + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.19.json b/.changes/1.5.19.json new file mode 100644 index 0000000..6772cd8 --- /dev/null +++ b/.changes/1.5.19.json @@ -0,0 +1,12 @@ +[ + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + }, + { + "category": "``transcribe``", + "description": "[``botocore``] Update transcribe client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.2.json b/.changes/1.5.2.json new file mode 100644 index 0000000..6bd3185 --- /dev/null +++ b/.changes/1.5.2.json @@ -0,0 +1,12 @@ +[ + { + "category": "presigned-url", + "description": "[``botocore``] Fixes a bug where content-type would be set on presigned requests for query services.", + "type": "bugfix" + }, + { + "category": "``cloudwatch``", + "description": "[``botocore``] Update cloudwatch client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.20.json b/.changes/1.5.20.json new file mode 100644 index 0000000..a0e318d --- /dev/null +++ b/.changes/1.5.20.json @@ -0,0 +1,7 @@ +[ + { + "category": "``budgets``", + "description": "[``botocore``] Update budgets client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.21.json b/.changes/1.5.21.json new file mode 100644 index 0000000..8c2cca7 --- /dev/null +++ b/.changes/1.5.21.json @@ -0,0 +1,37 @@ +[ + { + "category": "``lambda``", + "description": "[``botocore``] Update lambda client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + }, + { + "category": "``alexaforbusiness``", + "description": "[``botocore``] Update alexaforbusiness client to latest version", + "type": "api-change" + }, + { + "category": "Presign", + "description": "[``botocore``] Fix issue where some events were not fired during the presigning of a request thus not including a variety of customizations (`#1340 `__)", + "type": "bugfix" + }, + { + "category": "Credentials", + "description": "[``botocore``] Improved error message when the source profile for an assume role is misconfigured. Fixes aws/aws-cli`#2763 `__", + "type": "enhancement" + }, + { + "category": "``guardduty``", + "description": "[``botocore``] Update guardduty client to latest version", + "type": "api-change" + }, + { + "category": "Paginator", + "description": "[``botocore``] Added paginators for a number of services where the result key is unambiguous.", + "type": "enhancment" + } +] \ No newline at end of file diff --git a/.changes/1.5.22.json b/.changes/1.5.22.json new file mode 100644 index 0000000..b24b512 --- /dev/null +++ b/.changes/1.5.22.json @@ -0,0 +1,17 @@ +[ + { + "category": "``mturk``", + "description": "[``botocore``] Update mturk client to latest version", + "type": "api-change" + }, + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + }, + { + "category": "``devicefarm``", + "description": "[``botocore``] Update devicefarm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.23.json b/.changes/1.5.23.json new file mode 100644 index 0000000..7209119 --- /dev/null +++ b/.changes/1.5.23.json @@ -0,0 +1,22 @@ +[ + { + "category": "``cloud9``", + "description": "[``botocore``] Update cloud9 client to latest version", + "type": "api-change" + }, + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + }, + { + "category": "``kinesis``", + "description": "[``botocore``] Update kinesis client to latest version", + "type": "api-change" + }, + { + "category": "``opsworks``", + "description": "[``botocore``] Update opsworks client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.24.json b/.changes/1.5.24.json new file mode 100644 index 0000000..60ec861 --- /dev/null +++ b/.changes/1.5.24.json @@ -0,0 +1,22 @@ +[ + { + "category": "``servicediscovery``", + "description": "[``botocore``] Update servicediscovery client to latest version", + "type": "api-change" + }, + { + "category": "``servicecatalog``", + "description": "[``botocore``] Update servicecatalog client to latest version", + "type": "api-change" + }, + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.25.json b/.changes/1.5.25.json new file mode 100644 index 0000000..b6c979c --- /dev/null +++ b/.changes/1.5.25.json @@ -0,0 +1,42 @@ +[ + { + "category": "``ds``", + "description": "[``botocore``] Update ds client to latest version", + "type": "api-change" + }, + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + }, + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + }, + { + "category": "``budgets``", + "description": "[``botocore``] Update budgets client to latest version", + "type": "api-change" + }, + { + "category": "``gamelift``", + "description": "[``botocore``] Update gamelift client to latest version", + "type": "api-change" + }, + { + "category": "``dynamodb``", + "description": "[``botocore``] Update dynamodb client to latest version", + "type": "api-change" + }, + { + "category": "``dms``", + "description": "[``botocore``] Update dms client to latest version", + "type": "api-change" + }, + { + "category": "``mediastore``", + "description": "[``botocore``] Update mediastore client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.26.json b/.changes/1.5.26.json new file mode 100644 index 0000000..8a2dc26 --- /dev/null +++ b/.changes/1.5.26.json @@ -0,0 +1,17 @@ +[ + { + "category": "``lex-runtime``", + "description": "[``botocore``] Update lex-runtime client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``lex-models``", + "description": "[``botocore``] Update lex-models client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.27.json b/.changes/1.5.27.json new file mode 100644 index 0000000..39c3468 --- /dev/null +++ b/.changes/1.5.27.json @@ -0,0 +1,27 @@ +[ + { + "category": "``guardduty``", + "description": "[``botocore``] Update guardduty client to latest version", + "type": "api-change" + }, + { + "category": "``cognito-idp``", + "description": "[``botocore``] Update cognito-idp client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``kms``", + "description": "[``botocore``] Update kms client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.28.json b/.changes/1.5.28.json new file mode 100644 index 0000000..6520abd --- /dev/null +++ b/.changes/1.5.28.json @@ -0,0 +1,12 @@ +[ + { + "category": "``glacier``", + "description": "[``botocore``] Update glacier client to latest version", + "type": "api-change" + }, + { + "category": "``route53``", + "description": "[``botocore``] Update route53 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.29.json b/.changes/1.5.29.json new file mode 100644 index 0000000..40ab8a1 --- /dev/null +++ b/.changes/1.5.29.json @@ -0,0 +1,12 @@ +[ + { + "category": "``appsync``", + "description": "[``botocore``] Update appsync client to latest version", + "type": "api-change" + }, + { + "category": "``lex-models``", + "description": "[``botocore``] Update lex-models client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.3.json b/.changes/1.5.3.json new file mode 100644 index 0000000..d655612 --- /dev/null +++ b/.changes/1.5.3.json @@ -0,0 +1,17 @@ +[ + { + "category": "``route53``", + "description": "[``botocore``] Update route53 client to latest version", + "type": "api-change" + }, + { + "category": "``apigateway``", + "description": "[``botocore``] Update apigateway client to latest version", + "type": "api-change" + }, + { + "category": "``mediastore-data``", + "description": "[``botocore``] Update mediastore-data client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.30.json b/.changes/1.5.30.json new file mode 100644 index 0000000..65bc853 --- /dev/null +++ b/.changes/1.5.30.json @@ -0,0 +1,12 @@ +[ + { + "category": "``mediaconvert``", + "description": "[``botocore``] Update mediaconvert client to latest version", + "type": "api-change" + }, + { + "category": "``gamelift``", + "description": "[``botocore``] Update gamelift client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.31.json b/.changes/1.5.31.json new file mode 100644 index 0000000..739a619 --- /dev/null +++ b/.changes/1.5.31.json @@ -0,0 +1,7 @@ +[ + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.32.json b/.changes/1.5.32.json new file mode 100644 index 0000000..291b453 --- /dev/null +++ b/.changes/1.5.32.json @@ -0,0 +1,7 @@ +[ + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.33.json b/.changes/1.5.33.json new file mode 100644 index 0000000..4344a68 --- /dev/null +++ b/.changes/1.5.33.json @@ -0,0 +1,17 @@ +[ + { + "category": "``autoscaling``", + "description": "[``botocore``] Update autoscaling client to latest version", + "type": "api-change" + }, + { + "category": "``waf-regional``", + "description": "[``botocore``] Update waf-regional client to latest version", + "type": "api-change" + }, + { + "category": "``waf``", + "description": "[``botocore``] Update waf client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.34.json b/.changes/1.5.34.json new file mode 100644 index 0000000..8a06dd7 --- /dev/null +++ b/.changes/1.5.34.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``serverlessrepo``", + "description": "[``botocore``] Update serverlessrepo client to latest version", + "type": "api-change" + }, + { + "category": "``codecommit``", + "description": "[``botocore``] Update codecommit client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.35.json b/.changes/1.5.35.json new file mode 100644 index 0000000..20cb6e4 --- /dev/null +++ b/.changes/1.5.35.json @@ -0,0 +1,12 @@ +[ + { + "category": "``elbv2``", + "description": "[``botocore``] Update elbv2 client to latest version", + "type": "api-change" + }, + { + "category": "``ce``", + "description": "[``botocore``] Update ce client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.36.json b/.changes/1.5.36.json new file mode 100644 index 0000000..cd90a3e --- /dev/null +++ b/.changes/1.5.36.json @@ -0,0 +1,7 @@ +[ + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.4.json b/.changes/1.5.4.json new file mode 100644 index 0000000..6cd63f4 --- /dev/null +++ b/.changes/1.5.4.json @@ -0,0 +1,12 @@ +[ + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + }, + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.5.json b/.changes/1.5.5.json new file mode 100644 index 0000000..11315a2 --- /dev/null +++ b/.changes/1.5.5.json @@ -0,0 +1,22 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "Paginator", + "description": "[``botocore``] Added paginator support for lambda list aliases operation.", + "type": "enhancement" + }, + { + "category": "``kinesisanalytics``", + "description": "[``botocore``] Update kinesisanalytics client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.6.json b/.changes/1.5.6.json new file mode 100644 index 0000000..dbbad43 --- /dev/null +++ b/.changes/1.5.6.json @@ -0,0 +1,22 @@ +[ + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``inspector``", + "description": "[``botocore``] Update inspector client to latest version", + "type": "api-change" + }, + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.7.json b/.changes/1.5.7.json new file mode 100644 index 0000000..fccefbc --- /dev/null +++ b/.changes/1.5.7.json @@ -0,0 +1,7 @@ +[ + { + "category": "``workspaces``", + "description": "[``botocore``] Update workspaces client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.8.json b/.changes/1.5.8.json new file mode 100644 index 0000000..739a619 --- /dev/null +++ b/.changes/1.5.8.json @@ -0,0 +1,7 @@ +[ + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.5.9.json b/.changes/1.5.9.json new file mode 100644 index 0000000..6728ed4 --- /dev/null +++ b/.changes/1.5.9.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``inspector``", + "description": "[``botocore``] Update inspector client to latest version", + "type": "api-change" + }, + { + "category": "``snowball``", + "description": "[``botocore``] Update snowball client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.0.json b/.changes/1.6.0.json new file mode 100644 index 0000000..b9b5c84 --- /dev/null +++ b/.changes/1.6.0.json @@ -0,0 +1,22 @@ +[ + { + "category": "Stubber", + "description": "[``botocore``] Added the ability to add items to response metadata with the stubber.", + "type": "enhancement" + }, + { + "category": "``sts``", + "description": "[``botocore``] Update sts client to latest version", + "type": "api-change" + }, + { + "category": "``route53``", + "description": "[``botocore``] Update route53 client to latest version", + "type": "api-change" + }, + { + "category": "``s3``", + "description": "[``botocore``] Default to virtual hosted addressing regardless of signature version (boto/botocore`#1387 `__)", + "type": "feature" + } +] \ No newline at end of file diff --git a/.changes/1.6.1.json b/.changes/1.6.1.json new file mode 100644 index 0000000..4ff7ba2 --- /dev/null +++ b/.changes/1.6.1.json @@ -0,0 +1,7 @@ +[ + { + "category": "``ecr``", + "description": "[``botocore``] Update ecr client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.10.json b/.changes/1.6.10.json new file mode 100644 index 0000000..18cae2b --- /dev/null +++ b/.changes/1.6.10.json @@ -0,0 +1,17 @@ +[ + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + }, + { + "category": "``organizations``", + "description": "[``botocore``] Update organizations client to latest version", + "type": "api-change" + }, + { + "category": "``pinpoint``", + "description": "[``botocore``] Update pinpoint client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.11.json b/.changes/1.6.11.json new file mode 100644 index 0000000..eca6826 --- /dev/null +++ b/.changes/1.6.11.json @@ -0,0 +1,7 @@ +[ + { + "category": "``elasticbeanstalk``", + "description": "[``botocore``] Update elasticbeanstalk client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.12.json b/.changes/1.6.12.json new file mode 100644 index 0000000..92c57c9 --- /dev/null +++ b/.changes/1.6.12.json @@ -0,0 +1,47 @@ +[ + { + "category": "``ce``", + "description": "[``botocore``] Update ce client to latest version", + "type": "api-change" + }, + { + "category": "Credentials", + "description": "[``botocore``] Add the ability to disable fetching credentials from EC2 metadata by setting the environment variable AWS_EC2_METADATA_DISABLED to 'true'.", + "type": "enhancement" + }, + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + }, + { + "category": "``elasticbeanstalk``", + "description": "[``botocore``] Update elasticbeanstalk client to latest version", + "type": "api-change" + }, + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + }, + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + }, + { + "category": "Credentials", + "description": "[``botocore``] Fix a race condition related to assuming a role for the first time (`#1405 `__)", + "type": "bugfix" + }, + { + "category": "``events``", + "description": "[``botocore``] Update events client to latest version", + "type": "api-change" + }, + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.13.json b/.changes/1.6.13.json new file mode 100644 index 0000000..0c4050b --- /dev/null +++ b/.changes/1.6.13.json @@ -0,0 +1,12 @@ +[ + { + "category": "s3", + "description": "[``botocore``] Fixed a bug where head object and bucket calls would attempt redirects incorrectly.", + "type": "bugfix" + }, + { + "category": "``serverlessrepo``", + "description": "[``botocore``] Update serverlessrepo client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.14.json b/.changes/1.6.14.json new file mode 100644 index 0000000..dce33af --- /dev/null +++ b/.changes/1.6.14.json @@ -0,0 +1,7 @@ +[ + { + "category": "``s3``", + "description": "[``botocore``] Fix regression in redirects in using wrong region", + "type": "bugfix" + } +] \ No newline at end of file diff --git a/.changes/1.6.15.json b/.changes/1.6.15.json new file mode 100644 index 0000000..60f6d87 --- /dev/null +++ b/.changes/1.6.15.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + }, + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.16.json b/.changes/1.6.16.json new file mode 100644 index 0000000..739a619 --- /dev/null +++ b/.changes/1.6.16.json @@ -0,0 +1,7 @@ +[ + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.17.json b/.changes/1.6.17.json new file mode 100644 index 0000000..b850e0a --- /dev/null +++ b/.changes/1.6.17.json @@ -0,0 +1,12 @@ +[ + { + "category": "``dynamodb``", + "description": "[``botocore``] Update dynamodb client to latest version", + "type": "api-change" + }, + { + "category": "``s3``", + "description": "[``botocore``] Fix bug where invalid head_object requests would cause an infinite loop (alternate fix to `#1400 `__)", + "type": "bugfix" + } +] \ No newline at end of file diff --git a/.changes/1.6.18.json b/.changes/1.6.18.json new file mode 100644 index 0000000..c39fe8f --- /dev/null +++ b/.changes/1.6.18.json @@ -0,0 +1,7 @@ +[ + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.19.json b/.changes/1.6.19.json new file mode 100644 index 0000000..f14566d --- /dev/null +++ b/.changes/1.6.19.json @@ -0,0 +1,17 @@ +[ + { + "category": "``mturk``", + "description": "[``botocore``] Update mturk client to latest version", + "type": "api-change" + }, + { + "category": "``sts``", + "description": "[``botocore``] Update sts client to latest version", + "type": "api-change" + }, + { + "category": "``iam``", + "description": "[``botocore``] Update iam client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.2.json b/.changes/1.6.2.json new file mode 100644 index 0000000..022e34b --- /dev/null +++ b/.changes/1.6.2.json @@ -0,0 +1,7 @@ +[ + { + "category": "``application-autoscaling``", + "description": "[``botocore``] Update application-autoscaling client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.20.json b/.changes/1.6.20.json new file mode 100644 index 0000000..cf0a6ef --- /dev/null +++ b/.changes/1.6.20.json @@ -0,0 +1,22 @@ +[ + { + "category": "``greengrass``", + "description": "[``botocore``] Update greengrass client to latest version", + "type": "api-change" + }, + { + "category": "``cloudformation``", + "description": "[``botocore``] Update cloudformation client to latest version", + "type": "api-change" + }, + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``alexaforbusiness``", + "description": "[``botocore``] Update alexaforbusiness client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.21.json b/.changes/1.6.21.json new file mode 100644 index 0000000..d093f24 --- /dev/null +++ b/.changes/1.6.21.json @@ -0,0 +1,12 @@ +[ + { + "category": "``connect``", + "description": "[``botocore``] Update connect client to latest version", + "type": "api-change" + }, + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.22.json b/.changes/1.6.22.json new file mode 100644 index 0000000..26dfe65 --- /dev/null +++ b/.changes/1.6.22.json @@ -0,0 +1,17 @@ +[ + { + "category": "``cloudfront``", + "description": "[``botocore``] Update cloudfront client to latest version", + "type": "api-change" + }, + { + "category": "``apigateway``", + "description": "[``botocore``] Update apigateway client to latest version", + "type": "api-change" + }, + { + "category": "``es``", + "description": "[``botocore``] Update es client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.23.json b/.changes/1.6.23.json new file mode 100644 index 0000000..77eea7c --- /dev/null +++ b/.changes/1.6.23.json @@ -0,0 +1,17 @@ +[ + { + "category": "``lambda``", + "description": "[``botocore``] Update lambda client to latest version", + "type": "api-change" + }, + { + "category": "``devicefarm``", + "description": "[``botocore``] Update devicefarm client to latest version", + "type": "api-change" + }, + { + "category": "``translate``", + "description": "[``botocore``] Update translate client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.3.json b/.changes/1.6.3.json new file mode 100644 index 0000000..f0f2240 --- /dev/null +++ b/.changes/1.6.3.json @@ -0,0 +1,27 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``servicecatalog``", + "description": "[``botocore``] Update servicecatalog client to latest version", + "type": "api-change" + }, + { + "category": "``events``", + "description": "[``botocore``] Update events client to latest version", + "type": "api-change" + }, + { + "category": "``storagegateway``", + "description": "[``botocore``] Update storagegateway client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.4.json b/.changes/1.6.4.json new file mode 100644 index 0000000..e450c67 --- /dev/null +++ b/.changes/1.6.4.json @@ -0,0 +1,7 @@ +[ + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.5.json b/.changes/1.6.5.json new file mode 100644 index 0000000..0e4d7fb --- /dev/null +++ b/.changes/1.6.5.json @@ -0,0 +1,7 @@ +[ + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.6.json b/.changes/1.6.6.json new file mode 100644 index 0000000..3a0c0a5 --- /dev/null +++ b/.changes/1.6.6.json @@ -0,0 +1,22 @@ +[ + { + "category": "``pinpoint``", + "description": "[``botocore``] Update pinpoint client to latest version", + "type": "api-change" + }, + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``mgh``", + "description": "[``botocore``] Update mgh client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.7.json b/.changes/1.6.7.json new file mode 100644 index 0000000..22ba4a9 --- /dev/null +++ b/.changes/1.6.7.json @@ -0,0 +1,22 @@ +[ + { + "category": "``cloudhsmv2``", + "description": "[``botocore``] Update cloudhsmv2 client to latest version", + "type": "api-change" + }, + { + "category": "``discovery``", + "description": "[``botocore``] Update discovery client to latest version", + "type": "api-change" + }, + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + }, + { + "category": "``redshift``", + "description": "[``botocore``] Update redshift client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.8.json b/.changes/1.6.8.json new file mode 100644 index 0000000..01a4f0a --- /dev/null +++ b/.changes/1.6.8.json @@ -0,0 +1,7 @@ +[ + { + "category": "``servicediscovery``", + "description": "[``botocore``] Update servicediscovery client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.6.9.json b/.changes/1.6.9.json new file mode 100644 index 0000000..bb02ebe --- /dev/null +++ b/.changes/1.6.9.json @@ -0,0 +1,7 @@ +[ + { + "category": "``lightsail``", + "description": "[``botocore``] Update lightsail client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.0.json b/.changes/1.7.0.json new file mode 100644 index 0000000..1fb7230 --- /dev/null +++ b/.changes/1.7.0.json @@ -0,0 +1,52 @@ +[ + { + "category": "``s3``", + "description": "[``botocore``] Update s3 client to latest version", + "type": "api-change" + }, + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + }, + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + }, + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + }, + { + "category": "``transcribe``", + "description": "[``botocore``] Update transcribe client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``acm-pca``", + "description": "[``botocore``] Update acm-pca client to latest version", + "type": "api-change" + }, + { + "category": "``cloudwatch``", + "description": "[``botocore``] Update cloudwatch client to latest version", + "type": "api-change" + }, + { + "category": "s3", + "description": "Add support for S3 Select. Amazon S3 Select is an Amazon S3 feature that makes it easy to retrieve specific data from the contents of an object using simple SQL expressions without having to retrieve the entire object. With this release of the Amazon S3 SDK, S3 Select API (SelectObjectContent) is now generally available in all public regions. This release supports retrieval of a subset of data using SQL clauses, like SELECT and WHERE, from delimited text files and JSON objects in Amazon S3 through the SelectObjectContent API available in AWS S3 SDK.", + "type": "feature" + }, + { + "category": "``fms``", + "description": "[``botocore``] Update fms client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.1.json b/.changes/1.7.1.json new file mode 100644 index 0000000..b8dc742 --- /dev/null +++ b/.changes/1.7.1.json @@ -0,0 +1,12 @@ +[ + { + "category": "shield", + "description": "[``botocore``] Added paginator for list_protections operation.", + "type": "enhancement" + }, + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.10.json b/.changes/1.7.10.json new file mode 100644 index 0000000..ff5d7ca --- /dev/null +++ b/.changes/1.7.10.json @@ -0,0 +1,12 @@ +[ + { + "category": "``glacier``", + "description": "[``botocore``] Update glacier client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.11.json b/.changes/1.7.11.json new file mode 100644 index 0000000..a96e0d2 --- /dev/null +++ b/.changes/1.7.11.json @@ -0,0 +1,32 @@ +[ + { + "category": "``guardduty``", + "description": "[``botocore``] Update guardduty client to latest version", + "type": "api-change" + }, + { + "category": "``alexaforbusiness``", + "description": "[``botocore``] Update alexaforbusiness client to latest version", + "type": "api-change" + }, + { + "category": "``route53domains``", + "description": "[``botocore``] Update route53domains client to latest version", + "type": "api-change" + }, + { + "category": "``workspaces``", + "description": "[``botocore``] Update workspaces client to latest version", + "type": "api-change" + }, + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + }, + { + "category": "``dynamodb``", + "description": "[``botocore``] Update dynamodb client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.12.json b/.changes/1.7.12.json new file mode 100644 index 0000000..a99ee46 --- /dev/null +++ b/.changes/1.7.12.json @@ -0,0 +1,22 @@ +[ + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + }, + { + "category": "``codepipeline``", + "description": "[``botocore``] Update codepipeline client to latest version", + "type": "api-change" + }, + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.13.json b/.changes/1.7.13.json new file mode 100644 index 0000000..ea8bb8e --- /dev/null +++ b/.changes/1.7.13.json @@ -0,0 +1,17 @@ +[ + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``appsync``", + "description": "[``botocore``] Update appsync client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.14.json b/.changes/1.7.14.json new file mode 100644 index 0000000..c7ce056 --- /dev/null +++ b/.changes/1.7.14.json @@ -0,0 +1,7 @@ +[ + { + "category": "``guardduty``", + "description": "[``botocore``] Update guardduty client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.15.json b/.changes/1.7.15.json new file mode 100644 index 0000000..eb959b3 --- /dev/null +++ b/.changes/1.7.15.json @@ -0,0 +1,22 @@ +[ + { + "category": "``alexaforbusiness``", + "description": "[``botocore``] Update alexaforbusiness client to latest version", + "type": "api-change" + }, + { + "category": "``s3``", + "description": "[``botocore``] Update s3 client to latest version", + "type": "api-change" + }, + { + "category": "``budgets``", + "description": "[``botocore``] Update budgets client to latest version", + "type": "api-change" + }, + { + "category": "``es``", + "description": "[``botocore``] Update es client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.16.json b/.changes/1.7.16.json new file mode 100644 index 0000000..80f918f --- /dev/null +++ b/.changes/1.7.16.json @@ -0,0 +1,12 @@ +[ + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.17.json b/.changes/1.7.17.json new file mode 100644 index 0000000..8a503ca --- /dev/null +++ b/.changes/1.7.17.json @@ -0,0 +1,17 @@ +[ + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``budgets``", + "description": "[``botocore``] Update budgets client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.18.json b/.changes/1.7.18.json new file mode 100644 index 0000000..e7d1257 --- /dev/null +++ b/.changes/1.7.18.json @@ -0,0 +1,7 @@ +[ + { + "category": "``gamelift``", + "description": "[``botocore``] Update gamelift client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.19.json b/.changes/1.7.19.json new file mode 100644 index 0000000..40bb826 --- /dev/null +++ b/.changes/1.7.19.json @@ -0,0 +1,7 @@ +[ + { + "category": "``firehose``", + "description": "[``botocore``] Update firehose client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.2.json b/.changes/1.7.2.json new file mode 100644 index 0000000..4d3f0cb --- /dev/null +++ b/.changes/1.7.2.json @@ -0,0 +1,7 @@ +[ + { + "category": "``batch``", + "description": "[``botocore``] Update batch client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.20.json b/.changes/1.7.20.json new file mode 100644 index 0000000..e1cdfd4 --- /dev/null +++ b/.changes/1.7.20.json @@ -0,0 +1,22 @@ +[ + { + "category": "``organizations``", + "description": "[``botocore``] Update organizations client to latest version", + "type": "api-change" + }, + { + "category": "``iot1click-devices``", + "description": "[``botocore``] Update iot1click-devices client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + }, + { + "category": "``iot1click-projects``", + "description": "[``botocore``] Update iot1click-projects client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.21.json b/.changes/1.7.21.json new file mode 100644 index 0000000..291b453 --- /dev/null +++ b/.changes/1.7.21.json @@ -0,0 +1,7 @@ +[ + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.22.json b/.changes/1.7.22.json new file mode 100644 index 0000000..195f4f5 --- /dev/null +++ b/.changes/1.7.22.json @@ -0,0 +1,12 @@ +[ + { + "category": "``servicecatalog``", + "description": "[``botocore``] Update servicecatalog client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.23.json b/.changes/1.7.23.json new file mode 100644 index 0000000..53501a1 --- /dev/null +++ b/.changes/1.7.23.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``cognito-idp``", + "description": "[``botocore``] Update cognito-idp client to latest version", + "type": "api-change" + }, + { + "category": "``codedeploy``", + "description": "[``botocore``] Update codedeploy client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.24.json b/.changes/1.7.24.json new file mode 100644 index 0000000..8efcc9c --- /dev/null +++ b/.changes/1.7.24.json @@ -0,0 +1,12 @@ +[ + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + }, + { + "category": "``ses``", + "description": "[``botocore``] Update ses client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.25.json b/.changes/1.7.25.json new file mode 100644 index 0000000..7c916eb --- /dev/null +++ b/.changes/1.7.25.json @@ -0,0 +1,7 @@ +[ + { + "category": "``cloudformation``", + "description": "[``botocore``] Update cloudformation client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.26.json b/.changes/1.7.26.json new file mode 100644 index 0000000..0a445bc --- /dev/null +++ b/.changes/1.7.26.json @@ -0,0 +1,17 @@ +[ + { + "category": "``inspector``", + "description": "[``botocore``] Update inspector client to latest version", + "type": "api-change" + }, + { + "category": "Credentials", + "description": "[``botocore``] Disable proxy configuration when fetching container credentials", + "type": "enhancement" + }, + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.27.json b/.changes/1.7.27.json new file mode 100644 index 0000000..5b09a84 --- /dev/null +++ b/.changes/1.7.27.json @@ -0,0 +1,22 @@ +[ + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``elbv2``", + "description": "[``botocore``] Update elbv2 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.28.json b/.changes/1.7.28.json new file mode 100644 index 0000000..0619cda --- /dev/null +++ b/.changes/1.7.28.json @@ -0,0 +1,22 @@ +[ + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + }, + { + "category": "``config``", + "description": "[``botocore``] Update config client to latest version", + "type": "api-change" + }, + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + }, + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.29.json b/.changes/1.7.29.json new file mode 100644 index 0000000..8f49ed5 --- /dev/null +++ b/.changes/1.7.29.json @@ -0,0 +1,7 @@ +[ + { + "category": "``pi``", + "description": "[``botocore``] Update pi client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.3.json b/.changes/1.7.3.json new file mode 100644 index 0000000..cc329b7 --- /dev/null +++ b/.changes/1.7.3.json @@ -0,0 +1,7 @@ +[ + { + "category": "``clouddirectory``", + "description": "[``botocore``] Update clouddirectory client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.30.json b/.changes/1.7.30.json new file mode 100644 index 0000000..b965289 --- /dev/null +++ b/.changes/1.7.30.json @@ -0,0 +1,12 @@ +[ + { + "category": "``neptune``", + "description": "[``botocore``] Update neptune client to latest version", + "type": "api-change" + }, + { + "category": "``elbv2``", + "description": "[``botocore``] Update elbv2 client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.31.json b/.changes/1.7.31.json new file mode 100644 index 0000000..fd55829 --- /dev/null +++ b/.changes/1.7.31.json @@ -0,0 +1,27 @@ +[ + { + "category": "``ds``", + "description": "[``botocore``] Update ds client to latest version", + "type": "api-change" + }, + { + "category": "``mediatailor``", + "description": "[``botocore``] Update mediatailor client to latest version", + "type": "api-change" + }, + { + "category": "``sns``", + "description": "[``botocore``] Update sns client to latest version", + "type": "api-change" + }, + { + "category": "``redshift``", + "description": "[``botocore``] Update redshift client to latest version", + "type": "api-change" + }, + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.32.json b/.changes/1.7.32.json new file mode 100644 index 0000000..463422f --- /dev/null +++ b/.changes/1.7.32.json @@ -0,0 +1,32 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + }, + { + "category": "``mgh``", + "description": "[``botocore``] Update mgh client to latest version", + "type": "api-change" + }, + { + "category": "``mediaconvert``", + "description": "[``botocore``] Update mediaconvert client to latest version", + "type": "api-change" + }, + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + }, + { + "category": "``eks``", + "description": "[``botocore``] Update eks client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.33.json b/.changes/1.7.33.json new file mode 100644 index 0000000..4a43a14 --- /dev/null +++ b/.changes/1.7.33.json @@ -0,0 +1,27 @@ +[ + { + "category": "``polly``", + "description": "[``botocore``] Update polly client to latest version", + "type": "api-change" + }, + { + "category": "``ce``", + "description": "[``botocore``] Update ce client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``shield``", + "description": "[``botocore``] Update shield client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.34.json b/.changes/1.7.34.json new file mode 100644 index 0000000..0e4d7fb --- /dev/null +++ b/.changes/1.7.34.json @@ -0,0 +1,7 @@ +[ + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.35.json b/.changes/1.7.35.json new file mode 100644 index 0000000..6ba7a5c --- /dev/null +++ b/.changes/1.7.35.json @@ -0,0 +1,7 @@ +[ + { + "category": "``mediatailor``", + "description": "[``botocore``] Update mediatailor client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.36.json b/.changes/1.7.36.json new file mode 100644 index 0000000..f889771 --- /dev/null +++ b/.changes/1.7.36.json @@ -0,0 +1,17 @@ +[ + { + "category": "``storagegateway``", + "description": "[``botocore``] Update storagegateway client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``clouddirectory``", + "description": "[``botocore``] Update clouddirectory client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.37.json b/.changes/1.7.37.json new file mode 100644 index 0000000..6130a7b --- /dev/null +++ b/.changes/1.7.37.json @@ -0,0 +1,12 @@ +[ + { + "category": "``ecs``", + "description": "[``botocore``] Update ecs client to latest version", + "type": "api-change" + }, + { + "category": "``devicefarm``", + "description": "[``botocore``] Update devicefarm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.38.json b/.changes/1.7.38.json new file mode 100644 index 0000000..6c0d082 --- /dev/null +++ b/.changes/1.7.38.json @@ -0,0 +1,12 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``servicecatalog``", + "description": "[``botocore``] Update servicecatalog client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.39.json b/.changes/1.7.39.json new file mode 100644 index 0000000..a634a57 --- /dev/null +++ b/.changes/1.7.39.json @@ -0,0 +1,17 @@ +[ + { + "category": "``iotanalytics``", + "description": "[``botocore``] Update iotanalytics client to latest version", + "type": "api-change" + }, + { + "category": "``dynamodb``", + "description": "[``botocore``] Update dynamodb client to latest version", + "type": "api-change" + }, + { + "category": "``apigateway``", + "description": "[``botocore``] Update apigateway client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.4.json b/.changes/1.7.4.json new file mode 100644 index 0000000..55d7db3 --- /dev/null +++ b/.changes/1.7.4.json @@ -0,0 +1,27 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``workmail``", + "description": "[``botocore``] Update workmail client to latest version", + "type": "api-change" + }, + { + "category": "``dms``", + "description": "[``botocore``] Update dms client to latest version", + "type": "api-change" + }, + { + "category": "``mediapackage``", + "description": "[``botocore``] Update mediapackage client to latest version", + "type": "api-change" + }, + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.40.json b/.changes/1.7.40.json new file mode 100644 index 0000000..e288da6 --- /dev/null +++ b/.changes/1.7.40.json @@ -0,0 +1,7 @@ +[ + { + "category": "``mediaconvert``", + "description": "[``botocore``] Update mediaconvert client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.41.json b/.changes/1.7.41.json new file mode 100644 index 0000000..a32f235 --- /dev/null +++ b/.changes/1.7.41.json @@ -0,0 +1,7 @@ +[ + { + "category": "``rekognition``", + "description": "[``botocore``] Update rekognition client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.42.json b/.changes/1.7.42.json new file mode 100644 index 0000000..1396ae9 --- /dev/null +++ b/.changes/1.7.42.json @@ -0,0 +1,17 @@ +[ + { + "category": "``acm-pca``", + "description": "[``botocore``] Update acm-pca client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.43.json b/.changes/1.7.43.json new file mode 100644 index 0000000..cf8ee95 --- /dev/null +++ b/.changes/1.7.43.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``macie``", + "description": "[``botocore``] Update macie client to latest version", + "type": "api-change" + }, + { + "category": "``neptune``", + "description": "[``botocore``] Update neptune client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.44.json b/.changes/1.7.44.json new file mode 100644 index 0000000..cc329b7 --- /dev/null +++ b/.changes/1.7.44.json @@ -0,0 +1,7 @@ +[ + { + "category": "``clouddirectory``", + "description": "[``botocore``] Update clouddirectory client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.45.json b/.changes/1.7.45.json new file mode 100644 index 0000000..68df429 --- /dev/null +++ b/.changes/1.7.45.json @@ -0,0 +1,12 @@ +[ + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + }, + { + "category": "``alexaforbusiness``", + "description": "[``botocore``] Update alexaforbusiness client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.46.json b/.changes/1.7.46.json new file mode 100644 index 0000000..af2b372 --- /dev/null +++ b/.changes/1.7.46.json @@ -0,0 +1,17 @@ +[ + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``s3``", + "description": "[``botocore``] Update s3 client to latest version", + "type": "api-change" + }, + { + "category": "``inspector``", + "description": "[``botocore``] Update inspector client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.47.json b/.changes/1.7.47.json new file mode 100644 index 0000000..0be0897 --- /dev/null +++ b/.changes/1.7.47.json @@ -0,0 +1,27 @@ +[ + { + "category": "``cloudfront``", + "description": "[``botocore``] Update cloudfront client to latest version", + "type": "api-change" + }, + { + "category": "``comprehend``", + "description": "[``botocore``] Update comprehend client to latest version", + "type": "api-change" + }, + { + "category": "``codepipeline``", + "description": "[``botocore``] Update codepipeline client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "StreamingResponses", + "description": "[``botocore``] Add ``iter_lines()`` and ``iter_chunks()`` to streaming responses (`#1195 `__)", + "type": "enhancement" + } +] \ No newline at end of file diff --git a/.changes/1.7.48.json b/.changes/1.7.48.json new file mode 100644 index 0000000..926c61b --- /dev/null +++ b/.changes/1.7.48.json @@ -0,0 +1,17 @@ +[ + { + "category": "``elasticbeanstalk``", + "description": "[``botocore``] Update elasticbeanstalk client to latest version", + "type": "api-change" + }, + { + "category": "``storagegateway``", + "description": "[``botocore``] Update storagegateway client to latest version", + "type": "api-change" + }, + { + "category": "``lambda``", + "description": "[``botocore``] Update lambda client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.49.json b/.changes/1.7.49.json new file mode 100644 index 0000000..8b7f823 --- /dev/null +++ b/.changes/1.7.49.json @@ -0,0 +1,7 @@ +[ + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.5.json b/.changes/1.7.5.json new file mode 100644 index 0000000..8b5b06c --- /dev/null +++ b/.changes/1.7.5.json @@ -0,0 +1,42 @@ +[ + { + "category": "``ce``", + "description": "[``botocore``] Update ce client to latest version", + "type": "api-change" + }, + { + "category": "``codepipeline``", + "description": "[``botocore``] Update codepipeline client to latest version", + "type": "api-change" + }, + { + "category": "``ssm``", + "description": "[``botocore``] Update ssm client to latest version", + "type": "api-change" + }, + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``rds``", + "description": "[``botocore``] Update rds client to latest version", + "type": "api-change" + }, + { + "category": "``devicefarm``", + "description": "[``botocore``] Update devicefarm client to latest version", + "type": "api-change" + }, + { + "category": "dynamodb", + "description": "Fixes a bug causing dynamodb operations with no output to throw errors.", + "type": "bugfix" + } +] \ No newline at end of file diff --git a/.changes/1.7.50.json b/.changes/1.7.50.json new file mode 100644 index 0000000..02fd7ee --- /dev/null +++ b/.changes/1.7.50.json @@ -0,0 +1,17 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``redshift``", + "description": "[``botocore``] Update redshift client to latest version", + "type": "api-change" + }, + { + "category": "``acm``", + "description": "[``botocore``] Update acm client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.51.json b/.changes/1.7.51.json new file mode 100644 index 0000000..8e7c8b7 --- /dev/null +++ b/.changes/1.7.51.json @@ -0,0 +1,12 @@ +[ + { + "category": "``sagemaker``", + "description": "[``botocore``] Update sagemaker client to latest version", + "type": "api-change" + }, + { + "category": "``pinpoint``", + "description": "[``botocore``] Update pinpoint client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.52.json b/.changes/1.7.52.json new file mode 100644 index 0000000..a6375d6 --- /dev/null +++ b/.changes/1.7.52.json @@ -0,0 +1,12 @@ +[ + { + "category": "``mediaconvert``", + "description": "[``botocore``] Update mediaconvert client to latest version", + "type": "api-change" + }, + { + "category": "``serverlessrepo``", + "description": "[``botocore``] Update serverlessrepo client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.53.json b/.changes/1.7.53.json new file mode 100644 index 0000000..30da689 --- /dev/null +++ b/.changes/1.7.53.json @@ -0,0 +1,27 @@ +[ + { + "category": "``application-autoscaling``", + "description": "[``botocore``] Update application-autoscaling client to latest version", + "type": "api-change" + }, + { + "category": "``lambda``", + "description": "[``botocore``] Update lambda client to latest version", + "type": "api-change" + }, + { + "category": "``dms``", + "description": "[``botocore``] Update dms client to latest version", + "type": "api-change" + }, + { + "category": "``ce``", + "description": "[``botocore``] Update ce client to latest version", + "type": "api-change" + }, + { + "category": "``transcribe``", + "description": "[``botocore``] Update transcribe client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.54.json b/.changes/1.7.54.json new file mode 100644 index 0000000..022e34b --- /dev/null +++ b/.changes/1.7.54.json @@ -0,0 +1,7 @@ +[ + { + "category": "``application-autoscaling``", + "description": "[``botocore``] Update application-autoscaling client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.55.json b/.changes/1.7.55.json new file mode 100644 index 0000000..65e3dc5 --- /dev/null +++ b/.changes/1.7.55.json @@ -0,0 +1,27 @@ +[ + { + "category": "``ec2``", + "description": "[``botocore``] Update ec2 client to latest version", + "type": "api-change" + }, + { + "category": "``codebuild``", + "description": "[``botocore``] Update codebuild client to latest version", + "type": "api-change" + }, + { + "category": "``glue``", + "description": "[``botocore``] Update glue client to latest version", + "type": "api-change" + }, + { + "category": "``opsworks``", + "description": "[``botocore``] Update opsworks client to latest version", + "type": "api-change" + }, + { + "category": "``appstream``", + "description": "[``botocore``] Update appstream client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.6.json b/.changes/1.7.6.json new file mode 100644 index 0000000..430f376 --- /dev/null +++ b/.changes/1.7.6.json @@ -0,0 +1,12 @@ +[ + { + "category": "``medialive``", + "description": "[``botocore``] Update medialive client to latest version", + "type": "api-change" + }, + { + "category": "``firehose``", + "description": "[``botocore``] Update firehose client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.7.json b/.changes/1.7.7.json new file mode 100644 index 0000000..0ebcec1 --- /dev/null +++ b/.changes/1.7.7.json @@ -0,0 +1,17 @@ +[ + { + "category": "``iotanalytics``", + "description": "[``botocore``] Update iotanalytics client to latest version", + "type": "api-change" + }, + { + "category": "``iot``", + "description": "[``botocore``] Update iot client to latest version", + "type": "api-change" + }, + { + "category": "``autoscaling-plans``", + "description": "[``botocore``] Update autoscaling-plans client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.8.json b/.changes/1.7.8.json new file mode 100644 index 0000000..5f297c2 --- /dev/null +++ b/.changes/1.7.8.json @@ -0,0 +1,12 @@ +[ + { + "category": "``secretsmanager``", + "description": "[``botocore``] Update secretsmanager client to latest version", + "type": "api-change" + }, + { + "category": "``elasticbeanstalk``", + "description": "[``botocore``] Update elasticbeanstalk client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.changes/1.7.9.json b/.changes/1.7.9.json new file mode 100644 index 0000000..985e26d --- /dev/null +++ b/.changes/1.7.9.json @@ -0,0 +1,17 @@ +[ + { + "category": "``rekognition``", + "description": "[``botocore``] Update rekognition client to latest version", + "type": "api-change" + }, + { + "category": "``xray``", + "description": "[``botocore``] Update xray client to latest version", + "type": "api-change" + }, + { + "category": "``codedeploy``", + "description": "[``botocore``] Update codedeploy client to latest version", + "type": "api-change" + } +] \ No newline at end of file diff --git a/.github/no-response.yml b/.github/no-response.yml new file mode 100644 index 0000000..7953cfb --- /dev/null +++ b/.github/no-response.yml @@ -0,0 +1,13 @@ +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 7 +# Label requiring a response +responseRequiredLabel: closing-soon-if-no-response +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information from the original author. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0556b05..929a103 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ python: - "3.3" - "3.4" - "3.5" + - "3.6" sudo: false before_install: - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 96ebbd5..efdcb06 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,941 @@ CHANGELOG ========= +1.7.55 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version +* api-change:``glue``: [``botocore``] Update glue client to latest version +* api-change:``opsworks``: [``botocore``] Update opsworks client to latest version +* api-change:``appstream``: [``botocore``] Update appstream client to latest version + + +1.7.54 +====== + +* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version + + +1.7.53 +====== + +* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version +* api-change:``lambda``: [``botocore``] Update lambda client to latest version +* api-change:``dms``: [``botocore``] Update dms client to latest version +* api-change:``ce``: [``botocore``] Update ce client to latest version +* api-change:``transcribe``: [``botocore``] Update transcribe client to latest version + + +1.7.52 +====== + +* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version +* api-change:``serverlessrepo``: [``botocore``] Update serverlessrepo client to latest version + + +1.7.51 +====== + +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version +* api-change:``pinpoint``: [``botocore``] Update pinpoint client to latest version + + +1.7.50 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``redshift``: [``botocore``] Update redshift client to latest version +* api-change:``acm``: [``botocore``] Update acm client to latest version + + +1.7.49 +====== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version + + +1.7.48 +====== + +* api-change:``elasticbeanstalk``: [``botocore``] Update elasticbeanstalk client to latest version +* api-change:``storagegateway``: [``botocore``] Update storagegateway client to latest version +* api-change:``lambda``: [``botocore``] Update lambda client to latest version + + +1.7.47 +====== + +* api-change:``cloudfront``: [``botocore``] Update cloudfront client to latest version +* api-change:``comprehend``: [``botocore``] Update comprehend client to latest version +* api-change:``codepipeline``: [``botocore``] Update codepipeline client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* enhancement:StreamingResponses: [``botocore``] Add ``iter_lines()`` and ``iter_chunks()`` to streaming responses (`#1195 `__) + + +1.7.46 +====== + +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``s3``: [``botocore``] Update s3 client to latest version +* api-change:``inspector``: [``botocore``] Update inspector client to latest version + + +1.7.45 +====== + +* api-change:``appstream``: [``botocore``] Update appstream client to latest version +* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version + + +1.7.44 +====== + +* api-change:``clouddirectory``: [``botocore``] Update clouddirectory client to latest version + + +1.7.43 +====== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``macie``: [``botocore``] Update macie client to latest version +* api-change:``neptune``: [``botocore``] Update neptune client to latest version + + +1.7.42 +====== + +* api-change:``acm-pca``: [``botocore``] Update acm-pca client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``medialive``: [``botocore``] Update medialive client to latest version + + +1.7.41 +====== + +* api-change:``rekognition``: [``botocore``] Update rekognition client to latest version + + +1.7.40 +====== + +* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version + + +1.7.39 +====== + +* api-change:``iotanalytics``: [``botocore``] Update iotanalytics client to latest version +* api-change:``dynamodb``: [``botocore``] Update dynamodb client to latest version +* api-change:``apigateway``: [``botocore``] Update apigateway client to latest version + + +1.7.38 +====== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``servicecatalog``: [``botocore``] Update servicecatalog client to latest version + + +1.7.37 +====== + +* api-change:``ecs``: [``botocore``] Update ecs client to latest version +* api-change:``devicefarm``: [``botocore``] Update devicefarm client to latest version + + +1.7.36 +====== + +* api-change:``storagegateway``: [``botocore``] Update storagegateway client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``clouddirectory``: [``botocore``] Update clouddirectory client to latest version + + +1.7.35 +====== + +* api-change:``mediatailor``: [``botocore``] Update mediatailor client to latest version + + +1.7.34 +====== + +* api-change:``medialive``: [``botocore``] Update medialive client to latest version + + +1.7.33 +====== + +* api-change:``polly``: [``botocore``] Update polly client to latest version +* api-change:``ce``: [``botocore``] Update ce client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``shield``: [``botocore``] Update shield client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version + + +1.7.32 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version +* api-change:``mgh``: [``botocore``] Update mgh client to latest version +* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version +* api-change:``appstream``: [``botocore``] Update appstream client to latest version +* api-change:``eks``: [``botocore``] Update eks client to latest version + + +1.7.31 +====== + +* api-change:``ds``: [``botocore``] Update ds client to latest version +* api-change:``mediatailor``: [``botocore``] Update mediatailor client to latest version +* api-change:``sns``: [``botocore``] Update sns client to latest version +* api-change:``redshift``: [``botocore``] Update redshift client to latest version +* api-change:``iot``: [``botocore``] Update iot client to latest version + + +1.7.30 +====== + +* api-change:``neptune``: [``botocore``] Update neptune client to latest version +* api-change:``elbv2``: [``botocore``] Update elbv2 client to latest version + + +1.7.29 +====== + +* api-change:``pi``: [``botocore``] Update pi client to latest version + + +1.7.28 +====== + +* api-change:``iot``: [``botocore``] Update iot client to latest version +* api-change:``config``: [``botocore``] Update config client to latest version +* api-change:``appstream``: [``botocore``] Update appstream client to latest version +* api-change:``glue``: [``botocore``] Update glue client to latest version + + +1.7.27 +====== + +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``elbv2``: [``botocore``] Update elbv2 client to latest version + + +1.7.26 +====== + +* api-change:``inspector``: [``botocore``] Update inspector client to latest version +* enhancement:Credentials: [``botocore``] Disable proxy configuration when fetching container credentials +* api-change:``ecs``: [``botocore``] Update ecs client to latest version + + +1.7.25 +====== + +* api-change:``cloudformation``: [``botocore``] Update cloudformation client to latest version + + +1.7.24 +====== + +* api-change:``iot``: [``botocore``] Update iot client to latest version +* api-change:``ses``: [``botocore``] Update ses client to latest version + + +1.7.23 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``cognito-idp``: [``botocore``] Update cognito-idp client to latest version +* api-change:``codedeploy``: [``botocore``] Update codedeploy client to latest version + + +1.7.22 +====== + +* api-change:``servicecatalog``: [``botocore``] Update servicecatalog client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version + + +1.7.21 +====== + +* api-change:``config``: [``botocore``] Update config client to latest version + + +1.7.20 +====== + +* api-change:``organizations``: [``botocore``] Update organizations client to latest version +* api-change:``iot1click-devices``: [``botocore``] Update iot1click-devices client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version +* api-change:``iot1click-projects``: [``botocore``] Update iot1click-projects client to latest version + + +1.7.19 +====== + +* api-change:``firehose``: [``botocore``] Update firehose client to latest version + + +1.7.18 +====== + +* api-change:``gamelift``: [``botocore``] Update gamelift client to latest version + + +1.7.17 +====== + +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``budgets``: [``botocore``] Update budgets client to latest version + + +1.7.16 +====== + +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version + + +1.7.15 +====== + +* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version +* api-change:``s3``: [``botocore``] Update s3 client to latest version +* api-change:``budgets``: [``botocore``] Update budgets client to latest version +* api-change:``es``: [``botocore``] Update es client to latest version + + +1.7.14 +====== + +* api-change:``guardduty``: [``botocore``] Update guardduty client to latest version + + +1.7.13 +====== + +* api-change:``config``: [``botocore``] Update config client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``appsync``: [``botocore``] Update appsync client to latest version + + +1.7.12 +====== + +* api-change:``acm``: [``botocore``] Update acm client to latest version +* api-change:``codepipeline``: [``botocore``] Update codepipeline client to latest version +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version + + +1.7.11 +====== + +* api-change:``guardduty``: [``botocore``] Update guardduty client to latest version +* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version +* api-change:``route53domains``: [``botocore``] Update route53domains client to latest version +* api-change:``workspaces``: [``botocore``] Update workspaces client to latest version +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version +* api-change:``dynamodb``: [``botocore``] Update dynamodb client to latest version + + +1.7.10 +====== + +* api-change:``glacier``: [``botocore``] Update glacier client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version + + +1.7.9 +===== + +* api-change:``rekognition``: [``botocore``] Update rekognition client to latest version +* api-change:``xray``: [``botocore``] Update xray client to latest version +* api-change:``codedeploy``: [``botocore``] Update codedeploy client to latest version + + +1.7.8 +===== + +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``elasticbeanstalk``: [``botocore``] Update elasticbeanstalk client to latest version + + +1.7.7 +===== + +* api-change:``iotanalytics``: [``botocore``] Update iotanalytics client to latest version +* api-change:``iot``: [``botocore``] Update iot client to latest version +* api-change:``autoscaling-plans``: [``botocore``] Update autoscaling-plans client to latest version + + +1.7.6 +===== + +* api-change:``medialive``: [``botocore``] Update medialive client to latest version +* api-change:``firehose``: [``botocore``] Update firehose client to latest version + + +1.7.5 +===== + +* api-change:``ce``: [``botocore``] Update ce client to latest version +* api-change:``codepipeline``: [``botocore``] Update codepipeline client to latest version +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``devicefarm``: [``botocore``] Update devicefarm client to latest version +* bugfix:dynamodb: Fixes a bug causing dynamodb operations with no output to throw errors. + + +1.7.4 +===== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``workmail``: [``botocore``] Update workmail client to latest version +* api-change:``dms``: [``botocore``] Update dms client to latest version +* api-change:``mediapackage``: [``botocore``] Update mediapackage client to latest version +* api-change:``glue``: [``botocore``] Update glue client to latest version + + +1.7.3 +===== + +* api-change:``clouddirectory``: [``botocore``] Update clouddirectory client to latest version + + +1.7.2 +===== + +* api-change:``batch``: [``botocore``] Update batch client to latest version + + +1.7.1 +===== + +* enhancement:shield: [``botocore``] Added paginator for list_protections operation. +* api-change:``ssm``: [``botocore``] Update ssm client to latest version + + +1.7.0 +===== + +* api-change:``s3``: [``botocore``] Update s3 client to latest version +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version +* api-change:``acm``: [``botocore``] Update acm client to latest version +* api-change:``config``: [``botocore``] Update config client to latest version +* api-change:``transcribe``: [``botocore``] Update transcribe client to latest version +* api-change:``secretsmanager``: [``botocore``] Update secretsmanager client to latest version +* api-change:``acm-pca``: [``botocore``] Update acm-pca client to latest version +* api-change:``cloudwatch``: [``botocore``] Update cloudwatch client to latest version +* feature:s3: Add support for S3 Select. Amazon S3 Select is an Amazon S3 feature that makes it easy to retrieve specific data from the contents of an object using simple SQL expressions without having to retrieve the entire object. With this release of the Amazon S3 SDK, S3 Select API (SelectObjectContent) is now generally available in all public regions. This release supports retrieval of a subset of data using SQL clauses, like SELECT and WHERE, from delimited text files and JSON objects in Amazon S3 through the SelectObjectContent API available in AWS S3 SDK. +* api-change:``fms``: [``botocore``] Update fms client to latest version + + +1.6.23 +====== + +* api-change:``lambda``: [``botocore``] Update lambda client to latest version +* api-change:``devicefarm``: [``botocore``] Update devicefarm client to latest version +* api-change:``translate``: [``botocore``] Update translate client to latest version + + +1.6.22 +====== + +* api-change:``cloudfront``: [``botocore``] Update cloudfront client to latest version +* api-change:``apigateway``: [``botocore``] Update apigateway client to latest version +* api-change:``es``: [``botocore``] Update es client to latest version + + +1.6.21 +====== + +* api-change:``connect``: [``botocore``] Update connect client to latest version +* api-change:``acm``: [``botocore``] Update acm client to latest version + + +1.6.20 +====== + +* api-change:``greengrass``: [``botocore``] Update greengrass client to latest version +* api-change:``cloudformation``: [``botocore``] Update cloudformation client to latest version +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version + + +1.6.19 +====== + +* api-change:``mturk``: [``botocore``] Update mturk client to latest version +* api-change:``sts``: [``botocore``] Update sts client to latest version +* api-change:``iam``: [``botocore``] Update iam client to latest version + + +1.6.18 +====== + +* api-change:``acm``: [``botocore``] Update acm client to latest version + + +1.6.17 +====== + +* api-change:``dynamodb``: [``botocore``] Update dynamodb client to latest version +* bugfix:``s3``: [``botocore``] Fix bug where invalid head_object requests would cause an infinite loop (alternate fix to `#1400 `__) + + +1.6.16 +====== + +* api-change:``rds``: [``botocore``] Update rds client to latest version + + +1.6.15 +====== + +* api-change:``ecs``: [``botocore``] Update ecs client to latest version +* api-change:``appstream``: [``botocore``] Update appstream client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version + + +1.6.14 +====== + +* bugfix:``s3``: [``botocore``] Fix regression in redirects in using wrong region + + +1.6.13 +====== + +* bugfix:s3: [``botocore``] Fixed a bug where head object and bucket calls would attempt redirects incorrectly. +* api-change:``serverlessrepo``: [``botocore``] Update serverlessrepo client to latest version + + +1.6.12 +====== + +* api-change:``ce``: [``botocore``] Update ce client to latest version +* enhancement:Credentials: [``botocore``] Add the ability to disable fetching credentials from EC2 metadata by setting the environment variable AWS_EC2_METADATA_DISABLED to 'true'. +* api-change:``config``: [``botocore``] Update config client to latest version +* api-change:``elasticbeanstalk``: [``botocore``] Update elasticbeanstalk client to latest version +* api-change:``glue``: [``botocore``] Update glue client to latest version +* api-change:``medialive``: [``botocore``] Update medialive client to latest version +* bugfix:Credentials: [``botocore``] Fix a race condition related to assuming a role for the first time (`#1405 `__) +* api-change:``events``: [``botocore``] Update events client to latest version +* api-change:``ecs``: [``botocore``] Update ecs client to latest version + + +1.6.11 +====== + +* api-change:``elasticbeanstalk``: [``botocore``] Update elasticbeanstalk client to latest version + + +1.6.10 +====== + +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version +* api-change:``organizations``: [``botocore``] Update organizations client to latest version +* api-change:``pinpoint``: [``botocore``] Update pinpoint client to latest version + + +1.6.9 +===== + +* api-change:``lightsail``: [``botocore``] Update lightsail client to latest version + + +1.6.8 +===== + +* api-change:``servicediscovery``: [``botocore``] Update servicediscovery client to latest version + + +1.6.7 +===== + +* api-change:``cloudhsmv2``: [``botocore``] Update cloudhsmv2 client to latest version +* api-change:``discovery``: [``botocore``] Update discovery client to latest version +* api-change:``iot``: [``botocore``] Update iot client to latest version +* api-change:``redshift``: [``botocore``] Update redshift client to latest version + + +1.6.6 +===== + +* api-change:``pinpoint``: [``botocore``] Update pinpoint client to latest version +* api-change:``ecs``: [``botocore``] Update ecs client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``mgh``: [``botocore``] Update mgh client to latest version + + +1.6.5 +===== + +* api-change:``medialive``: [``botocore``] Update medialive client to latest version + + +1.6.4 +===== + +* api-change:``ecs``: [``botocore``] Update ecs client to latest version + + +1.6.3 +===== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``servicecatalog``: [``botocore``] Update servicecatalog client to latest version +* api-change:``events``: [``botocore``] Update events client to latest version +* api-change:``storagegateway``: [``botocore``] Update storagegateway client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version + + +1.6.2 +===== + +* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version + + +1.6.1 +===== + +* api-change:``ecr``: [``botocore``] Update ecr client to latest version + + +1.6.0 +===== + +* enhancement:Stubber: [``botocore``] Added the ability to add items to response metadata with the stubber. +* api-change:``sts``: [``botocore``] Update sts client to latest version +* api-change:``route53``: [``botocore``] Update route53 client to latest version +* feature:``s3``: [``botocore``] Default to virtual hosted addressing regardless of signature version (boto/botocore`#1387 `__) + + +1.5.36 +====== + +* api-change:``appstream``: [``botocore``] Update appstream client to latest version + + +1.5.35 +====== + +* api-change:``elbv2``: [``botocore``] Update elbv2 client to latest version +* api-change:``ce``: [``botocore``] Update ce client to latest version + + +1.5.34 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``serverlessrepo``: [``botocore``] Update serverlessrepo client to latest version +* api-change:``codecommit``: [``botocore``] Update codecommit client to latest version + + +1.5.33 +====== + +* api-change:``autoscaling``: [``botocore``] Update autoscaling client to latest version +* api-change:``waf-regional``: [``botocore``] Update waf-regional client to latest version +* api-change:``waf``: [``botocore``] Update waf client to latest version + + +1.5.32 +====== + +* api-change:``config``: [``botocore``] Update config client to latest version + + +1.5.31 +====== + +* api-change:``rds``: [``botocore``] Update rds client to latest version + + +1.5.30 +====== + +* api-change:``mediaconvert``: [``botocore``] Update mediaconvert client to latest version +* api-change:``gamelift``: [``botocore``] Update gamelift client to latest version + + +1.5.29 +====== + +* api-change:``appsync``: [``botocore``] Update appsync client to latest version +* api-change:``lex-models``: [``botocore``] Update lex-models client to latest version + + +1.5.28 +====== + +* api-change:``glacier``: [``botocore``] Update glacier client to latest version +* api-change:``route53``: [``botocore``] Update route53 client to latest version + + +1.5.27 +====== + +* api-change:``guardduty``: [``botocore``] Update guardduty client to latest version +* api-change:``cognito-idp``: [``botocore``] Update cognito-idp client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``kms``: [``botocore``] Update kms client to latest version + + +1.5.26 +====== + +* api-change:``lex-runtime``: [``botocore``] Update lex-runtime client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``lex-models``: [``botocore``] Update lex-models client to latest version + + +1.5.25 +====== + +* api-change:``ds``: [``botocore``] Update ds client to latest version +* api-change:``appstream``: [``botocore``] Update appstream client to latest version +* api-change:``medialive``: [``botocore``] Update medialive client to latest version +* api-change:``budgets``: [``botocore``] Update budgets client to latest version +* api-change:``gamelift``: [``botocore``] Update gamelift client to latest version +* api-change:``dynamodb``: [``botocore``] Update dynamodb client to latest version +* api-change:``dms``: [``botocore``] Update dms client to latest version +* api-change:``mediastore``: [``botocore``] Update mediastore client to latest version + + +1.5.24 +====== + +* api-change:``servicediscovery``: [``botocore``] Update servicediscovery client to latest version +* api-change:``servicecatalog``: [``botocore``] Update servicecatalog client to latest version +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``glue``: [``botocore``] Update glue client to latest version + + +1.5.23 +====== + +* api-change:``cloud9``: [``botocore``] Update cloud9 client to latest version +* api-change:``acm``: [``botocore``] Update acm client to latest version +* api-change:``kinesis``: [``botocore``] Update kinesis client to latest version +* api-change:``opsworks``: [``botocore``] Update opsworks client to latest version + + +1.5.22 +====== + +* api-change:``mturk``: [``botocore``] Update mturk client to latest version +* api-change:``medialive``: [``botocore``] Update medialive client to latest version +* api-change:``devicefarm``: [``botocore``] Update devicefarm client to latest version + + +1.5.21 +====== + +* api-change:``lambda``: [``botocore``] Update lambda client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version +* api-change:``alexaforbusiness``: [``botocore``] Update alexaforbusiness client to latest version +* bugfix:Presign: [``botocore``] Fix issue where some events were not fired during the presigning of a request thus not including a variety of customizations (`#1340 `__) +* enhancement:Credentials: [``botocore``] Improved error message when the source profile for an assume role is misconfigured. Fixes aws/aws-cli`#2763 `__ +* api-change:``guardduty``: [``botocore``] Update guardduty client to latest version +* enhancment:Paginator: [``botocore``] Added paginators for a number of services where the result key is unambiguous. + + +1.5.20 +====== + +* api-change:``budgets``: [``botocore``] Update budgets client to latest version + + +1.5.19 +====== + +* api-change:``glue``: [``botocore``] Update glue client to latest version +* api-change:``transcribe``: [``botocore``] Update transcribe client to latest version + + +1.5.18 +====== + +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version + + +1.5.17 +====== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``autoscaling-plans``: [``botocore``] Update autoscaling-plans client to latest version + + +1.5.16 +====== + +* api-change:``application-autoscaling``: [``botocore``] Update application-autoscaling client to latest version +* api-change:``autoscaling-plans``: [``botocore``] Update autoscaling-plans client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version + + +1.5.15 +====== + +* api-change:``lambda``: [``botocore``] Update lambda client to latest version +* enhancement:cloudformation get_template template body ordering: [``botocore``] fixes boto/boto3`#1378 `__ + + +1.5.14 +====== + +* api-change:``glue``: [``botocore``] Update glue client to latest version + + +1.5.13 +====== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``elbv2``: [``botocore``] Update elbv2 client to latest version +* api-change:``rds``: [``botocore``] Update rds client to latest version +* api-change:``elb``: [``botocore``] Update elb client to latest version + + +1.5.12 +====== + +* api-change:``kms``: [``botocore``] Update kms client to latest version + + +1.5.11 +====== + +* api-change:``ds``: [``botocore``] Update ds client to latest version + + +1.5.10 +====== + +* api-change:``route53``: [``botocore``] Update route53 client to latest version +* api-change:``discovery``: [``botocore``] Update discovery client to latest version +* api-change:``codedeploy``: [``botocore``] Update codedeploy client to latest version + + +1.5.9 +===== + +* api-change:``ssm``: [``botocore``] Update ssm client to latest version +* api-change:``inspector``: [``botocore``] Update inspector client to latest version +* api-change:``snowball``: [``botocore``] Update snowball client to latest version + + +1.5.8 +===== + +* api-change:``rds``: [``botocore``] Update rds client to latest version + + +1.5.7 +===== + +* api-change:``workspaces``: [``botocore``] Update workspaces client to latest version + + +1.5.6 +===== + +* api-change:``ecs``: [``botocore``] Update ecs client to latest version +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* api-change:``inspector``: [``botocore``] Update inspector client to latest version +* api-change:``sagemaker``: [``botocore``] Update sagemaker client to latest version + + +1.5.5 +===== + +* api-change:``ec2``: [``botocore``] Update ec2 client to latest version +* enhancement:Paginator: [``botocore``] Added paginator support for lambda list aliases operation. +* api-change:``kinesisanalytics``: [``botocore``] Update kinesisanalytics client to latest version +* api-change:``codebuild``: [``botocore``] Update codebuild client to latest version + + +1.5.4 +===== + +* api-change:``iot``: [``botocore``] Update iot client to latest version +* api-change:``config``: [``botocore``] Update config client to latest version + + +1.5.3 +===== + +* api-change:``route53``: [``botocore``] Update route53 client to latest version +* api-change:``apigateway``: [``botocore``] Update apigateway client to latest version +* api-change:``mediastore-data``: [``botocore``] Update mediastore-data client to latest version + + +1.5.2 +===== + +* bugfix:presigned-url: [``botocore``] Fixes a bug where content-type would be set on presigned requests for query services. +* api-change:``cloudwatch``: [``botocore``] Update cloudwatch client to latest version + + +1.5.1 +===== + +* api-change:``appstream``: [``botocore``] Update appstream client to latest version + + +1.5.0 +===== + +* bugfix:Filters: Fixes a bug where parameters passed to resource collections could be mutated after the collections were created. +* api-change:``ses``: [``botocore``] Update ses client to latest version +* enhancement:credentials: [``botocore``] Moved the JSONFileCache from the CLI into botocore so that it can be used without importing from the cli. +* feature:``botocore`` dependency: Update dependency strategy to always take a floor on the most recent version of ``botocore``. This means whenever there is a release of ``botocore``, ``boto3`` will release as well to account for the new version of ``botocore``. +* api-change:``apigateway``: [``botocore``] Update apigateway client to latest version + + +1.4.8 +===== + +* enhancement:``botocore``: Raised minor version dependency for botocore + + +1.4.7 +===== + +* enhancement:``botocore``: Raised minor version dependency for botocore + + +1.4.6 +===== + +* enhancement:Logging: Switch log levels from INFO to DEBUG (`#1208 `__) + + +1.4.5 +===== + +* enhancement:s3: Add a LifecycleConfiguration resource to resolve issues with the existing Lifecycle resource. + + +1.4.3 +===== + +* feature:``s3``: Add ability to disable thread use with ``use_threads`` option +* bugfix:Resource: Fix resource hashing. + + 1.4.2 ===== diff --git a/LICENSE b/LICENSE index 01b6fb5..761ea7c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2013-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2013-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of diff --git a/README.rst b/README.rst index a208b9e..4d53863 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Boto 3 - The AWS SDK for Python =============================== -|Build Status| |Docs| |Version| +|Build Status| |Docs| |Version| |Gitter| Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use @@ -18,6 +18,9 @@ released, check out the `stable docs`_. .. |Build Status| image:: http://img.shields.io/travis/boto/boto3/develop.svg?style=flat :target: https://travis-ci.org/boto/boto3 :alt: Build Status +.. |Gitter| image:: https://badges.gitter.im/boto/boto3.svg + :target: https://gitter.im/boto/boto3 + :alt: Gitter .. |Docs| image:: https://readthedocs.org/projects/boto3/badge/?version=latest&style=flat :target: https://boto3.readthedocs.io/en/latest/ :alt: Read the docs @@ -85,7 +88,7 @@ the ``pip install boto3`` defined above: Running Tests ~~~~~~~~~~~~~ You can run tests in all supported Python versions using ``tox``. By default, -it will run all of the unit tests, but you can also specify your own +it will run all of the unit and functional tests, but you can also specify your own ``nosetests`` options. Note that this requires that you have all supported versions of Python installed, otherwise you must pass ``-e`` or run the ``nosetests`` command directly: @@ -93,8 +96,8 @@ versions of Python installed, otherwise you must pass ``-e`` or run the .. code-block:: sh $ tox - $ tox tests/unit/test_session.py - $ tox -e py26,py33 tests/integration + $ tox -- unit/test_session.py + $ tox -e py26,py33 -- integration/ You can also run individual tests with your default Python version: @@ -112,3 +115,16 @@ following: $ pip install -r requirements-docs.txt $ cd docs $ make html + + +Getting Help +------------ + +We use GitHub issues for tracking bugs and feature requests and have limited +bandwidth to address them. Please use these community resources for getting +help: + +* Ask a question on `Stack Overflow `__ and tag it with `boto3 `__ +* Come join the AWS Python community chat on `gitter `__ +* Open a support ticket with `AWS Support `__ +* If it turns out that you may have found a bug, please `open an issue `__ diff --git a/boto3/__init__.py b/boto3/__init__.py index 52babc1..902e496 100644 --- a/boto3/__init__.py +++ b/boto3/__init__.py @@ -17,7 +17,7 @@ from boto3.session import Session __author__ = 'Amazon Web Services' -__version__ = '1.4.2' +__version__ = '1.7.55' # The default Boto3 session; autoloaded when needed. @@ -42,6 +42,14 @@ def set_stream_logger(name='boto3', level=logging.DEBUG, format_string=None): >>> import boto3 >>> boto3.set_stream_logger('boto3.resources', logging.INFO) + For debugging purposes a good choice is to set the stream logger to ``''`` + which is equivalent to saying "log everything". + + .. WARNING:: + Be aware that when logging anything from ``'botocore'`` the full wire + trace will appear in your logs. If your payloads contain sensitive data + this should not be used in production. + :type name: string :param name: Log name :type level: int @@ -65,7 +73,7 @@ def _get_default_session(): """ Get the default session, creating one if needed. - :rtype: :py:class:`~boto3.session.Sesssion` + :rtype: :py:class:`~boto3.session.Session` :return: The default session """ if DEFAULT_SESSION is None: diff --git a/boto3/data/glacier/2012-06-01/resources-1.json b/boto3/data/glacier/2012-06-01/resources-1.json index 06267cf..d1ed48f 100644 --- a/boto3/data/glacier/2012-06-01/resources-1.json +++ b/boto3/data/glacier/2012-06-01/resources-1.json @@ -538,6 +538,24 @@ "path": "UploadsList[]" } }, + "MultipartUploads": { + "request": { + "operation": "ListMultipartUploads", + "params": [ + { "target": "vaultName", "source": "identifier", "name": "Name" }, + { "target": "accountId", "source": "identifier", "name": "AccountId" } + ] + }, + "resource": { + "type": "MultipartUpload", + "identifiers": [ + { "target": "AccountId", "source": "identifier", "name": "AccountId" }, + { "target": "VaultName", "source": "identifier", "name": "Name" }, + { "target": "Id", "source": "response", "path": "UploadsList[].MultipartUploadId" } + ], + "path": "UploadsList[]" + } + }, "SucceededJobs": { "request": { "operation": "ListJobs", diff --git a/boto3/data/s3/2006-03-01/resources-1.json b/boto3/data/s3/2006-03-01/resources-1.json index 1045b86..f1e88c6 100644 --- a/boto3/data/s3/2006-03-01/resources-1.json +++ b/boto3/data/s3/2006-03-01/resources-1.json @@ -120,6 +120,18 @@ ] } }, + "LifecycleConfiguration": { + "resource": { + "type": "BucketLifecycleConfiguration", + "identifiers": [ + { + "target": "BucketName", + "source": "identifier", + "name": "Name" + } + ] + } + }, "Logging": { "resource": { "type": "BucketLogging", @@ -360,6 +372,67 @@ } } }, + "BucketLifecycleConfiguration": { + "identifiers": [ + { + "name": "BucketName" + } + ], + "shape": "GetBucketLifecycleConfigurationOutput", + "load": { + "request": { + "operation": "GetBucketLifecycleConfiguration", + "params": [ + { + "target": "Bucket", + "source": "identifier", + "name": "BucketName" + } + ] + }, + "path": "@" + }, + "actions": { + "Delete": { + "request": { + "operation": "DeleteBucketLifecycle", + "params": [ + { + "target": "Bucket", + "source": "identifier", + "name": "BucketName" + } + ] + } + }, + "Put": { + "request": { + "operation": "PutBucketLifecycleConfiguration", + "params": [ + { + "target": "Bucket", + "source": "identifier", + "name": "BucketName" + } + ] + } + } + }, + "has": { + "Bucket": { + "resource": { + "type": "Bucket", + "identifiers": [ + { + "target": "Name", + "source": "identifier", + "name": "BucketName" + } + ] + } + } + } + }, "BucketLogging": { "identifiers": [ { "name": "BucketName" } diff --git a/boto3/dynamodb/table.py b/boto3/dynamodb/table.py index 56e1bcb..4bd9a98 100644 --- a/boto3/dynamodb/table.py +++ b/boto3/dynamodb/table.py @@ -39,9 +39,7 @@ class TableResource(object): in batches. In addition, the batch writer will also automatically handle any unprocessed items and resend them as needed. All you need to do is call ``put_item`` for any items you want to add, and - ``delete_item`` for any items you want to delete. In addition, you can - specify ``auto_dedup`` if the batch might contain duplicated requests - and you want this writer to handle de-dup for you. + ``delete_item`` for any items you want to delete. Example usage:: diff --git a/boto3/dynamodb/transform.py b/boto3/dynamodb/transform.py index b0b5225..6b8002c 100644 --- a/boto3/dynamodb/transform.py +++ b/boto3/dynamodb/transform.py @@ -198,9 +198,11 @@ class TransformationInjector(object): def inject_attribute_value_output(self, parsed, model, **kwargs): """Injects DynamoDB deserialization into responses""" - self._transformer.transform( - parsed, model.output_shape, self._deserializer.deserialize, - 'AttributeValue') + if model.output_shape is not None: + self._transformer.transform( + parsed, model.output_shape, self._deserializer.deserialize, + 'AttributeValue' + ) class ConditionExpressionTransformation(object): diff --git a/boto3/examples/s3.rst b/boto3/examples/s3.rst index 85da590..147c4a3 100644 --- a/boto3/examples/s3.rst +++ b/boto3/examples/s3.rst @@ -52,7 +52,7 @@ restoration is finished. # request. if obj.restore is None: print('Submitting restoration request: %s' % obj.key) - obj.restore_object() + obj.restore_object(RestoreRequest={'Days': 1}) # Print out objects whose restoration is on-going elif 'ongoing-request="true"' in obj.restore: print('Restoration in-progress: %s' % obj.key) @@ -61,6 +61,46 @@ restoration is finished. print('Restoration complete: %s' % obj.key) +Uploading/downloading files using SSE KMS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This example shows how to use SSE-KMS to upload objects using +server side encryption with a key managed by KMS. + +We can either use the default KMS master key, or create a +custom key in AWS and use it to encrypt the object by passing in its +key id. + +With KMS, nothing else needs to be provided for getting the +object; S3 already knows how to decrypt the object. + + +.. code-block:: python + + import boto3 + import os + + BUCKET = 'your-bucket-name' + s3 = boto3.client('s3') + keyid = '' + + print("Uploading S3 object with SSE-KMS") + s3.put_object(Bucket=BUCKET, + Key='encrypt-key', + Body=b'foobar', + ServerSideEncryption='aws:kms', + # Optional: SSEKMSKeyId + SSEKMSKeyId=keyid) + print("Done") + + # Getting the object: + print("Getting S3 object...") + response = s3.get_object(Bucket=BUCKET, + Key='encrypt-key') + print("Done, response body:") + print(response['Body'].read()) + + Uploading/downloading files using SSE Customer Keys ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/boto3/resources/action.py b/boto3/resources/action.py index 6ed0ece..52dea55 100644 --- a/boto3/resources/action.py +++ b/boto3/resources/action.py @@ -77,7 +77,7 @@ class ServiceAction(object): params = create_request_parameters(parent, self._action_model.request) params.update(kwargs) - logger.info('Calling %s:%s with %r', parent.meta.service_name, + logger.debug('Calling %s:%s with %r', parent.meta.service_name, operation_name, params) response = getattr(parent.meta.client, operation_name)(**params) @@ -146,7 +146,7 @@ class BatchAction(ServiceAction): params.update(kwargs) - logger.info('Calling %s:%s with %r', + logger.debug('Calling %s:%s with %r', service_name, operation_name, params) response = getattr(client, operation_name)(**params) @@ -193,7 +193,7 @@ class WaiterAction(object): params = create_request_parameters(parent, self._waiter_model) params.update(kwargs) - logger.info('Calling %s:%s with %r', + logger.debug('Calling %s:%s with %r', parent.meta.service_name, self._waiter_resource_name, params) diff --git a/boto3/resources/base.py b/boto3/resources/base.py index b3b9025..4e60c5a 100644 --- a/boto3/resources/base.py +++ b/boto3/resources/base.py @@ -140,3 +140,9 @@ class ServiceResource(object): return False return True + + def __hash__(self): + identifiers = [] + for identifier in self.meta.identifiers: + identifiers.append(getattr(self, identifier)) + return hash((self.__class__.__name__, tuple(identifiers))) diff --git a/boto3/resources/collection.py b/boto3/resources/collection.py index dec20a8..083f9cd 100644 --- a/boto3/resources/collection.py +++ b/boto3/resources/collection.py @@ -49,7 +49,7 @@ class ResourceCollection(object): self._py_operation_name = xform_name( model.request.operation) self._handler = handler - self._params = kwargs + self._params = copy.deepcopy(kwargs) def __repr__(self): return '{0}({1}, {2})'.format( @@ -147,17 +147,17 @@ class ResourceCollection(object): # page in a list. For non-paginated results, we just ignore # the page size parameter. if client.can_paginate(self._py_operation_name): - logger.info('Calling paginated %s:%s with %r', - self._parent.meta.service_name, - self._py_operation_name, params) + logger.debug('Calling paginated %s:%s with %r', + self._parent.meta.service_name, + self._py_operation_name, params) paginator = client.get_paginator(self._py_operation_name) pages = paginator.paginate( PaginationConfig={ 'MaxItems': limit, 'PageSize': page_size}, **params) else: - logger.info('Calling %s:%s with %r', - self._parent.meta.service_name, - self._py_operation_name, params) + logger.debug('Calling %s:%s with %r', + self._parent.meta.service_name, + self._py_operation_name, params) pages = [getattr(client, self._py_operation_name)(**params)] # Now that we have a page iterator or single page of results diff --git a/boto3/resources/model.py b/boto3/resources/model.py index a19926d..5b65b0e 100644 --- a/boto3/resources/model.py +++ b/boto3/resources/model.py @@ -578,7 +578,7 @@ class ResourceModel(object): """ Get a list of sub-resources. - :type: list(:py:class`ResponseResource`) + :type: list(:py:class:`ResponseResource`) """ return self._get_related_resources(True) diff --git a/boto3/s3/inject.py b/boto3/s3/inject.py index c8e09d1..a1a0183 100644 --- a/boto3/s3/inject.py +++ b/boto3/s3/inject.py @@ -10,10 +10,11 @@ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF # ANY KIND, either express or implied. See the License for the specific # language governing permissions and limitations under the License. -from s3transfer.manager import TransferManager, TransferConfig from botocore.exceptions import ClientError -from boto3.s3.transfer import S3Transfer, ProgressCallbackInvoker +from boto3.s3.transfer import create_transfer_manager +from boto3.s3.transfer import TransferConfig, S3Transfer +from boto3.s3.transfer import ProgressCallbackInvoker from boto3 import utils @@ -63,15 +64,19 @@ def bucket_load(self, *args, **kwargs): # We can't actually get the bucket's attributes from a HeadBucket, # so we need to use a ListBuckets and search for our bucket. - response = self.meta.client.list_buckets() - for bucket_data in response['Buckets']: - if bucket_data['Name'] == self.name: - self.meta.data = bucket_data - break - else: - raise ClientError({'Error': {'Code': '404', 'Message': 'NotFound'}}, - 'ListBuckets') - + # However, we may fail if we lack permissions to ListBuckets + # or the bucket is in another account. In which case, creation_date + # will be None. + self.meta.data = {} + try: + response = self.meta.client.list_buckets() + for bucket_data in response['Buckets']: + if bucket_data['Name'] == self.name: + self.meta.data = bucket_data + break + except ClientError as e: + if not e.response.get('Error', {}).get('Code') == 'AccessDenied': + raise def object_summary_load(self, *args, **kwargs): """ @@ -98,6 +103,27 @@ def upload_file(self, Filename, Bucket, Key, ExtraArgs=None, Similar behavior as S3Transfer's upload_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to upload. + + :type Bucket: str + :param Bucket: The name of the bucket to upload to. + + :type Key: str + :param Key: The name of the key to upload to. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the upload. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ with S3Transfer(self, Config) as transfer: return transfer.upload_file( @@ -118,6 +144,27 @@ def download_file(self, Bucket, Key, Filename, ExtraArgs=None, Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to download to. + + :type Bucket: str + :param Bucket: The name of the bucket to download from. + + :type Key: str + :param Key: The name of the key to download from. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the download. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ with S3Transfer(self, Config) as transfer: return transfer.download_file( @@ -138,6 +185,24 @@ def bucket_upload_file(self, Filename, Key, Similar behavior as S3Transfer's upload_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to upload. + + :type Key: str + :param Key: The name of the key to upload to. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the upload. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ return self.meta.client.upload_file( Filename=Filename, Bucket=self.name, Key=Key, @@ -157,6 +222,24 @@ def bucket_download_file(self, Key, Filename, Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to download to. + + :type Key: str + :param Key: The name of the key to download from. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the download. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ return self.meta.client.download_file( Bucket=self.name, Key=Key, Filename=Filename, @@ -176,6 +259,21 @@ def object_upload_file(self, Filename, Similar behavior as S3Transfer's upload_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to upload. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the upload. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ return self.meta.client.upload_file( Filename=Filename, Bucket=self.bucket_name, Key=self.key, @@ -195,6 +293,21 @@ def object_download_file(self, Filename, Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at :ref:`S3Transfer's Usage `. + + :type Filename: str + :param Filename: The path to the file to download to. + + :type ExtraArgs: dict + :param ExtraArgs: Extra arguments that may be passed to the + client operation. + + :type Callback: function + :param Callback: A method which takes a number of bytes transferred to + be periodically called during the download. + + :type Config: boto3.s3.transfer.TransferConfig + :param Config: The transfer configuration to be used when performing the + transfer. """ return self.meta.client.download_file( Bucket=self.bucket_name, Key=self.key, Filename=Filename, @@ -235,7 +348,7 @@ def copy(self, CopySource, Bucket, Key, ExtraArgs=None, Callback=None, :param ExtraArgs: Extra arguments that may be passed to the client operation - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the copy. @@ -258,7 +371,7 @@ def copy(self, CopySource, Bucket, Key, ExtraArgs=None, Callback=None, if config is None: config = TransferConfig() - with TransferManager(self, config) as manager: + with create_transfer_manager(self, config) as manager: future = manager.copy( copy_source=CopySource, bucket=Bucket, key=Key, extra_args=ExtraArgs, subscribers=subscribers, @@ -298,7 +411,7 @@ def bucket_copy(self, CopySource, Key, ExtraArgs=None, Callback=None, :param ExtraArgs: Extra arguments that may be passed to the client operation - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the copy. @@ -348,7 +461,7 @@ def object_copy(self, CopySource, ExtraArgs=None, Callback=None, :param ExtraArgs: Extra arguments that may be passed to the client operation - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the copy. @@ -400,7 +513,7 @@ def upload_fileobj(self, Fileobj, Bucket, Key, ExtraArgs=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the upload. @@ -419,7 +532,7 @@ def upload_fileobj(self, Fileobj, Bucket, Key, ExtraArgs=None, if config is None: config = TransferConfig() - with TransferManager(self, config) as manager: + with create_transfer_manager(self, config) as manager: future = manager.upload( fileobj=Fileobj, bucket=Bucket, key=Key, extra_args=ExtraArgs, subscribers=subscribers) @@ -455,7 +568,7 @@ def bucket_upload_fileobj(self, Fileobj, Key, ExtraArgs=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the upload. @@ -495,7 +608,7 @@ def object_upload_fileobj(self, Fileobj, ExtraArgs=None, Callback=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the upload. @@ -539,7 +652,7 @@ def download_fileobj(self, Bucket, Key, Fileobj, ExtraArgs=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the download. @@ -558,7 +671,7 @@ def download_fileobj(self, Bucket, Key, Fileobj, ExtraArgs=None, if config is None: config = TransferConfig() - with TransferManager(self, config) as manager: + with create_transfer_manager(self, config) as manager: future = manager.download( bucket=Bucket, key=Key, fileobj=Fileobj, extra_args=ExtraArgs, subscribers=subscribers) @@ -594,7 +707,7 @@ def bucket_download_fileobj(self, Key, Fileobj, ExtraArgs=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the download. @@ -634,7 +747,7 @@ def object_download_fileobj(self, Fileobj, ExtraArgs=None, Callback=None, :param ExtraArgs: Extra arguments that may be passed to the client operation. - :type Callback: method + :type Callback: function :param Callback: A method which takes a number of bytes transferred to be periodically called during the download. diff --git a/boto3/s3/transfer.py b/boto3/s3/transfer.py index b721b2e..5c8b831 100644 --- a/boto3/s3/transfer.py +++ b/boto3/s3/transfer.py @@ -92,7 +92,7 @@ to the user: self._seen_so_far += bytes_amount percentage = (self._seen_so_far / self._size) * 100 sys.stdout.write( - "\\r%s %s / %s (%.2f%%)" % ( + "\r%s %s / %s (%.2f%%)" % ( self._filename, self._seen_so_far, self._size, percentage)) sys.stdout.flush() @@ -128,6 +128,7 @@ from s3transfer.exceptions import RetriesExceededError as \ S3TransferRetriesExceededError from s3transfer.manager import TransferConfig as S3TransferConfig from s3transfer.manager import TransferManager +from s3transfer.futures import NonThreadedExecutor from s3transfer.subscribers import BaseSubscriber from s3transfer.utils import OSUtils @@ -138,6 +139,27 @@ KB = 1024 MB = KB * KB +def create_transfer_manager(client, config, osutil=None): + """Creates a transfer manager based on configuration + + :type client: boto3.client + :param client: The S3 client to use + + :type config: boto3.s3.transfer.TransferConfig + :param config: The transfer config to use + + :type osutil: s3transfer.utils.OSUtils + :param osutil: The os utility to use + + :rtype: s3transfer.manager.TransferManager + :returns: A transfer manager based on parameters provided + """ + executor_cls = None + if not config.use_threads: + executor_cls = NonThreadedExecutor + return TransferManager(client, config, osutil, executor_cls) + + class TransferConfig(S3TransferConfig): ALIAS = { 'max_concurrency': 'max_request_concurrency', @@ -150,7 +172,8 @@ class TransferConfig(S3TransferConfig): multipart_chunksize=8 * MB, num_download_attempts=5, max_io_queue=100, - io_chunksize=256 * KB): + io_chunksize=256 * KB, + use_threads=True): """Configuration object for managed S3 transfers :param multipart_threshold: The transfer size threshold for which @@ -158,7 +181,9 @@ class TransferConfig(S3TransferConfig): triggered. :param max_concurrency: The maximum number of threads that will be - making requests to perform a transfer. + making requests to perform a transfer. If ``use_threads`` is + set to ``False``, the value provided is ignored as the transfer + will only ever use the main thread. :param multipart_chunksize: The partition size of each part for a multipart transfer. @@ -180,6 +205,10 @@ class TransferConfig(S3TransferConfig): :param io_chunksize: The max size of each chunk in the io queue. Currently, this is size used when ``read`` is called on the downloaded stream as well. + + :param use_threads: If True, threads will be used when performing + S3 transfers. If False, no threads will be used in + performing transfers: all logic will be ran in the main thread. """ super(TransferConfig, self).__init__( multipart_threshold=multipart_threshold, @@ -194,6 +223,7 @@ class TransferConfig(S3TransferConfig): # old version of the names. for alias in self.ALIAS: setattr(self, alias, getattr(self, self.ALIAS[alias])) + self.use_threads = use_threads def __setattr__(self, name, value): # If the alias name is used, make sure we set the name that it points @@ -226,7 +256,7 @@ class S3Transfer(object): if manager: self._manager = manager else: - self._manager = TransferManager(client, config, osutil) + self._manager = create_transfer_manager(client, config, osutil) def upload_file(self, filename, bucket, key, callback=None, extra_args=None): @@ -234,6 +264,10 @@ class S3Transfer(object): Variants have also been injected into S3 client, Bucket and Object. You don't have to use S3Transfer.upload_file() directly. + + .. seealso:: + :py:meth:`S3.Client.upload_file` + :py:meth:`S3.Client.upload_fileobj` """ if not isinstance(filename, six.string_types): raise ValueError('Filename must be a string') @@ -258,6 +292,10 @@ class S3Transfer(object): Variants have also been injected into S3 client, Bucket and Object. You don't have to use S3Transfer.download_file() directly. + + .. seealso:: + :py:meth:`S3.Client.download_file` + :py:meth:`S3.Client.download_fileobj` """ if not isinstance(filename, six.string_types): raise ValueError('Filename must be a string') diff --git a/docs/source/guide/collections.rst b/docs/source/guide/collections.rst index 48195e2..079da13 100644 --- a/docs/source/guide/collections.rst +++ b/docs/source/guide/collections.rst @@ -126,7 +126,7 @@ pagination:: # S3 delete everything in `my-bucket` s3 = boto3.resource('s3') - s3.buckets('my-bucket').objects.delete() + s3.Bucket('my-bucket').objects.delete() .. danger:: diff --git a/docs/source/guide/configuration.rst b/docs/source/guide/configuration.rst index 6499d6f..6d22bd0 100644 --- a/docs/source/guide/configuration.rst +++ b/docs/source/guide/configuration.rst @@ -313,7 +313,7 @@ In addition to credentials, you can also configure non-credential values. In general, boto3 follows the same approach used in credential lookup: try various locations until a value is found. Boto3 uses these sources for configuration: -* Explicitly passed as the ``config`` paramter when creating a client. +* Explicitly passed as the ``config`` parameter when creating a client. * Environment variables * The ``~/.aws/config`` file. @@ -334,11 +334,11 @@ Environment Variable Configuration supported by multiple AWS SDKs besides python. ``AWS_DEFAULT_REGION`` - The default region to use, e.g. ``us-west-2``, ``us-west-2``, etc. + The default region to use, e.g. ``us-west-1``, ``us-west-2``, etc. ``AWS_PROFILE`` The default profile to use, if any. If no value is specified, boto3 - will attempt to seach the shared credentials file and the config file + will attempt to search the shared credentials file and the config file for the ``default`` profile. ``AWS_CONFIG_FILE`` @@ -403,7 +403,7 @@ If your profile name has spaces, you'll need to surround this value in quotes: in the ``~/.aws/config`` file: ``region`` - The default region to use, e.g. ``us-west-2``, ``us-west-2``, etc. When specifying a region inline during client initialization, this property is named ``region_name`` + The default region to use, e.g. ``us-west-1``, ``us-west-2``, etc. When specifying a region inline during client initialization, this property is named ``region_name`` ``aws_access_key_id`` The access key to use. ``aws_secret_access_key`` diff --git a/docs/source/guide/cw-example-creating-alarms.rst b/docs/source/guide/cw-example-creating-alarms.rst new file mode 100644 index 0000000..ff7d27f --- /dev/null +++ b/docs/source/guide/cw-example-creating-alarms.rst @@ -0,0 +1,148 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-creating-alarms: + +#################################### +Creating Alarms in Amazon CloudWatch +#################################### + +This Python example shows you how to: + +* Get basic information about your CloudWatch alarms + +* Create and delete a CloudWatch alarm + +The Scenario +============ + +An alarm watches a single metric over a time period you specify, and performs one or more actions +based on the value of the metric relative to a given threshold over a number of time periods. + +In this example, Python code is used to create alarms in CloudWatch. The code +uses the uses AWS SDK for Python to create alarms using these methods of the AWS.CloudWatch client class: + +* `paginate(StateValue='INSUFFICIENT_DATA') `_. + +* `put_metric_alarm `_. + +* `delete_alarms `_. + +For more information about CloudWatch alarms, see `Creating Amazon CloudWatch Alarms `_ +in the *Amazon CloudWatch User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Alarms +=============== + +The example below shows how to: + +* List metric alarms for insufficient data using + `paginate(StateValue='INSUFFICIENT_DATA') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # List alarms of insufficient data through the pagination interface + paginator = cloudwatch.get_paginator('describe_alarms') + for response in paginator.paginate(StateValue='INSUFFICIENT_DATA'): + print(response['MetricAlarms']) + +Create an Alarm for a CloudWatch Metric Alarm +============================================= + +Create or update an alarm and associate it with the specified metric alarm. Optionally, this operation +can associate one or more Amazon SNS resources with the alarm. + +When this operation creates an alarm, the alarm state is immediately set to :code:`INSUFFICIENT_DATA`. +The alarm is evaluated and its state is set appropriately. Any actions associated with the state are +then executed. + +When you update an existing alarm, its state is left unchanged, but the update completely overwrites +the previous configuration of the alarm. + +The example below shows how to: + +* Create or update a metric alarm using + `put_metric_alarm `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # Create alarm + cloudwatch.put_metric_alarm( + AlarmName='Web_Server_CPU_Utilization', + ComparisonOperator='GreaterThanThreshold', + EvaluationPeriods=1, + MetricName='CPUUtilization', + Namespace='AWS/EC2', + Period=60, + Statistic='Average', + Threshold=70.0, + ActionsEnabled=False, + AlarmDescription='Alarm when server CPU exceeds 70%', + Dimensions=[ + { + 'Name': 'InstanceId', + 'Value': 'INSTANCE_ID' + }, + ], + Unit='Seconds' + ) + + +Delete an Alarm +=============== + +Delete the specified alarms. In the event of an error, no alarms are deleted. + +The example below shows how to: + +* Delete a metric alarm using + `delete_alarms `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # Delete alarm + cloudwatch.delete_alarms( + AlarmNames=['Web_Server_CPU_Utilization'], + ) + + \ No newline at end of file diff --git a/docs/source/guide/cw-example-events.rst b/docs/source/guide/cw-example-events.rst new file mode 100644 index 0000000..932bb58 --- /dev/null +++ b/docs/source/guide/cw-example-events.rst @@ -0,0 +1,207 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-events: + +########################################## +Sending Events to Amazon CloudWatch Events +########################################## + +This Python example shows you how to: + +* Create and update a rule used to trigger an event + +* Define one or more targets to respond to an event + +* Send events that are matched to targets for handling + +The Scenario +============ + +CloudWatch Events delivers a near real-time stream of system events that describe changes in +Amazon Web Services (AWS) resources to any of various targets. Using simple rules, you can match +events and route them to one or more target functions or streams. + +In this example, Python code is used to send events to CloudWatch Events. The code uses the uses the +AWS SDK for Python to manage instances using these methods of the CloudWatchEvents client class: + +* `put_rule `_. + +* `put_targets `_. + +* `put_events `_. + +For more information about CloudWatch Events, see +`Adding Events with PutEvents `_ +in the *Amazon CloudWatch Events User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create a Lambda function using the **hello-world** blueprint to serve as the target for events. To + learn how, see `Step 1: Create an AWS Lambda function `_ + in the *Amazon CloudWatch Events User Guide*. + +* Create an IAM role whose policy grants permission to CloudWatch Events and that includes :code:`events.amazonaws.com` + as a trusted entity. For more information about creating an IAM role, see + `Creating a Role to Delegate Permissions to an AWS Service `_ + in the *IAM User Guide*. + + Use the following role policy when creating the IAM role. + + .. code-block:: python + + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "CloudWatchEventsFullAccess", + "Effect": "Allow", + "Action": "events:*", + "Resource": "*" + }, + { + "Sid": "IAMPassRoleForCloudWatchEvents", + "Effect": "Allow", + "Action": "iam:PassRole", + "Resource": "arn:aws:iam::*:role/AWS_Events_Invoke_Targets" + } + ] + } + +Use the following trust relationship when creating the IAM role. + + .. code-block:: python + + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "events.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + } + + +Create a Scheduled Rule +======================= + +Create or update the specified rule. Rules are enabled by default, or based on value of the state. +You can disable a rule using `DisableRule `_. + +The example below shows how to: + +* Create a CloudWatch Events rule using + `put_rule `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + + # Create CloudWatchEvents client + cloudwatch_events = boto3.client('events') + + # Put an event rule + response = cloudwatch_events.put_rule( + Name='DEMO_EVENT', + RoleArn='IAM_ROLE_ARN', + ScheduleExpression='rate(5 minutes)', + State='ENABLED' + ) + print(response['RuleArn']) + + +Add a Lambda Function Target +============================ + +Add the specified targets to the specified rule, or update the targets if they are already +associated with the rule. + +The example below shows how to: + +* Add a target to a rule using + `put_targets `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatchEvents client + cloudwatch_events = boto3.client('events') + + # Put target for rule + response = cloudwatch_events.put_targets( + Rule='DEMO_EVENT', + Targets=[ + { + 'Arn': 'LAMBDA_FUNCTION_ARN', + 'Id': 'myCloudWatchEventsTarget', + } + ] + ) + print(response) + + +Send Events +=========== + +Send custom events to Amazon CloudWatch Events so that they can be matched to rules. + +The example below shows how to: + +* Send a custom event to CloudWatch Events using + `put_events `_. + +Example +------- + +.. code-block:: python + + import json + + import boto3 + + + # Create CloudWatchEvents client + cloudwatch_events = boto3.client('events') + + # Put an event + response = cloudwatch_events.put_events( + Entries=[ + { + 'Detail': json.dumps({'key1': 'value1', 'key2': 'value2'}), + 'DetailType': 'appRequestSubmitted', + 'Resources': [ + 'RESOURCE_ARN', + ], + 'Source': 'com.company.myapp' + } + ] + ) + print(response['Entries']) + + \ No newline at end of file diff --git a/docs/source/guide/cw-example-metrics.rst b/docs/source/guide/cw-example-metrics.rst new file mode 100644 index 0000000..c88e613 --- /dev/null +++ b/docs/source/guide/cw-example-metrics.rst @@ -0,0 +1,119 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-metrics: + +###################################### +Getting Metrics from Amazon CloudWatch +###################################### + +This Python example shows you how to: + +* Get a list of published CloudWatch metrics + +* Publish data points to CloudWatch metrics + +The Scenario +============ + +Metrics are data about the performance of your systems. You can enable detailed monitoring of some +resources, such as your Amazon CloudWatch instances, or your own application metrics. + +In this example, Python code is used to get and send CloudWatch metrics data. +The code uses the uses the AWS SDK for Python to get metrics from CloudWatch +using these methods of the CloudWatch client class: + +* `paginate('list_metrics') `_. + +* `put_metric_data `_. + +For more information about CloudWatch metrics, see `Using Amazon CloudWatch Metrics `_ in the +*Amazon CloudWatch User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + + +List Metrics +=============== + +List the metric alarm events uploaded to CloudWatch Logs. + +The example below shows how to: + +* List metric alarms of incoming log events using + `paginate('list_metrics') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # List metrics through the pagination interface + paginator = cloudwatch.get_paginator('list_metrics') + for response in paginator.paginate(Dimensions=[{'Name': 'LogGroupName'}], + MetricName='IncomingLogEvents', + Namespace='AWS/Logs'): + print(response['Metrics']) + + +Publish Custom Metrics +====================== + +Publish metric data points to Amazon CloudWatch. Amazon CloudWatch associates the data points with +the specified metric. If the specified metric does not exist, Amazon CloudWatch creates the metric. +When Amazon CloudWatch creates a metric, it can take up to fifteen minutes for the metric to appear +in calls to ListMetrics. + +The example below shows how to: + +* Publish custom metrics using + `put_metric_data `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # Put custom metrics + cloudwatch.put_metric_data( + MetricData=[ + { + 'MetricName': 'PAGES_VISITED', + 'Dimensions': [ + { + 'Name': 'UNIQUE_PAGES', + 'Value': 'URLS' + }, + ], + 'Unit': 'None', + 'Value': 1.0 + }, + ], + Namespace='SITE/TRAFFIC' + ) + \ No newline at end of file diff --git a/docs/source/guide/cw-example-subscription-filters.rst b/docs/source/guide/cw-example-subscription-filters.rst new file mode 100644 index 0000000..6580ede --- /dev/null +++ b/docs/source/guide/cw-example-subscription-filters.rst @@ -0,0 +1,172 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-subscription-filters: + +#################################################### +Using Subscription Filters in Amazon CloudWatch Logs +#################################################### + +This Python example shows you how to create and delete filters for log events in CloudWatch Logs. + +The Scenario +============ + +Subscriptions provide access to a real-time feed of log events from CloudWatch Logs and deliver that +feed to other services, such as an Amazon Kinesis stream or AWS Lambda, for custom processing, +analysis, or loading to other systems. A subscription filter defines the pattern to use for filtering +which log events are delivered to your AWS resource. + +In this example, Python code is used to list, create, and delete a subscription +filter in CloudWatch Logs. The destination for the log events is a Lambda function. +The code uses the uses AWS SDK for Python to manage subscription filters using these methods of the +CloudWatchLogs client class: + +* `get_paginator('describe_subscription_filters') `_. + +* `put_subscription_filter `_. + +* `delete_subscription_filter `_. + +For more information about CloudWatch Logs subscriptions, see +Real-time `Processing of Log Data with Subscriptions `_ +in the Amazon CloudWatch Logs User Guide. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create a Lambda function as the destination for log events. You will need to use the ARN of this + function. For more information about setting up a Lambda function, see + `Subscription Filters with AWS Lambda `_ + in the *Amazon CloudWatch Logs User Guide*. + +* Create an IAM role whose policy grants permission to invoke the Lambda function you created and + grants full access to CloudWatch Logs or apply the following policy to the execution role you create + for the Lambda function. For more information about creating an IAM role, see + Creating a Role to `Delegate Permissions to an AWS Service `_ + in the *IAM User Guide*. + + Use the following role policy when creating the IAM role. + + .. code-block:: python + + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:CreateLogGroup", + "logs:CrateLogStream", + "logs:PutLogEvents" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": [ + "*" + ] + } + ] + } + +List Existing Subscription Filters +================================== + +List the subscription filters for the specified log group. + +The example below shows how to: + +* List subscription filters using + `get_paginator('describe_subscription_filters') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatchLogs client + cloudwatch_logs = boto3.client('logs') + + # List subscription filters through the pagination interface + paginator = cloudwatch_logs.get_paginator('describe_subscription_filters') + for response in paginator.paginate(logGroupName='GROUP_NAME'): + print(response['subscriptionFilters']) + + + + +Create a Subscription Filter +============================ + +Create or update a subscription filter and associates it with the specified log group. + +The example below shows how to: + +* Create a subscription filter using + `put_subscription_filter `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatchLogs client + cloudwatch_logs = boto3.client('logs') + + # Create a subscription filter + cloudwatch_logs.put_subscription_filter( + destinationArn='LAMBDA_FUNCTION_ARN', + filterName='FILTER_NAME', + filterPattern='ERROR', + logGroupName='LOG_GROUP', + ) + + +Delete a Subscription Filter +============================ + +The example below shows how to: + +* Delete a subscription filter. using + `delete_subscription_filter `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatchLogs client + cloudwatch_logs = boto3.client('logs') + + # Delete a subscription filter + cloudwatch_logs.delete_subscription_filter( + filterName='FILTER_NAME', + logGroupName='LOG_GROUP', + ) + + + \ No newline at end of file diff --git a/docs/source/guide/cw-example-using-alarms.rst b/docs/source/guide/cw-example-using-alarms.rst new file mode 100644 index 0000000..ff9eeac --- /dev/null +++ b/docs/source/guide/cw-example-using-alarms.rst @@ -0,0 +1,156 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-using-alarms: + +######################################## +Using Alarm Actions in Amazon CloudWatch +######################################## + +This Python example shows you how to: + +* Create a CloudWatch alarm and enable actions + +* Disable a CloudWatch alarm action + +The Scenario +============ + +Using alarm actions, you can create alarms that automatically stop, terminate, reboot, or recover +your Amazon EC2 instances. You can use the stop or terminate actions when you no longer need an EC2 +instance to be running. You can use the reboot and recover actions to automatically reboot those instances. + +In this example, Python code is used to define an alarm action in CloudWatch that +triggers the reboot of an Amazon EC2 instance. The code uses the uses AWS SDK for Python to manage +Amazon EC2 instances using these methods of the CloudWatch client class: + +* `put_metric_alarm `_. + +* `disable_alarm_actions `_. + + +For more information about CloudWatch alarm actions, see +`Create Alarms to Stop, Terminate, Reboot, or Recover an Instance `_ +in the *Amazon CloudWatch User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create an IAM role whose policy grants permission to describe, reboot, stop, or terminate an Amazon + EC2 instance. For more information about creating an IAM role, see + `Creating a Role to Delegate Permissions to an AWS Service `_ + in the *IAM User Guide*. + + Use the following role policy when creating the IAM role. + + .. code-block:: python + + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "cloudwatch:Describe*", + "ec2:Describe*", + "ec2:RebootInstances", + "ec2:StopInstances*", + "ec2:TerminateInstances" + ], + "Resource": [ + "*" + ] + } + ] + } + +Create and Enable Actions on an Alarm +===================================== + +Create or update an alarm and associate it with the specified metric. Optionally, this operation +can associate one or more Amazon SNS resources with the alarm. + +When this operation creates an alarm, the alarm state is immediately set to :code:`INSUFFICIENT_DATA`. +The alarm is evaluated and its state is set appropriately. Any actions associated with the state are +then executed. + +When you update an existing alarm, its state is left unchanged, but the update completely overwrites +the previous configuration of the alarm. + +The example below shows how to: + +* Create an alarm and enable actions using + `put_metric_alarm `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # Create alarm with actions enabled + cloudwatch.put_metric_alarm( + AlarmName='Web_Server_CPU_Utilization', + ComparisonOperator='GreaterThanThreshold', + EvaluationPeriods=1, + MetricName='CPUUtilization', + Namespace='AWS/EC2', + Period=60, + Statistic='Average', + Threshold=70.0, + ActionsEnabled=True, + AlarmActions=[ + 'arn:aws:swf:us-west-2:{CUSTOMER_ACCOUNT}:action/actions/AWS_EC2.InstanceId.Reboot/1.0' + ], + AlarmDescription='Alarm when server CPU exceeds 70%', + Dimensions=[ + { + 'Name': 'InstanceId', + 'Value': 'INSTANCE_ID' + }, + ], + Unit='Seconds' + ) + +Disable Actions on an Alarm +=========================== + +Disable the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions +do not execute when the alarm state changes. + +The example below shows how to: + +* Disable metric alarm actions using + `disable_alarm_actions `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create CloudWatch client + cloudwatch = boto3.client('cloudwatch') + + # Disable alarm + cloudwatch.disable_alarm_actions( + AlarmNames=['Web_Server_CPU_Utilization'], + ) + + \ No newline at end of file diff --git a/docs/source/guide/cw-examples.rst b/docs/source/guide/cw-examples.rst new file mode 100644 index 0000000..eccef19 --- /dev/null +++ b/docs/source/guide/cw-examples.rst @@ -0,0 +1,29 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-cw-examples: + +########################## +Amazon CloudWatch Examples +########################## + +You can use the following examples to access Amazon Cloudwatch (CloudWatch) by using Amazon Boto. For more +information about ClodWatch, see the `CloudWatch Developer Guide `_. + +**Examples** + +.. toctree:: + :maxdepth: 1 + + cw-example-creating-alarms + cw-example-using-alarms + cw-example-metrics + cw-example-events + cw-example-subscription-filters diff --git a/docs/source/guide/dynamodb.rst b/docs/source/guide/dynamodb.rst index 3e1a380..fd39252 100644 --- a/docs/source/guide/dynamodb.rst +++ b/docs/source/guide/dynamodb.rst @@ -187,7 +187,7 @@ You can also delete the item using :py:meth:`DynamoDB.Table.delete_item`:: Batch Writing ------------- If you are loading a lot of data at a time, you can make use of -:py:meth:`DyanmoDB.Table.batch_writer` so you can both speed up the process and +:py:meth:`DynamoDB.Table.batch_writer` so you can both speed up the process and reduce the number of write requests made to the service. This method returns a handle to a batch writer object that will automatically @@ -371,7 +371,7 @@ Expected Output:: u'road': u'1 Jefferson Street'}}] -Similiarly you can scan the table based on attributes of the items. For +Similarly you can scan the table based on attributes of the items. For example, this scans for all the users whose ``age`` is less than ``27``:: response = table.scan( diff --git a/docs/source/guide/ec2-example-elastic-ip-addresses.rst b/docs/source/guide/ec2-example-elastic-ip-addresses.rst new file mode 100644 index 0000000..689ac3a --- /dev/null +++ b/docs/source/guide/ec2-example-elastic-ip-addresses.rst @@ -0,0 +1,144 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-ec2-example-elastic-ip-addresses: + +######################################## +Using Elastic IP Addresses in Amazon EC2 +######################################## + +This Python example shows you how to: + +* Get descriptions of your Elastic IP addresses + +* Allocate an Elastic IP address + +* Release an Elastic IP address + +The Scenario +============ + +An Elastic IP address is a static IP address designed for dynamic cloud computing. An Elastic IP +address is associated with your AWS account. It is a public IP address, which is reachable from the +Internet. If your instance does not have a public IP address, you can associate an Elastic IP address +with your instance to enable communication with the Internet. + +In this example, Python code performs several Amazon EC2 operations involving Elastic IP addresses. +The code uses the AWS SDK for Python to manage IAM access keys using these methods of the EC2 +client class: + +* `describe_addresses `_. + +* `allocate_address `_. + +* `release_address `_. + +For more information about Elastic IP addresses in Amazon EC2, see +`Elastic IP Addresses `_ +in the *Amazon EC2 User Guide for Linux Instances* or +`Elastic IP Addresses `_ in the *Amazon EC2 User Guide for Windows Instances*. +Prerequisite Tasks + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Elastic IP Addresses +============================= + +An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP +address is associated with your AWS account. With an Elastic IP address, you can mask the failure of +an instance or software by rapidly remapping the address to another instance in your account. + +The example below shows how to: + +* Describe Elastic IP addresses using + `describe_addresses `_. + +Example +------- + +.. code-block:: python + + import boto3 + + + ec2 = boto3.client('ec2') + filters = [ + {'Name': 'domain', 'Values': ['vpc']} + ] + response = ec2.describe_addresses(Filters=filters) + print(response) + +Allocate and Associate an Elastic IP Address with an Amazon EC2 Instance +======================================================================== + +An *Elastic IP address* is a static IPv4 address designed for dynamic cloud computing. An Elastic IP +address is associated with your AWS account. With an Elastic IP address, you can mask the failure of +an instance or software by rapidly remapping the address to another instance in your account. + +The example below shows how to: + +* Acquire an Elastic IP address using + `allocate_address `_. + +Example +------- + +.. code-block:: python + + import boto3 + from botocore.exceptions import ClientError + + ec2 = boto3.client('ec2') + + try: + allocation = ec2.allocate_address(Domain='vpc') + response = ec2.associate_address(AllocationId=allocation['AllocationId'], + InstanceId='INSTANCE_ID') + print(response) + except ClientError as e: + print(e) + + + +Release an Elastic IP Address +============================= + +After releasing an Elastic IP address, it is released to the IP address pool and might be unavailable +to you. Be sure to update your DNS records and any servers or devices that communicate with the address. +If you attempt to release an Elastic IP address that you already released, you'll get an :code:`AuthFailure` +error if the address is already allocated to another AWS account. + +The example below shows how to: + +* Release the specified Elastic IP address using + `release_address `_. + +Example +------- + +.. code-block:: python + + import boto3 + from botocore.exceptions import ClientError + + + ec2 = boto3.client('ec2') + + try: + response = ec2.release_address(AllocationId='ALLOCATION_ID') + print('Address released') + except ClientError as e: + print(e) + diff --git a/docs/source/guide/ec2-example-key-pairs.rst b/docs/source/guide/ec2-example-key-pairs.rst new file mode 100644 index 0000000..9c317c4 --- /dev/null +++ b/docs/source/guide/ec2-example-key-pairs.rst @@ -0,0 +1,120 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-ec2-example-key-pairs: + +################################# +Working with Amazon EC2 Key Pairs +################################# + +This Python example shows you how to: + +* Get information about your key pairs + +* Create a key pair to access an Amazon EC2 instance + +* Delete an existing key pair + +The Scenario +============ + +Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. Public–key cryptography +uses a public key to encrypt data, then the recipient uses the private key to decrypt the data. The +public and private keys are known as a key pair. + +In this example, Python code is used to perform several Amazon EC2 key pair management +operations. The code uses the AWS SDK for Python to manage IAM access keys using these methods of the EC2 client class: + +* `describe_key_pairs `_. + +* `create_key_pair `_. + +* `delete_key_pair `_. + +For more information about the Amazon EC2 key pairs, see `Amazon EC2 Key Pairs `_ +in the *Amazon EC2 User Guide for Linux Instances* +or `Amazon EC2 Key Pairs and Windows Instances `_ +in the *Amazon EC2 User Guide for Windows Instances*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Key Pairs +================== + +Describe one or more of your key pairs. + +The example below shows how to: + +* Describe keypairs using + `describe_key_pairs `_. + +Example +------- + +.. code-block:: python + + import boto3 + + ec2 = boto3.client('ec2') + response = ec2.describe_key_pairs() + print(response) + + +Create a Key Pair +================= + +Create a 2048-bit RSA key pair with the specified name. Amazon EC2 stores the public key and displays +the private key for you to save to a file. The private key is returned as an unencrypted PEM encoded +PKCS#8 private key. If a key with the specified name already exists, Amazon EC2 returns an error. + +The example below shows how to: + +* Create a 2048-bit RSA key pair with a specified name using + `create_key_pair `_. + +Example +------- + +.. code-block:: python + + import boto3 + + ec2 = boto3.client('ec2') + response = ec2.create_key_pair(KeyName='KEY_PAIR_NAME') + print(response) + + +Delete a Key Pair +================= + +Delete the specified key pair, by removing the public key from Amazon EC2. + +The example below shows how to: + +* Delete a key pair by removing the public key from Amazon EC2 using + `delete_key_pair `_. + +Example +------- + +.. code-block:: python + + import boto3 + + ec2 = boto3.client('ec2') + response = ec2.delete_key_pair(KeyName='KEY_PAIR_NAME') + print(response) + + \ No newline at end of file diff --git a/docs/source/guide/ec2-example-managing-instances.rst b/docs/source/guide/ec2-example-managing-instances.rst new file mode 100644 index 0000000..a0eef49 --- /dev/null +++ b/docs/source/guide/ec2-example-managing-instances.rst @@ -0,0 +1,212 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-ec2-managing-instances: + +############################# +Managing Amazon EC2 Instances +############################# + +This Python example shows you how to: + +* Get basic information about your Amazon EC2 instances + +* Start and stop detailed monitoring of an Amazon EC2 instance + +* Start and stop an Amazon EC2 instance + +* Reboot an Amazon EC2 instance + +The Scenario +============ + +In this example, Python code is used perform several basic instance management operations. The code uses the +AWS SDK for Python to manage the instances by using these methods of the EC2 client class: + +* `describe_instances `_. + +* `monitor_instances `_. + +* `unmonitor_instances `_. + +* `start_instances `_. + +* `stop_instances `_. + +* `reboot_instances `_. + +For more information about the lifecycle of Amazon EC2 instances, see +`Instance Lifecycle `_ +in the *Amazon EC2 User Guide for Linux Instances* or `Instance Lifecycle `_ +in the *Amazon EC2 User Guide for Windows Instances*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Instances +================== + +An EC2 instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) for running applications +on the Amazon Web Services (AWS) infrastructure. + +The example below shows how to: + +* Describe one or more EC2 instances using + `describe_instances `_. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Example +------- + +.. code-block:: python + + import boto3 + + ec2 = boto3.client('ec2') + response = ec2.describe_instances() + print(response) + + +Monitor and Unmonitor Instances +=============================== + +Enable or disable detailed monitoring for a running instance. If detailed monitoring is not enabled, +basic monitoring is enabled. For more information, see +`Monitoring Your Instances and Volumes `_ +in the *Amazon Elastic Compute Cloud User Guide*. + +The example below shows how to: + +* Enable detailed monitoring for a running instance using + `monitor_instances `_. + +* Disable detailed monitoring for a running instance using + `unmonitor_instances `_. + +Example +------- + +.. code-block:: python + + import sys + import boto3 + + + ec2 = boto3.client('ec2') + if sys.argv[1] == 'ON': + response = ec2.monitor_instances(InstanceIds=['INSTANCE_ID']) + else: + response = ec2.unmonitor_instances(InstanceIds=['INSTANCE_ID']) + print(response) + + +Start and Stop Instances +======================== + +Instances that use Amazon EBS volumes as their root devices can be quickly stopped and started. When +an instance is stopped, the compute resources are released and you are not billed for hourly instance +usage. However, your root partition Amazon EBS volume remains, continues to persist your data, and +you are charged for Amazon EBS volume usage. You can restart your instance at any time. Each time +you transition an instance from stopped to started, Amazon EC2 charges a full instance hour, even +if transitions happen multiple times within a single hour. + +The example below shows how to: + +* Start an Amazon EBS-backed AMI that you've previously stopped using + `start_instances `_. + +* Stop an Amazon EBS-backed instance using + `stop_instances `_. + +Example +------- + +.. code-block:: python + + import sys + import boto3 + from botocore.exceptions import ClientError + + instance_id = sys.argv[2] + action = sys.argv[1].upper() + + ec2 = boto3.client('ec2') + + + if action == 'ON': + # Do a dryrun first to verify permissions + try: + ec2.start_instances(InstanceIds=[instance_id], DryRun=True) + except ClientError as e: + if 'DryRunOperation' not in str(e): + raise + + # Dry run succeeded, run start_instances without dryrun + try: + response = ec2.start_instances(InstanceIds=[instance_id], DryRun=False) + print(response) + except ClientError as e: + print(e) + else: + # Do a dryrun first to verify permissions + try: + ec2.stop_instances(InstanceIds=[instance_id], DryRun=True) + except ClientError as e: + if 'DryRunOperation' not in str(e): + raise + + # Dry run succeeded, call stop_instances without dryrun + try: + response = ec2.stop_instances(InstanceIds=[instance_id], DryRun=False) + print(response) + except ClientError as e: + print(e) + + +Reboot Instances +================ +Request a reboot of one or more instances. This operation is asynchronous; it only queues a request +to reboot the specified instances. The operation succeeds if the instances are valid and belong to +you. Requests to reboot terminated instances are ignored. + +The example below shows how to: + +* Request a reboot of one or more instances using + `reboot_instances `_. + +Example +------- + +.. code-block:: python + + + import boto3 + from botocore.exceptions import ClientError + + + ec2 = boto3.client('ec2') + + try: + ec2.reboot_instances(InstanceIds=['INSTANCE_ID'], DryRun=True) + except ClientError as e: + if 'DryRunOperation' not in str(e): + print("You don't have permission to reboot instances.") + raise + + try: + response = ec2.reboot_instances(InstanceIds=['INSTANCE_ID'], DryRun=False) + print('Success', response) + except ClientError as e: + print('Error', e) diff --git a/docs/source/guide/ec2-example-regions-avail-zones.rst b/docs/source/guide/ec2-example-regions-avail-zones.rst new file mode 100644 index 0000000..c9322ed --- /dev/null +++ b/docs/source/guide/ec2-example-regions-avail-zones.rst @@ -0,0 +1,77 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-ec2-example-regions-zones: + +################################################## +Describe Amazon EC2 Regions and Availability Zones +################################################## + +Amazon EC2 is hosted in multiple locations worldwide. These locations are composed of regions and +Availability Zones. Each region is a separate geographic area. Each region has multiple, isolated +locations known as Availability Zones. Amazon EC2 provides the ability to place instances and data +in multiple locations. + +The Scenario +============ + +In this example, Python code is used to get details about regions and Availability Zones. The code uses the +AWS SDK for Python to get the data by using these methods of the EC2 client class: + +* `describe_regions `_. + +* `describe_availability_zones `_. + +For more information about regions and Availability Zones, see +`Regions and Availability Zones `_ +in the *Amazon EC2 User Guide for Linux Instances* or +`Regions and Availability Zones `_ +in the *Amazon EC2 User Guide for Windows Instances*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Regions and Availability Zones +======================================= + +* Describe one or more regions that are currently available to you. + +* Describe one or more of the Availability Zones that are available to you. The results include zones + only for the region you're currently using. If there is an event impacting an Availability Zone, + you can use this request to view the state and any provided message for that Availability Zone. + +The example below shows how to: + +* Describe regions using + `describe_regions `_. + +* Describe AvailabilityZones using + `describe_availability_zones `_. + +Example +------- + +.. code-block:: python + + import boto3 + + ec2 = boto3.client('ec2') + + # Retrieves all regions/endpoints that work with EC2 + response = ec2.describe_regions() + print('Regions:', response['Regions']) + + # Retrieves availability zones only for region of the ec2 object + response = ec2.describe_availability_zones() + print('Availability Zones:', response['AvailabilityZones']) diff --git a/docs/source/guide/ec2-example-security-group.rst b/docs/source/guide/ec2-example-security-group.rst new file mode 100644 index 0000000..691f37f --- /dev/null +++ b/docs/source/guide/ec2-example-security-group.rst @@ -0,0 +1,173 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-ec2-example-security-group: + +########################################## +Working with Security Groups in Amazon EC2 +########################################## + +This Python example shows you how to: + +* Get information about your security groups + +* Create a security group to access an Amazon EC2 instance + +* Delete an existing security group + +The Scenario +============ + +An Amazon EC2 security group acts as a virtual firewall that controls the traffic for one or more instances. +You add rules to each security group to allow traffic to or from its associated instances. You can +modify the rules for a security group at any time; the new rules are automatically applied to all +instances that are associated with the security group. + +In this example, Python code is used to perform several Amazon EC2 operations involving security groups. +The code uses the AWS SDK for Python to manage IAM access keys using these methods of the EC2 +client class: + +* `describe_security_groups `_. + +* `authorize_security_group_ingress `_. + +* `create_security_group `_. + +* `delete_security_group `_. + +For more information about the Amazon EC2 security groups, see +`Amazon EC2 Amazon Security Groups for Linux Instances `_ +in the *Amazon EC2 User Guide for Linux Instances* or +`Amazon EC2 Security Groups for Windows Instances `_ +in the *Amazon EC2 User Guide for Windows Instances*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Describe Security Groups +======================= +Describe one or more of your security groups. + +A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. +For more information, see `Amazon EC2 Security Groups `_ +in the *Amazon Elastic Compute Cloud User Guide* and +`Security Groups for Your VPC `_ +in the *Amazon Virtual Private Cloud User Guide*. + +The example below shows how to: + +* Describe a Security Group using + `describe_security_groups `_. + +Example +------- + +.. code:: python + + import boto3 + from botocore.exceptions import ClientError + + ec2 = boto3.client('ec2') + + try: + response = ec2.describe_security_groups(GroupIds=['SECURITY_GROUP_ID']) + print(response) + except ClientError as e: + print(e) + +Create a Security Group and Rules +================================= + +* Create a security group. + +* Add one or more ingress rules to a security group. + + Rule changes are propagated to instances within the security group as quickly as possible. However, + a small delay might occur. + +The example below shows how to: + +* Create a Security Group using + `create_security_group `_. + +* Add an ingress rule to a security group using + `authorize_security_group_ingress `_. + +Example +------- + +.. code-block:: python + + import boto3 + from botocore.exceptions import ClientError + + ec2 = boto3.client('ec2') + + response = ec2.describe_vpcs() + vpc_id = response.get('Vpcs', [{}])[0].get('VpcId', '') + + try: + response = ec2.create_security_group(GroupName='SECURITY_GROUP_NAME', + Description='DESCRIPTION', + VpcId=vpc_id) + security_group_id = response['GroupId'] + print('Security Group Created %s in vpc %s.' % (security_group_id, vpc_id)) + + data = ec2.authorize_security_group_ingress( + GroupId=security_group_id, + IpPermissions=[ + {'IpProtocol': 'tcp', + 'FromPort': 80, + 'ToPort': 80, + 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, + {'IpProtocol': 'tcp', + 'FromPort': 22, + 'ToPort': 22, + 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]} + ]) + print('Ingress Successfully Set %s' % data) + except ClientError as e: + print(e) + +Delete a Security Group +======================= + +If you attempt to delete a security group that is associated with an instance, or is referenced by +another security group, the operation fails with :code:`InvalidGroup.InUse` in EC2-Classic or :code:`DependencyViolation` +in EC2-VPC. + +The example below shows how to: + +* Delete a security group using + `delete_security_group `_. + +Example +------- + +.. code-block:: python + + import boto3 + from botocore.exceptions import ClientError + + # Create EC2 client + ec2 = boto3.client('ec2') + + # Delete security group + try: + response = ec2.delete_security_group(GroupId='SECURITY_GROUP_ID') + print('Security Group Deleted') + except ClientError as e: + print(e) + + \ No newline at end of file diff --git a/docs/source/guide/ec2-examples.rst b/docs/source/guide/ec2-examples.rst new file mode 100644 index 0000000..dd7134f --- /dev/null +++ b/docs/source/guide/ec2-examples.rst @@ -0,0 +1,37 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-ec2-examples: + +################### +Amazon EC2 Examples +################### + +.. meta:: + :description: + :keywords: AWS EC2 code examples for the AWS SDK for Python + +Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizeable computing +capacity in servers in Amazon's data centers—that you use to build and host your software systems. + +You can use the following examples to access Amazon EC2 using the Amazon Web Services (AWS) SDK for Python. +For more information about Amazon EC2, see the `Amazon EC2 Documentation `_. + +**Examples** + +.. toctree:: + :maxdepth: 1 + + ec2-example-managing-instances + ec2-example-key-pairs + ec2-example-regions-avail-zones + ec2-example-security-group + ec2-example-elastic-ip-addresses + diff --git a/docs/source/guide/events.rst b/docs/source/guide/events.rst index 895572f..7ca00b5 100644 --- a/docs/source/guide/events.rst +++ b/docs/source/guide/events.rst @@ -79,9 +79,9 @@ A Hierarchical Structure The event system also provides a hierarchy for registering events such that you can register a function to a set of events depending on the event name -heirarchy. +hierarchy. -An event name can have its own heirachy by specifying ``.`` in its name. For +An event name can have its own hierarchy by specifying ``.`` in its name. For example, take the event name ``'general.specific.more_specific'``. When this event is emitted, the registered functions will be called in the order from most specific to least specific registration. So in this example, the @@ -92,7 +92,7 @@ functions will be called in the following order: 3) Functions registered to ``'general'`` Here is a deeper example of how the event system works with respect to -its hierarchial structure:: +its hierarchical structure:: import boto3 @@ -421,3 +421,4 @@ provide-client-params event_system.register('provide-client-params.s3.ListObjects', add_my_bucket) response = s3.list_objects() + diff --git a/docs/source/guide/examples.rst b/docs/source/guide/examples.rst new file mode 100644 index 0000000..996b1eb --- /dev/null +++ b/docs/source/guide/examples.rst @@ -0,0 +1,27 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-examples: + +############# +Code Examples +############# + +This section provides code examples that demonstrate common Amazon Web Services scenarios using the +Amazon Web Services (AWS) SDK for Python. + +.. toctree:: + :maxdepth: 1 + + cw-examples + ec2-examples + iam-examples + s3-examples + sqs-examples diff --git a/docs/source/guide/iam-example-managing-access-keys.rst b/docs/source/guide/iam-example-managing-access-keys.rst new file mode 100644 index 0000000..817ea55 --- /dev/null +++ b/docs/source/guide/iam-example-managing-access-keys.rst @@ -0,0 +1,204 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-iam-managing-access-keys: + +######################## +Managing IAM Access Keys +######################## + +This Python example shows you how to manage the access keys of your users. + +The Scenario +============ + +Users need their own access keys to make programmatic calls to AWS from the Amazon Web Services (AWS) +SDK for Python. To fill this need, you can create, modify, view, or rotate access keys +(access key IDs and secret access keys) for IAM users. By default, when you create an access key, its +status is Active, which means the user can use the access key for API calls. + +In this example, Python code is used to manage access keys in IAM. The code uses the AWS SDK for Python +to manage IAM access keys using these methods of the IAM client class: + +* `create_access_key `_. + +* `paginate(UserName='IAM_USER_NAME') `_. + +* `get_access_key_last_used `_. + +* `update_access_key `_. + +* `delete_access_key `_. + + +For more information about IAM access keys, see `Managing Access Keys `_ +in the *IAM User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Create Access Keys for a User +============================= + +Create a new AWS secret access key and corresponding AWS access key ID for the specified user. The +default status for new keys is :code:`Active`. + +The example below shows how to: + +* Create a new AWS access key using + `create_access_key `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Create an access key + response = iam.create_access_key( + UserName='IAM_USER_NAME' + ) + + print(response['AccessKey']) + +List a User's Access Keys +========================= + +List information about the access key IDs associated with the specified IAM user. If there are none, +the action returns an empty list. + +If the UserName field is not specified, the UserName is determined implicitly based on the AWS access +key ID used to sign the request. Because this action works for access keys under the AWS account, +you can use this action to manage root credentials even if the AWS account has no associated users. + +The example below shows how to: + +* List a user's access keys using + `paginate(UserName='IAM_USER_NAME') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # List access keys through the pagination interface. + paginator = iam.get_paginator('list_access_keys') + for response in paginator.paginate(UserName='IAM_USER_NAME'): + print(response) + + +Get the Access Key Last Used +============================ + +Get information about when the specified access key was last used. The information includes the +date and time of last use, along with the AWS service and region that were specified in the last request +made with that key. + +The example below shows how to: + +* Get the access key last used using + `get_access_key_last_used `_. + +Example +------- + +.. code-block:: python + + import boto3 + + + # Create IAM client + iam = boto3.client('iam') + + # Get last use of access key + response = iam.get_access_key_last_used( + AccessKeyId='ACCESS_KEY_ID' + ) + + print(response['AccessKeyLastUsed']) + + + +Update Access Key Status +======================== + +Change the status of the specified access key from Active to Inactive, or vice versa. This action +can be used to disable a user's key as part of a key rotation work flow. + +The example below shows how to: + +* Change the status of an access key to :code:`Active` using + `update_access_key `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Update access key to be active + iam.update_access_key( + AccessKeyId='ACCESS_KEY_ID', + Status='Active', + UserName='IAM_USER_NAME' + ) + + +Delete an Access Key +==================== + +Delete the access key pair associated with the specified IAM user. + +If you do not specify a user name, IAM determines the user name implicitly based on the AWS access +key ID signing the request. Because this action works for access keys under the AWS account, you can +use this action to manage root credentials even if the AWS account has no associated users. + +The example below shows how to: + +* Delete an access key using + `delete_access_key `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Delete access key + iam.delete_access_key( + AccessKeyId='ACCESS_KEY_ID', + UserName='IAM_USER_NAME' + ) + + + \ No newline at end of file diff --git a/docs/source/guide/iam-example-managing-account-aliases.rst b/docs/source/guide/iam-example-managing-account-aliases.rst new file mode 100644 index 0000000..93f7236 --- /dev/null +++ b/docs/source/guide/iam-example-managing-account-aliases.rst @@ -0,0 +1,126 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-iam-managing-account-aliases: + +############################ +Managing IAM Account Aliases +############################ + +This Python example shows you how to manage aliases for your AWS account ID. + +The Scenario +============ + +If you want the URL for your sign-in page to contain your company name or other friendly identifier +instead of your AWS account ID, you can create an alias for your AWS account ID. If you create an +AWS account alias, your sign-in page URL changes to incorporate the alias. + +In this example, Python code is used to create and manage IAM account aliases. The code uses the +AWS SDK for Python to manage IAM access keys using these methods of the IAM client class: + +* `create_account_alias `_. + +* `get_paginator('list_account_aliases') `_. + +* `delete_account_alias `_. + +For more information about IAM account aliases, see `Your AWS Account ID and Its Alias `_ +in the *IAM User Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Create an Account Alias +======================= + +Create an alias for your AWS account. For information about using an AWS account alias, see +`Using an Alias for Your AWS Account ID `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Create an account alias using + `create_account_alias `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Create an account alias + iam.create_account_alias( + AccountAlias='ALIAS' + ) + +List an Account Alias +===================== + +List the account alias associated with the AWS account (Note: you can have only one). For information +about using an AWS account alias, see `Using an Alias for Your AWS Account ID `_ +in the *IAM User Guide*. + +The example below shows how to: + +* List account aliases using + `get_paginator('list_account_aliases') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # List account aliases through the pagination interface + paginator = iam.get_paginator('list_account_aliases') + for response in paginator.paginate(): + print(response['AccountAliases']) + +Delete an Account Alias +========================= + +Delete the specified AWS account alias. For information about using an AWS account alias, see +`Using an Alias for Your AWS Account ID `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Delete an account alias using + `delete_account_alias `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Delete an account alias + iam.delete_account_alias( + AccountAlias='ALIAS' + ) diff --git a/docs/source/guide/iam-example-managing-users.rst b/docs/source/guide/iam-example-managing-users.rst new file mode 100644 index 0000000..3622b38 --- /dev/null +++ b/docs/source/guide/iam-example-managing-users.rst @@ -0,0 +1,160 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-iam-examples-managing-users: + +****************** +Managing IAM Users +****************** + +This Python example shows you how to create a user, list users, update a user name and delete a user. + +The Scenario +============ + +In this example Python code is used to create and manage users in IAM. The code uses the +Amazon Web Services (AWS) SDK for Python to manage users using these methods of the +IAM client class: + +* `create_user `_ + +* `get_paginator('list_users') `_. + +* `update_user `_. + +* `delete_user `_. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +For more information about IAM users, see `IAM Users `_ +in the *IAM User Guide*. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Create a User +============= + +Create a new IAM user for your AWS account. + +For information about limitations on the number of IAM users you can create, see +`Limitations on IAM Entities `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Create a new IAM user using + `create_user `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Create user + response = iam.create_user( + UserName='IAM_USER_NAME' + ) + + print(response) + +List Users in Your Account +========================== + +List the IAM users. + +The example below shows how to: + +* List the IAM users using + `get_paginator('list_users') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # List users with the pagination interface + paginator = iam.get_paginator('list_users') + for response in paginator.paginate(): + print(response) + +Update a User's Name +==================== + +Update the name and/or the path of the specified IAM user. + +To change a user's name or path, you must use the AWS CLI, Tools for Windows PowerShell, or AWS API. +There is no option in the console to rename a user. For information about the permissions that you +need in order to rename a user, see +`Delegating Permissions to Administer IAM Users, Groups, and Credentials `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Update an IAM user name using + `update_user `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Update a user name + iam.update_user( + UserName='IAM_USER_NAME', + NewUserName='NEW_IAM_USER_NAME' + ) + + +Delete a User +============= + +Delete the specified IAM user. The user must not belong to any groups or have any access keys, signing +certificates, or attached policies. + +The example below shows how to: + +* Delete an IAM user name using + `delete_user `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Delete a user + iam.delete_user( + UserName='IAM_USER_NAME' + ) + \ No newline at end of file diff --git a/docs/source/guide/iam-example-policies.rst b/docs/source/guide/iam-example-policies.rst new file mode 100644 index 0000000..cc02a21 --- /dev/null +++ b/docs/source/guide/iam-example-policies.rst @@ -0,0 +1,206 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-iam-examples-policies: + +######################### +Working with IAM Policies +######################### + +This Python example shows you how to create and get IAM policies and attach and detach IAM policies from roles. + +The Scenario +============ + +You grant permissions to a user by creating a policy, which is a document that lists the actions +that a user can perform and the resources those actions can affect. Any actions or resources that are +not explicitly allowed are denied by default. Policies can be created and attached to users, groups +of users, roles assumed by users, and resources. + +In this example, Python code used to manage policies in IAM. The code uses the +Amazon Web Services (AWS) SDK for Python to create and delete policies as well as attaching and +detaching role policies using these methods of the IAM client class: + +* `create_policy `_. + +* `get_policy `_. + +* `attach_role_policy `_. + +* `detach_role_policy `_. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +For more information about IAM policies, see `Overview of Access Management: Permissions and Policies `_ +in the IAM User Guide. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +Create an IAM Policy +==================== + +Create a new managed policy for your AWS account. + +This operation creates a policy version with a version identifier of :code:`v1` and sets :code:`v1` +as the policy's default version. For more information about policy versions, see +`Versioning for Managed Policies `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Create a new managed policy using + `create_policy `_. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Example +------- + +.. code-block:: python + + import json + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Create a policy + my_managed_policy = { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "logs:CreateLogGroup", + "Resource": "RESOURCE_ARN" + }, + { + "Effect": "Allow", + "Action": [ + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:PutItem", + "dynamodb:Scan", + "dynamodb:UpdateItem" + ], + "Resource": "RESOURCE_ARN" + } + ] + } + response = iam.create_policy( + PolicyName='myDynamoDBPolicy', + PolicyDocument=json.dumps(my_managed_policy) + ) + print(response) + +Get an IAM Policy +================= + +Get information about the specified managed policy, including the policy's default version and +the total number of IAM users, groups, and roles to which the policy is attached. To get the +list of the specific users, groups, and roles that the policy is attached to, use the +:code:`list_entities_for_policy` API. This API returns metadata about the policy. To get the actual policy +document for a specific version of the policy, use :code:`get_policy_version` API. + +This API gets information about managed policies. To get information about an inline policy +that is embedded with an IAM user, group, or role, use the :code:`get_user_policy`, :code:`get_group_policy`, +or :code:`get_role_policy` API. + +The example below shows how to: + +* Get information about a managed policy using + `get_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + + + # Create IAM client + iam = boto3.client('iam') + + # Get a policy + response = iam.get_policy( + PolicyArn='arn:aws:iam::aws:policy/AWSLambdaExecute' + ) + print(response['Policy']) + + + +Attach a Managed Role Policy +============================ + +When you attach a managed policy to a role, the managed policy becomes part of the role's permission +(access) policy. You cannot use a managed policy as the role's trust policy. The role's trust policy +is created at the same time as the role, using :code:`create_role`. You can update a role's trust policy using +:code:`update_assume_role_policy`. + +Use this API to attach a managed policy to a role. To embed an inline policy in a role, use :code:`put_role_policy`. + +The example below shows how to: + +* Attach a managed policy to an IAM role. using + `attach_role_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Attach a role policy + iam.attach_role_policy( + PolicyArn='arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess', + RoleName='AmazonDynamoDBFullAccess' + ) + + + +Detach a Managed Role Policy +============================ + +Detach the specified managed policy from the specified role. + +A role can also have inline policies embedded with it. To delete an inline policy, use the +:code:`delete_role_policy` API. For information about policies, see +`Managed Policies and Inline Policies `_ +in the *IAM User Guide*. + +The example below shows how to: + +* Detach a managed role policy using + `detach_role_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Detach a role policy + iam.detach_role_policy( + PolicyArn='arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess', + RoleName='AmazonDynamoDBFullAccess' + ) + diff --git a/docs/source/guide/iam-example-server-certificates.rst b/docs/source/guide/iam-example-server-certificates.rst new file mode 100644 index 0000000..3113aba --- /dev/null +++ b/docs/source/guide/iam-example-server-certificates.rst @@ -0,0 +1,151 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-iam-examples-server-certs: + + +#################################### +Working with IAM Server Certificates +#################################### + +This Python example shows you how to carry out basic tasks in managing server certificates for HTTPS connections. + +The Scenario +============ + +To enable HTTPS connections to your website or application on AWS, you need an SSL/TLS server certificate. +To use a certificate that you obtained from an external provider with your website or application on AWS, +you must upload the certificate to IAM or import it into AWS Certificate Manager. + +In this example, python code is used to handle server certificates in IAM. The code uses the +Amazon Web Services (AWS) SDK for Python to manage server certificates using these methods of the +IAM client class: + +* `get_paginator('list_server_certificates') `_. + +* `get_server_certificate `_. + +* `update_server_certificate `_. + +* `delete_server_certificate `_. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +For more information about server certificates, see `Working with Server Certificates `_ +in the *IAM User Guide*. + +Prerequisite Task +================= + +To set up and run this example, you must first configure your AWS credentials, as described in :doc:`quickstart`. + +List Your Server Certificates +============================= + +List the server certificates stored in IAM. If none exist, the action returns an empty list. + +The example below shows how to: + +* List server certificates using + `get_paginator('list_server_certificates') `_. + +For more information about paginators see, :doc:`paginators` + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # List server certificates through the pagination interface + paginator = iam.get_paginator('list_server_certificates') + for response in paginator.paginate(): + print(response['ServerCertificateMetadataList']) + +Get a Server Certificate +======================== + +Get information about the specified server certificate stored in IAM. + +The example below shows how to: + +* Get a server certificate using + `get_server_certificate `_. + +Example +------- + +.. code-block:: python + + import boto3 + + + # Create IAM client + iam = boto3.client('iam') + + # Get the server certificate + response = iam.get_server_certificate(ServerCertificateName='CERTIFICATE_NAME') + print(response['ServerCertificate']) + +Update a Server Certificate +=========================== + +Update the name and/or the path of the specified server certificate stored in IAM. + +The example below shows how to: + +* Update a server certificate using + `update_server_certificate `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create IAM client + iam = boto3.client('iam') + + # Update the name of the server certificate + iam.update_server_certificate( + ServerCertificateName='CERTIFICATE_NAME', + NewServerCertificateName='NEW_CERTIFICATE_NAME' + ) + +Delete a Server Certificate +=========================== + +Delete the specified server certificate. + +The example below shows how to: + +* Delete a server certificate using + `delete_server_certificate `_. + +Example +------- + +.. code-block:: python + + import boto3 + + + # Create IAM client + iam = boto3.client('iam') + + # Delete the server certificate + iam.delete_server_certificate( + ServerCertificateName='CERTIFICATE_NAME' + ) diff --git a/docs/source/guide/iam-examples.rst b/docs/source/guide/iam-examples.rst new file mode 100644 index 0000000..d2e3654 --- /dev/null +++ b/docs/source/guide/iam-examples.rst @@ -0,0 +1,42 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto-iam-examples: + +########################################### +AWS Identity and Access Management Examples +########################################### + +.. meta:: + :description: + :keywords: AWS IAM code examples for the Amazon Web Services (AWS) SDK for Python + + +AWS Identity and Access Management (IAM) is a web service that enables Amazon Web Services (AWS) +customers to manage users and user permissions in AWS. The service is targeted at organizations with +multiple users or systems in the cloud that use AWS products such as Amazon EC2, Amazon SimpleDB, and +the AWS Management Console. With IAM, you can centrally manage users, security credentials such as +access keys, and permissions that control which AWS resources users can access. + +You can use the following examples to access AWS Identity and Access Management (IAM) using the +Amazon Web Services (AWS) SDK for Python. +For more information about IAM, see the `IAM documentation `_. + +**Examples** + +.. toctree:: + :maxdepth: 1 + + iam-example-managing-users + iam-example-policies + iam-example-managing-access-keys + iam-example-server-certificates + iam-example-managing-account-aliases + diff --git a/docs/source/guide/paginators.rst b/docs/source/guide/paginators.rst index b4571b9..c0c0ba4 100644 --- a/docs/source/guide/paginators.rst +++ b/docs/source/guide/paginators.rst @@ -108,7 +108,7 @@ JMESPath expressions that are applied to each page of results through the When filtering with JMESPath expressions, each page of results that is yielded by the paginator is mapped through the JMESPath expression. If a JMESPath expression returns a single value that is not an array, that value is yielded -directly. If the the result of applying the JMESPath expression to a page of +directly. If the result of applying the JMESPath expression to a page of results is a list, then each value of the list is yielded individually (essentially implementing a flat map). For example, in the above expression, each key that has a ``Size`` greater than `100` is yielded by the diff --git a/docs/source/guide/resources.rst b/docs/source/guide/resources.rst index fdf80e3..0f9599c 100644 --- a/docs/source/guide/resources.rst +++ b/docs/source/guide/resources.rst @@ -198,9 +198,9 @@ keyword arguments. Examples of waiters include:: instance.wait_until_running() -Multithreading --------------- -It is recommended to create a resource instance for each thread in a multithreaded application rather than sharing a single instance among the threads. For example:: +Multithreading / Multiprocessing +-------------------------------- +It is recommended to create a resource instance for each thread / process in a multithreaded or multiprocess application rather than sharing a single instance among the threads / processes. For example:: import boto3 import boto3.session diff --git a/docs/source/guide/s3-example-access-permissions.rst b/docs/source/guide/s3-example-access-permissions.rst new file mode 100644 index 0000000..99f6fe8 --- /dev/null +++ b/docs/source/guide/s3-example-access-permissions.rst @@ -0,0 +1,66 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-access-permissions: + +############################################ +Managing Amazon S3 Bucket Access Permissions +############################################ + +This Python example shows you how to get or set the access control list for an Amazon S3 bucket. + +The Scenario +============ + +In this example, a Python code is used to display the bucket access control list (ACL) for a selected +bucket. The code uses the AWS SDK for Python to manage Amazon S3 bucket access permissions using this +method of the Amazon S3 client class: + +* `get_bucket_acl `_. + +For more information about access control lists for Amazon S3 buckets, see +`Managing Access with ACLs `_ +in the *Amazon Simple Storage Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Get a Specified Bucket Access Control (ACL) List +================================================ + +Access control lists (ACLs) are one of the resource-based access policy option you can use to manage +access to your buckets and objects. You can use ACLs to grant basic read/write permissions to other +AWS accounts. + +The example below shows how to: + +* Get the bucket ACL for a specified bucket using + `get_bucket_acl `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call to S3 to retrieve the policy for the given bucket + result = s3.get_bucket_acl(Bucket='my-bucket') + print(result) + diff --git a/docs/source/guide/s3-example-bucket-policies.rst b/docs/source/guide/s3-example-bucket-policies.rst new file mode 100644 index 0000000..2cca816 --- /dev/null +++ b/docs/source/guide/s3-example-bucket-policies.rst @@ -0,0 +1,135 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-bucket-policies: + +###################################### +Working with Amazon S3 Bucket Policies +###################################### + +This Python example shows you how to: + +* Get the bucket policy of an Amazon S3 bucket. + +* Add or update the bucket policy of an Amazon S3 bucket. + +* Delete the bucket policy of an Amazon S3 bucket. + +The Scenario +============ + +In this example, Python code is used to get, set, or delete a bucket policy on an Amazon S3 bucket. +The code uses the AWS SDK for Python to configure policy for a selected Amazon S3 bucket using these +methods of the Amazon S3 client class: + +* `get_bucket_policy `_. + +* `put_bucket_policy `_. + +* `delete_bucket_policy `_ + +For more information about bucket policies for Amazon S3 buckets, see +`Using Bucket Policies and User Policies `_ +in the *Amazon Simple Storage Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Get the Current Bucket Policy +============================= + +The example below shows how to: + +* Get the bucket ACL for a specified bucket using + `get_bucket_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call to S3 to retrieve the policy for the given bucket + result = s3.get_bucket_policy(Bucket='my-bucket') + print(result) + + + + +Set a Simple Bucket Policy +========================== + +The example below shows how to: + +* Set the bucket policy for a specified bucket using + `put_bucket_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + import json + + # Create an S3 client + s3 = boto3.client('s3') + + bucket_name = 'my-bucket' + + # Create the bucket policy + bucket_policy = { + 'Version': '2012-10-17', + 'Statement': [{ + 'Sid': 'AddPerm', + 'Effect': 'Allow', + 'Principal': '*', + 'Action': ['s3:GetObject'], + 'Resource': "arn:aws:s3:::%s/*" % bucket_name + }] + } + + # Convert the policy to a JSON string + bucket_policy = json.dumps(bucket_policy) + + # Set the new policy on the given bucket + s3.put_bucket_policy(Bucket=bucket_name, Policy=bucket_policy) + + +Delete a Bucket Policy +====================== + +The example below shows how to: + +* Delete a bucket policy for a specified bucket using + `delete_bucket_policy `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call S3 to delete the policy for the given bucket + s3.delete_bucket_policy(Bucket='my-bucket') diff --git a/docs/source/guide/s3-example-configuring-buckets.rst b/docs/source/guide/s3-example-configuring-buckets.rst new file mode 100644 index 0000000..421a44e --- /dev/null +++ b/docs/source/guide/s3-example-configuring-buckets.rst @@ -0,0 +1,89 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-configuring-buckets: + +############################# +Configuring Amazon S3 Buckets +############################# + +This Python example shows you how to configure the cross-origin resource sharing (CORS) permissions for a bucket. + +The Scenario +============ + +In this example, Python code is used to list your Amazon S3 buckets and to configure CORS and bucket logging. +The Python code uses the AWS SDK for Python to configure a selected Amazon S3 bucket using these +methods of the Amazon S3 client class: + +* `get_bucket_cors `_ + +* `put_bucket_cors `_. + +For more information about using CORS configuration with an Amazon S3 bucket, see +`Cross-Origin Resource Sharing (CORS) `_ +in the *Amazon Simple Storage Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Get a Bucket CORS Configuration +=============================== + +The example below shows how to: + +* Get a CORS configuration for a specified bucket using + `get_bucket_cors `_. + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call S3 to get CORS configuration for selected bucket + result = s3.get_bucket_cors(Bucket='my-bucket') + +Set a Bucket CORS Configuration +=============================== + +The example below shows how to: + +* Set a CORS configuration for a specified bucket using + `put_bucket_cors `_. + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Create the CORS configuration + cors_configuration = { + 'CORSRules': [{ + 'AllowedHeaders': ['Authorization'], + 'AllowedMethods': ['GET', 'PUT'], + 'AllowedOrigins': ['*'], + 'ExposeHeaders': ['GET', 'PUT'], + 'MaxAgeSeconds': 3000 + }] + } + + # Set the new CORS configuration on the selected bucket + s3.put_bucket_cors(Bucket='my-bucket', CORSConfiguration=cors_configuration) + diff --git a/docs/source/guide/s3-example-creating-buckets.rst b/docs/source/guide/s3-example-creating-buckets.rst new file mode 100644 index 0000000..8359b75 --- /dev/null +++ b/docs/source/guide/s3-example-creating-buckets.rst @@ -0,0 +1,123 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-creating-buckets: + +#################################### +Creating and Using Amazon S3 Buckets +#################################### + +This Python example shows you how to: + +* Obtain and display a list of Amazon S3 buckets in your account. + +* Create an Amazon S3 bucket. + +* Upload an object to a specified bucket. + +The Scenario +============ + +In this example, Python code is used to obtain a list of existing Amazon S3 buckets, create a bucket, +and upload a file to a specified bucket. The code uses the AWS SDK for Python to get information from +and upload files to an Amazon S3 bucket using these methods of the Amazon S3 client class: + +* `list_buckets `_ + +* `create_bucket `_ + +* `upload_file `_ + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Display a List of Amazon S3 Buckets +=================================== + +List all the buckets owned by the authenticated sender of the request. + +The example below shows how to: + +* List buckets using + `list_buckets `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call S3 to list current buckets + response = s3.list_buckets() + + # Get a list of all bucket names from the response + buckets = [bucket['Name'] for bucket in response['Buckets']] + + # Print out the bucket list + print("Bucket List: %s" % buckets) + + +Create an Amazon S3 Bucket +========================== + +The example below shows how to: + +* Create a new bucket using + `create_bucket `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + s3 = boto3.client('s3') + s3.create_bucket(Bucket='my-bucket') + + +Upload a File to an Amazon S3 Bucket +==================================== + +The example below shows how to: + +* Upload a file to a bucket using + `upload_file `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + filename = 'file.txt' + bucket_name = 'my-bucket' + + # Uploads the given file using a managed uploader, which will split up large + # files automatically and upload parts in parallel. + s3.upload_file(filename, bucket_name, filename) + \ No newline at end of file diff --git a/docs/source/guide/s3-example-download-file.rst b/docs/source/guide/s3-example-download-file.rst new file mode 100644 index 0000000..0b3b988 --- /dev/null +++ b/docs/source/guide/s3-example-download-file.rst @@ -0,0 +1,59 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-download-file: + +#################################### +Downloading a File from an S3 Bucket +#################################### + +.. meta:: + :description: Use the AWS SDK for Python (aka Boto) to download a file from an S3 bucket. + :keywords: download file, s3, bucket + +This example shows how to download a file from an S3 bucket, using :py:meth:`S3.Bucket.download_file`. + +Prerequisites +============= + +To set up and run this example, you must first: + +* Configure your AWS credentials, as described in :doc:`quickstart`. +* Create an S3 bucket and upload a file to the bucket. +* Replace the ``BUCKET_NAME`` and ``KEY`` values in the code snippet with the name of your bucket and the key for the uploaded file. + +Downloading a File +================== + +The example below tries to download an S3 object to a file. If the service returns a 404 error, it prints an error message indicating that the object doesn't exist. + +.. code-block:: python + + import boto3 + import botocore + + BUCKET_NAME = 'my-bucket' # replace with your bucket name + KEY = 'my_image_in_s3.jpg' # replace with your object key + + s3 = boto3.resource('s3') + + try: + s3.Bucket(BUCKET_NAME).download_file(KEY, 'my_local_image.jpg') + except botocore.exceptions.ClientError as e: + if e.response['Error']['Code'] == "404": + print("The object does not exist.") + else: + raise + +More Info +========= + +* :py:meth:`S3.Bucket.download_file` +* :ref:`s3_guide` diff --git a/docs/source/guide/s3-example-static-web-host.rst b/docs/source/guide/s3-example-static-web-host.rst new file mode 100644 index 0000000..1377bf4 --- /dev/null +++ b/docs/source/guide/s3-example-static-web-host.rst @@ -0,0 +1,116 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-static-web-host: + +############################################## +Using an Amazon S3 Bucket as a Static Web Host +############################################## + +This Python example shows you how to set up an Amazon S3 bucket as a static web host. +The Scenario + +In this example, Python code is used to configure any of your buckets to act as a static web host. +The code uses the AWS SDK for Python to configure a selected Amazon S3 bucket using these methods +of the Amazon S3 client class: + +* `get_bucket_website `_ + +* `put_bucket_website `_ + +* `delete_bucket_website `_ + +For more information about using an Amazon S3 bucket as a static web host, see +`Hosting a Static Website on Amazon S3 `_ +in the *Amazon Simple Storage Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Get the Current Bucket Website Configuration +============================================= + +The example below shows how to: + +* Get the bucket website configuration using + `get_bucket_website `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call to S3 to retrieve the policy for the given bucket + result = s3.get_bucket_website(Bucket='my-bucket') + +Set a Bucket Website Configuration +================================== + +The example below shows how to: + +* Set a bucket website configuration using + `put_bucket_website `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Create the configuration for the website + website_configuration = { + 'ErrorDocument': {'Key': 'error.html'}, + 'IndexDocument': {'Suffix': 'index.html'}, + } + + # Set the new policy on the selected bucket + s3.put_bucket_website( + Bucket='my-bucket', + WebsiteConfiguration=website_configuration + ) + + +Delete a Bucket Website Configuration +===================================== + +The example below shows how to: + +* Delete a bucket website configuration using + `delete_bucket_website `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create an S3 client + s3 = boto3.client('s3') + + # Call S3 to delete the website policy for the given bucket + s3.delete_bucket_website(Bucket='my-bucket') + + \ No newline at end of file diff --git a/docs/source/guide/s3-examples.rst b/docs/source/guide/s3-examples.rst new file mode 100644 index 0000000..5ce9305 --- /dev/null +++ b/docs/source/guide/s3-examples.rst @@ -0,0 +1,41 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-s3-examples: + +################## +Amazon S3 Examples +################## + +.. meta:: + :description: + :keywords: AWS S3 code examples for Boto3 + +Amazon Simple Storage Service (Amazon S3) is a web service that provides highly scalable cloud storage. +Amazon S3 provides easy to use object storage, with a simple web service interface to store and get +any amount of data from anywhere on the web. + +The Python API for Amazon S3 is exposed through the AWS.S3 client class. For more information about +Amazon S3, see the `Amazon S3 documentation `_. + +You can use the following examples to access Amazon Simple Storage Service (Amazon S3) using +AWS Python SDK. For more information about Amazon S3, see the `Amazon S3 documentation `_. + +**Examples** + +.. toctree:: + :maxdepth: 1 + + s3-example-creating-buckets + s3-example-download-file + s3-example-configuring-buckets + s3-example-access-permissions + s3-example-bucket-policies + s3-example-static-web-host diff --git a/docs/source/guide/s3.rst b/docs/source/guide/s3.rst index dff75ef..f19592d 100644 --- a/docs/source/guide/s3.rst +++ b/docs/source/guide/s3.rst @@ -19,7 +19,7 @@ decision of what style to use for you, but there are some cases where you may want to set it yourself. For instance, if you have a CORS configured bucket that is only a few hours old, you may need to use path style addressing for generating pre-signed POSTs and URLs until the necessary DNS changes have time -to propagagte. +to propagate. Note: if you set the addressing style to path style, you HAVE to set the correct region. @@ -61,6 +61,7 @@ S3. Functionality includes: * Multipart transfer thresholds * Multipart transfer part sizes * Number of download retry attempts + * Enabling/disabling the use of threads Uploads @@ -108,25 +109,37 @@ from, **not** text:: s3.upload_fileobj(f, "bucket-name", "key-name") -To upload a file using any extra parameters such as user metadata, use the -``ExtraArgs`` parameter:: +When uploading, ``ExtraArgs`` can be used to specify a variety of +additional parameters. For example, to supply user metadata:: - - import boto3 - - # Get the service client - s3 = boto3.client('s3') - - # Upload tmp.txt to bucket-name at key-name s3.upload_file( "tmp.txt", "bucket-name", "key-name", ExtraArgs={"Metadata": {"mykey": "myvalue"}} ) +To set a canned ACL:: + + s3.upload_file( + 'tmp.txt', 'bucket-name', 'key-name', + ExtraArgs={'ACL': 'public-read'} + ) + + +To set custom or multiple ACLs:: + + s3.upload_file( + 'tmp.txt', 'bucket-name', 'key-name', + ExtraArgs={ + 'GrantRead': 'uri="http://acs.amazonaws.com/groups/global/AllUsers"', + 'GrantFullControl': 'id="79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be"', + } + ) + + All valid ``ExtraArgs`` are listed at :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS` -To track the progess of a transfer, a progress callback can be provided such +To track the progress of a transfer, a progress callback can be provided such that the callback gets invoked each time progress is made on the transfer:: import os @@ -227,7 +240,7 @@ To download using any extra parameters such as version ids, use the All valid ``ExtraArgs`` are listed at :py:attr:`boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS` -To track the progess of a transfer, a progress callback can be provided such +To track the progress of a transfer, a progress callback can be provided such that the callback gets invoked each time progress is made on the transfer:: import sys @@ -340,7 +353,7 @@ existing object, use the ``ExtraArgs`` parameter:: ) -To track the progess of a transfer, a progress callback can be provided such +To track the progress of a transfer, a progress callback can be provided such that the callback gets invoked each time progress is made on the transfer:: import sys @@ -376,7 +389,7 @@ that the callback gets invoked each time progress is made on the transfer:: Callback=ProgressPercentage("otherbucket/otherkey")) -Note that the grainularity of these callbacks will be much larger than the +Note that the granularity of these callbacks will be much larger than the upload and download methods because copies are all done server side and so there is no local file to track the streaming of data. @@ -437,6 +450,26 @@ amount of concurrent S3 transfer-related API requests:: s3.download_file("bucket-name", "key-name", "tmp.txt", Config=config) +Threads are used by default in the managed transfer methods. To ensure no +threads are used in the transfer process, set ``use_threads`` to +``False``. Note that in setting ``use_threads`` to ``False``, the value for +``max_concurrency`` is ignored as the main thread will only ever be used:: + + + import boto3 + from boto3.s3.transfer import TransferConfig + + # Get the service client + s3 = boto3.client('s3') + + # Ensure that no threads are used. + config = TransferConfig(use_threads=False) + + # Download object at bucket-name with key-name to tmp.txt with the + # set configuration + s3.download_file("bucket-name", "key-name", "tmp.txt", Config=config) + + Generating Presigned URLs ------------------------- diff --git a/docs/source/guide/sqs-example-dead-letter-queue.rst b/docs/source/guide/sqs-example-dead-letter-queue.rst new file mode 100644 index 0000000..fef4970 --- /dev/null +++ b/docs/source/guide/sqs-example-dead-letter-queue.rst @@ -0,0 +1,90 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-dead-letter-queue: + +###################################### +Using Dead Letter Queues in Amazon SQS +###################################### + +This Python example shows you how to use a queue to receive and hold messages from other queues that +the queues can't process. + +The Scenario +============ + +A dead letter queue is one that other (source) queues can target for messages that can't be processed +successfully. You can set aside and isolate these messages in the dead letter queue to determine why +their processing did not succeed. You must individually configure each source queue that sends messages +to a dead letter queue. Multiple queues can target a single dead letter queue. + +In this example, Python code is used to route messages to a dead letter queue. The code uses the +SDK for Python to use dead letter queues using this method of the AWS.SQS client class: + +* `set_queue_attributes `_. + +For more information about Amazon SQS dead letter queues, see +`Using Amazon SQS Dead Letter Queues `_ +in the *Amazon Simple Queue Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete these tasks: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create an Amazon SQS queue to serve as a dead letter queue. For an example of creating a queue, see + `Using Queues `_ in *Amazon SQS*. + +Configure Source Queues +======================= + +After you create a queue to act as a dead letter queue, you must configure the other queues that route +unprocessed messages to the dead letter queue. To do this, specify a redrive policy that identifies +the queue to use as a dead letter queue and the maximum number of receives by individual messages +before they are routed to the dead letter queue. + +The example below shows how to: + +* Configure a source queue using + `set_queue_attributes `_. + + +Example +------- + +.. code-block:: python + + import json + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SOURCE_QUEUE_URL' + dead_letter_queue_arn = 'DEAD_LETTER_QUEUE_ARN' + + redrive_policy = { + 'deadLetterTargetArn': dead_letter_queue_arn, + 'maxReceiveCount': '10' + } + + + # Configure queue to send messages to dead letter queue + sqs.set_queue_attributes( + QueueUrl=queue_url, + Attributes={ + 'RedrivePolicy': json.dumps(redrive_policy) + } + ) diff --git a/docs/source/guide/sqs-example-long-polling.rst b/docs/source/guide/sqs-example-long-polling.rst new file mode 100644 index 0000000..e17d54e --- /dev/null +++ b/docs/source/guide/sqs-example-long-polling.rst @@ -0,0 +1,151 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-long-polling: + +################################### +Enabling Long Polling in Amazon SQS +################################### + +This Python example shows you how to enable long polling in Amazon SQS in one of these ways: + +* For a newly created queue + +* For an existing queue + +* Upon receipt of a message + +The Scenario +============ + +Long polling reduces the number of empty responses by allowing Amazon SQS to wait a specified time +for a message to become available in the queue before sending a response. Also, long polling eliminates +false empty responses by querying all of the servers instead of a sampling of servers. To enable long +polling, you must specify a non-zero wait time for received messages. You can do this by setting the +:code:`ReceiveMessageWaitTimeSeconds` parameter of a queue or by setting the :code:`WaitTimeSeconds` +parameter on a message when it is received. + +In this example, Python code is used to enable long polling. The code uses the AWS SDK for Python to +enable long polling using these methods of the AWS.SQS client class: + +* `create_queue `_ + +* `set_queue_attributes `_. + +* `receive_message `_. + +For more information about Amazon SQS long polling, see +`Long Polling `_ +in the *Amazon Simple Queue Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete these tasks: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +Enable Long Polling When Creating a Queue +========================================= + +The example below shows how to: + +* Create a queue and enable long polling using + `create_queue `_. + + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + # Create a SQS queue with long polling enabled + response = sqs.create_queue( + QueueName='SQS_QUEUE_NAME', + Attributes={'ReceiveMessageWaitTimeSeconds': '20'} + ) + + print(response['QueueUrl']) + + +Enable Long Polling on an Existing Queue +======================================== + +The example below shows how to: + +* Enable long polling on an existing queue using + `set_queue_attributes `_. + + +Example +------- + +.. code:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SQS_QUEUE_URL' + + # Enable long polling on an existing SQS queue + sqs.set_queue_attributes( + QueueUrl=queue_url, + Attributes={'ReceiveMessageWaitTimeSeconds': '20'} + ) + +Enable Long Polling on Message Receipt +====================================== + +Get one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds +parameter enables long-poll support. For more information, see +`Amazon SQS Long Polling `_ +in the *Amazon SQS Developer Guide*. + +The example below shows how to: + +* Enable a long poll for message on provided SQS queue using + `receive_message `_. + + +Example +------- + +.. code-block:: python/example_code + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SQS_QUEUE_URL' + + # Long poll for message on provided SQS queue + response = sqs.receive_message( + QueueUrl=queue_url, + AttributeNames=[ + 'SentTimestamp' + ], + MaxNumberOfMessages=1, + MessageAttributeNames=[ + 'All' + ], + WaitTimeSeconds=20 + ) + + print(response) diff --git a/docs/source/guide/sqs-example-sending-receiving-msgs.rst b/docs/source/guide/sqs-example-sending-receiving-msgs.rst new file mode 100644 index 0000000..48fb410 --- /dev/null +++ b/docs/source/guide/sqs-example-sending-receiving-msgs.rst @@ -0,0 +1,141 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-messages: + +############################################ +Sending and Receiving Messages in Amazon SQS +############################################ + +This Python example shows you how to send, receive, and delete messages in a queue. + +The Scenario +============ + +In this example, Python code is used to send and receive messages. The code uses the AWS SDK for Python +to send and receive messages by using these methods of the AWS.SQS client class: + +* `send_message `_. + +* `receive_message `_. + +* `delete_message `_. + +For more information about Amazon SQS messages, see +`Sending a Message to an Amazon SQS Queue `_ +and `Receiving and Deleting a Message from an Amazon SQS Queue `_ +in the *Amazon Simple Queue Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete these tasks: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create an Amazon SQS queue. For an example of creating a queue, see + `Using Queues in Amazon SQS `_. + +Send a Message to a Queue +========================= + +The example below shows how to: + +* Send a message to a queue using + `send_message `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SQS_QUEUE_URL' + + # Send message to SQS queue + response = sqs.send_message( + QueueUrl=queue_url, + DelaySeconds=10, + MessageAttributes={ + 'Title': { + 'DataType': 'String', + 'StringValue': 'The Whistler' + }, + 'Author': { + 'DataType': 'String', + 'StringValue': 'John Grisham' + }, + 'WeeksOn': { + 'DataType': 'Number', + 'StringValue': '6' + } + }, + MessageBody=( + 'Information about current NY Times fiction bestseller for ' + 'week of 12/11/2016.' + ) + ) + + print(response['MessageId']) + + +Receive and Delete Messages from a Queue +======================================== + +The example below shows how to: + +* Receive a message from a queue using + `receive_message `_. + +* Delete a message from a queue using + `delete_message `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SQS_QUEUE_URL' + + # Receive message from SQS queue + response = sqs.receive_message( + QueueUrl=queue_url, + AttributeNames=[ + 'SentTimestamp' + ], + MaxNumberOfMessages=1, + MessageAttributeNames=[ + 'All' + ], + VisibilityTimeout=0, + WaitTimeSeconds=0 + ) + + message = response['Messages'][0] + receipt_handle = message['ReceiptHandle'] + + # Delete received message from queue + sqs.delete_message( + QueueUrl=queue_url, + ReceiptHandle=receipt_handle + ) + print('Received and deleted message: %s' % message) + diff --git a/docs/source/guide/sqs-example-using-queues.rst b/docs/source/guide/sqs-example-using-queues.rst new file mode 100644 index 0000000..ae4dc9a --- /dev/null +++ b/docs/source/guide/sqs-example-using-queues.rst @@ -0,0 +1,149 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-using-queues: + +########################## +Using Queues in Amazon SQS +########################## + +This Python example shows you how to: + +* Get a list of all of your message queues + +* Obtain the URL for a particular queue + +* Create and delete queues + +The Scenario +============ + +In this example, Python code is used to work with queues. The code uses the AWS SDK for Python to use +queues using these methods of the AWS.SQS client class: + +* `list_queues `_. + +* `create_queue `_. + +* `get_queue_url `_. + +* `delete_queue `_. + +For more information about Amazon SQS messages, see +`How Queues Work `_ +in the *Amazon Simple Queue Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete this task: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +List Your Queues +================ + +The example below shows how to: + +* List queues using + `list_queues `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + # List SQS queues + response = sqs.list_queues() + + print(response['QueueUrls']) + +Create a Queue +============== + +The example below shows how to: + +* Create a queue using + `create_queue `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + # Create a SQS queue + response = sqs.create_queue( + QueueName='SQS_QUEUE_NAME', + Attributes={ + 'DelaySeconds': '60', + 'MessageRetentionPeriod': '86400' + } + ) + + print(response['QueueUrl']) + +Get the URL for a Queue +======================= + +The example below shows how to: + +* Get the URL for a queue using + `get_queue_url `_. + +Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + # Get URL for SQS queue + response = sqs.get_queue_url(QueueName='SQS_QUEUE_NAME') + + print(response['QueueUrl']) + +Delete a Queue +============== + +The example below shows how to: + +* Delete a queue using + `delete_queue `_. + +Example +------- + + .. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + # Delete SQS queue + sqs.delete_queue(QueueUrl='SQS_QUEUE_URL') + + + \ No newline at end of file diff --git a/docs/source/guide/sqs-example-visibility-timeout.rst b/docs/source/guide/sqs-example-visibility-timeout.rst new file mode 100644 index 0000000..4049fcf --- /dev/null +++ b/docs/source/guide/sqs-example-visibility-timeout.rst @@ -0,0 +1,88 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-visibility-timeout: + +######################################### +Managing Visibility Timeout in Amazon SQS +######################################### + +This Python example shows you how to specify the time interval during which messages received by a +queue are not visible. + +The Scenario +============ + +In this example, Python code is used to manage visibility timeout. The code uses the SDK for Python +to manage visibility timeout by using this method of the AWS.SQS client class: + +* `set_queue_attributes `_. + +For more information about Amazon SQS visibility timeout, see +`Visibility Timeout `_ +in the *Amazon Simple Queue Service Developer Guide*. + +All the example code for the Amazon Web Services (AWS) SDK for Python is available `here on GitHub `_. + +Prerequisite Tasks +================== + +To set up and run this example, you must first complete these tasks: + +* Configure your AWS credentials, as described in :doc:`quickstart`. + +* Create an Amazon SQS queue. For an example of creating a queue, see + `Using Queues in Amazon SQS `_. + +* Send a message to the queue. For an example of sending a message to a queue, see + `Sending and Receiving Messages in Amazon SQS `_. + +Change the Visibility Timeout +============================= + +The example below shows how to: + +* Change the visibility timeout using + `set_queue_attributes `_. + + Example +------- + +.. code-block:: python + + import boto3 + + # Create SQS client + sqs = boto3.client('sqs') + + queue_url = 'SQS_QUEUE_URL' + + # Receive message from SQS queue + response = sqs.receive_message( + QueueUrl=queue_url, + AttributeNames=[ + 'SentTimestamp' + ], + MaxNumberOfMessages=1, + MessageAttributeNames=[ + 'All' + ], + ) + + message = response['Messages'][0] + receipt_handle = message['ReceiptHandle'] + + # Change visibility timeout of message from queue + sqs.change_message_visibility( + QueueUrl=queue_url, + ReceiptHandle=receipt_handle, + VisibilityTimeout=36000 + ) + print('Received and changed visibility timeout of message: %s' % message) diff --git a/docs/source/guide/sqs-examples.rst b/docs/source/guide/sqs-examples.rst new file mode 100644 index 0000000..de45fea --- /dev/null +++ b/docs/source/guide/sqs-examples.rst @@ -0,0 +1,36 @@ +.. Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 + International License (the "License"). You may not use this file except in compliance with the + License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/. + + This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied. See the License for the specific language governing permissions and + limitations under the License. + +.. _aws-boto3-sqs-examples: + +################### +Amazon SQS Examples +################### + +.. meta:: + :description: + :keywords: AWS IAM SQS code examples for Boto3 + +You can use the following examples to access Amazon Simple Queue Service (Amazon SQS) using +AWS Boto. For more information about Amazon SQS, see the `Amazon SQS documentation +`_. + +**Examples** + +.. toctree:: + :maxdepth: 1 + + sqs-example-using-queues + sqs-example-sending-receiving-msgs + sqs-example-visibility-timeout + sqs-example-long-polling + sqs-example-dead-letter-queue + + diff --git a/docs/source/guide/upgrading.rst b/docs/source/guide/upgrading.rst index aa82e10..05e543d 100644 --- a/docs/source/guide/upgrading.rst +++ b/docs/source/guide/upgrading.rst @@ -4,6 +4,17 @@ Upgrading Notes Notes to refer to when upgrading ``boto3`` versions. + +1.4.2 +===== + +* The ``use_threads`` option was added to + :py:class:`boto3.s3.transfer.TransferConfig`. + Starting in version ``1.4.0``, all managed S3 transfer methods became + threaded instead of possibly being threaded. If it is not desired to use + threads for managed S3 transfers, set ``use_threads`` to ``False``. + + 1.4.0 ===== @@ -27,3 +38,11 @@ Notes to refer to when upgrading ``boto3`` versions. objects for transfers, use the newly added ``upload_fileobj`` and ``download_fileobj`` methods that support both nonmultipart and multipart transfers. + + * By default, all managed transfer methods are now threaded. In prior + versions, threads were only created if a non multipart upload or download + was initiated. To run the managed transfer methods with no threads + (i.e. all of the transfer logic happens in the main thread), set + ``use_threads`` to ``False`` when providing a ``TransferConfig`` object. + The ``use_threads`` option is only available in ``boto3`` versions higher + than ``1.4.1``. diff --git a/docs/source/index.rst b/docs/source/index.rst index b6606dc..d66a351 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -19,6 +19,7 @@ Quickstart guide/quickstart guide/sqs + guide/examples User Guide ---------- diff --git a/docs/source/reference/customizations/s3.rst b/docs/source/reference/customizations/s3.rst index a5578e6..3778c85 100644 --- a/docs/source/reference/customizations/s3.rst +++ b/docs/source/reference/customizations/s3.rst @@ -13,7 +13,16 @@ S3 Transfers exposed to breaking changes. If a class from the ``boto3.s3.transfer`` module is not documented below, it is considered internal and users should be very cautious in directly using them because breaking changes may - be introduced from version to version of the library. + be introduced from version to version of the library. It is recommended to + use the variants of the transfer functions injected into the S3 client + instead. + + .. seealso:: + :py:meth:`S3.Client.upload_file` + :py:meth:`S3.Client.upload_fileobj` + :py:meth:`S3.Client.download_file` + :py:meth:`S3.Client.download_fileobj` + .. autoclass:: boto3.s3.transfer.TransferConfig diff --git a/requirements.txt b/requirements.txt index 2462b6a..d93a192 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ nose==1.3.3 mock==1.3.0 wheel==0.24.0 +unittest2==0.5.1; python_version == '2.6' diff --git a/requirements26.txt b/requirements26.txt deleted file mode 100644 index 9696b3b..0000000 --- a/requirements26.txt +++ /dev/null @@ -1 +0,0 @@ -unittest2==0.5.1 diff --git a/scripts/ci/install b/scripts/ci/install index 62846cb..b897cd2 100755 --- a/scripts/ci/install +++ b/scripts/ci/install @@ -13,16 +13,6 @@ os.chdir(REPO_ROOT) def run(command): return check_call(command, shell=True) - -try: - # Has the form "major.minor" - python_version = os.environ['PYTHON_VERSION'] -except KeyError: - python_version = '.'.join([str(i) for i in sys.version_info[:2]]) - -if python_version == '2.6': - run('pip install -r requirements26.txt') - run('pip install -r requirements.txt') run('pip install coverage') if os.path.isdir('dist') and os.listdir('dist'): diff --git a/scripts/ci/run-tests b/scripts/ci/run-tests index ef09340..d7008a4 100755 --- a/scripts/ci/run-tests +++ b/scripts/ci/run-tests @@ -4,6 +4,7 @@ # binary package not from the CWD. import os +import sys from subprocess import check_call _dname = os.path.dirname @@ -11,10 +12,10 @@ _dname = os.path.dirname REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__)))) os.chdir(os.path.join(REPO_ROOT, 'tests')) +args = sys.argv[1:] +if not args: + args = ['unit/', 'functional/'] -def run(command): - return check_call(command, shell=True) - - -run('nosetests --with-coverage --cover-erase --cover-package boto3 ' - '--with-xunit --cover-xml -v unit/ functional/') +check_call(['nosetests', '--with-coverage', '--cover-erase', + '--cover-package', 'boto3', '--with-xunit', '--cover-xml', + '-v'] + args) diff --git a/scripts/new-change b/scripts/new-change index 6d56220..59109fc 100755 --- a/scripts/new-change +++ b/scripts/new-change @@ -53,7 +53,12 @@ CHANGES_DIR = os.path.join( '.changes' ) TEMPLATE = """\ -# Type should be one of: feature, bugfix +# Type should be one of: feature, bugfix, enhancement, api-change +# feature: A larger feature or change in behavior, usually resulting in a +# minor version bump. +# bugfix: Fixing a bug in an existing code path. +# enhancment: Small change to an underlying implementation detail. +# api-change: Changes to a modeled API. type: {change_type} # Category is the high level feature area. @@ -194,7 +199,8 @@ def parse_filled_in_contents(contents): def main(): parser = argparse.ArgumentParser() parser.add_argument('-t', '--type', dest='change_type', - default='', choices=('bugfix', 'feature')) + default='', choices=('bugfix', 'feature', + 'enhancement', 'api-change')) parser.add_argument('-c', '--category', dest='category', default='') parser.add_argument('-d', '--description', dest='description', diff --git a/setup.cfg b/setup.cfg index cc55d0f..7a81559 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ -[wheel] +[bdist_wheel] universal = 1 [metadata] requires-dist = - botocore>=1.4.1,<1.5.0 - jmespath>=0.7.1,<1.0.0 - s3transfer>=0.1.0,<0.2.0 + botocore>=1.10.55,<1.11.0 + jmespath>=0.7.1,<1.0.0 + s3transfer>=0.1.10,<0.2.0 diff --git a/setup.py b/setup.py index 53f18c9..93e582f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ distutils/setuptools install script. """ import os import re -import sys from setuptools import setup, find_packages @@ -15,9 +14,9 @@ VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''') requires = [ - 'botocore>=1.4.1,<1.5.0', + 'botocore>=1.10.55,<1.11.0', 'jmespath>=0.7.1,<1.0.0', - 's3transfer>=0.1.0,<0.2.0' + 's3transfer>=0.1.10,<0.2.0' ] @@ -56,5 +55,6 @@ setup( 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ], ) diff --git a/tests/functional/docs/test_s3.py b/tests/functional/docs/test_s3.py index 2208f10..5e7ec9a 100644 --- a/tests/functional/docs/test_s3.py +++ b/tests/functional/docs/test_s3.py @@ -26,8 +26,8 @@ class TestS3Customizations(BaseDocsFunctionalTests): def test_file_transfer_methods_are_documented(self): self.assert_contains_lines_in_order([ '.. py:class:: S3.Client', - ' * :py:meth:`download_file`', - ' * :py:meth:`upload_file`', + ' * :py:meth:`~S3.Client.download_file`', + ' * :py:meth:`~S3.Client.upload_file`', ' .. py:method:: download_file(', ' .. py:method:: upload_file('], self.generated_contents diff --git a/tests/functional/docs/test_smoke.py b/tests/functional/docs/test_smoke.py index 386fcf4..da49bd4 100644 --- a/tests/functional/docs/test_smoke.py +++ b/tests/functional/docs/test_smoke.py @@ -78,17 +78,18 @@ def _assert_has_title(generated_docs, client): def _assert_has_client_documentation(generated_docs, service_name, client): + class_name = client.__class__.__name__ ref_lines = [ '======', 'Client', '======', - '.. py:class:: %s.Client' % client.__class__.__name__, + '.. py:class:: %s.Client' % class_name, ' A low-level client representing', ' import boto3', ' client = boto3.client(\'%s\')' % service_name, ' These are the available methods:', - ' * :py:meth:`get_paginator`', - ' * :py:meth:`get_waiter`', + ' * :py:meth:`~%s.Client.get_paginator`' % class_name, + ' * :py:meth:`~%s.Client.get_waiter`' % class_name, ' .. py:method:: get_paginator(operation_name)', ' .. py:method:: get_waiter(waiter_name)', ] diff --git a/tests/functional/dynamodb/test_table.py b/tests/functional/dynamodb/test_table.py index 974072f..9311a60 100644 --- a/tests/functional/dynamodb/test_table.py +++ b/tests/functional/dynamodb/test_table.py @@ -13,6 +13,7 @@ from tests import unittest, mock import boto3 +from botocore.stub import Stubber class TestTableResourceCustomizations(unittest.TestCase): @@ -25,3 +26,17 @@ class TestTableResourceCustomizations(unittest.TestCase): def test_resource_has_batch_writer_added(self): table = self.resource.Table('mytable') self.assertTrue(hasattr(table, 'batch_writer')) + + def test_operation_without_output(self): + table = self.resource.Table('mytable') + stubber = Stubber(table.meta.client) + stubber.add_response('tag_resource', {}) + arn = 'arn:aws:dynamodb:us-west-2:123456789:table/mytable' + + with stubber: + table.meta.client.tag_resource( + ResourceArn=arn, + Tags=[{'Key': 'project', 'Value': 'val'}] + ) + + stubber.assert_no_pending_responses() diff --git a/tests/functional/test_ec2.py b/tests/functional/test_ec2.py index 35ca290..0187dc6 100644 --- a/tests/functional/test_ec2.py +++ b/tests/functional/test_ec2.py @@ -34,3 +34,35 @@ class TestInstanceDeleteTags(unittest.TestCase): stubber.assert_no_pending_responses() self.assertEqual(response, {}) stubber.deactivate() + + def test_mutating_filters(self): + stubber = Stubber(self.service_resource.meta.client) + instance_filters = [ + {'Name': 'instance-state-name', 'Values': ['running']} + ] + running_instances = self.service_resource.instances.filter( + Filters=instance_filters + ) + + # This should not impact the already-created filter. + instance_filters.append( + {'Name': 'instance-type', 'Values': ['c4.large']} + ) + + stubber.add_response( + method='describe_instances', + service_response={ + 'Reservations': [] + }, + expected_params={ + 'Filters': [{ + 'Name': 'instance-state-name', + 'Values': ['running'] + }] + } + ) + + with stubber: + list(running_instances) + + stubber.assert_no_pending_responses() diff --git a/tests/functional/test_s3.py b/tests/functional/test_s3.py index 733a6bf..f395814 100644 --- a/tests/functional/test_s3.py +++ b/tests/functional/test_s3.py @@ -12,7 +12,9 @@ # language governing permissions and limitations under the License. from tests import unittest +import botocore import botocore.stub +from botocore.config import Config from botocore.stub import Stubber from botocore.compat import six @@ -531,3 +533,16 @@ class TestS3ObjectSummary(unittest.TestCase): # Even though an HeadObject was used to load this, it should # only expose the attributes from its shape defined in ListObjects. self.assertFalse(hasattr(self.obj_summary, 'content_length')) + + +class TestServiceResource(unittest.TestCase): + def setUp(self): + self.session = boto3.session.Session() + + def test_unsigned_signature_version_is_not_corrupted(self): + config = Config(signature_version=botocore.UNSIGNED) + resource = self.session.resource('s3', config=config) + self.assertIs( + resource.meta.client.meta.config.signature_version, + botocore.UNSIGNED + ) diff --git a/tests/integration/test_dynamodb.py b/tests/integration/test_dynamodb.py index dca2922..ebbe4b7 100644 --- a/tests/integration/test_dynamodb.py +++ b/tests/integration/test_dynamodb.py @@ -73,119 +73,132 @@ class TestDynamoDBConditions(BaseDynamoDBTest): cls.table.delete_item(Key={'MyHashKey': 'mykey'}) super(TestDynamoDBConditions, cls).tearDownClass() + def scan(self, filter_expression): + return self.table.scan(FilterExpression=filter_expression, + ConsistentRead=True) + + def query(self, key_condition_expression, filter_expression=None): + kwargs = { + 'KeyConditionExpression': key_condition_expression, + 'ConsistentRead': True + } + if filter_expression is not None: + kwargs['FilterExpression'] = filter_expression + return self.table.query(**kwargs) + def test_filter_expression(self): - r = self.table.scan( - FilterExpression=Attr('MyHashKey').eq('mykey')) + r = self.scan( + filter_expression=Attr('MyHashKey').eq('mykey')) self.assertEqual(r['Items'][0]['MyHashKey'], 'mykey') def test_key_condition_expression(self): - r = self.table.query( - KeyConditionExpression=Key('MyHashKey').eq('mykey')) + r = self.query( + key_condition_expression=Key('MyHashKey').eq('mykey')) self.assertEqual(r['Items'][0]['MyHashKey'], 'mykey') def test_key_condition_with_filter_condition_expression(self): - r = self.table.query( - KeyConditionExpression=Key('MyHashKey').eq('mykey'), - FilterExpression=Attr('MyString').eq('mystring')) + r = self.query( + key_condition_expression=Key('MyHashKey').eq('mykey'), + filter_expression=Attr('MyString').eq('mystring')) self.assertEqual(r['Items'][0]['MyString'], 'mystring') def test_condition_less_than(self): - r = self.table.scan( - FilterExpression=Attr('MyNumber').lt(Decimal('1.26'))) + r = self.scan( + filter_expression=Attr('MyNumber').lt(Decimal('1.26'))) self.assertTrue(r['Items'][0]['MyNumber'] < Decimal('1.26')) def test_condition_less_than_equal(self): - r = self.table.scan( - FilterExpression=Attr('MyNumber').lte(Decimal('1.26'))) + r = self.scan( + filter_expression=Attr('MyNumber').lte(Decimal('1.26'))) self.assertTrue(r['Items'][0]['MyNumber'] <= Decimal('1.26')) def test_condition_greater_than(self): - r = self.table.scan( - FilterExpression=Attr('MyNumber').gt(Decimal('1.24'))) + r = self.scan( + filter_expression=Attr('MyNumber').gt(Decimal('1.24'))) self.assertTrue(r['Items'][0]['MyNumber'] > Decimal('1.24')) def test_condition_greater_than_equal(self): - r = self.table.scan( - FilterExpression=Attr('MyNumber').gte(Decimal('1.24'))) + r = self.scan( + filter_expression=Attr('MyNumber').gte(Decimal('1.24'))) self.assertTrue(r['Items'][0]['MyNumber'] >= Decimal('1.24')) def test_condition_begins_with(self): - r = self.table.scan( - FilterExpression=Attr('MyString').begins_with('my')) + r = self.scan( + filter_expression=Attr('MyString').begins_with('my')) self.assertTrue(r['Items'][0]['MyString'].startswith('my')) def test_condition_between(self): - r = self.table.scan( - FilterExpression=Attr('MyNumber').between( + r = self.scan( + filter_expression=Attr('MyNumber').between( Decimal('1.24'), Decimal('1.26'))) self.assertTrue(r['Items'][0]['MyNumber'] > Decimal('1.24')) self.assertTrue(r['Items'][0]['MyNumber'] < Decimal('1.26')) def test_condition_not_equal(self): - r = self.table.scan( - FilterExpression=Attr('MyHashKey').ne('notmykey')) + r = self.scan( + filter_expression=Attr('MyHashKey').ne('notmykey')) self.assertNotEqual(r['Items'][0]['MyHashKey'], 'notmykey') def test_condition_in(self): - r = self.table.scan( - FilterExpression=Attr('MyHashKey').is_in(['notmykey', 'mykey'])) + r = self.scan( + filter_expression=Attr('MyHashKey').is_in(['notmykey', 'mykey'])) self.assertIn(r['Items'][0]['MyHashKey'], ['notmykey', 'mykey']) def test_condition_exists(self): - r = self.table.scan( - FilterExpression=Attr('MyString').exists()) + r = self.scan( + filter_expression=Attr('MyString').exists()) self.assertIn('MyString', r['Items'][0]) def test_condition_not_exists(self): - r = self.table.scan( - FilterExpression=Attr('MyFakeKey').not_exists()) + r = self.scan( + filter_expression=Attr('MyFakeKey').not_exists()) self.assertNotIn('MyFakeKey', r['Items'][0]) def test_condition_contains(self): - r = self.table.scan( - FilterExpression=Attr('MyString').contains('my')) + r = self.scan( + filter_expression=Attr('MyString').contains('my')) self.assertIn('my', r['Items'][0]['MyString']) def test_condition_size(self): - r = self.table.scan( - FilterExpression=Attr('MyString').size().eq(len('mystring'))) + r = self.scan( + filter_expression=Attr('MyString').size().eq(len('mystring'))) self.assertEqual(len(r['Items'][0]['MyString']), len('mystring')) def test_condition_attribute_type(self): - r = self.table.scan( - FilterExpression=Attr('MyMap').attribute_type('M')) + r = self.scan( + filter_expression=Attr('MyMap').attribute_type('M')) self.assertIsInstance(r['Items'][0]['MyMap'], collections.Mapping) def test_condition_and(self): - r = self.table.scan( - FilterExpression=(Attr('MyHashKey').eq('mykey') & - Attr('MyString').eq('mystring'))) + r = self.scan( + filter_expression=(Attr('MyHashKey').eq('mykey') & + Attr('MyString').eq('mystring'))) item = r['Items'][0] self.assertTrue( item['MyHashKey'] == 'mykey' and item['MyString'] == 'mystring') def test_condition_or(self): - r = self.table.scan( - FilterExpression=(Attr('MyHashKey').eq('mykey2') | - Attr('MyString').eq('mystring'))) + r = self.scan( + filter_expression=(Attr('MyHashKey').eq('mykey2') | + Attr('MyString').eq('mystring'))) item = r['Items'][0] self.assertTrue( item['MyHashKey'] == 'mykey2' or item['MyString'] == 'mystring') def test_condition_not(self): - r = self.table.scan( - FilterExpression=(~Attr('MyHashKey').eq('mykey2'))) + r = self.scan( + filter_expression=(~Attr('MyHashKey').eq('mykey2'))) item = r['Items'][0] self.assertTrue(item['MyHashKey'] != 'mykey2') def test_condition_in_map(self): - r = self.table.scan( - FilterExpression=Attr('MyMap.foo').eq('bar')) + r = self.scan( + filter_expression=Attr('MyMap.foo').eq('bar')) self.assertEqual(r['Items'][0]['MyMap']['foo'], 'bar') def test_condition_in_list(self): - r = self.table.scan( - FilterExpression=Attr('MyList[0]').eq('foo')) + r = self.scan( + filter_expression=Attr('MyList[0]').eq('foo')) self.assertEqual(r['Items'][0]['MyList'][0], 'foo') @@ -201,5 +214,5 @@ class TestDynamodbBatchWrite(BaseDynamoDBTest): batch.put_item(Item=item) # Verify all the items were added to dynamodb. - for obj in self.table.scan()['Items']: + for obj in self.table.scan(ConsistentRead=True)['Items']: self.assertIn(obj, items) diff --git a/tests/integration/test_s3.py b/tests/integration/test_s3.py index b583a61..b4236ae 100644 --- a/tests/integration/test_s3.py +++ b/tests/integration/test_s3.py @@ -307,6 +307,15 @@ class TestS3Transfers(unittest.TestCase): Key=key) return True + def wait_until_object_exists(self, key_name, extra_params=None, + min_successes=3): + waiter = self.client.get_waiter('object_exists') + params = {'Bucket': self.bucket_name, 'Key': key_name} + if extra_params is not None: + params.update(extra_params) + for _ in range(min_successes): + waiter.wait(**params) + def create_s3_transfer(self, config=None): return boto3.s3.transfer.S3Transfer(self.client, config=config) @@ -367,6 +376,7 @@ class TestS3Transfers(unittest.TestCase): Bucket=self.bucket_name, Key='foo', Body=b'beach') self.addCleanup(self.delete_object, 'foo') + self.wait_until_object_exists('foo') self.client.download_fileobj( Bucket=self.bucket_name, Key='foo', Fileobj=fileobj) @@ -516,6 +526,7 @@ class TestS3Transfers(unittest.TestCase): transfer = self.create_s3_transfer() download_path = os.path.join(self.files.rootdir, 'downloaded.txt') + self.wait_until_object_exists('foo.txt', extra_params=extra_args) transfer.download_file(self.bucket_name, 'foo.txt', download_path, extra_args=extra_args) with open(download_path, 'rb') as f: @@ -555,6 +566,7 @@ class TestS3Transfers(unittest.TestCase): self.addCleanup(self.delete_object, 'foo.txt') download_path = os.path.join(self.files.rootdir, 'downloaded.txt') + self.wait_until_object_exists('foo.txt') transfer.download_file(self.bucket_name, 'foo.txt', download_path) assert_files_equal(filename, download_path) @@ -571,6 +583,7 @@ class TestS3Transfers(unittest.TestCase): self.addCleanup(self.delete_object, 'foo.txt') download_path = os.path.join(self.files.rootdir, 'downloaded.txt') + self.wait_until_object_exists('foo.txt') transfer.download_file(self.bucket_name, 'foo.txt', download_path) assert_files_equal(filename, download_path) @@ -583,6 +596,7 @@ class TestS3Transfers(unittest.TestCase): self.addCleanup(self.delete_object, 'foo.txt') download_path = os.path.join(self.files.rootdir, 'a', 'b', 'c', 'downloaded.txt') + self.wait_until_object_exists('foo.txt') with self.assertRaises(IOError): transfer.download_file(self.bucket_name, 'foo.txt', download_path) @@ -598,6 +612,7 @@ class TestS3Transfers(unittest.TestCase): self.addCleanup(self.delete_object, 'foo.txt') download_path = os.path.join(self.files.rootdir, 'a', 'b', 'c', 'downloaded.txt') + self.wait_until_object_exists('foo.txt') with self.assertRaises(IOError): transfer.download_file(self.bucket_name, 'foo.txt', download_path) @@ -613,11 +628,38 @@ class TestS3Transfers(unittest.TestCase): self.addCleanup(self.delete_object, 'foo.txt') download_path = os.path.join(self.files.rootdir, 'downloaded.txt') + self.wait_until_object_exists('foo.txt') self.client.download_file(Bucket=self.bucket_name, Key='foo.txt', Filename=download_path) assert_files_equal(filename, download_path) + def test_transfer_methods_do_not_use_threads(self): + # This is just a smoke test to make sure that + # setting use_threads to False has no issues transferring files as + # the non-threaded implementation is ran under the same integration + # and functional tests in s3transfer as the normal threaded + # implementation + # + # The methods used are arbitrary other than one of the methods + # use ``boto3.s3.transfer.S3Transfer`` and the other should be + # using ``s3transfer.manager.TransferManager`` directly + content = b'my content' + filename = self.files.create_file('myfile', content.decode('utf-8')) + key = 'foo' + config = boto3.s3.transfer.TransferConfig(use_threads=False) + + self.client.upload_file( + Bucket=self.bucket_name, Key=key, Filename=filename, + Config=config) + self.addCleanup(self.delete_object, key) + self.assertTrue(self.object_exists(key)) + + fileobj = six.BytesIO() + self.client.download_fileobj( + Bucket=self.bucket_name, Key='foo', Fileobj=fileobj, Config=config) + self.assertEqual(fileobj.getvalue(), content) + def test_transfer_methods_through_bucket(self): # This is just a sanity check to ensure that the bucket interface work. key = 'bucket.txt' diff --git a/tests/unit/docs/test_client.py b/tests/unit/docs/test_client.py index c2774e8..318fe1f 100644 --- a/tests/unit/docs/test_client.py +++ b/tests/unit/docs/test_client.py @@ -31,10 +31,10 @@ class TestBoto3ClientDocumenter(BaseDocsTest): ' import boto3', ' client = boto3.client(\'myservice\')', ' These are the available methods:', - ' * :py:meth:`can_paginate`', - ' * :py:meth:`get_paginator`', - ' * :py:meth:`get_waiter`', - ' * :py:meth:`sample_operation`', + ' * :py:meth:`~MyService.Client.can_paginate`', + ' * :py:meth:`~MyService.Client.get_paginator`', + ' * :py:meth:`~MyService.Client.get_waiter`', + ' * :py:meth:`~MyService.Client.sample_operation`', ' .. py:method:: can_paginate(operation_name)', ' .. py:method:: get_paginator(operation_name)', ' .. py:method:: get_waiter(waiter_name)', diff --git a/tests/unit/docs/test_service.py b/tests/unit/docs/test_service.py index c5daa55..54e4baf 100644 --- a/tests/unit/docs/test_service.py +++ b/tests/unit/docs/test_service.py @@ -33,7 +33,7 @@ class TestServiceDocumenter(BaseDocsTest): '======', '.. py:class:: MyService.Client', ' These are the available methods:', - ' * :py:meth:`sample_operation`', + ' * :py:meth:`~MyService.Client.sample_operation`', ' **Examples** ', ' Sample Description.', ' ::', diff --git a/tests/unit/dynamodb/test_transform.py b/tests/unit/dynamodb/test_transform.py index 0f689fa..daf4de0 100644 --- a/tests/unit/dynamodb/test_transform.py +++ b/tests/unit/dynamodb/test_transform.py @@ -464,6 +464,33 @@ class TestTransformAttributeValueOutput(BaseTransformAttributeValueTest): ) + def test_no_output(self): + service_model = ServiceModel({ + 'operations': { + 'SampleOperation': { + 'name': 'SampleOperation', + 'input': {'shape': 'SampleOperationInputOutput'}, + } + }, + 'shapes': { + 'SampleOperationInput': { + 'type': 'structure', + 'members': {} + }, + 'String': { + 'type': 'string' + } + } + }) + operation_model = service_model.operation_model('SampleOperation') + + parsed = {} + self.injector.inject_attribute_value_output( + parsed=parsed, model=operation_model) + self.assertEqual(parsed, {}) + + + class TestTransformConditionExpression(BaseTransformationTest): def setUp(self): super(TestTransformConditionExpression, self).setUp() diff --git a/tests/unit/resources/test_factory.py b/tests/unit/resources/test_factory.py index 9855148..2e3e0bd 100644 --- a/tests/unit/resources/test_factory.py +++ b/tests/unit/resources/test_factory.py @@ -672,6 +672,22 @@ class TestResourceFactoryDanglingResource(BaseTestResourceFactory): self.assertIsInstance(q, ServiceResource, 'Dangling resource instance not a ServiceResource') + def test_hash_resource_equal(self): + resource = self.load('test', self.model, self.defs)() + p = resource.Queue('test') + q = resource.Queue('test') + + self.assertEqual(p, q, "Should be equal resource") + self.assertEqual(hash(p), hash(q), "Hash values should be equal") + + def test_hash_resource_not_equal(self): + resource = self.load('test', self.model, self.defs)() + p = resource.Queue('test1') + q = resource.Queue('test2') + + self.assertNotEquals(p, q, "Should not be equal resource") + self.assertNotEquals(hash(p), hash(q), "Hash values should be different") + def test_dangling_resource_create_with_kwarg(self): resource = self.load('test', self.model, self.defs)() q = resource.Queue(url='test') diff --git a/tests/unit/s3/test_inject.py b/tests/unit/s3/test_inject.py index dd2b85d..8677a19 100644 --- a/tests/unit/s3/test_inject.py +++ b/tests/unit/s3/test_inject.py @@ -70,7 +70,7 @@ class TestBucketLoad(unittest.TestCase): self.resource.meta.data, {'Name': self.resource.name, 'CreationDate': 2}) - def test_bucket_load_raise_error(self): + def test_bucket_load_doesnt_find_bucket(self): self.resource.name = 'MyBucket' self.client.list_buckets.return_value = { 'Buckets': [ @@ -78,10 +78,27 @@ class TestBucketLoad(unittest.TestCase): {'Name': 'NotMine2', 'CreationDate': 2}, ], } + inject.bucket_load(self.resource) + self.assertEqual(self.resource.meta.data, {}) + + def test_bucket_load_encounters_access_exception(self): + self.client.list_buckets.side_effect = ClientError( + {'Error': + {'Code': 'AccessDenied', + 'Message': 'Access Denied'}}, + 'ListBuckets') + inject.bucket_load(self.resource) + self.assertEqual(self.resource.meta.data, {}) + + def test_bucket_load_encounters_other_exception(self): + self.client.list_buckets.side_effect = ClientError( + {'Error': + {'Code': 'ExpiredToken', + 'Message': 'The provided token has expired.'}}, + 'ListBuckets') with self.assertRaises(ClientError): inject.bucket_load(self.resource) - class TestBucketTransferMethods(unittest.TestCase): def setUp(self): diff --git a/tests/unit/s3/test_transfer.py b/tests/unit/s3/test_transfer.py index db3963d..9673df0 100644 --- a/tests/unit/s3/test_transfer.py +++ b/tests/unit/s3/test_transfer.py @@ -14,14 +14,41 @@ from tests import unittest import mock from s3transfer.manager import TransferManager +from s3transfer.futures import NonThreadedExecutor from boto3.exceptions import RetriesExceededError from boto3.exceptions import S3UploadFailedError +from boto3.s3.transfer import create_transfer_manager from boto3.s3.transfer import S3Transfer from boto3.s3.transfer import OSUtils, TransferConfig, ProgressCallbackInvoker from boto3.s3.transfer import ClientError, S3TransferRetriesExceededError +class TestCreateTransferManager(unittest.TestCase): + def test_create_transfer_manager(self): + client = object() + config = TransferConfig() + osutil = OSUtils() + with mock.patch('boto3.s3.transfer.TransferManager') as manager: + create_transfer_manager(client, config, osutil) + self.assertEqual( + manager.call_args, + mock.call(client, config, osutil, None) + ) + + def test_create_transfer_manager_with_no_threads(self): + client = object() + config = TransferConfig() + config.use_threads = False + with mock.patch( + 'boto3.s3.transfer.TransferManager') as manager: + create_transfer_manager(client, config) + self.assertEqual( + manager.call_args, + mock.call(client, config, None, NonThreadedExecutor) + ) + + class TestTransferConfig(unittest.TestCase): def assert_value_of_actual_and_alias(self, config, actual, alias, ref_value): diff --git a/tox.ini b/tox.ini index 062af50..f82e9bf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,py33,py34,py35 +envlist = py26,py27,py33,py34,py35,py36 # Comment to build sdist and install into virtualenv # This is helpful to test installation but takes extra time @@ -8,4 +8,4 @@ skipsdist = True [testenv] commands = {toxinidir}/scripts/ci/install - {toxinidir}/scripts/ci/run-tests + {toxinidir}/scripts/ci/run-tests {posargs}