gcloud 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +4 -0
- data/Makefile +4 -0
- data/Manifest +760 -1
- data/bin/gcloud +7 -0
- data/bin/{gcutil → gcutil.symlink} +0 -0
- data/bin/gsutil-symlink +377 -0
- data/gcloud.gemspec +5 -5
- data/packages/gsutil/CHECKSUM +1 -0
- data/packages/gsutil/COPYING +202 -0
- data/packages/gsutil/LICENSE.third_party +295 -0
- data/packages/gsutil/MANIFEST.in +5 -0
- data/packages/gsutil/README +38 -0
- data/packages/gsutil/README.pkg +49 -0
- data/packages/gsutil/ReleaseNotes.txt +780 -0
- data/packages/gsutil/VERSION +1 -0
- data/packages/gsutil/boto/Changelog.rst +35 -0
- data/packages/gsutil/boto/LICENSE +18 -0
- data/packages/gsutil/boto/MANIFEST.in +12 -0
- data/packages/gsutil/boto/README.rst +163 -0
- data/packages/gsutil/boto/bin/asadmin +290 -0
- data/packages/gsutil/boto/bin/bundle_image +27 -0
- data/packages/gsutil/boto/bin/cfadmin +108 -0
- data/packages/gsutil/boto/bin/cq +89 -0
- data/packages/gsutil/boto/bin/cwutil +140 -0
- data/packages/gsutil/boto/bin/elbadmin +284 -0
- data/packages/gsutil/boto/bin/fetch_file +43 -0
- data/packages/gsutil/boto/bin/glacier +154 -0
- data/packages/gsutil/boto/bin/instance_events +145 -0
- data/packages/gsutil/boto/bin/kill_instance +35 -0
- data/packages/gsutil/boto/bin/launch_instance +252 -0
- data/packages/gsutil/boto/bin/list_instances +90 -0
- data/packages/gsutil/boto/bin/lss3 +77 -0
- data/packages/gsutil/boto/bin/mturk +465 -0
- data/packages/gsutil/boto/bin/pyami_sendmail +52 -0
- data/packages/gsutil/boto/bin/route53 +205 -0
- data/packages/gsutil/boto/bin/s3put +374 -0
- data/packages/gsutil/boto/bin/sdbadmin +194 -0
- data/packages/gsutil/boto/bin/taskadmin +116 -0
- data/packages/gsutil/boto/boto/__init__.py +793 -0
- data/packages/gsutil/boto/boto/__init__.pyc +0 -0
- data/packages/gsutil/boto/boto/auth.py +682 -0
- data/packages/gsutil/boto/boto/auth.pyc +0 -0
- data/packages/gsutil/boto/boto/auth_handler.py +58 -0
- data/packages/gsutil/boto/boto/auth_handler.pyc +0 -0
- data/packages/gsutil/boto/boto/beanstalk/__init__.py +65 -0
- data/packages/gsutil/boto/boto/beanstalk/exception.py +64 -0
- data/packages/gsutil/boto/boto/beanstalk/layer1.py +1153 -0
- data/packages/gsutil/boto/boto/beanstalk/response.py +703 -0
- data/packages/gsutil/boto/boto/beanstalk/wrapper.py +29 -0
- data/packages/gsutil/boto/boto/cacerts/__init__.py +22 -0
- data/packages/gsutil/boto/boto/cacerts/__init__.pyc +0 -0
- data/packages/gsutil/boto/boto/cacerts/cacerts.txt +633 -0
- data/packages/gsutil/boto/boto/cloudformation/__init__.py +68 -0
- data/packages/gsutil/boto/boto/cloudformation/connection.py +364 -0
- data/packages/gsutil/boto/boto/cloudformation/stack.py +360 -0
- data/packages/gsutil/boto/boto/cloudformation/template.py +43 -0
- data/packages/gsutil/boto/boto/cloudfront/__init__.py +324 -0
- data/packages/gsutil/boto/boto/cloudfront/distribution.py +745 -0
- data/packages/gsutil/boto/boto/cloudfront/exception.py +26 -0
- data/packages/gsutil/boto/boto/cloudfront/identity.py +122 -0
- data/packages/gsutil/boto/boto/cloudfront/invalidation.py +216 -0
- data/packages/gsutil/boto/boto/cloudfront/logging.py +38 -0
- data/packages/gsutil/boto/boto/cloudfront/object.py +48 -0
- data/packages/gsutil/boto/boto/cloudfront/origin.py +150 -0
- data/packages/gsutil/boto/boto/cloudfront/signers.py +60 -0
- data/packages/gsutil/boto/boto/cloudsearch/__init__.py +45 -0
- data/packages/gsutil/boto/boto/cloudsearch/document.py +265 -0
- data/packages/gsutil/boto/boto/cloudsearch/domain.py +394 -0
- data/packages/gsutil/boto/boto/cloudsearch/layer1.py +738 -0
- data/packages/gsutil/boto/boto/cloudsearch/layer2.py +67 -0
- data/packages/gsutil/boto/boto/cloudsearch/optionstatus.py +248 -0
- data/packages/gsutil/boto/boto/cloudsearch/search.py +365 -0
- data/packages/gsutil/boto/boto/cloudsearch/sourceattribute.py +75 -0
- data/packages/gsutil/boto/boto/compat.py +28 -0
- data/packages/gsutil/boto/boto/compat.pyc +0 -0
- data/packages/gsutil/boto/boto/connection.py +1081 -0
- data/packages/gsutil/boto/boto/connection.pyc +0 -0
- data/packages/gsutil/boto/boto/contrib/__init__.py +22 -0
- data/packages/gsutil/boto/boto/contrib/ymlmessage.py +52 -0
- data/packages/gsutil/boto/boto/core/README +58 -0
- data/packages/gsutil/boto/boto/core/__init__.py +23 -0
- data/packages/gsutil/boto/boto/core/auth.py +78 -0
- data/packages/gsutil/boto/boto/core/credentials.py +154 -0
- data/packages/gsutil/boto/boto/core/dictresponse.py +178 -0
- data/packages/gsutil/boto/boto/core/service.py +67 -0
- data/packages/gsutil/boto/boto/datapipeline/__init__.py +0 -0
- data/packages/gsutil/boto/boto/datapipeline/exceptions.py +42 -0
- data/packages/gsutil/boto/boto/datapipeline/layer1.py +546 -0
- data/packages/gsutil/boto/boto/dynamodb/__init__.py +66 -0
- data/packages/gsutil/boto/boto/dynamodb/batch.py +262 -0
- data/packages/gsutil/boto/boto/dynamodb/condition.py +170 -0
- data/packages/gsutil/boto/boto/dynamodb/exceptions.py +64 -0
- data/packages/gsutil/boto/boto/dynamodb/item.py +196 -0
- data/packages/gsutil/boto/boto/dynamodb/layer1.py +575 -0
- data/packages/gsutil/boto/boto/dynamodb/layer2.py +798 -0
- data/packages/gsutil/boto/boto/dynamodb/schema.py +112 -0
- data/packages/gsutil/boto/boto/dynamodb/table.py +540 -0
- data/packages/gsutil/boto/boto/dynamodb/types.py +326 -0
- data/packages/gsutil/boto/boto/ec2/__init__.py +96 -0
- data/packages/gsutil/boto/boto/ec2/address.py +103 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/__init__.py +781 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/activity.py +74 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/group.py +337 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/instance.py +60 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/launchconfig.py +209 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/policy.py +166 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/request.py +38 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/scheduled.py +60 -0
- data/packages/gsutil/boto/boto/ec2/autoscale/tag.py +84 -0
- data/packages/gsutil/boto/boto/ec2/blockdevicemapping.py +141 -0
- data/packages/gsutil/boto/boto/ec2/bundleinstance.py +78 -0
- data/packages/gsutil/boto/boto/ec2/buyreservation.py +84 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/__init__.py +603 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/alarm.py +316 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/datapoint.py +40 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/dimension.py +38 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/listelement.py +31 -0
- data/packages/gsutil/boto/boto/ec2/cloudwatch/metric.py +175 -0
- data/packages/gsutil/boto/boto/ec2/connection.py +3409 -0
- data/packages/gsutil/boto/boto/ec2/ec2object.py +107 -0
- data/packages/gsutil/boto/boto/ec2/elb/__init__.py +553 -0
- data/packages/gsutil/boto/boto/ec2/elb/healthcheck.py +89 -0
- data/packages/gsutil/boto/boto/ec2/elb/instancestate.py +62 -0
- data/packages/gsutil/boto/boto/ec2/elb/listelement.py +36 -0
- data/packages/gsutil/boto/boto/ec2/elb/listener.py +75 -0
- data/packages/gsutil/boto/boto/ec2/elb/loadbalancer.py +324 -0
- data/packages/gsutil/boto/boto/ec2/elb/policies.py +89 -0
- data/packages/gsutil/boto/boto/ec2/elb/securitygroup.py +38 -0
- data/packages/gsutil/boto/boto/ec2/group.py +39 -0
- data/packages/gsutil/boto/boto/ec2/image.py +350 -0
- data/packages/gsutil/boto/boto/ec2/instance.py +661 -0
- data/packages/gsutil/boto/boto/ec2/instanceinfo.py +51 -0
- data/packages/gsutil/boto/boto/ec2/instancestatus.py +207 -0
- data/packages/gsutil/boto/boto/ec2/keypair.py +113 -0
- data/packages/gsutil/boto/boto/ec2/launchspecification.py +105 -0
- data/packages/gsutil/boto/boto/ec2/networkinterface.py +247 -0
- data/packages/gsutil/boto/boto/ec2/placementgroup.py +51 -0
- data/packages/gsutil/boto/boto/ec2/regioninfo.py +34 -0
- data/packages/gsutil/boto/boto/ec2/reservedinstance.py +227 -0
- data/packages/gsutil/boto/boto/ec2/securitygroup.py +357 -0
- data/packages/gsutil/boto/boto/ec2/snapshot.py +170 -0
- data/packages/gsutil/boto/boto/ec2/spotdatafeedsubscription.py +63 -0
- data/packages/gsutil/boto/boto/ec2/spotinstancerequest.py +188 -0
- data/packages/gsutil/boto/boto/ec2/spotpricehistory.py +55 -0
- data/packages/gsutil/boto/boto/ec2/tag.py +87 -0
- data/packages/gsutil/boto/boto/ec2/vmtype.py +58 -0
- data/packages/gsutil/boto/boto/ec2/volume.py +293 -0
- data/packages/gsutil/boto/boto/ec2/volumestatus.py +200 -0
- data/packages/gsutil/boto/boto/ec2/zone.py +80 -0
- data/packages/gsutil/boto/boto/ecs/__init__.py +90 -0
- data/packages/gsutil/boto/boto/ecs/item.py +153 -0
- data/packages/gsutil/boto/boto/elasticache/__init__.py +62 -0
- data/packages/gsutil/boto/boto/elasticache/layer1.py +1252 -0
- data/packages/gsutil/boto/boto/elastictranscoder/__init__.py +62 -0
- data/packages/gsutil/boto/boto/elastictranscoder/exceptions.py +46 -0
- data/packages/gsutil/boto/boto/elastictranscoder/layer1.py +509 -0
- data/packages/gsutil/boto/boto/emr/__init__.py +73 -0
- data/packages/gsutil/boto/boto/emr/bootstrap_action.py +44 -0
- data/packages/gsutil/boto/boto/emr/connection.py +531 -0
- data/packages/gsutil/boto/boto/emr/emrobject.py +176 -0
- data/packages/gsutil/boto/boto/emr/instance_group.py +43 -0
- data/packages/gsutil/boto/boto/emr/step.py +281 -0
- data/packages/gsutil/boto/boto/exception.py +476 -0
- data/packages/gsutil/boto/boto/exception.pyc +0 -0
- data/packages/gsutil/boto/boto/file/README +49 -0
- data/packages/gsutil/boto/boto/file/__init__.py +28 -0
- data/packages/gsutil/boto/boto/file/bucket.py +112 -0
- data/packages/gsutil/boto/boto/file/connection.py +33 -0
- data/packages/gsutil/boto/boto/file/key.py +199 -0
- data/packages/gsutil/boto/boto/file/simpleresultset.py +30 -0
- data/packages/gsutil/boto/boto/fps/__init__.py +21 -0
- data/packages/gsutil/boto/boto/fps/connection.py +369 -0
- data/packages/gsutil/boto/boto/fps/exception.py +344 -0
- data/packages/gsutil/boto/boto/fps/response.py +175 -0
- data/packages/gsutil/boto/boto/glacier/__init__.py +57 -0
- data/packages/gsutil/boto/boto/glacier/concurrent.py +409 -0
- data/packages/gsutil/boto/boto/glacier/exceptions.py +58 -0
- data/packages/gsutil/boto/boto/glacier/job.py +152 -0
- data/packages/gsutil/boto/boto/glacier/layer1.py +637 -0
- data/packages/gsutil/boto/boto/glacier/layer2.py +93 -0
- data/packages/gsutil/boto/boto/glacier/response.py +48 -0
- data/packages/gsutil/boto/boto/glacier/utils.py +163 -0
- data/packages/gsutil/boto/boto/glacier/vault.py +387 -0
- data/packages/gsutil/boto/boto/glacier/writer.py +242 -0
- data/packages/gsutil/boto/boto/gs/__init__.py +22 -0
- data/packages/gsutil/boto/boto/gs/__init__.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/acl.py +304 -0
- data/packages/gsutil/boto/boto/gs/acl.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/bucket.py +870 -0
- data/packages/gsutil/boto/boto/gs/bucket.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/bucketlistresultset.py +64 -0
- data/packages/gsutil/boto/boto/gs/bucketlistresultset.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/connection.py +103 -0
- data/packages/gsutil/boto/boto/gs/connection.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/cors.py +169 -0
- data/packages/gsutil/boto/boto/gs/cors.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/key.py +704 -0
- data/packages/gsutil/boto/boto/gs/key.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/resumable_upload_handler.py +659 -0
- data/packages/gsutil/boto/boto/gs/resumable_upload_handler.pyc +0 -0
- data/packages/gsutil/boto/boto/gs/user.py +54 -0
- data/packages/gsutil/boto/boto/gs/user.pyc +0 -0
- data/packages/gsutil/boto/boto/handler.py +44 -0
- data/packages/gsutil/boto/boto/handler.pyc +0 -0
- data/packages/gsutil/boto/boto/https_connection.py +124 -0
- data/packages/gsutil/boto/boto/https_connection.pyc +0 -0
- data/packages/gsutil/boto/boto/iam/__init__.py +74 -0
- data/packages/gsutil/boto/boto/iam/connection.py +1317 -0
- data/packages/gsutil/boto/boto/iam/summarymap.py +42 -0
- data/packages/gsutil/boto/boto/jsonresponse.py +163 -0
- data/packages/gsutil/boto/boto/jsonresponse.pyc +0 -0
- data/packages/gsutil/boto/boto/manage/__init__.py +23 -0
- data/packages/gsutil/boto/boto/manage/cmdshell.py +241 -0
- data/packages/gsutil/boto/boto/manage/propget.py +64 -0
- data/packages/gsutil/boto/boto/manage/server.py +556 -0
- data/packages/gsutil/boto/boto/manage/task.py +175 -0
- data/packages/gsutil/boto/boto/manage/test_manage.py +34 -0
- data/packages/gsutil/boto/boto/manage/volume.py +420 -0
- data/packages/gsutil/boto/boto/mashups/__init__.py +23 -0
- data/packages/gsutil/boto/boto/mashups/interactive.py +97 -0
- data/packages/gsutil/boto/boto/mashups/iobject.py +115 -0
- data/packages/gsutil/boto/boto/mashups/order.py +211 -0
- data/packages/gsutil/boto/boto/mashups/server.py +395 -0
- data/packages/gsutil/boto/boto/mturk/__init__.py +23 -0
- data/packages/gsutil/boto/boto/mturk/connection.py +1027 -0
- data/packages/gsutil/boto/boto/mturk/layoutparam.py +55 -0
- data/packages/gsutil/boto/boto/mturk/notification.py +103 -0
- data/packages/gsutil/boto/boto/mturk/price.py +48 -0
- data/packages/gsutil/boto/boto/mturk/qualification.py +137 -0
- data/packages/gsutil/boto/boto/mturk/question.py +455 -0
- data/packages/gsutil/boto/boto/mws/__init__.py +21 -0
- data/packages/gsutil/boto/boto/mws/connection.py +813 -0
- data/packages/gsutil/boto/boto/mws/exception.py +75 -0
- data/packages/gsutil/boto/boto/mws/response.py +655 -0
- data/packages/gsutil/boto/boto/plugin.py +90 -0
- data/packages/gsutil/boto/boto/plugin.pyc +0 -0
- data/packages/gsutil/boto/boto/provider.py +337 -0
- data/packages/gsutil/boto/boto/provider.pyc +0 -0
- data/packages/gsutil/boto/boto/pyami/__init__.py +22 -0
- data/packages/gsutil/boto/boto/pyami/__init__.pyc +0 -0
- data/packages/gsutil/boto/boto/pyami/bootstrap.py +134 -0
- data/packages/gsutil/boto/boto/pyami/config.py +229 -0
- data/packages/gsutil/boto/boto/pyami/config.pyc +0 -0
- data/packages/gsutil/boto/boto/pyami/copybot.cfg +60 -0
- data/packages/gsutil/boto/boto/pyami/copybot.py +97 -0
- data/packages/gsutil/boto/boto/pyami/helloworld.py +28 -0
- data/packages/gsutil/boto/boto/pyami/installers/__init__.py +64 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/__init__.py +22 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/apache.py +43 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/ebs.py +238 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/installer.py +96 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/mysql.py +109 -0
- data/packages/gsutil/boto/boto/pyami/installers/ubuntu/trac.py +139 -0
- data/packages/gsutil/boto/boto/pyami/launch_ami.py +178 -0
- data/packages/gsutil/boto/boto/pyami/scriptbase.py +44 -0
- data/packages/gsutil/boto/boto/pyami/startup.py +60 -0
- data/packages/gsutil/boto/boto/rds/__init__.py +1194 -0
- data/packages/gsutil/boto/boto/rds/dbinstance.py +357 -0
- data/packages/gsutil/boto/boto/rds/dbsecuritygroup.py +177 -0
- data/packages/gsutil/boto/boto/rds/dbsnapshot.py +108 -0
- data/packages/gsutil/boto/boto/rds/event.py +49 -0
- data/packages/gsutil/boto/boto/rds/parametergroup.py +201 -0
- data/packages/gsutil/boto/boto/rds/regioninfo.py +32 -0
- data/packages/gsutil/boto/boto/regioninfo.py +63 -0
- data/packages/gsutil/boto/boto/regioninfo.pyc +0 -0
- data/packages/gsutil/boto/boto/resultset.py +169 -0
- data/packages/gsutil/boto/boto/resultset.pyc +0 -0
- data/packages/gsutil/boto/boto/roboto/__init__.py +1 -0
- data/packages/gsutil/boto/boto/roboto/awsqueryrequest.py +504 -0
- data/packages/gsutil/boto/boto/roboto/awsqueryservice.py +121 -0
- data/packages/gsutil/boto/boto/roboto/param.py +147 -0
- data/packages/gsutil/boto/boto/route53/__init__.py +75 -0
- data/packages/gsutil/boto/boto/route53/connection.py +403 -0
- data/packages/gsutil/boto/boto/route53/exception.py +27 -0
- data/packages/gsutil/boto/boto/route53/hostedzone.py +56 -0
- data/packages/gsutil/boto/boto/route53/record.py +306 -0
- data/packages/gsutil/boto/boto/route53/status.py +42 -0
- data/packages/gsutil/boto/boto/route53/zone.py +412 -0
- data/packages/gsutil/boto/boto/s3/__init__.py +84 -0
- data/packages/gsutil/boto/boto/s3/__init__.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/acl.py +164 -0
- data/packages/gsutil/boto/boto/s3/acl.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/bucket.py +1634 -0
- data/packages/gsutil/boto/boto/s3/bucket.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/bucketlistresultset.py +139 -0
- data/packages/gsutil/boto/boto/s3/bucketlistresultset.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/bucketlogging.py +83 -0
- data/packages/gsutil/boto/boto/s3/bucketlogging.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/connection.py +540 -0
- data/packages/gsutil/boto/boto/s3/connection.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/cors.py +210 -0
- data/packages/gsutil/boto/boto/s3/cors.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/deletemarker.py +55 -0
- data/packages/gsutil/boto/boto/s3/deletemarker.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/key.py +1712 -0
- data/packages/gsutil/boto/boto/s3/key.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/keyfile.py +134 -0
- data/packages/gsutil/boto/boto/s3/keyfile.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/lifecycle.py +231 -0
- data/packages/gsutil/boto/boto/s3/lifecycle.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/multidelete.py +138 -0
- data/packages/gsutil/boto/boto/s3/multidelete.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/multipart.py +315 -0
- data/packages/gsutil/boto/boto/s3/multipart.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/prefix.py +42 -0
- data/packages/gsutil/boto/boto/s3/prefix.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/resumable_download_handler.py +339 -0
- data/packages/gsutil/boto/boto/s3/resumable_download_handler.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/tagging.py +71 -0
- data/packages/gsutil/boto/boto/s3/tagging.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/user.py +49 -0
- data/packages/gsutil/boto/boto/s3/user.pyc +0 -0
- data/packages/gsutil/boto/boto/s3/website.py +237 -0
- data/packages/gsutil/boto/boto/s3/website.pyc +0 -0
- data/packages/gsutil/boto/boto/sdb/__init__.py +67 -0
- data/packages/gsutil/boto/boto/sdb/connection.py +617 -0
- data/packages/gsutil/boto/boto/sdb/db/__init__.py +20 -0
- data/packages/gsutil/boto/boto/sdb/db/blob.py +75 -0
- data/packages/gsutil/boto/boto/sdb/db/key.py +59 -0
- data/packages/gsutil/boto/boto/sdb/db/manager/__init__.py +85 -0
- data/packages/gsutil/boto/boto/sdb/db/manager/sdbmanager.py +732 -0
- data/packages/gsutil/boto/boto/sdb/db/manager/xmlmanager.py +517 -0
- data/packages/gsutil/boto/boto/sdb/db/model.py +294 -0
- data/packages/gsutil/boto/boto/sdb/db/property.py +703 -0
- data/packages/gsutil/boto/boto/sdb/db/query.py +85 -0
- data/packages/gsutil/boto/boto/sdb/db/sequence.py +226 -0
- data/packages/gsutil/boto/boto/sdb/db/test_db.py +231 -0
- data/packages/gsutil/boto/boto/sdb/domain.py +377 -0
- data/packages/gsutil/boto/boto/sdb/item.py +181 -0
- data/packages/gsutil/boto/boto/sdb/queryresultset.py +92 -0
- data/packages/gsutil/boto/boto/sdb/regioninfo.py +32 -0
- data/packages/gsutil/boto/boto/services/__init__.py +23 -0
- data/packages/gsutil/boto/boto/services/bs.py +179 -0
- data/packages/gsutil/boto/boto/services/message.py +58 -0
- data/packages/gsutil/boto/boto/services/result.py +136 -0
- data/packages/gsutil/boto/boto/services/service.py +161 -0
- data/packages/gsutil/boto/boto/services/servicedef.py +91 -0
- data/packages/gsutil/boto/boto/services/sonofmmm.cfg +43 -0
- data/packages/gsutil/boto/boto/services/sonofmmm.py +81 -0
- data/packages/gsutil/boto/boto/services/submit.py +88 -0
- data/packages/gsutil/boto/boto/ses/__init__.py +54 -0
- data/packages/gsutil/boto/boto/ses/connection.py +521 -0
- data/packages/gsutil/boto/boto/ses/exceptions.py +77 -0
- data/packages/gsutil/boto/boto/sns/__init__.py +78 -0
- data/packages/gsutil/boto/boto/sns/connection.py +431 -0
- data/packages/gsutil/boto/boto/sqs/__init__.py +56 -0
- data/packages/gsutil/boto/boto/sqs/attributes.py +46 -0
- data/packages/gsutil/boto/boto/sqs/batchresults.py +95 -0
- data/packages/gsutil/boto/boto/sqs/connection.py +417 -0
- data/packages/gsutil/boto/boto/sqs/jsonmessage.py +43 -0
- data/packages/gsutil/boto/boto/sqs/message.py +253 -0
- data/packages/gsutil/boto/boto/sqs/queue.py +478 -0
- data/packages/gsutil/boto/boto/sqs/regioninfo.py +32 -0
- data/packages/gsutil/boto/boto/storage_uri.py +835 -0
- data/packages/gsutil/boto/boto/storage_uri.pyc +0 -0
- data/packages/gsutil/boto/boto/sts/__init__.py +55 -0
- data/packages/gsutil/boto/boto/sts/connection.py +207 -0
- data/packages/gsutil/boto/boto/sts/credentials.py +215 -0
- data/packages/gsutil/boto/boto/swf/__init__.py +60 -0
- data/packages/gsutil/boto/boto/swf/exceptions.py +44 -0
- data/packages/gsutil/boto/boto/swf/layer1.py +1512 -0
- data/packages/gsutil/boto/boto/swf/layer1_decisions.py +287 -0
- data/packages/gsutil/boto/boto/swf/layer2.py +342 -0
- data/packages/gsutil/boto/boto/utils.py +927 -0
- data/packages/gsutil/boto/boto/utils.pyc +0 -0
- data/packages/gsutil/boto/boto/vpc/__init__.py +910 -0
- data/packages/gsutil/boto/boto/vpc/customergateway.py +54 -0
- data/packages/gsutil/boto/boto/vpc/dhcpoptions.py +72 -0
- data/packages/gsutil/boto/boto/vpc/internetgateway.py +72 -0
- data/packages/gsutil/boto/boto/vpc/routetable.py +109 -0
- data/packages/gsutil/boto/boto/vpc/subnet.py +57 -0
- data/packages/gsutil/boto/boto/vpc/vpc.py +54 -0
- data/packages/gsutil/boto/boto/vpc/vpnconnection.py +60 -0
- data/packages/gsutil/boto/boto/vpc/vpngateway.py +83 -0
- data/packages/gsutil/boto/docs/BotoCheatSheet.pdf +0 -0
- data/packages/gsutil/boto/docs/Makefile +89 -0
- data/packages/gsutil/boto/docs/make.bat +113 -0
- data/packages/gsutil/boto/docs/source/_templates/layout.html +3 -0
- data/packages/gsutil/boto/docs/source/autoscale_tut.rst +220 -0
- data/packages/gsutil/boto/docs/source/boto_config_tut.rst +125 -0
- data/packages/gsutil/boto/docs/source/boto_theme/static/boto.css_t +239 -0
- data/packages/gsutil/boto/docs/source/boto_theme/static/pygments.css +61 -0
- data/packages/gsutil/boto/docs/source/boto_theme/theme.conf +3 -0
- data/packages/gsutil/boto/docs/source/cloudfront_tut.rst +196 -0
- data/packages/gsutil/boto/docs/source/cloudsearch_tut.rst +411 -0
- data/packages/gsutil/boto/docs/source/cloudwatch_tut.rst +116 -0
- data/packages/gsutil/boto/docs/source/conf.py +32 -0
- data/packages/gsutil/boto/docs/source/contributing.rst +204 -0
- data/packages/gsutil/boto/docs/source/documentation.rst +59 -0
- data/packages/gsutil/boto/docs/source/dynamodb_tut.rst +339 -0
- data/packages/gsutil/boto/docs/source/ec2_tut.rst +86 -0
- data/packages/gsutil/boto/docs/source/elb_tut.rst +257 -0
- data/packages/gsutil/boto/docs/source/emr_tut.rst +108 -0
- data/packages/gsutil/boto/docs/source/index.rst +146 -0
- data/packages/gsutil/boto/docs/source/rds_tut.rst +108 -0
- data/packages/gsutil/boto/docs/source/ref/autoscale.rst +62 -0
- data/packages/gsutil/boto/docs/source/ref/beanstalk.rst +26 -0
- data/packages/gsutil/boto/docs/source/ref/boto.rst +47 -0
- data/packages/gsutil/boto/docs/source/ref/cloudformation.rst +34 -0
- data/packages/gsutil/boto/docs/source/ref/cloudfront.rst +68 -0
- data/packages/gsutil/boto/docs/source/ref/cloudsearch.rst +59 -0
- data/packages/gsutil/boto/docs/source/ref/cloudwatch.rst +27 -0
- data/packages/gsutil/boto/docs/source/ref/contrib.rst +32 -0
- data/packages/gsutil/boto/docs/source/ref/datapipeline.rst +26 -0
- data/packages/gsutil/boto/docs/source/ref/dynamodb.rst +61 -0
- data/packages/gsutil/boto/docs/source/ref/ec2.rst +140 -0
- data/packages/gsutil/boto/docs/source/ref/ecs.rst +19 -0
- data/packages/gsutil/boto/docs/source/ref/elasticache.rst +19 -0
- data/packages/gsutil/boto/docs/source/ref/elastictranscoder.rst +26 -0
- data/packages/gsutil/boto/docs/source/ref/elb.rst +47 -0
- data/packages/gsutil/boto/docs/source/ref/emr.rst +34 -0
- data/packages/gsutil/boto/docs/source/ref/file.rst +34 -0
- data/packages/gsutil/boto/docs/source/ref/fps.rst +19 -0
- data/packages/gsutil/boto/docs/source/ref/glacier.rst +63 -0
- data/packages/gsutil/boto/docs/source/ref/gs.rst +72 -0
- data/packages/gsutil/boto/docs/source/ref/iam.rst +27 -0
- data/packages/gsutil/boto/docs/source/ref/index.rst +40 -0
- data/packages/gsutil/boto/docs/source/ref/manage.rst +47 -0
- data/packages/gsutil/boto/docs/source/ref/mturk.rst +54 -0
- data/packages/gsutil/boto/docs/source/ref/mws.rst +33 -0
- data/packages/gsutil/boto/docs/source/ref/pyami.rst +103 -0
- data/packages/gsutil/boto/docs/source/ref/rds.rst +47 -0
- data/packages/gsutil/boto/docs/source/ref/route53.rst +34 -0
- data/packages/gsutil/boto/docs/source/ref/s3.rst +111 -0
- data/packages/gsutil/boto/docs/source/ref/sdb.rst +45 -0
- data/packages/gsutil/boto/docs/source/ref/sdb_db.rst +83 -0
- data/packages/gsutil/boto/docs/source/ref/services.rst +61 -0
- data/packages/gsutil/boto/docs/source/ref/ses.rst +21 -0
- data/packages/gsutil/boto/docs/source/ref/sns.rst +17 -0
- data/packages/gsutil/boto/docs/source/ref/sqs.rst +61 -0
- data/packages/gsutil/boto/docs/source/ref/sts.rst +25 -0
- data/packages/gsutil/boto/docs/source/ref/swf.rst +22 -0
- data/packages/gsutil/boto/docs/source/ref/vpc.rst +54 -0
- data/packages/gsutil/boto/docs/source/s3_tut.rst +450 -0
- data/packages/gsutil/boto/docs/source/security_groups.rst +82 -0
- data/packages/gsutil/boto/docs/source/ses_tut.rst +171 -0
- data/packages/gsutil/boto/docs/source/simpledb_tut.rst +188 -0
- data/packages/gsutil/boto/docs/source/sqs_tut.rst +246 -0
- data/packages/gsutil/boto/docs/source/vpc_tut.rst +100 -0
- data/packages/gsutil/boto/pylintrc +305 -0
- data/packages/gsutil/boto/requirements.txt +10 -0
- data/packages/gsutil/boto/setup.py +89 -0
- data/packages/gsutil/boto/tests/__init__.py +20 -0
- data/packages/gsutil/boto/tests/db/test_lists.py +96 -0
- data/packages/gsutil/boto/tests/db/test_password.py +128 -0
- data/packages/gsutil/boto/tests/db/test_query.py +152 -0
- data/packages/gsutil/boto/tests/db/test_sequence.py +109 -0
- data/packages/gsutil/boto/tests/devpay/__init__.py +0 -0
- data/packages/gsutil/boto/tests/devpay/test_s3.py +181 -0
- data/packages/gsutil/boto/tests/fps/__init__.py +0 -0
- data/packages/gsutil/boto/tests/fps/test.py +100 -0
- data/packages/gsutil/boto/tests/fps/test_verify_signature.py +12 -0
- data/packages/gsutil/boto/tests/integration/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/beanstalk/test_wrapper.py +209 -0
- data/packages/gsutil/boto/tests/integration/cloudformation/__init__.py +21 -0
- data/packages/gsutil/boto/tests/integration/cloudformation/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/cloudformation/test_connection.py +110 -0
- data/packages/gsutil/boto/tests/integration/cloudsearch/__init__.py +21 -0
- data/packages/gsutil/boto/tests/integration/cloudsearch/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/datapipeline/test_layer1.py +122 -0
- data/packages/gsutil/boto/tests/integration/dynamodb/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/dynamodb/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/dynamodb/test_layer1.py +266 -0
- data/packages/gsutil/boto/tests/integration/dynamodb/test_layer2.py +484 -0
- data/packages/gsutil/boto/tests/integration/dynamodb/test_table.py +84 -0
- data/packages/gsutil/boto/tests/integration/ec2/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/ec2/autoscale/__init__.py +21 -0
- data/packages/gsutil/boto/tests/integration/ec2/autoscale/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/ec2/autoscale/test_connection.py +167 -0
- data/packages/gsutil/boto/tests/integration/ec2/cloudwatch/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/ec2/cloudwatch/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/ec2/cloudwatch/test_connection.py +277 -0
- data/packages/gsutil/boto/tests/integration/ec2/elb/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/ec2/elb/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/ec2/elb/test_connection.py +130 -0
- data/packages/gsutil/boto/tests/integration/ec2/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/ec2/test_connection.py +192 -0
- data/packages/gsutil/boto/tests/integration/ec2/vpc/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/ec2/vpc/test_connection.py +95 -0
- data/packages/gsutil/boto/tests/integration/elasticache/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/elasticache/test_layer1.py +67 -0
- data/packages/gsutil/boto/tests/integration/elastictranscoder/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/elastictranscoder/test_cert_verification.py +35 -0
- data/packages/gsutil/boto/tests/integration/elastictranscoder/test_layer1.py +115 -0
- data/packages/gsutil/boto/tests/integration/emr/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/emr/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/glacier/__init__.py +22 -0
- data/packages/gsutil/boto/tests/integration/glacier/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/glacier/test_layer1.py +44 -0
- data/packages/gsutil/boto/tests/integration/glacier/test_layer2.py +45 -0
- data/packages/gsutil/boto/tests/integration/gs/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/gs/cb_test_harness.py +71 -0
- data/packages/gsutil/boto/tests/integration/gs/test_basic.py +379 -0
- data/packages/gsutil/boto/tests/integration/gs/test_generation_conditionals.py +399 -0
- data/packages/gsutil/boto/tests/integration/gs/test_resumable_downloads.py +358 -0
- data/packages/gsutil/boto/tests/integration/gs/test_resumable_uploads.py +525 -0
- data/packages/gsutil/boto/tests/integration/gs/test_storage_uri.py +125 -0
- data/packages/gsutil/boto/tests/integration/gs/test_versioning.py +268 -0
- data/packages/gsutil/boto/tests/integration/gs/testcase.py +116 -0
- data/packages/gsutil/boto/tests/integration/gs/util.py +63 -0
- data/packages/gsutil/boto/tests/integration/iam/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/iam/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/mws/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/mws/test.py +100 -0
- data/packages/gsutil/boto/tests/integration/rds/__init__.py +21 -0
- data/packages/gsutil/boto/tests/integration/rds/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/route53/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/route53/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/route53/test_zone.py +132 -0
- data/packages/gsutil/boto/tests/integration/s3/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/s3/mock_storage_service.py +589 -0
- data/packages/gsutil/boto/tests/integration/s3/other_cacerts.txt +70 -0
- data/packages/gsutil/boto/tests/integration/s3/test_bucket.py +263 -0
- data/packages/gsutil/boto/tests/integration/s3/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/s3/test_connection.py +245 -0
- data/packages/gsutil/boto/tests/integration/s3/test_cors.py +78 -0
- data/packages/gsutil/boto/tests/integration/s3/test_encryption.py +115 -0
- data/packages/gsutil/boto/tests/integration/s3/test_https_cert_validation.py +141 -0
- data/packages/gsutil/boto/tests/integration/s3/test_key.py +375 -0
- data/packages/gsutil/boto/tests/integration/s3/test_mfa.py +95 -0
- data/packages/gsutil/boto/tests/integration/s3/test_multidelete.py +181 -0
- data/packages/gsutil/boto/tests/integration/s3/test_multipart.py +139 -0
- data/packages/gsutil/boto/tests/integration/s3/test_pool.py +246 -0
- data/packages/gsutil/boto/tests/integration/s3/test_versioning.py +158 -0
- data/packages/gsutil/boto/tests/integration/sdb/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/sdb/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/sdb/test_connection.py +119 -0
- data/packages/gsutil/boto/tests/integration/ses/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/ses/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/ses/test_connection.py +38 -0
- data/packages/gsutil/boto/tests/integration/sns/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/sns/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/sqs/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/sqs/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/sqs/test_connection.py +217 -0
- data/packages/gsutil/boto/tests/integration/sts/__init__.py +20 -0
- data/packages/gsutil/boto/tests/integration/sts/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/sts/test_session_token.py +65 -0
- data/packages/gsutil/boto/tests/integration/swf/__init__.py +0 -0
- data/packages/gsutil/boto/tests/integration/swf/test_cert_verification.py +40 -0
- data/packages/gsutil/boto/tests/integration/swf/test_layer1.py +246 -0
- data/packages/gsutil/boto/tests/integration/swf/test_layer1_workflow_execution.py +173 -0
- data/packages/gsutil/boto/tests/mturk/__init__.py +0 -0
- data/packages/gsutil/boto/tests/mturk/_init_environment.py +28 -0
- data/packages/gsutil/boto/tests/mturk/all_tests.py +24 -0
- data/packages/gsutil/boto/tests/mturk/cleanup_tests.py +47 -0
- data/packages/gsutil/boto/tests/mturk/common.py +45 -0
- data/packages/gsutil/boto/tests/mturk/create_free_text_question_regex.doctest +100 -0
- data/packages/gsutil/boto/tests/mturk/create_hit.doctest +92 -0
- data/packages/gsutil/boto/tests/mturk/create_hit_binary.doctest +94 -0
- data/packages/gsutil/boto/tests/mturk/create_hit_external.py +21 -0
- data/packages/gsutil/boto/tests/mturk/create_hit_from_hit_type.doctest +103 -0
- data/packages/gsutil/boto/tests/mturk/create_hit_test.py +21 -0
- data/packages/gsutil/boto/tests/mturk/create_hit_with_qualifications.py +16 -0
- data/packages/gsutil/boto/tests/mturk/hit_persistence.py +27 -0
- data/packages/gsutil/boto/tests/mturk/mocks.py +11 -0
- data/packages/gsutil/boto/tests/mturk/reviewable_hits.doctest +129 -0
- data/packages/gsutil/boto/tests/mturk/run-doctest.py +13 -0
- data/packages/gsutil/boto/tests/mturk/search_hits.doctest +16 -0
- data/packages/gsutil/boto/tests/mturk/selenium_support.py +61 -0
- data/packages/gsutil/boto/tests/mturk/support.py +7 -0
- data/packages/gsutil/boto/tests/mturk/test_disable_hit.py +11 -0
- data/packages/gsutil/boto/tests/test.py +59 -0
- data/packages/gsutil/boto/tests/unit/__init__.py +79 -0
- data/packages/gsutil/boto/tests/unit/auth/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/auth/test_sigv4.py +73 -0
- data/packages/gsutil/boto/tests/unit/beanstalk/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/beanstalk/test_layer1.py +128 -0
- data/packages/gsutil/boto/tests/unit/cloudformation/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/cloudformation/test_connection.py +605 -0
- data/packages/gsutil/boto/tests/unit/cloudformation/test_stack.py +63 -0
- data/packages/gsutil/boto/tests/unit/cloudfront/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/cloudfront/test_invalidation_list.py +113 -0
- data/packages/gsutil/boto/tests/unit/cloudfront/test_signed_urls.py +354 -0
- data/packages/gsutil/boto/tests/unit/cloudsearch/__init__.py +1 -0
- data/packages/gsutil/boto/tests/unit/cloudsearch/test_connection.py +241 -0
- data/packages/gsutil/boto/tests/unit/cloudsearch/test_document.py +324 -0
- data/packages/gsutil/boto/tests/unit/cloudsearch/test_search.py +325 -0
- data/packages/gsutil/boto/tests/unit/dynamodb/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/dynamodb/test_batch.py +103 -0
- data/packages/gsutil/boto/tests/unit/dynamodb/test_layer2.py +119 -0
- data/packages/gsutil/boto/tests/unit/dynamodb/test_types.py +82 -0
- data/packages/gsutil/boto/tests/unit/ec2/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/ec2/autoscale/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/ec2/autoscale/test_group.py +162 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_address.py +39 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_blockdevicemapping.py +79 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_connection.py +480 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_instance.py +243 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_networkinterface.py +140 -0
- data/packages/gsutil/boto/tests/unit/ec2/test_volume.py +248 -0
- data/packages/gsutil/boto/tests/unit/emr/test_emr_responses.py +373 -0
- data/packages/gsutil/boto/tests/unit/glacier/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_concurrent.py +120 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_job.py +60 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_layer1.py +98 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_layer2.py +266 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_utils.py +116 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_vault.py +100 -0
- data/packages/gsutil/boto/tests/unit/glacier/test_writer.py +185 -0
- data/packages/gsutil/boto/tests/unit/provider/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/provider/test_provider.py +176 -0
- data/packages/gsutil/boto/tests/unit/rds/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/rds/test_connection.py +131 -0
- data/packages/gsutil/boto/tests/unit/s3/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/s3/test_cors_configuration.py +77 -0
- data/packages/gsutil/boto/tests/unit/s3/test_key.py +75 -0
- data/packages/gsutil/boto/tests/unit/s3/test_keyfile.py +101 -0
- data/packages/gsutil/boto/tests/unit/s3/test_lifecycle.py +97 -0
- data/packages/gsutil/boto/tests/unit/s3/test_tagging.py +47 -0
- data/packages/gsutil/boto/tests/unit/s3/test_uri.py +257 -0
- data/packages/gsutil/boto/tests/unit/s3/test_website.py +188 -0
- data/packages/gsutil/boto/tests/unit/sns/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/sns/test_connection.py +99 -0
- data/packages/gsutil/boto/tests/unit/sqs/__init__.py +0 -0
- data/packages/gsutil/boto/tests/unit/sqs/test_connection.py +98 -0
- data/packages/gsutil/boto/tests/unit/sqs/test_queue.py +40 -0
- data/packages/gsutil/boto/tests/unit/sts/test_connection.py +74 -0
- data/packages/gsutil/boto/tests/unit/test_connection.py +60 -0
- data/packages/gsutil/boto/tests/unit/utils/test_utils.py +109 -0
- data/packages/gsutil/boto/tox.ini +8 -0
- data/packages/gsutil/gslib/README +5 -0
- data/packages/gsutil/gslib/__init__.py +22 -0
- data/packages/gsutil/gslib/__init__.pyc +0 -0
- data/packages/gsutil/gslib/addlhelp/__init__.py +15 -0
- data/packages/gsutil/gslib/addlhelp/acls.py +234 -0
- data/packages/gsutil/gslib/addlhelp/anon.py +57 -0
- data/packages/gsutil/gslib/addlhelp/command_opts.py +116 -0
- data/packages/gsutil/gslib/addlhelp/dev.py +139 -0
- data/packages/gsutil/gslib/addlhelp/metadata.py +186 -0
- data/packages/gsutil/gslib/addlhelp/naming.py +173 -0
- data/packages/gsutil/gslib/addlhelp/prod.py +160 -0
- data/packages/gsutil/gslib/addlhelp/projects.py +130 -0
- data/packages/gsutil/gslib/addlhelp/subdirs.py +110 -0
- data/packages/gsutil/gslib/addlhelp/support.py +86 -0
- data/packages/gsutil/gslib/addlhelp/versioning.py +242 -0
- data/packages/gsutil/gslib/addlhelp/wildcards.py +170 -0
- data/packages/gsutil/gslib/bucket_listing_ref.py +175 -0
- data/packages/gsutil/gslib/bucket_listing_ref.pyc +0 -0
- data/packages/gsutil/gslib/command.py +722 -0
- data/packages/gsutil/gslib/command.pyc +0 -0
- data/packages/gsutil/gslib/command_runner.py +101 -0
- data/packages/gsutil/gslib/command_runner.pyc +0 -0
- data/packages/gsutil/gslib/commands/__init__.py +15 -0
- data/packages/gsutil/gslib/commands/__init__.pyc +0 -0
- data/packages/gsutil/gslib/commands/cat.py +131 -0
- data/packages/gsutil/gslib/commands/cat.pyc +0 -0
- data/packages/gsutil/gslib/commands/chacl.py +532 -0
- data/packages/gsutil/gslib/commands/chacl.pyc +0 -0
- data/packages/gsutil/gslib/commands/config.py +694 -0
- data/packages/gsutil/gslib/commands/config.pyc +0 -0
- data/packages/gsutil/gslib/commands/cp.py +1818 -0
- data/packages/gsutil/gslib/commands/cp.pyc +0 -0
- data/packages/gsutil/gslib/commands/disablelogging.py +101 -0
- data/packages/gsutil/gslib/commands/disablelogging.pyc +0 -0
- data/packages/gsutil/gslib/commands/enablelogging.py +149 -0
- data/packages/gsutil/gslib/commands/enablelogging.pyc +0 -0
- data/packages/gsutil/gslib/commands/getacl.py +82 -0
- data/packages/gsutil/gslib/commands/getacl.pyc +0 -0
- data/packages/gsutil/gslib/commands/getcors.py +121 -0
- data/packages/gsutil/gslib/commands/getcors.pyc +0 -0
- data/packages/gsutil/gslib/commands/getdefacl.py +86 -0
- data/packages/gsutil/gslib/commands/getdefacl.pyc +0 -0
- data/packages/gsutil/gslib/commands/getlogging.py +137 -0
- data/packages/gsutil/gslib/commands/getlogging.pyc +0 -0
- data/packages/gsutil/gslib/commands/getversioning.py +116 -0
- data/packages/gsutil/gslib/commands/getversioning.pyc +0 -0
- data/packages/gsutil/gslib/commands/getwebcfg.py +122 -0
- data/packages/gsutil/gslib/commands/getwebcfg.pyc +0 -0
- data/packages/gsutil/gslib/commands/help.py +218 -0
- data/packages/gsutil/gslib/commands/help.pyc +0 -0
- data/packages/gsutil/gslib/commands/ls.py +578 -0
- data/packages/gsutil/gslib/commands/ls.pyc +0 -0
- data/packages/gsutil/gslib/commands/mb.py +172 -0
- data/packages/gsutil/gslib/commands/mb.pyc +0 -0
- data/packages/gsutil/gslib/commands/mv.py +159 -0
- data/packages/gsutil/gslib/commands/mv.pyc +0 -0
- data/packages/gsutil/gslib/commands/perfdiag.py +903 -0
- data/packages/gsutil/gslib/commands/perfdiag.pyc +0 -0
- data/packages/gsutil/gslib/commands/rb.py +113 -0
- data/packages/gsutil/gslib/commands/rb.pyc +0 -0
- data/packages/gsutil/gslib/commands/rm.py +239 -0
- data/packages/gsutil/gslib/commands/rm.pyc +0 -0
- data/packages/gsutil/gslib/commands/setacl.py +138 -0
- data/packages/gsutil/gslib/commands/setacl.pyc +0 -0
- data/packages/gsutil/gslib/commands/setcors.py +145 -0
- data/packages/gsutil/gslib/commands/setcors.pyc +0 -0
- data/packages/gsutil/gslib/commands/setdefacl.py +105 -0
- data/packages/gsutil/gslib/commands/setdefacl.pyc +0 -0
- data/packages/gsutil/gslib/commands/setmeta.py +428 -0
- data/packages/gsutil/gslib/commands/setmeta.pyc +0 -0
- data/packages/gsutil/gslib/commands/setversioning.py +114 -0
- data/packages/gsutil/gslib/commands/setversioning.pyc +0 -0
- data/packages/gsutil/gslib/commands/setwebcfg.py +190 -0
- data/packages/gsutil/gslib/commands/setwebcfg.pyc +0 -0
- data/packages/gsutil/gslib/commands/test.py +228 -0
- data/packages/gsutil/gslib/commands/test.pyc +0 -0
- data/packages/gsutil/gslib/commands/update.py +305 -0
- data/packages/gsutil/gslib/commands/update.pyc +0 -0
- data/packages/gsutil/gslib/commands/version.py +150 -0
- data/packages/gsutil/gslib/commands/version.pyc +0 -0
- data/packages/gsutil/gslib/exception.py +76 -0
- data/packages/gsutil/gslib/exception.pyc +0 -0
- data/packages/gsutil/gslib/help_provider.py +81 -0
- data/packages/gsutil/gslib/help_provider.pyc +0 -0
- data/packages/gsutil/gslib/name_expansion.py +550 -0
- data/packages/gsutil/gslib/name_expansion.pyc +0 -0
- data/packages/gsutil/gslib/no_op_auth_plugin.py +30 -0
- data/packages/gsutil/gslib/plurality_checkable_iterator.py +56 -0
- data/packages/gsutil/gslib/plurality_checkable_iterator.pyc +0 -0
- data/packages/gsutil/gslib/project_id.py +67 -0
- data/packages/gsutil/gslib/project_id.pyc +0 -0
- data/packages/gsutil/gslib/storage_uri_builder.py +56 -0
- data/packages/gsutil/gslib/storage_uri_builder.pyc +0 -0
- data/packages/gsutil/gslib/tests/__init__.py +15 -0
- data/packages/gsutil/gslib/tests/__init__.pyc +0 -0
- data/packages/gsutil/gslib/tests/test_chacl.py +236 -0
- data/packages/gsutil/gslib/tests/test_cp.py +267 -0
- data/packages/gsutil/gslib/tests/test_data/test.gif +0 -0
- data/packages/gsutil/gslib/tests/test_data/test.mp3 +0 -0
- data/packages/gsutil/gslib/tests/test_ls.py +66 -0
- data/packages/gsutil/gslib/tests/test_mv.py +69 -0
- data/packages/gsutil/gslib/tests/test_naming.py +989 -0
- data/packages/gsutil/gslib/tests/test_perfdiag.py +41 -0
- data/packages/gsutil/gslib/tests/test_plurality_checkable_iterator.py +67 -0
- data/packages/gsutil/gslib/tests/test_rm.py +143 -0
- data/packages/gsutil/gslib/tests/test_setacl.py +152 -0
- data/packages/gsutil/gslib/tests/test_setcors.py +168 -0
- data/packages/gsutil/gslib/tests/test_setmeta.py +91 -0
- data/packages/gsutil/gslib/tests/test_setversioning.py +44 -0
- data/packages/gsutil/gslib/tests/test_setwebcfg.py +63 -0
- data/packages/gsutil/gslib/tests/test_thread_pool.py +92 -0
- data/packages/gsutil/gslib/tests/test_wildcard_iterator.py +364 -0
- data/packages/gsutil/gslib/tests/testcase/__init__.py +18 -0
- data/packages/gsutil/gslib/tests/testcase/base.py +89 -0
- data/packages/gsutil/gslib/tests/testcase/integration_testcase.py +197 -0
- data/packages/gsutil/gslib/tests/testcase/unit_testcase.py +230 -0
- data/packages/gsutil/gslib/tests/util.py +125 -0
- data/packages/gsutil/gslib/tests/util.pyc +0 -0
- data/packages/gsutil/gslib/thread_pool.py +79 -0
- data/packages/gsutil/gslib/thread_pool.pyc +0 -0
- data/packages/gsutil/gslib/util.py +151 -0
- data/packages/gsutil/gslib/util.pyc +0 -0
- data/packages/gsutil/gslib/wildcard_iterator.py +492 -0
- data/packages/gsutil/gslib/wildcard_iterator.pyc +0 -0
- data/packages/gsutil/gsutil +377 -0
- data/packages/gsutil/gsutil.spec.in +75 -0
- data/packages/gsutil/oauth2_plugin/__init__.py +22 -0
- data/packages/gsutil/oauth2_plugin/__init__.pyc +0 -0
- data/packages/gsutil/oauth2_plugin/oauth2_client.py +642 -0
- data/packages/gsutil/oauth2_plugin/oauth2_client.pyc +0 -0
- data/packages/gsutil/oauth2_plugin/oauth2_client_test.py +374 -0
- data/packages/gsutil/oauth2_plugin/oauth2_helper.py +110 -0
- data/packages/gsutil/oauth2_plugin/oauth2_helper.pyc +0 -0
- data/packages/gsutil/oauth2_plugin/oauth2_plugin.py +24 -0
- data/packages/gsutil/oauth2_plugin/oauth2_plugin.pyc +0 -0
- data/packages/gsutil/pkg_gen.sh +54 -0
- data/packages/gsutil/pkg_util.py +60 -0
- data/packages/gsutil/setup.py +141 -0
- data/packages/gsutil/third_party/__init__.py +0 -0
- data/packages/gsutil/third_party/__init__.pyc +0 -0
- data/packages/gsutil/third_party/fancy_urllib/README +21 -0
- data/packages/gsutil/third_party/fancy_urllib/__init__.py +398 -0
- data/packages/gsutil/third_party/fancy_urllib/__init__.pyc +0 -0
- data/tasks/rubygem.rake +3 -1
- metadata +770 -7
- metadata.gz.sig +0 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
"""
|
2
|
+
Exceptions that are specific to the dynamodb module.
|
3
|
+
"""
|
4
|
+
from boto.exception import BotoServerError, BotoClientError
|
5
|
+
from boto.exception import DynamoDBResponseError
|
6
|
+
|
7
|
+
|
8
|
+
class DynamoDBExpiredTokenError(BotoServerError):
|
9
|
+
"""
|
10
|
+
Raised when a DynamoDB security token expires. This is generally boto's
|
11
|
+
(or the user's) notice to renew their DynamoDB security tokens.
|
12
|
+
"""
|
13
|
+
pass
|
14
|
+
|
15
|
+
|
16
|
+
class DynamoDBKeyNotFoundError(BotoClientError):
|
17
|
+
"""
|
18
|
+
Raised when attempting to retrieve or interact with an item whose key
|
19
|
+
can't be found.
|
20
|
+
"""
|
21
|
+
pass
|
22
|
+
|
23
|
+
|
24
|
+
class DynamoDBItemError(BotoClientError):
|
25
|
+
"""
|
26
|
+
Raised when invalid parameters are passed when creating a
|
27
|
+
new Item in DynamoDB.
|
28
|
+
"""
|
29
|
+
pass
|
30
|
+
|
31
|
+
|
32
|
+
class DynamoDBNumberError(BotoClientError):
|
33
|
+
"""
|
34
|
+
Raised in the event of incompatible numeric type casting.
|
35
|
+
"""
|
36
|
+
pass
|
37
|
+
|
38
|
+
|
39
|
+
class DynamoDBConditionalCheckFailedError(DynamoDBResponseError):
|
40
|
+
"""
|
41
|
+
Raised when a ConditionalCheckFailedException response is received.
|
42
|
+
This happens when a conditional check, expressed via the expected_value
|
43
|
+
paramenter, fails.
|
44
|
+
"""
|
45
|
+
pass
|
46
|
+
|
47
|
+
|
48
|
+
class DynamoDBValidationError(DynamoDBResponseError):
|
49
|
+
"""
|
50
|
+
Raised when a ValidationException response is received. This happens
|
51
|
+
when one or more required parameter values are missing, or if the item
|
52
|
+
has exceeded the 64Kb size limit.
|
53
|
+
"""
|
54
|
+
pass
|
55
|
+
|
56
|
+
|
57
|
+
class DynamoDBThroughputExceededError(DynamoDBResponseError):
|
58
|
+
"""
|
59
|
+
Raised when the provisioned throughput has been exceeded.
|
60
|
+
Normally, when provisioned throughput is exceeded the operation
|
61
|
+
is retried. If the retries are exhausted then this exception
|
62
|
+
will be raised.
|
63
|
+
"""
|
64
|
+
pass
|
@@ -0,0 +1,196 @@
|
|
1
|
+
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
|
2
|
+
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
5
|
+
# copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish, dis-
|
8
|
+
# tribute, sublicense, and/or sell copies of the Software, and to permit
|
9
|
+
# persons to whom the Software is furnished to do so, subject to the fol-
|
10
|
+
# lowing conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included
|
13
|
+
# in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
|
17
|
+
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
18
|
+
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
19
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
21
|
+
# IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
|
24
|
+
from boto.dynamodb.exceptions import DynamoDBItemError
|
25
|
+
|
26
|
+
|
27
|
+
class Item(dict):
|
28
|
+
"""
|
29
|
+
An item in Amazon DynamoDB.
|
30
|
+
|
31
|
+
:ivar hash_key: The HashKey of this item.
|
32
|
+
:ivar range_key: The RangeKey of this item or None if no RangeKey
|
33
|
+
is defined.
|
34
|
+
:ivar hash_key_name: The name of the HashKey associated with this item.
|
35
|
+
:ivar range_key_name: The name of the RangeKey associated with this item.
|
36
|
+
:ivar table: The Table this item belongs to.
|
37
|
+
"""
|
38
|
+
|
39
|
+
def __init__(self, table, hash_key=None, range_key=None, attrs=None):
|
40
|
+
self.table = table
|
41
|
+
self._updates = None
|
42
|
+
self._hash_key_name = self.table.schema.hash_key_name
|
43
|
+
self._range_key_name = self.table.schema.range_key_name
|
44
|
+
if attrs == None:
|
45
|
+
attrs = {}
|
46
|
+
if hash_key == None:
|
47
|
+
hash_key = attrs.get(self._hash_key_name, None)
|
48
|
+
self[self._hash_key_name] = hash_key
|
49
|
+
if self._range_key_name:
|
50
|
+
if range_key == None:
|
51
|
+
range_key = attrs.get(self._range_key_name, None)
|
52
|
+
self[self._range_key_name] = range_key
|
53
|
+
for key, value in attrs.items():
|
54
|
+
if key != self._hash_key_name and key != self._range_key_name:
|
55
|
+
self[key] = value
|
56
|
+
self.consumed_units = 0
|
57
|
+
self._updates = {}
|
58
|
+
|
59
|
+
@property
|
60
|
+
def hash_key(self):
|
61
|
+
return self[self._hash_key_name]
|
62
|
+
|
63
|
+
@property
|
64
|
+
def range_key(self):
|
65
|
+
return self.get(self._range_key_name)
|
66
|
+
|
67
|
+
@property
|
68
|
+
def hash_key_name(self):
|
69
|
+
return self._hash_key_name
|
70
|
+
|
71
|
+
@property
|
72
|
+
def range_key_name(self):
|
73
|
+
return self._range_key_name
|
74
|
+
|
75
|
+
def add_attribute(self, attr_name, attr_value):
|
76
|
+
"""
|
77
|
+
Queue the addition of an attribute to an item in DynamoDB.
|
78
|
+
This will eventually result in an UpdateItem request being issued
|
79
|
+
with an update action of ADD when the save method is called.
|
80
|
+
|
81
|
+
:type attr_name: str
|
82
|
+
:param attr_name: Name of the attribute you want to alter.
|
83
|
+
|
84
|
+
:type attr_value: int|long|float|set
|
85
|
+
:param attr_value: Value which is to be added to the attribute.
|
86
|
+
"""
|
87
|
+
self._updates[attr_name] = ("ADD", attr_value)
|
88
|
+
|
89
|
+
def delete_attribute(self, attr_name, attr_value=None):
|
90
|
+
"""
|
91
|
+
Queue the deletion of an attribute from an item in DynamoDB.
|
92
|
+
This call will result in a UpdateItem request being issued
|
93
|
+
with update action of DELETE when the save method is called.
|
94
|
+
|
95
|
+
:type attr_name: str
|
96
|
+
:param attr_name: Name of the attribute you want to alter.
|
97
|
+
|
98
|
+
:type attr_value: set
|
99
|
+
:param attr_value: A set of values to be removed from the attribute.
|
100
|
+
This parameter is optional. If None, the whole attribute is
|
101
|
+
removed from the item.
|
102
|
+
"""
|
103
|
+
self._updates[attr_name] = ("DELETE", attr_value)
|
104
|
+
|
105
|
+
def put_attribute(self, attr_name, attr_value):
|
106
|
+
"""
|
107
|
+
Queue the putting of an attribute to an item in DynamoDB.
|
108
|
+
This call will result in an UpdateItem request being issued
|
109
|
+
with the update action of PUT when the save method is called.
|
110
|
+
|
111
|
+
:type attr_name: str
|
112
|
+
:param attr_name: Name of the attribute you want to alter.
|
113
|
+
|
114
|
+
:type attr_value: int|long|float|str|set
|
115
|
+
:param attr_value: New value of the attribute.
|
116
|
+
"""
|
117
|
+
self._updates[attr_name] = ("PUT", attr_value)
|
118
|
+
|
119
|
+
def save(self, expected_value=None, return_values=None):
|
120
|
+
"""
|
121
|
+
Commits pending updates to Amazon DynamoDB.
|
122
|
+
|
123
|
+
:type expected_value: dict
|
124
|
+
:param expected_value: A dictionary of name/value pairs that
|
125
|
+
you expect. This dictionary should have name/value pairs
|
126
|
+
where the name is the name of the attribute and the value is
|
127
|
+
either the value you are expecting or False if you expect
|
128
|
+
the attribute not to exist.
|
129
|
+
|
130
|
+
:type return_values: str
|
131
|
+
:param return_values: Controls the return of attribute name/value pairs
|
132
|
+
before they were updated. Possible values are: None, 'ALL_OLD',
|
133
|
+
'UPDATED_OLD', 'ALL_NEW' or 'UPDATED_NEW'. If 'ALL_OLD' is
|
134
|
+
specified and the item is overwritten, the content of the old item
|
135
|
+
is returned. If 'ALL_NEW' is specified, then all the attributes of
|
136
|
+
the new version of the item are returned. If 'UPDATED_NEW' is
|
137
|
+
specified, the new versions of only the updated attributes are
|
138
|
+
returned.
|
139
|
+
"""
|
140
|
+
return self.table.layer2.update_item(self, expected_value,
|
141
|
+
return_values)
|
142
|
+
|
143
|
+
def delete(self, expected_value=None, return_values=None):
|
144
|
+
"""
|
145
|
+
Delete the item from DynamoDB.
|
146
|
+
|
147
|
+
:type expected_value: dict
|
148
|
+
:param expected_value: A dictionary of name/value pairs that
|
149
|
+
you expect. This dictionary should have name/value pairs
|
150
|
+
where the name is the name of the attribute and the value
|
151
|
+
is either the value you are expecting or False if you expect
|
152
|
+
the attribute not to exist.
|
153
|
+
|
154
|
+
:type return_values: str
|
155
|
+
:param return_values: Controls the return of attribute
|
156
|
+
name-value pairs before then were changed. Possible
|
157
|
+
values are: None or 'ALL_OLD'. If 'ALL_OLD' is
|
158
|
+
specified and the item is overwritten, the content
|
159
|
+
of the old item is returned.
|
160
|
+
"""
|
161
|
+
return self.table.layer2.delete_item(self, expected_value,
|
162
|
+
return_values)
|
163
|
+
|
164
|
+
def put(self, expected_value=None, return_values=None):
|
165
|
+
"""
|
166
|
+
Store a new item or completely replace an existing item
|
167
|
+
in Amazon DynamoDB.
|
168
|
+
|
169
|
+
:type expected_value: dict
|
170
|
+
:param expected_value: A dictionary of name/value pairs that
|
171
|
+
you expect. This dictionary should have name/value pairs
|
172
|
+
where the name is the name of the attribute and the value
|
173
|
+
is either the value you are expecting or False if you expect
|
174
|
+
the attribute not to exist.
|
175
|
+
|
176
|
+
:type return_values: str
|
177
|
+
:param return_values: Controls the return of attribute
|
178
|
+
name-value pairs before then were changed. Possible
|
179
|
+
values are: None or 'ALL_OLD'. If 'ALL_OLD' is
|
180
|
+
specified and the item is overwritten, the content
|
181
|
+
of the old item is returned.
|
182
|
+
"""
|
183
|
+
return self.table.layer2.put_item(self, expected_value, return_values)
|
184
|
+
|
185
|
+
def __setitem__(self, key, value):
|
186
|
+
"""Overrwrite the setter to instead update the _updates
|
187
|
+
method so this can act like a normal dict"""
|
188
|
+
if self._updates is not None:
|
189
|
+
self.put_attribute(key, value)
|
190
|
+
dict.__setitem__(self, key, value)
|
191
|
+
|
192
|
+
def __delitem__(self, key):
|
193
|
+
"""Remove this key from the items"""
|
194
|
+
if self._updates is not None:
|
195
|
+
self.delete_attribute(key)
|
196
|
+
dict.__delitem__(self, key)
|
@@ -0,0 +1,575 @@
|
|
1
|
+
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
|
2
|
+
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a
|
5
|
+
# copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish, dis-
|
8
|
+
# tribute, sublicense, and/or sell copies of the Software, and to permit
|
9
|
+
# persons to whom the Software is furnished to do so, subject to the fol-
|
10
|
+
# lowing conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included
|
13
|
+
# in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
|
+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
|
17
|
+
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
18
|
+
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
19
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
21
|
+
# IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
import time
|
24
|
+
from binascii import crc32
|
25
|
+
|
26
|
+
import boto
|
27
|
+
from boto.connection import AWSAuthConnection
|
28
|
+
from boto.exception import DynamoDBResponseError
|
29
|
+
from boto.provider import Provider
|
30
|
+
from boto.dynamodb import exceptions as dynamodb_exceptions
|
31
|
+
from boto.compat import json
|
32
|
+
|
33
|
+
|
34
|
+
class Layer1(AWSAuthConnection):
|
35
|
+
"""
|
36
|
+
This is the lowest-level interface to DynamoDB. Methods at this
|
37
|
+
layer map directly to API requests and parameters to the methods
|
38
|
+
are either simple, scalar values or they are the Python equivalent
|
39
|
+
of the JSON input as defined in the DynamoDB Developer's Guide.
|
40
|
+
All responses are direct decoding of the JSON response bodies to
|
41
|
+
Python data structures via the json or simplejson modules.
|
42
|
+
|
43
|
+
:ivar throughput_exceeded_events: An integer variable that
|
44
|
+
keeps a running total of the number of ThroughputExceeded
|
45
|
+
responses this connection has received from Amazon DynamoDB.
|
46
|
+
"""
|
47
|
+
|
48
|
+
DefaultRegionName = 'us-east-1'
|
49
|
+
"""The default region name for DynamoDB API."""
|
50
|
+
|
51
|
+
ServiceName = 'DynamoDB'
|
52
|
+
"""The name of the Service"""
|
53
|
+
|
54
|
+
Version = '20111205'
|
55
|
+
"""DynamoDB API version."""
|
56
|
+
|
57
|
+
ThruputError = "ProvisionedThroughputExceededException"
|
58
|
+
"""The error response returned when provisioned throughput is exceeded"""
|
59
|
+
|
60
|
+
SessionExpiredError = 'com.amazon.coral.service#ExpiredTokenException'
|
61
|
+
"""The error response returned when session token has expired"""
|
62
|
+
|
63
|
+
ConditionalCheckFailedError = 'ConditionalCheckFailedException'
|
64
|
+
"""The error response returned when a conditional check fails"""
|
65
|
+
|
66
|
+
ValidationError = 'ValidationException'
|
67
|
+
"""The error response returned when an item is invalid in some way"""
|
68
|
+
|
69
|
+
ResponseError = DynamoDBResponseError
|
70
|
+
|
71
|
+
NumberRetries = 10
|
72
|
+
"""The number of times an error is retried."""
|
73
|
+
|
74
|
+
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
|
75
|
+
is_secure=True, port=None, proxy=None, proxy_port=None,
|
76
|
+
debug=0, security_token=None, region=None,
|
77
|
+
validate_certs=True, validate_checksums=True):
|
78
|
+
if not region:
|
79
|
+
region_name = boto.config.get('DynamoDB', 'region',
|
80
|
+
self.DefaultRegionName)
|
81
|
+
for reg in boto.dynamodb.regions():
|
82
|
+
if reg.name == region_name:
|
83
|
+
region = reg
|
84
|
+
break
|
85
|
+
|
86
|
+
self.region = region
|
87
|
+
AWSAuthConnection.__init__(self, self.region.endpoint,
|
88
|
+
aws_access_key_id,
|
89
|
+
aws_secret_access_key,
|
90
|
+
is_secure, port, proxy, proxy_port,
|
91
|
+
debug=debug, security_token=security_token,
|
92
|
+
validate_certs=validate_certs)
|
93
|
+
self.throughput_exceeded_events = 0
|
94
|
+
self._validate_checksums = boto.config.getbool(
|
95
|
+
'DynamoDB', 'validate_checksums', validate_checksums)
|
96
|
+
|
97
|
+
def _get_session_token(self):
|
98
|
+
self.provider = Provider(self._provider_type)
|
99
|
+
self._auth_handler.update_provider(self.provider)
|
100
|
+
|
101
|
+
def _required_auth_capability(self):
|
102
|
+
return ['hmac-v4']
|
103
|
+
|
104
|
+
def make_request(self, action, body='', object_hook=None):
|
105
|
+
"""
|
106
|
+
:raises: ``DynamoDBExpiredTokenError`` if the security token expires.
|
107
|
+
"""
|
108
|
+
headers = {'X-Amz-Target': '%s_%s.%s' % (self.ServiceName,
|
109
|
+
self.Version, action),
|
110
|
+
'Host': self.region.endpoint,
|
111
|
+
'Content-Type': 'application/x-amz-json-1.0',
|
112
|
+
'Content-Length': str(len(body))}
|
113
|
+
http_request = self.build_base_http_request('POST', '/', '/',
|
114
|
+
{}, headers, body, None)
|
115
|
+
start = time.time()
|
116
|
+
response = self._mexe(http_request, sender=None,
|
117
|
+
override_num_retries=self.NumberRetries,
|
118
|
+
retry_handler=self._retry_handler)
|
119
|
+
elapsed = (time.time() - start) * 1000
|
120
|
+
request_id = response.getheader('x-amzn-RequestId')
|
121
|
+
boto.log.debug('RequestId: %s' % request_id)
|
122
|
+
boto.perflog.debug('%s: id=%s time=%sms',
|
123
|
+
headers['X-Amz-Target'], request_id, int(elapsed))
|
124
|
+
response_body = response.read()
|
125
|
+
boto.log.debug(response_body)
|
126
|
+
return json.loads(response_body, object_hook=object_hook)
|
127
|
+
|
128
|
+
def _retry_handler(self, response, i, next_sleep):
|
129
|
+
status = None
|
130
|
+
if response.status == 400:
|
131
|
+
response_body = response.read()
|
132
|
+
boto.log.debug(response_body)
|
133
|
+
data = json.loads(response_body)
|
134
|
+
if self.ThruputError in data.get('__type'):
|
135
|
+
self.throughput_exceeded_events += 1
|
136
|
+
msg = "%s, retry attempt %s" % (self.ThruputError, i)
|
137
|
+
next_sleep = self._exponential_time(i)
|
138
|
+
i += 1
|
139
|
+
status = (msg, i, next_sleep)
|
140
|
+
if i == self.NumberRetries:
|
141
|
+
# If this was our last retry attempt, raise
|
142
|
+
# a specific error saying that the throughput
|
143
|
+
# was exceeded.
|
144
|
+
raise dynamodb_exceptions.DynamoDBThroughputExceededError(
|
145
|
+
response.status, response.reason, data)
|
146
|
+
elif self.SessionExpiredError in data.get('__type'):
|
147
|
+
msg = 'Renewing Session Token'
|
148
|
+
self._get_session_token()
|
149
|
+
status = (msg, i + self.num_retries - 1, 0)
|
150
|
+
elif self.ConditionalCheckFailedError in data.get('__type'):
|
151
|
+
raise dynamodb_exceptions.DynamoDBConditionalCheckFailedError(
|
152
|
+
response.status, response.reason, data)
|
153
|
+
elif self.ValidationError in data.get('__type'):
|
154
|
+
raise dynamodb_exceptions.DynamoDBValidationError(
|
155
|
+
response.status, response.reason, data)
|
156
|
+
else:
|
157
|
+
raise self.ResponseError(response.status, response.reason,
|
158
|
+
data)
|
159
|
+
expected_crc32 = response.getheader('x-amz-crc32')
|
160
|
+
if self._validate_checksums and expected_crc32 is not None:
|
161
|
+
boto.log.debug('Validating crc32 checksum for body: %s',
|
162
|
+
response.read())
|
163
|
+
actual_crc32 = crc32(response.read()) & 0xffffffff
|
164
|
+
expected_crc32 = int(expected_crc32)
|
165
|
+
if actual_crc32 != expected_crc32:
|
166
|
+
msg = ("The calculated checksum %s did not match the expected "
|
167
|
+
"checksum %s" % (actual_crc32, expected_crc32))
|
168
|
+
status = (msg, i + 1, self._exponential_time(i))
|
169
|
+
return status
|
170
|
+
|
171
|
+
def _exponential_time(self, i):
|
172
|
+
if i == 0:
|
173
|
+
next_sleep = 0
|
174
|
+
else:
|
175
|
+
next_sleep = 0.05 * (2 ** i)
|
176
|
+
return next_sleep
|
177
|
+
|
178
|
+
def list_tables(self, limit=None, start_table=None):
|
179
|
+
"""
|
180
|
+
Returns a dictionary of results. The dictionary contains
|
181
|
+
a **TableNames** key whose value is a list of the table names.
|
182
|
+
The dictionary could also contain a **LastEvaluatedTableName**
|
183
|
+
key whose value would be the last table name returned if
|
184
|
+
the complete list of table names was not returned. This
|
185
|
+
value would then be passed as the ``start_table`` parameter on
|
186
|
+
a subsequent call to this method.
|
187
|
+
|
188
|
+
:type limit: int
|
189
|
+
:param limit: The maximum number of tables to return.
|
190
|
+
|
191
|
+
:type start_table: str
|
192
|
+
:param start_table: The name of the table that starts the
|
193
|
+
list. If you ran a previous list_tables and not
|
194
|
+
all results were returned, the response dict would
|
195
|
+
include a LastEvaluatedTableName attribute. Use
|
196
|
+
that value here to continue the listing.
|
197
|
+
"""
|
198
|
+
data = {}
|
199
|
+
if limit:
|
200
|
+
data['Limit'] = limit
|
201
|
+
if start_table:
|
202
|
+
data['ExclusiveStartTableName'] = start_table
|
203
|
+
json_input = json.dumps(data)
|
204
|
+
return self.make_request('ListTables', json_input)
|
205
|
+
|
206
|
+
def describe_table(self, table_name):
|
207
|
+
"""
|
208
|
+
Returns information about the table including current
|
209
|
+
state of the table, primary key schema and when the
|
210
|
+
table was created.
|
211
|
+
|
212
|
+
:type table_name: str
|
213
|
+
:param table_name: The name of the table to describe.
|
214
|
+
"""
|
215
|
+
data = {'TableName': table_name}
|
216
|
+
json_input = json.dumps(data)
|
217
|
+
return self.make_request('DescribeTable', json_input)
|
218
|
+
|
219
|
+
def create_table(self, table_name, schema, provisioned_throughput):
|
220
|
+
"""
|
221
|
+
Add a new table to your account. The table name must be unique
|
222
|
+
among those associated with the account issuing the request.
|
223
|
+
This request triggers an asynchronous workflow to begin creating
|
224
|
+
the table. When the workflow is complete, the state of the
|
225
|
+
table will be ACTIVE.
|
226
|
+
|
227
|
+
:type table_name: str
|
228
|
+
:param table_name: The name of the table to create.
|
229
|
+
|
230
|
+
:type schema: dict
|
231
|
+
:param schema: A Python version of the KeySchema data structure
|
232
|
+
as defined by DynamoDB
|
233
|
+
|
234
|
+
:type provisioned_throughput: dict
|
235
|
+
:param provisioned_throughput: A Python version of the
|
236
|
+
ProvisionedThroughput data structure defined by
|
237
|
+
DynamoDB.
|
238
|
+
"""
|
239
|
+
data = {'TableName': table_name,
|
240
|
+
'KeySchema': schema,
|
241
|
+
'ProvisionedThroughput': provisioned_throughput}
|
242
|
+
json_input = json.dumps(data)
|
243
|
+
response_dict = self.make_request('CreateTable', json_input)
|
244
|
+
return response_dict
|
245
|
+
|
246
|
+
def update_table(self, table_name, provisioned_throughput):
|
247
|
+
"""
|
248
|
+
Updates the provisioned throughput for a given table.
|
249
|
+
|
250
|
+
:type table_name: str
|
251
|
+
:param table_name: The name of the table to update.
|
252
|
+
|
253
|
+
:type provisioned_throughput: dict
|
254
|
+
:param provisioned_throughput: A Python version of the
|
255
|
+
ProvisionedThroughput data structure defined by
|
256
|
+
DynamoDB.
|
257
|
+
"""
|
258
|
+
data = {'TableName': table_name,
|
259
|
+
'ProvisionedThroughput': provisioned_throughput}
|
260
|
+
json_input = json.dumps(data)
|
261
|
+
return self.make_request('UpdateTable', json_input)
|
262
|
+
|
263
|
+
def delete_table(self, table_name):
|
264
|
+
"""
|
265
|
+
Deletes the table and all of it's data. After this request
|
266
|
+
the table will be in the DELETING state until DynamoDB
|
267
|
+
completes the delete operation.
|
268
|
+
|
269
|
+
:type table_name: str
|
270
|
+
:param table_name: The name of the table to delete.
|
271
|
+
"""
|
272
|
+
data = {'TableName': table_name}
|
273
|
+
json_input = json.dumps(data)
|
274
|
+
return self.make_request('DeleteTable', json_input)
|
275
|
+
|
276
|
+
def get_item(self, table_name, key, attributes_to_get=None,
|
277
|
+
consistent_read=False, object_hook=None):
|
278
|
+
"""
|
279
|
+
Return a set of attributes for an item that matches
|
280
|
+
the supplied key.
|
281
|
+
|
282
|
+
:type table_name: str
|
283
|
+
:param table_name: The name of the table containing the item.
|
284
|
+
|
285
|
+
:type key: dict
|
286
|
+
:param key: A Python version of the Key data structure
|
287
|
+
defined by DynamoDB.
|
288
|
+
|
289
|
+
:type attributes_to_get: list
|
290
|
+
:param attributes_to_get: A list of attribute names.
|
291
|
+
If supplied, only the specified attribute names will
|
292
|
+
be returned. Otherwise, all attributes will be returned.
|
293
|
+
|
294
|
+
:type consistent_read: bool
|
295
|
+
:param consistent_read: If True, a consistent read
|
296
|
+
request is issued. Otherwise, an eventually consistent
|
297
|
+
request is issued.
|
298
|
+
"""
|
299
|
+
data = {'TableName': table_name,
|
300
|
+
'Key': key}
|
301
|
+
if attributes_to_get:
|
302
|
+
data['AttributesToGet'] = attributes_to_get
|
303
|
+
if consistent_read:
|
304
|
+
data['ConsistentRead'] = True
|
305
|
+
json_input = json.dumps(data)
|
306
|
+
response = self.make_request('GetItem', json_input,
|
307
|
+
object_hook=object_hook)
|
308
|
+
if 'Item' not in response:
|
309
|
+
raise dynamodb_exceptions.DynamoDBKeyNotFoundError(
|
310
|
+
"Key does not exist."
|
311
|
+
)
|
312
|
+
return response
|
313
|
+
|
314
|
+
def batch_get_item(self, request_items, object_hook=None):
|
315
|
+
"""
|
316
|
+
Return a set of attributes for a multiple items in
|
317
|
+
multiple tables using their primary keys.
|
318
|
+
|
319
|
+
:type request_items: dict
|
320
|
+
:param request_items: A Python version of the RequestItems
|
321
|
+
data structure defined by DynamoDB.
|
322
|
+
"""
|
323
|
+
# If the list is empty, return empty response
|
324
|
+
if not request_items:
|
325
|
+
return {}
|
326
|
+
data = {'RequestItems': request_items}
|
327
|
+
json_input = json.dumps(data)
|
328
|
+
return self.make_request('BatchGetItem', json_input,
|
329
|
+
object_hook=object_hook)
|
330
|
+
|
331
|
+
def batch_write_item(self, request_items, object_hook=None):
|
332
|
+
"""
|
333
|
+
This operation enables you to put or delete several items
|
334
|
+
across multiple tables in a single API call.
|
335
|
+
|
336
|
+
:type request_items: dict
|
337
|
+
:param request_items: A Python version of the RequestItems
|
338
|
+
data structure defined by DynamoDB.
|
339
|
+
"""
|
340
|
+
data = {'RequestItems': request_items}
|
341
|
+
json_input = json.dumps(data)
|
342
|
+
return self.make_request('BatchWriteItem', json_input,
|
343
|
+
object_hook=object_hook)
|
344
|
+
|
345
|
+
def put_item(self, table_name, item,
|
346
|
+
expected=None, return_values=None,
|
347
|
+
object_hook=None):
|
348
|
+
"""
|
349
|
+
Create a new item or replace an old item with a new
|
350
|
+
item (including all attributes). If an item already
|
351
|
+
exists in the specified table with the same primary
|
352
|
+
key, the new item will completely replace the old item.
|
353
|
+
You can perform a conditional put by specifying an
|
354
|
+
expected rule.
|
355
|
+
|
356
|
+
:type table_name: str
|
357
|
+
:param table_name: The name of the table in which to put the item.
|
358
|
+
|
359
|
+
:type item: dict
|
360
|
+
:param item: A Python version of the Item data structure
|
361
|
+
defined by DynamoDB.
|
362
|
+
|
363
|
+
:type expected: dict
|
364
|
+
:param expected: A Python version of the Expected
|
365
|
+
data structure defined by DynamoDB.
|
366
|
+
|
367
|
+
:type return_values: str
|
368
|
+
:param return_values: Controls the return of attribute
|
369
|
+
name-value pairs before then were changed. Possible
|
370
|
+
values are: None or 'ALL_OLD'. If 'ALL_OLD' is
|
371
|
+
specified and the item is overwritten, the content
|
372
|
+
of the old item is returned.
|
373
|
+
"""
|
374
|
+
data = {'TableName': table_name,
|
375
|
+
'Item': item}
|
376
|
+
if expected:
|
377
|
+
data['Expected'] = expected
|
378
|
+
if return_values:
|
379
|
+
data['ReturnValues'] = return_values
|
380
|
+
json_input = json.dumps(data)
|
381
|
+
return self.make_request('PutItem', json_input,
|
382
|
+
object_hook=object_hook)
|
383
|
+
|
384
|
+
def update_item(self, table_name, key, attribute_updates,
|
385
|
+
expected=None, return_values=None,
|
386
|
+
object_hook=None):
|
387
|
+
"""
|
388
|
+
Edits an existing item's attributes. You can perform a conditional
|
389
|
+
update (insert a new attribute name-value pair if it doesn't exist,
|
390
|
+
or replace an existing name-value pair if it has certain expected
|
391
|
+
attribute values).
|
392
|
+
|
393
|
+
:type table_name: str
|
394
|
+
:param table_name: The name of the table.
|
395
|
+
|
396
|
+
:type key: dict
|
397
|
+
:param key: A Python version of the Key data structure
|
398
|
+
defined by DynamoDB which identifies the item to be updated.
|
399
|
+
|
400
|
+
:type attribute_updates: dict
|
401
|
+
:param attribute_updates: A Python version of the AttributeUpdates
|
402
|
+
data structure defined by DynamoDB.
|
403
|
+
|
404
|
+
:type expected: dict
|
405
|
+
:param expected: A Python version of the Expected
|
406
|
+
data structure defined by DynamoDB.
|
407
|
+
|
408
|
+
:type return_values: str
|
409
|
+
:param return_values: Controls the return of attribute
|
410
|
+
name-value pairs before then were changed. Possible
|
411
|
+
values are: None or 'ALL_OLD'. If 'ALL_OLD' is
|
412
|
+
specified and the item is overwritten, the content
|
413
|
+
of the old item is returned.
|
414
|
+
"""
|
415
|
+
data = {'TableName': table_name,
|
416
|
+
'Key': key,
|
417
|
+
'AttributeUpdates': attribute_updates}
|
418
|
+
if expected:
|
419
|
+
data['Expected'] = expected
|
420
|
+
if return_values:
|
421
|
+
data['ReturnValues'] = return_values
|
422
|
+
json_input = json.dumps(data)
|
423
|
+
return self.make_request('UpdateItem', json_input,
|
424
|
+
object_hook=object_hook)
|
425
|
+
|
426
|
+
def delete_item(self, table_name, key,
|
427
|
+
expected=None, return_values=None,
|
428
|
+
object_hook=None):
|
429
|
+
"""
|
430
|
+
Delete an item and all of it's attributes by primary key.
|
431
|
+
You can perform a conditional delete by specifying an
|
432
|
+
expected rule.
|
433
|
+
|
434
|
+
:type table_name: str
|
435
|
+
:param table_name: The name of the table containing the item.
|
436
|
+
|
437
|
+
:type key: dict
|
438
|
+
:param key: A Python version of the Key data structure
|
439
|
+
defined by DynamoDB.
|
440
|
+
|
441
|
+
:type expected: dict
|
442
|
+
:param expected: A Python version of the Expected
|
443
|
+
data structure defined by DynamoDB.
|
444
|
+
|
445
|
+
:type return_values: str
|
446
|
+
:param return_values: Controls the return of attribute
|
447
|
+
name-value pairs before then were changed. Possible
|
448
|
+
values are: None or 'ALL_OLD'. If 'ALL_OLD' is
|
449
|
+
specified and the item is overwritten, the content
|
450
|
+
of the old item is returned.
|
451
|
+
"""
|
452
|
+
data = {'TableName': table_name,
|
453
|
+
'Key': key}
|
454
|
+
if expected:
|
455
|
+
data['Expected'] = expected
|
456
|
+
if return_values:
|
457
|
+
data['ReturnValues'] = return_values
|
458
|
+
json_input = json.dumps(data)
|
459
|
+
return self.make_request('DeleteItem', json_input,
|
460
|
+
object_hook=object_hook)
|
461
|
+
|
462
|
+
def query(self, table_name, hash_key_value, range_key_conditions=None,
|
463
|
+
attributes_to_get=None, limit=None, consistent_read=False,
|
464
|
+
scan_index_forward=True, exclusive_start_key=None,
|
465
|
+
object_hook=None, count=False):
|
466
|
+
"""
|
467
|
+
Perform a query of DynamoDB. This version is currently punting
|
468
|
+
and expecting you to provide a full and correct JSON body
|
469
|
+
which is passed as is to DynamoDB.
|
470
|
+
|
471
|
+
:type table_name: str
|
472
|
+
:param table_name: The name of the table to query.
|
473
|
+
|
474
|
+
:type hash_key_value: dict
|
475
|
+
:param key: A DynamoDB-style HashKeyValue.
|
476
|
+
|
477
|
+
:type range_key_conditions: dict
|
478
|
+
:param range_key_conditions: A Python version of the
|
479
|
+
RangeKeyConditions data structure.
|
480
|
+
|
481
|
+
:type attributes_to_get: list
|
482
|
+
:param attributes_to_get: A list of attribute names.
|
483
|
+
If supplied, only the specified attribute names will
|
484
|
+
be returned. Otherwise, all attributes will be returned.
|
485
|
+
|
486
|
+
:type limit: int
|
487
|
+
:param limit: The maximum number of items to return.
|
488
|
+
|
489
|
+
:type count: bool
|
490
|
+
:param count: If True, Amazon DynamoDB returns a total
|
491
|
+
number of items for the Query operation, even if the
|
492
|
+
operation has no matching items for the assigned filter.
|
493
|
+
|
494
|
+
:type consistent_read: bool
|
495
|
+
:param consistent_read: If True, a consistent read
|
496
|
+
request is issued. Otherwise, an eventually consistent
|
497
|
+
request is issued.
|
498
|
+
|
499
|
+
:type scan_index_forward: bool
|
500
|
+
:param scan_index_forward: Specified forward or backward
|
501
|
+
traversal of the index. Default is forward (True).
|
502
|
+
|
503
|
+
:type exclusive_start_key: list or tuple
|
504
|
+
:param exclusive_start_key: Primary key of the item from
|
505
|
+
which to continue an earlier query. This would be
|
506
|
+
provided as the LastEvaluatedKey in that query.
|
507
|
+
"""
|
508
|
+
data = {'TableName': table_name,
|
509
|
+
'HashKeyValue': hash_key_value}
|
510
|
+
if range_key_conditions:
|
511
|
+
data['RangeKeyCondition'] = range_key_conditions
|
512
|
+
if attributes_to_get:
|
513
|
+
data['AttributesToGet'] = attributes_to_get
|
514
|
+
if limit:
|
515
|
+
data['Limit'] = limit
|
516
|
+
if count:
|
517
|
+
data['Count'] = True
|
518
|
+
if consistent_read:
|
519
|
+
data['ConsistentRead'] = True
|
520
|
+
if scan_index_forward:
|
521
|
+
data['ScanIndexForward'] = True
|
522
|
+
else:
|
523
|
+
data['ScanIndexForward'] = False
|
524
|
+
if exclusive_start_key:
|
525
|
+
data['ExclusiveStartKey'] = exclusive_start_key
|
526
|
+
json_input = json.dumps(data)
|
527
|
+
return self.make_request('Query', json_input,
|
528
|
+
object_hook=object_hook)
|
529
|
+
|
530
|
+
def scan(self, table_name, scan_filter=None,
|
531
|
+
attributes_to_get=None, limit=None,
|
532
|
+
exclusive_start_key=None, object_hook=None, count=False):
|
533
|
+
"""
|
534
|
+
Perform a scan of DynamoDB. This version is currently punting
|
535
|
+
and expecting you to provide a full and correct JSON body
|
536
|
+
which is passed as is to DynamoDB.
|
537
|
+
|
538
|
+
:type table_name: str
|
539
|
+
:param table_name: The name of the table to scan.
|
540
|
+
|
541
|
+
:type scan_filter: dict
|
542
|
+
:param scan_filter: A Python version of the
|
543
|
+
ScanFilter data structure.
|
544
|
+
|
545
|
+
:type attributes_to_get: list
|
546
|
+
:param attributes_to_get: A list of attribute names.
|
547
|
+
If supplied, only the specified attribute names will
|
548
|
+
be returned. Otherwise, all attributes will be returned.
|
549
|
+
|
550
|
+
:type limit: int
|
551
|
+
:param limit: The maximum number of items to evaluate.
|
552
|
+
|
553
|
+
:type count: bool
|
554
|
+
:param count: If True, Amazon DynamoDB returns a total
|
555
|
+
number of items for the Scan operation, even if the
|
556
|
+
operation has no matching items for the assigned filter.
|
557
|
+
|
558
|
+
:type exclusive_start_key: list or tuple
|
559
|
+
:param exclusive_start_key: Primary key of the item from
|
560
|
+
which to continue an earlier query. This would be
|
561
|
+
provided as the LastEvaluatedKey in that query.
|
562
|
+
"""
|
563
|
+
data = {'TableName': table_name}
|
564
|
+
if scan_filter:
|
565
|
+
data['ScanFilter'] = scan_filter
|
566
|
+
if attributes_to_get:
|
567
|
+
data['AttributesToGet'] = attributes_to_get
|
568
|
+
if limit:
|
569
|
+
data['Limit'] = limit
|
570
|
+
if count:
|
571
|
+
data['Count'] = True
|
572
|
+
if exclusive_start_key:
|
573
|
+
data['ExclusiveStartKey'] = exclusive_start_key
|
574
|
+
json_input = json.dumps(data)
|
575
|
+
return self.make_request('Scan', json_input, object_hook=object_hook)
|