├── tests ├── fps │ ├── __init__.py │ └── test_verify_signature.py ├── mturk │ ├── __init__.py │ ├── .gitignore │ ├── support.py │ ├── run-doctest.py │ ├── test_disable_hit.py │ ├── mocks.py │ ├── search_hits.doctest │ ├── create_hit_test.py │ ├── all_tests.py │ ├── hit_persistence.py │ ├── create_hit_with_qualifications.py │ ├── _init_environment.py │ ├── create_hit_external.py │ └── cleanup_tests.py ├── devpay │ └── __init__.py ├── unit │ ├── auth │ │ └── __init__.py │ ├── ec2 │ │ ├── __init__.py │ │ ├── autoscale │ │ │ └── __init__.py │ │ ├── cloudwatch │ │ │ └── __init__.py │ │ ├── test_instancestatus.py │ │ └── test_address.py │ ├── rds │ │ └── __init__.py │ ├── s3 │ │ ├── __init__.py │ │ ├── test_tagging.py │ │ └── test_bucket.py │ ├── sns │ │ └── __init__.py │ ├── sqs │ │ ├── __init__.py │ │ └── test_queue.py │ ├── utils │ │ └── __init__.py │ ├── vpc │ │ ├── __init__.py │ │ └── test_vpc.py │ ├── beanstalk │ │ └── __init__.py │ ├── cloudfront │ │ └── __init__.py │ ├── dynamodb │ │ └── __init__.py │ ├── dynamodb2 │ │ └── __init__.py │ ├── glacier │ │ └── __init__.py │ ├── provider │ │ └── __init__.py │ ├── cloudformation │ │ └── __init__.py │ └── cloudsearch │ │ └── __init__.py ├── integration │ ├── __init__.py │ ├── gs │ │ └── __init__.py │ ├── mws │ │ └── __init__.py │ ├── ses │ │ ├── __init__.py │ │ ├── test_connection.py │ │ └── test_cert_verification.py │ ├── swf │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── ec2 │ │ ├── vpc │ │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── elb │ │ │ ├── __init__.py │ │ │ └── test_cert_verification.py │ │ ├── autoscale │ │ │ ├── __init__.py │ │ │ └── test_cert_verification.py │ │ ├── cloudwatch │ │ │ ├── __init__.py │ │ │ └── test_cert_verification.py │ │ └── test_cert_verification.py │ ├── opsworks │ │ ├── __init__.py │ │ └── test_layer1.py │ ├── redshift │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── support │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── dynamodb2 │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── elasticache │ │ └── __init__.py │ ├── storage_uri │ │ └── __init__.py │ ├── elastictranscoder │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── iam │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── sts │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── dynamodb │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── emr │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── route53 │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── s3 │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── sdb │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── sns │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── sqs │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── glacier │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── rds │ │ ├── __init__.py │ │ └── test_cert_verification.py │ ├── cloudsearch │ │ ├── __init__.py │ │ └── test_cert_verification.py │ └── cloudformation │ │ ├── __init__.py │ │ └── test_cert_verification.py └── __init__.py ├── boto ├── opsworks │ ├── __init__.py │ └── exceptions.py ├── datapipeline │ ├── __init__.py │ └── exceptions.py ├── roboto │ └── __init__.py ├── manage │ ├── test_manage.py │ └── __init__.py ├── dynamodb2 │ └── types.py ├── swf │ └── exceptions.py ├── gs │ └── __init__.py ├── fps │ └── __init__.py ├── mws │ └── __init__.py ├── cacerts │ └── __init__.py ├── sdb │ ├── db │ │ └── __init__.py │ └── regioninfo.py ├── contrib │ └── __init__.py ├── pyami │ ├── __init__.py │ ├── installers │ │ └── ubuntu │ │ │ └── __init__.py │ ├── helloworld.py │ ├── scriptbase.py │ └── copybot.cfg ├── beanstalk │ └── wrapper.py ├── mashups │ └── __init__.py ├── mturk │ └── __init__.py ├── services │ ├── __init__.py │ └── sonofmmm.cfg ├── core │ └── __init__.py ├── cloudfront │ ├── exception.py │ ├── logging.py │ └── object.py ├── file │ ├── __init__.py │ ├── simpleresultset.py │ └── connection.py ├── route53 │ └── exception.py ├── compat.py ├── ec2 │ ├── cloudwatch │ │ ├── listelement.py │ │ ├── dimension.py │ │ └── datapoint.py │ ├── regioninfo.py │ ├── elb │ │ ├── listelement.py │ │ └── securitygroup.py │ ├── autoscale │ │ └── request.py │ └── group.py ├── support │ ├── exceptions.py │ └── __init__.py ├── cloudformation │ └── template.py ├── rds │ └── regioninfo.py ├── sqs │ ├── regioninfo.py │ ├── jsonmessage.py │ └── attributes.py ├── elastictranscoder │ └── exceptions.py ├── iam │ └── summarymap.py ├── s3 │ └── prefix.py └── dynamodb │ └── exceptions.py ├── docs ├── source │ ├── boto_theme │ │ └── theme.conf │ ├── _templates │ │ └── layout.html │ ├── ref │ │ ├── sns.rst │ │ ├── ecs.rst │ │ ├── fps.rst │ │ ├── swf.rst │ │ ├── ses.rst │ │ ├── elasticache.rst │ │ ├── sts.rst │ │ ├── iam.rst │ │ ├── support.rst │ │ ├── redshift.rst │ │ ├── beanstalk.rst │ │ ├── datapipeline.rst │ │ ├── emr.rst │ │ ├── index.rst │ │ ├── mws.rst │ │ ├── cloudwatch.rst │ │ ├── elastictranscoder.rst │ │ ├── file.rst │ │ ├── contrib.rst │ │ ├── route53.rst │ │ ├── cloudformation.rst │ │ ├── boto.rst │ │ ├── rds.rst │ │ ├── manage.rst │ │ ├── sdb.rst │ │ ├── elb.rst │ │ ├── vpc.rst │ │ ├── mturk.rst │ │ ├── sqs.rst │ │ ├── dynamodb.rst │ │ ├── dynamodb2.rst │ │ ├── cloudsearch.rst │ │ ├── glacier.rst │ │ ├── services.rst │ │ ├── autoscale.rst │ │ ├── cloudfront.rst │ │ ├── gs.rst │ │ └── sdb_db.rst │ ├── releasenotes │ │ ├── v2.9.2.rst │ │ ├── v2.9.4.rst │ │ ├── v2.9.5.rst │ │ └── v2.9.1.rst │ └── conf.py └── BotoCheatSheet.pdf ├── tox.ini ├── .gitignore ├── .travis.yml ├── requirements.txt ├── MANIFEST.in ├── LICENSE ├── bin ├── kill_instance └── bundle_image ├── Changelog.rst └── CONTRIBUTING /tests/fps/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mturk/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boto/opsworks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/devpay/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/auth/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/ec2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/rds/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/s3/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/sns/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/sqs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/vpc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boto/datapipeline/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /boto/roboto/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | -------------------------------------------------------------------------------- /tests/integration/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/gs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/mws/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/ses/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/swf/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/beanstalk/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/cloudfront/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/dynamodb/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/dynamodb2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/glacier/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/provider/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/ec2/vpc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/opsworks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/redshift/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/support/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/mturk/.gitignore: -------------------------------------------------------------------------------- 1 | local.py 2 | -------------------------------------------------------------------------------- /tests/unit/cloudformation/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/ec2/autoscale/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/ec2/cloudwatch/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/dynamodb2/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/elasticache/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/integration/storage_uri/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/unit/cloudsearch/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/integration/elastictranscoder/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/source/boto_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = boto.css -------------------------------------------------------------------------------- /docs/BotoCheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sandbox/boto/develop/docs/BotoCheatSheet.pdf -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py26,py27 3 | 4 | 5 | [testenv] 6 | commands = 7 | pip install -qr requirements.txt 8 | python tests/test.py tests/unit 9 | -------------------------------------------------------------------------------- /docs/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends '!layout.html' %} 2 | 3 | {% block sidebarsearch %}{{ super() }}
PDF Version
{% endblock %} 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .*.swp 3 | *.log 4 | *~ 5 | boto.egg-info 6 | build/ 7 | dist/ 8 | MANIFEST 9 | .DS_Store 10 | .idea 11 | .tox 12 | .coverage 13 | *flymake.py 14 | venv 15 | -------------------------------------------------------------------------------- /tests/mturk/support.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # use unittest2 under Python 2.6 and earlier. 4 | if sys.version_info >= (2, 7): 5 | import unittest 6 | else: 7 | import unittest2 as unittest 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "2.6" 4 | - "2.7" 5 | before_install: 6 | - sudo apt-get install swig 7 | install: pip install --use-mirrors -r requirements.txt 8 | script: python tests/test.py unit 9 | -------------------------------------------------------------------------------- /docs/source/ref/sns.rst: -------------------------------------------------------------------------------- 1 | .. ref-sns 2 | 3 | === 4 | SNS 5 | === 6 | 7 | boto.sns 8 | -------- 9 | 10 | .. automodule:: boto.sns 11 | :members: 12 | :undoc-members: 13 | 14 | .. autoclass:: boto.sns.SNSConnection 15 | :members: 16 | :undoc-members: 17 | 18 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mock==1.0.1 2 | nose==1.2.1 3 | # If you upgrade to ``requests>=1.2.1``, please update 4 | # ``boto/cloudsearch/document.py``. 5 | requests>=1.1.0 6 | rsa==3.1.1 7 | tox==1.4 8 | Sphinx==1.1.3 9 | simplejson==2.5.2 10 | argparse==1.2.1 11 | unittest2==0.5.1 12 | httpretty==0.5.5 13 | -------------------------------------------------------------------------------- /docs/source/ref/ecs.rst: -------------------------------------------------------------------------------- 1 | .. ref-ecs 2 | 3 | === 4 | ECS 5 | === 6 | 7 | boto.ecs 8 | -------- 9 | 10 | .. automodule:: boto.ecs 11 | :members: 12 | :undoc-members: 13 | 14 | boto.ecs.item 15 | ---------------------------- 16 | 17 | .. automodule:: boto.ecs.item 18 | :members: 19 | :undoc-members: 20 | -------------------------------------------------------------------------------- /docs/source/ref/fps.rst: -------------------------------------------------------------------------------- 1 | .. ref-fps 2 | 3 | === 4 | fps 5 | === 6 | 7 | boto.fps 8 | -------- 9 | 10 | .. automodule:: boto.fps 11 | :members: 12 | :undoc-members: 13 | 14 | boto.fps.connection 15 | ------------------- 16 | 17 | .. automodule:: boto.fps.connection 18 | :members: 19 | :undoc-members: 20 | -------------------------------------------------------------------------------- /docs/source/ref/swf.rst: -------------------------------------------------------------------------------- 1 | .. ref-swf 2 | 3 | === 4 | SWF 5 | === 6 | 7 | boto.swf 8 | -------- 9 | 10 | .. automodule:: boto.swf 11 | :members: 12 | :undoc-members: 13 | 14 | boto.swf.layer1 15 | -------------------- 16 | 17 | .. automodule:: boto.swf.layer1 18 | :members: 19 | :undoc-members: 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/source/ref/ses.rst: -------------------------------------------------------------------------------- 1 | .. ref-ses 2 | 3 | === 4 | SES 5 | === 6 | 7 | 8 | boto.ses 9 | ------------ 10 | 11 | .. automodule:: boto.ses 12 | :members: 13 | :undoc-members: 14 | 15 | boto.ses.connection 16 | --------------------- 17 | 18 | .. automodule:: boto.ses.connection 19 | :members: 20 | :undoc-members: 21 | 22 | -------------------------------------------------------------------------------- /docs/source/releasenotes/v2.9.2.rst: -------------------------------------------------------------------------------- 1 | boto v2.9.2 2 | =========== 3 | 4 | :date: 2013/04/30 5 | 6 | A hotfix release that adds the ``boto.support`` into ``setup.py``. 7 | 8 | 9 | Features 10 | -------- 11 | 12 | * None. 13 | 14 | 15 | Bugfixes 16 | -------- 17 | 18 | * Fixed the missing ``boto.support`` in ``setup.py``. (:sha:`9ac196`) 19 | -------------------------------------------------------------------------------- /tests/mturk/run-doctest.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import doctest 3 | 4 | parser = argparse.ArgumentParser( 5 | description="Run a test by name" 6 | ) 7 | parser.add_argument('test_name') 8 | args = parser.parse_args() 9 | 10 | doctest.testfile( 11 | args.test_name, 12 | optionflags=doctest.REPORT_ONLY_FIRST_FAILURE 13 | ) 14 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include boto/cacerts/cacerts.txt 2 | include README.rst 3 | include Changelog.rst 4 | include boto/file/README 5 | include .gitignore 6 | include pylintrc 7 | include boto/pyami/copybot.cfg 8 | include boto/services/sonofmmm.cfg 9 | include boto/mturk/test/*.doctest 10 | include boto/mturk/test/.gitignore 11 | recursive-include tests *.py *.txt 12 | recursive-include docs * 13 | -------------------------------------------------------------------------------- /tests/mturk/test_disable_hit.py: -------------------------------------------------------------------------------- 1 | from tests.mturk.support import unittest 2 | 3 | from common import MTurkCommon 4 | from boto.mturk.connection import MTurkRequestError 5 | 6 | class TestDisableHITs(MTurkCommon): 7 | def test_disable_invalid_hit(self): 8 | self.assertRaises(MTurkRequestError, self.conn.disable_hit, 'foo') 9 | 10 | if __name__ == '__main__': 11 | unittest.main() 12 | -------------------------------------------------------------------------------- /docs/source/ref/elasticache.rst: -------------------------------------------------------------------------------- 1 | .. ref-elasticache 2 | 3 | ================== 4 | Amazon ElastiCache 5 | ================== 6 | 7 | boto.elasticache 8 | ---------------- 9 | 10 | .. automodule:: boto.elasticache 11 | :members: 12 | :undoc-members: 13 | 14 | boto.elasticache.layer1 15 | ----------------------- 16 | 17 | .. automodule:: boto.elasticache.layer1 18 | :members: 19 | :undoc-members: 20 | -------------------------------------------------------------------------------- /docs/source/ref/sts.rst: -------------------------------------------------------------------------------- 1 | .. ref-sts 2 | 3 | === 4 | STS 5 | === 6 | 7 | boto.sts 8 | -------- 9 | 10 | .. automodule:: boto.sts 11 | :members: 12 | :undoc-members: 13 | 14 | .. autoclass:: boto.sts.STSConnection 15 | :members: 16 | :undoc-members: 17 | 18 | boto.sts.credentials 19 | -------------------- 20 | 21 | .. automodule:: boto.sts.credentials 22 | :members: 23 | :undoc-members: 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/source/ref/iam.rst: -------------------------------------------------------------------------------- 1 | .. ref-iam 2 | 3 | === 4 | IAM 5 | === 6 | 7 | boto.iam 8 | -------- 9 | 10 | .. automodule:: boto.iam 11 | :members: 12 | :undoc-members: 13 | 14 | boto.iam.connection 15 | ------------------- 16 | 17 | .. automodule:: boto.iam.connection 18 | :members: 19 | :undoc-members: 20 | 21 | boto.iam.summarymap 22 | ------------------- 23 | 24 | .. automodule:: boto.iam.summarymap 25 | :members: 26 | :undoc-members: 27 | 28 | -------------------------------------------------------------------------------- /tests/mturk/mocks.py: -------------------------------------------------------------------------------- 1 | from boto.mturk.connection import MTurkConnection as RealMTurkConnection 2 | 3 | class MTurkConnection(RealMTurkConnection): 4 | """ 5 | Mock MTurkConnection that doesn't connect, but instead just prepares 6 | the request and captures information about its usage. 7 | """ 8 | 9 | def _process_request(self, *args, **kwargs): 10 | saved_args = self.__dict__.setdefault('_mock_saved_args', dict()) 11 | saved_args['_process_request'] = (args, kwargs) 12 | -------------------------------------------------------------------------------- /tests/mturk/search_hits.doctest: -------------------------------------------------------------------------------- 1 | >>> from _init_environment import MTurkConnection, mturk_host 2 | >>> conn = MTurkConnection(host=mturk_host) 3 | 4 | # should have some HIT's returned by a search (but only if your account has existing HIT's) 5 | >>> search_rs = conn.search_hits() 6 | 7 | # this is a valid request 8 | >>> search_rs.status 9 | True 10 | 11 | >>> len(search_rs) > 1 12 | True 13 | 14 | >>> search_rs # doctest: +ELLIPSIS 15 | [ Creating New Volume' 6 | volume = Volume.create() 7 | print volume 8 | 9 | print '--> Creating New Server' 10 | server_list = Server.create() 11 | server = server_list[0] 12 | print server 13 | 14 | print '----> Waiting for Server to start up' 15 | while server.status != 'running': 16 | print '*' 17 | time.sleep(10) 18 | print '----> Server is running' 19 | 20 | print '--> Run "df -k" on Server' 21 | status = server.run('df -k') 22 | print status[1] 23 | 24 | print '--> Now run volume.make_ready to make the volume ready to use on server' 25 | volume.make_ready(server) 26 | 27 | print '--> Run "df -k" on Server' 28 | status = server.run('df -k') 29 | print status[1] 30 | 31 | print '--> Do an "ls -al" on the new filesystem' 32 | status = server.run('ls -al %s' % volume.mount_point) 33 | print status[1] 34 | 35 | -------------------------------------------------------------------------------- /docs/source/ref/sdb.rst: -------------------------------------------------------------------------------- 1 | .. ref-sdb 2 | 3 | ============= 4 | SDB Reference 5 | ============= 6 | 7 | In addition to what is seen below, boto includes an abstraction 8 | layer for SimpleDB that may be used: 9 | 10 | * :doc:`SimpleDB DB ` (Maintained, but little documentation) 11 | 12 | boto.sdb 13 | -------- 14 | 15 | .. automodule:: boto.sdb 16 | :members: 17 | :undoc-members: 18 | 19 | boto.sdb.connection 20 | ------------------- 21 | 22 | .. automodule:: boto.sdb.connection 23 | :members: 24 | :undoc-members: 25 | 26 | boto.sdb.domain 27 | --------------- 28 | 29 | .. automodule:: boto.sdb.domain 30 | :members: 31 | :undoc-members: 32 | 33 | boto.sdb.item 34 | ------------- 35 | 36 | .. automodule:: boto.sdb.item 37 | :members: 38 | :undoc-members: 39 | 40 | boto.sdb.queryresultset 41 | ----------------------- 42 | 43 | .. automodule:: boto.sdb.queryresultset 44 | :members: 45 | :undoc-members: 46 | -------------------------------------------------------------------------------- /docs/source/releasenotes/v2.9.4.rst: -------------------------------------------------------------------------------- 1 | boto v2.9.4 2 | =========== 3 | 4 | :date: 2013/05/20 5 | 6 | This release adds updated Elastic Transcoder support & fixes several bugs 7 | from recent releases & API updates. 8 | 9 | 10 | Features 11 | -------- 12 | 13 | * Updated Elastic Transcoder support - It now supports HLS, WebM, MPEG2-TS & a 14 | host of `other features`_. (:sha:`89196a`) 15 | 16 | .. _`other features`: http://aws.typepad.com/aws/2013/05/new-features-for-the-amazon-elastic-transcoder.html 17 | 18 | 19 | Bugfixes 20 | -------- 21 | 22 | * Fixed a bug in the canonicalization of URLs on Windows. (:sha:`09ef8c`) 23 | * Fixed glacier part size bug (:issue:`1478`, :sha:`9e04171`) 24 | * Fixed a bug in the bucket regex for S3 involving capital letters. 25 | (:sha:`950031`) 26 | * Fixed a bug where timestamps from Cloudformation would fail to be parsed. 27 | (:sha:`b40542`) 28 | * Several documentation improvements/fixes: 29 | 30 | * Added autodocs for many of the EC2 apis. (:sha:`79f939`) 31 | -------------------------------------------------------------------------------- /docs/source/ref/elb.rst: -------------------------------------------------------------------------------- 1 | .. ref-elb 2 | 3 | ============= 4 | ELB Reference 5 | ============= 6 | 7 | boto.ec2.elb 8 | ------------ 9 | 10 | .. automodule:: boto.ec2.elb 11 | :members: 12 | :undoc-members: 13 | 14 | boto.ec2.elb.healthcheck 15 | ------------------------ 16 | 17 | .. automodule:: boto.ec2.elb.healthcheck 18 | :members: 19 | :undoc-members: 20 | 21 | boto.ec2.elb.instancestate 22 | -------------------------- 23 | 24 | .. automodule:: boto.ec2.elb.instancestate 25 | :members: 26 | :undoc-members: 27 | 28 | boto.ec2.elb.listelement 29 | ------------------------ 30 | 31 | .. automodule:: boto.ec2.elb.listelement 32 | :members: 33 | :undoc-members: 34 | 35 | boto.ec2.elb.listener 36 | --------------------- 37 | 38 | .. automodule:: boto.ec2.elb.listener 39 | :members: 40 | :undoc-members: 41 | 42 | boto.ec2.elb.loadbalancer 43 | ------------------------- 44 | 45 | .. automodule:: boto.ec2.elb.loadbalancer 46 | :members: 47 | :undoc-members: 48 | -------------------------------------------------------------------------------- /tests/fps/test_verify_signature.py: -------------------------------------------------------------------------------- 1 | from boto.fps.connection import FPSConnection 2 | 3 | def test(): 4 | conn = FPSConnection() 5 | # example response from the docs 6 | params = 'expiry=08%2F2015&signature=ynDukZ9%2FG77uSJVb5YM0cadwHVwYKPMKOO3PNvgADbv6VtymgBxeOWEhED6KGHsGSvSJnMWDN%2FZl639AkRe9Ry%2F7zmn9CmiM%2FZkp1XtshERGTqi2YL10GwQpaH17MQqOX3u1cW4LlyFoLy4celUFBPq1WM2ZJnaNZRJIEY%2FvpeVnCVK8VIPdY3HMxPAkNi5zeF2BbqH%2BL2vAWef6vfHkNcJPlOuOl6jP4E%2B58F24ni%2B9ek%2FQH18O4kw%2FUJ7ZfKwjCCI13%2BcFybpofcKqddq8CuUJj5Ii7Pdw1fje7ktzHeeNhF0r9siWcYmd4JaxTP3NmLJdHFRq2T%2FgsF3vK9m3gw%3D%3D&signatureVersion=2&signatureMethod=RSA-SHA1&certificateUrl=https%3A%2F%2Ffps.sandbox.amazonaws.com%2Fcerts%2F090909%2FPKICert.pem&tokenID=A5BB3HUNAZFJ5CRXIPH72LIODZUNAUZIVP7UB74QNFQDSQ9MN4HPIKISQZWPLJXF&status=SC&callerReference=callerReferenceMultiUse1' 7 | endpoint = 'http://vamsik.desktop.amazon.com:8080/ipn.jsp' 8 | conn.verify_signature(endpoint, params) 9 | 10 | 11 | if __name__ == '__main__': 12 | test() 13 | -------------------------------------------------------------------------------- /tests/mturk/create_hit_with_qualifications.py: -------------------------------------------------------------------------------- 1 | from boto.mturk.connection import MTurkConnection 2 | from boto.mturk.question import ExternalQuestion 3 | from boto.mturk.qualification import Qualifications, PercentAssignmentsApprovedRequirement 4 | 5 | def test(): 6 | q = ExternalQuestion(external_url="http://websort.net/s/F3481C", frame_height=800) 7 | conn = MTurkConnection(host='mechanicalturk.sandbox.amazonaws.com') 8 | keywords=['boto', 'test', 'doctest'] 9 | qualifications = Qualifications() 10 | qualifications.add(PercentAssignmentsApprovedRequirement(comparator="GreaterThan", integer_value="95")) 11 | create_hit_rs = conn.create_hit(question=q, lifetime=60*65, max_assignments=2, title="Boto External Question Test", keywords=keywords, reward = 0.05, duration=60*6, approval_delay=60*60, annotation='An annotation from boto external question test', qualifications=qualifications) 12 | assert(create_hit_rs.status == True) 13 | print create_hit_rs.HITTypeId 14 | 15 | if __name__ == "__main__": 16 | test() 17 | -------------------------------------------------------------------------------- /docs/source/ref/vpc.rst: -------------------------------------------------------------------------------- 1 | .. _ref-vpc: 2 | 3 | ==== 4 | VPC 5 | ==== 6 | 7 | boto.vpc 8 | -------- 9 | 10 | .. automodule:: boto.vpc 11 | :members: 12 | :undoc-members: 13 | 14 | boto.vpc.customergateway 15 | ------------------------ 16 | 17 | .. automodule:: boto.vpc.customergateway 18 | :members: 19 | :undoc-members: 20 | 21 | boto.vpc.dhcpoptions 22 | -------------------- 23 | 24 | .. automodule:: boto.vpc.dhcpoptions 25 | :members: 26 | :undoc-members: 27 | 28 | boto.vpc.subnet 29 | --------------- 30 | 31 | .. automodule:: boto.vpc.subnet 32 | :members: 33 | :undoc-members: 34 | 35 | boto.vpc.vpc 36 | ------------ 37 | 38 | .. automodule:: boto.vpc.vpc 39 | :members: 40 | :undoc-members: 41 | 42 | boto.vpc.vpnconnection 43 | ---------------------- 44 | 45 | .. automodule:: boto.vpc.vpnconnection 46 | :members: 47 | :undoc-members: 48 | 49 | boto.vpc.vpngateway 50 | ------------------- 51 | 52 | .. automodule:: boto.vpc.vpngateway 53 | :members: 54 | :undoc-members: 55 | -------------------------------------------------------------------------------- /boto/dynamodb2/types.py: -------------------------------------------------------------------------------- 1 | # Shadow the DynamoDB v1 bits. 2 | # This way, no end user should have to cross-import between versions & we 3 | # reserve the namespace to extend v2 if it's ever needed. 4 | from boto.dynamodb.types import Dynamizer 5 | 6 | 7 | # Some constants for our use. 8 | STRING = 'S' 9 | NUMBER = 'N' 10 | BINARY = 'B' 11 | STRING_SET = 'SS' 12 | NUMBER_SET = 'NS' 13 | BINARY_SET = 'BS' 14 | 15 | QUERY_OPERATORS = { 16 | 'eq': 'EQ', 17 | 'lte': 'LE', 18 | 'lt': 'LT', 19 | 'gte': 'GE', 20 | 'gt': 'GT', 21 | 'beginswith': 'BEGINS_WITH', 22 | 'between': 'BETWEEN', 23 | } 24 | 25 | FILTER_OPERATORS = { 26 | 'eq': 'EQ', 27 | 'ne': 'NE', 28 | 'lte': 'LE', 29 | 'lt': 'LT', 30 | 'gte': 'GE', 31 | 'gt': 'GT', 32 | # FIXME: Is this necessary? i.e. ``whatever__null=False`` 33 | 'nnull': 'NOT_NULL', 34 | 'null': 'NULL', 35 | 'contains': 'CONTAINS', 36 | 'ncontains': 'NOT_CONTAINS', 37 | 'beginswith': 'BEGINS_WITH', 38 | 'in': 'IN', 39 | 'between': 'BETWEEN', 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a 2 | copy of this software and associated documentation files (the 3 | "Software"), to deal in the Software without restriction, including 4 | without limitation the rights to use, copy, modify, merge, publish, dis- 5 | tribute, sublicense, and/or sell copies of the Software, and to permit 6 | persons to whom the Software is furnished to do so, subject to the fol- 7 | lowing conditions: 8 | 9 | The above copyright notice and this permission notice shall be included 10 | in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 13 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 14 | ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 15 | SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /tests/mturk/_init_environment.py: -------------------------------------------------------------------------------- 1 | import os 2 | import functools 3 | 4 | live_connection = False 5 | mturk_host = 'mechanicalturk.sandbox.amazonaws.com' 6 | external_url = 'http://www.example.com/' 7 | 8 | 9 | SetHostMTurkConnection = None 10 | 11 | def config_environment(): 12 | global SetHostMTurkConnection 13 | try: 14 | local = os.path.join(os.path.dirname(__file__), 'local.py') 15 | execfile(local) 16 | except: 17 | pass 18 | 19 | if live_connection: 20 | #TODO: you must set the auth credentials to something valid 21 | from boto.mturk.connection import MTurkConnection 22 | else: 23 | # Here the credentials must be set, but it doesn't matter what 24 | # they're set to. 25 | os.environ.setdefault('AWS_ACCESS_KEY_ID', 'foo') 26 | os.environ.setdefault('AWS_SECRET_ACCESS_KEY', 'bar') 27 | from mocks import MTurkConnection 28 | SetHostMTurkConnection = functools.partial(MTurkConnection, host=mturk_host) 29 | -------------------------------------------------------------------------------- /tests/mturk/create_hit_external.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import uuid 3 | import datetime 4 | from boto.mturk.question import ExternalQuestion 5 | 6 | from _init_environment import SetHostMTurkConnection, external_url, \ 7 | config_environment 8 | 9 | class Test(unittest.TestCase): 10 | def setUp(self): 11 | config_environment() 12 | 13 | def test_create_hit_external(self): 14 | q = ExternalQuestion(external_url=external_url, frame_height=800) 15 | conn = SetHostMTurkConnection() 16 | keywords=['boto', 'test', 'doctest'] 17 | create_hit_rs = conn.create_hit(question=q, lifetime=60*65, max_assignments=2, title="Boto External Question Test", keywords=keywords, reward = 0.05, duration=60*6, approval_delay=60*60, annotation='An annotation from boto external question test', response_groups=['Minimal', 'HITDetail', 'HITQuestion', 'HITAssignmentSummary',]) 18 | assert(create_hit_rs.status == True) 19 | 20 | if __name__ == "__main__": 21 | unittest.main() 22 | -------------------------------------------------------------------------------- /bin/kill_instance: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | from optparse import OptionParser 5 | 6 | import boto 7 | from boto.ec2 import regions 8 | 9 | 10 | 11 | def kill_instance(region, ids): 12 | """Kill an instances given it's instance IDs""" 13 | # Connect the region 14 | ec2 = boto.connect_ec2(region=region) 15 | for instance_id in ids: 16 | print "Stopping instance: %s" % instance_id 17 | ec2.terminate_instances([instance_id]) 18 | 19 | 20 | if __name__ == "__main__": 21 | parser = OptionParser(usage="kill_instance [-r] id [id ...]") 22 | parser.add_option("-r", "--region", help="Region (default us-east-1)", dest="region", default="us-east-1") 23 | (options, args) = parser.parse_args() 24 | if not args: 25 | parser.print_help() 26 | sys.exit(1) 27 | for r in regions(): 28 | if r.name == options.region: 29 | region = r 30 | break 31 | else: 32 | print "Region %s not found." % options.region 33 | sys.exit(1) 34 | 35 | kill_instance(region, args) 36 | -------------------------------------------------------------------------------- /docs/source/ref/mturk.rst: -------------------------------------------------------------------------------- 1 | .. ref-mturk 2 | 3 | ===== 4 | mturk 5 | ===== 6 | 7 | boto.mturk 8 | ------------ 9 | 10 | .. automodule:: boto.mturk 11 | :members: 12 | :undoc-members: 13 | 14 | boto.mturk.connection 15 | --------------------- 16 | 17 | .. automodule:: boto.mturk.connection 18 | :members: 19 | :undoc-members: 20 | 21 | boto.mturk.layoutparam 22 | ---------------------- 23 | 24 | .. automodule:: boto.mturk.layoutparam 25 | :members: 26 | :undoc-members: 27 | 28 | boto.mturk.notification 29 | ----------------------- 30 | 31 | .. automodule:: boto.mturk.notification 32 | :members: 33 | :undoc-members: 34 | 35 | boto.mturk.price 36 | ---------------- 37 | 38 | .. automodule:: boto.mturk.price 39 | :members: 40 | :undoc-members: 41 | 42 | boto.mturk.qualification 43 | ------------------------ 44 | 45 | .. automodule:: boto.mturk.qualification 46 | :members: 47 | :undoc-members: 48 | 49 | boto.mturk.question 50 | ------------------- 51 | 52 | .. automodule:: boto.mturk.question 53 | :members: 54 | :undoc-members: 55 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | import boto 5 | import sys 6 | 7 | sys.path.append(os.path.join(os.path.dirname(__file__), 'extensions')) 8 | 9 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 10 | 'githublinks'] 11 | autoclass_content = "both" 12 | templates_path = ['_templates'] 13 | source_suffix = '.rst' 14 | master_doc = 'index' 15 | project = u'boto' 16 | copyright = u'2009,2010, Mitch Garnaat' 17 | version = boto.__version__ 18 | exclude_trees = [] 19 | pygments_style = 'sphinx' 20 | html_theme = 'boto_theme' 21 | html_theme_path = ["."] 22 | html_static_path = ['_static'] 23 | htmlhelp_basename = 'botodoc' 24 | latex_documents = [ 25 | ('index', 'boto.tex', u'boto Documentation', 26 | u'Mitch Garnaat', 'manual'), 27 | ] 28 | intersphinx_mapping = {'http://docs.python.org/': None} 29 | github_project_url = 'https://github.com/boto/boto/' 30 | 31 | try: 32 | release = os.environ.get('SVN_REVISION', 'HEAD') 33 | print release 34 | except Exception, e: 35 | print e 36 | 37 | html_title = "boto v%s" % version 38 | -------------------------------------------------------------------------------- /Changelog.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Change history 3 | ============== 4 | 5 | .. contents:: 6 | :local: 7 | 8 | .. _version-2.0: 9 | 10 | 2.0 11 | === 12 | :release-date: 2011-07-14 13 | 14 | .. _v20-important: 15 | 16 | Important Notes 17 | --------------- 18 | 19 | * Backwards-incompatible filter changes in the latest 2011 EC2 APIs 20 | 21 | In the latest 2011 EC2 APIs all security groups are assigned a unique 22 | identifier (sg-\*). As a consequence, some existing filters which used to take 23 | the group name now require the group *id* instead: 24 | 25 | 1. *group-id* filter in DescribeInstances (ie get_all_instances()) 26 | 27 | To filter by group name you must instead use the *group-name* filter 28 | 29 | 2. *launch.group-id* filter in DescribeSpotInstanceRequests (ie get_all_spot_instance_requests()) 30 | 31 | Unfortunately for now, it is *not* possible to filter spot instance 32 | requests by group name; the security group id *must* be used instead. 33 | 34 | This new security group id can be found in the *id* attribute of a boto 35 | SecurityGroup instance. 36 | -------------------------------------------------------------------------------- /boto/swf/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | Exceptions that are specific to the swf module. 3 | 4 | This module subclasses the base SWF response exception, 5 | boto.exceptions.SWFResponseError, for some of the SWF specific faults. 6 | """ 7 | from boto.exception import SWFResponseError 8 | 9 | 10 | class SWFDomainAlreadyExistsError(SWFResponseError): 11 | """ 12 | Raised when when the domain already exists. 13 | """ 14 | pass 15 | 16 | 17 | class SWFLimitExceededError(SWFResponseError): 18 | """ 19 | Raised when when a system imposed limitation has been reached. 20 | """ 21 | pass 22 | 23 | 24 | class SWFOperationNotPermittedError(SWFResponseError): 25 | """ 26 | Raised when (reserved for future use). 27 | """ 28 | 29 | 30 | class SWFTypeAlreadyExistsError(SWFResponseError): 31 | """ 32 | Raised when when the workflow type or activity type already exists. 33 | """ 34 | pass 35 | 36 | 37 | class SWFWorkflowExecutionAlreadyStartedError(SWFResponseError): 38 | """ 39 | Raised when an open execution with the same workflow_id is already running 40 | in the specified domain. 41 | """ 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /boto/gs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | -------------------------------------------------------------------------------- /docs/source/ref/sqs.rst: -------------------------------------------------------------------------------- 1 | .. ref-sqs 2 | 3 | ==== 4 | SQS 5 | ==== 6 | 7 | boto.sqs 8 | -------- 9 | 10 | .. automodule:: boto.sqs 11 | :members: 12 | :undoc-members: 13 | 14 | boto.sqs.attributes 15 | ------------------- 16 | 17 | .. automodule:: boto.sqs.attributes 18 | :members: 19 | :undoc-members: 20 | 21 | boto.sqs.connection 22 | ------------------- 23 | 24 | .. automodule:: boto.sqs.connection 25 | :members: 26 | :undoc-members: 27 | 28 | boto.sqs.jsonmessage 29 | -------------------- 30 | 31 | .. automodule:: boto.sqs.jsonmessage 32 | :members: 33 | :undoc-members: 34 | 35 | boto.sqs.message 36 | ---------------- 37 | 38 | .. automodule:: boto.sqs.message 39 | :members: 40 | :undoc-members: 41 | 42 | boto.sqs.queue 43 | -------------- 44 | 45 | .. automodule:: boto.sqs.queue 46 | :members: 47 | :undoc-members: 48 | 49 | boto.sqs.regioninfo 50 | ------------------- 51 | 52 | .. automodule:: boto.sqs.regioninfo 53 | :members: 54 | :undoc-members: 55 | 56 | boto.sqs.batchresults 57 | --------------------- 58 | 59 | .. automodule:: boto.sqs.batchresults 60 | :members: 61 | :undoc-members: 62 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /boto/fps/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2008, Chris Moyer http://coredumped.org 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | -------------------------------------------------------------------------------- /boto/mws/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2008, Chris Moyer http://coredumped.org 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | -------------------------------------------------------------------------------- /docs/source/releasenotes/v2.9.5.rst: -------------------------------------------------------------------------------- 1 | boto v2.9.5 2 | =========== 3 | 4 | :date: 2013/05/28 5 | 6 | This release adds support for `web identity federation`_ within the Secure 7 | Token Service (STS) & fixes several bugs. 8 | 9 | .. _`web identity federation`: http://docs.aws.amazon.com/STS/latest/UsingSTS/CreatingWIF.html 10 | 11 | Features 12 | -------- 13 | 14 | * Added support for web identity federation - You can now delegate token access 15 | via either an Oauth 2.0 or OpenID provider. (:sha:`9bd0a3`) 16 | 17 | 18 | Bugfixes 19 | -------- 20 | 21 | * Altered the S3 key buffer to be a configurable value. (:issue:`1506`, 22 | :sha:`8e3e36`) 23 | * Added Sphinx extension for better release notes. (:issue:`1511`, 24 | :sha:`e2e32d` & :sha:`3d998b`) 25 | * Fixed a bug where DynamoDB v2 would only ever connect to the default endpoint. 26 | (:issue:`1508`, :sha:`139912`) 27 | * Fixed a iteration/empty results bug & a ``between`` bug in DynamoDB v2. 28 | (:issue:`1512`, :sha:`d109b6`) 29 | * Fixed an issue with ``EbsOptimized`` in EC2 Autoscale. (:issue:`1513`, 30 | :sha:`424c41`) 31 | * Fixed a missing instance variable bug in DynamoDB v2. (:issue:`1516`, 32 | :sha:`6fa8bf`) 33 | -------------------------------------------------------------------------------- /boto/cacerts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. 2 | # 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 | -------------------------------------------------------------------------------- /boto/sdb/db/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/iam/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/sts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/dynamodb/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/ec2/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/emr/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/route53/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/s3/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/sdb/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/sns/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/integration/sqs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /boto/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | -------------------------------------------------------------------------------- /boto/pyami/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | -------------------------------------------------------------------------------- /tests/integration/ec2/elb/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /boto/beanstalk/wrapper.py: -------------------------------------------------------------------------------- 1 | """Wraps layer1 api methods and converts layer1 dict responses to objects.""" 2 | from boto.beanstalk.layer1 import Layer1 3 | import boto.beanstalk.response 4 | from boto.exception import BotoServerError 5 | import boto.beanstalk.exception as exception 6 | 7 | 8 | def beanstalk_wrapper(func, name): 9 | def _wrapped_low_level_api(*args, **kwargs): 10 | try: 11 | response = func(*args, **kwargs) 12 | except BotoServerError, e: 13 | raise exception.simple(e) 14 | # Turn 'this_is_a_function_name' into 'ThisIsAFunctionNameResponse'. 15 | cls_name = ''.join([part.capitalize() for part in name.split('_')]) + 'Response' 16 | cls = getattr(boto.beanstalk.response, cls_name) 17 | return cls(response) 18 | return _wrapped_low_level_api 19 | 20 | 21 | class Layer1Wrapper(object): 22 | def __init__(self, *args, **kwargs): 23 | self.api = Layer1(*args, **kwargs) 24 | 25 | def __getattr__(self, name): 26 | try: 27 | return beanstalk_wrapper(getattr(self.api, name), name) 28 | except AttributeError: 29 | raise AttributeError("%s has no attribute %r" % (self, name)) 30 | -------------------------------------------------------------------------------- /boto/manage/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | 24 | -------------------------------------------------------------------------------- /boto/mashups/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | 24 | -------------------------------------------------------------------------------- /boto/mturk/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/source/ref/dynamodb.rst: -------------------------------------------------------------------------------- 1 | .. ref-dynamodb 2 | 3 | ======== 4 | DynamoDB 5 | ======== 6 | 7 | boto.dynamodb 8 | ------------- 9 | 10 | .. automodule:: boto.dynamodb 11 | :members: 12 | :undoc-members: 13 | 14 | boto.dynamodb.layer1 15 | -------------------- 16 | 17 | .. automodule:: boto.dynamodb.layer1 18 | :members: 19 | :undoc-members: 20 | 21 | boto.dynamodb.layer2 22 | -------------------- 23 | 24 | .. automodule:: boto.dynamodb.layer2 25 | :members: 26 | :undoc-members: 27 | 28 | boto.dynamodb.table 29 | ------------------- 30 | 31 | .. automodule:: boto.dynamodb.table 32 | :members: 33 | :undoc-members: 34 | 35 | boto.dynamodb.schema 36 | -------------------- 37 | 38 | .. automodule:: boto.dynamodb.schema 39 | :members: 40 | :undoc-members: 41 | 42 | boto.dynamodb.item 43 | ------------------ 44 | 45 | .. automodule:: boto.dynamodb.item 46 | :members: 47 | :undoc-members: 48 | 49 | boto.dynamodb.batch 50 | ------------------- 51 | 52 | .. automodule:: boto.dynamodb.batch 53 | :members: 54 | :undoc-members: 55 | 56 | boto.dynamodb.types 57 | ------------------- 58 | 59 | .. automodule:: boto.dynamodb.types 60 | :members: 61 | :undoc-members: 62 | -------------------------------------------------------------------------------- /docs/source/ref/dynamodb2.rst: -------------------------------------------------------------------------------- 1 | .. ref-dynamodb2 2 | 3 | ========= 4 | DynamoDB2 5 | ========= 6 | 7 | High-Level API 8 | ============== 9 | 10 | boto.dynamodb2.fields 11 | --------------------- 12 | 13 | .. automodule:: boto.dynamodb2.fields 14 | :members: 15 | :undoc-members: 16 | 17 | boto.dynamodb2.items 18 | -------------------- 19 | 20 | .. automodule:: boto.dynamodb2.items 21 | :members: 22 | :undoc-members: 23 | 24 | boto.dynamodb2.results 25 | ---------------------- 26 | 27 | .. automodule:: boto.dynamodb2.results 28 | :members: 29 | :undoc-members: 30 | 31 | boto.dynamodb2.table 32 | -------------------- 33 | 34 | .. automodule:: boto.dynamodb2.table 35 | :members: 36 | :undoc-members: 37 | 38 | 39 | Low-Level API 40 | ============= 41 | 42 | boto.dynamodb2 43 | -------------- 44 | 45 | .. automodule:: boto.dynamodb2 46 | :members: 47 | :undoc-members: 48 | 49 | boto.dynamodb2.layer1 50 | --------------------- 51 | 52 | .. automodule:: boto.dynamodb2.layer1 53 | :members: 54 | :undoc-members: 55 | 56 | boto.dynamodb2.exceptions 57 | ------------------------- 58 | 59 | .. automodule:: boto.dynamodb2.exceptions 60 | :members: 61 | :undoc-members: 62 | -------------------------------------------------------------------------------- /tests/integration/ec2/autoscale/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011 Reza Lotun http://reza.lotun.name 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /boto/services/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/source/ref/cloudsearch.rst: -------------------------------------------------------------------------------- 1 | .. ref-cloudsearch 2 | 3 | =========== 4 | Cloudsearch 5 | =========== 6 | 7 | boto.cloudsearch 8 | ---------------- 9 | 10 | .. automodule:: boto.cloudsearch 11 | :members: 12 | :undoc-members: 13 | 14 | boto.cloudsearch.domain 15 | ----------------------- 16 | 17 | .. automodule:: boto.cloudsearch.domain 18 | :members: 19 | :undoc-members: 20 | 21 | boto.cloudsearch.layer1 22 | ----------------------- 23 | 24 | .. automodule:: boto.cloudsearch.layer1 25 | :members: 26 | :undoc-members: 27 | 28 | boto.cloudsearch.layer2 29 | ----------------------- 30 | 31 | .. automodule:: boto.cloudsearch.layer2 32 | :members: 33 | :undoc-members: 34 | 35 | boto.cloudsearch.optionstatus 36 | ----------------------------- 37 | 38 | .. automodule:: boto.cloudsearch.optionstatus 39 | :members: 40 | :undoc-members: 41 | 42 | boto.cloudsearch.search 43 | ----------------------- 44 | 45 | .. automodule:: boto.cloudsearch.search 46 | :members: 47 | :undoc-members: 48 | 49 | boto.cloudsearch.document 50 | ------------------------- 51 | 52 | .. automodule:: boto.cloudsearch.document 53 | :members: 54 | :undoc-members: 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /tests/integration/ec2/cloudwatch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /docs/source/ref/glacier.rst: -------------------------------------------------------------------------------- 1 | .. ref-glacier 2 | 3 | ======= 4 | Glacier 5 | ======= 6 | 7 | boto.glacier 8 | ------------ 9 | 10 | .. automodule:: boto.glacier 11 | :members: 12 | :undoc-members: 13 | 14 | boto.glacier.layer1 15 | ------------------- 16 | 17 | .. automodule:: boto.glacier.layer1 18 | :members: 19 | :undoc-members: 20 | 21 | boto.glacier.layer2 22 | ------------------- 23 | 24 | .. automodule:: boto.glacier.layer2 25 | :members: 26 | :undoc-members: 27 | 28 | boto.glacier.vault 29 | ------------------ 30 | 31 | .. automodule:: boto.glacier.vault 32 | :members: 33 | :undoc-members: 34 | 35 | boto.glacier.job 36 | ---------------- 37 | 38 | .. automodule:: boto.glacier.job 39 | :members: 40 | :undoc-members: 41 | 42 | boto.glacier.writer 43 | ------------------- 44 | 45 | .. automodule:: boto.glacier.writer 46 | :members: 47 | :undoc-members: 48 | 49 | boto.glacier.concurrent 50 | ----------------------- 51 | 52 | .. automodule:: boto.glacier.concurrent 53 | :members: 54 | :undoc-members: 55 | 56 | boto.glacier.exceptions 57 | ----------------------- 58 | 59 | .. automodule:: boto.glacier.exceptions 60 | :members: 61 | :undoc-members: 62 | 63 | 64 | -------------------------------------------------------------------------------- /boto/pyami/installers/ubuntu/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | -------------------------------------------------------------------------------- /tests/integration/glacier/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ 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 | -------------------------------------------------------------------------------- /tests/unit/ec2/test_instancestatus.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from tests.unit import unittest 4 | from tests.unit import AWSMockServiceTestCase 5 | 6 | import mock 7 | 8 | from boto.ec2.connection import EC2Connection 9 | 10 | INSTANCE_STATUS_RESPONSE = r""" 11 | 12 | 3be1508e-c444-4fef-89cc-0b1223c4f02fEXAMPLE 13 | page-2 14 | 15 | 16 | """ 17 | 18 | 19 | class TestInstanceStatusResponseParsing(unittest.TestCase): 20 | def test_next_token(self): 21 | ec2 = EC2Connection(aws_access_key_id='aws_access_key_id', 22 | aws_secret_access_key='aws_secret_access_key') 23 | mock_response = mock.Mock() 24 | mock_response.read.return_value = INSTANCE_STATUS_RESPONSE 25 | mock_response.status = 200 26 | ec2.make_request = mock.Mock(return_value=mock_response) 27 | all_statuses = ec2.get_all_instance_status() 28 | self.assertEqual(all_statuses.next_token, 'page-2') 29 | 30 | 31 | if __name__ == '__main__': 32 | unittest.main() 33 | -------------------------------------------------------------------------------- /docs/source/ref/services.rst: -------------------------------------------------------------------------------- 1 | .. ref-services 2 | 3 | ======== 4 | services 5 | ======== 6 | 7 | boto.services 8 | ------------- 9 | 10 | .. automodule:: boto.services 11 | :members: 12 | :undoc-members: 13 | 14 | boto.services.bs 15 | ---------------- 16 | 17 | .. automodule:: boto.services.bs 18 | :members: 19 | :undoc-members: 20 | 21 | boto.services.message 22 | --------------------- 23 | 24 | .. automodule:: boto.services.message 25 | :members: 26 | :undoc-members: 27 | 28 | boto.services.result 29 | -------------------- 30 | 31 | .. automodule:: boto.services.result 32 | :members: 33 | :undoc-members: 34 | 35 | boto.services.service 36 | --------------------- 37 | 38 | .. automodule:: boto.services.service 39 | :members: 40 | :undoc-members: 41 | 42 | boto.services.servicedef 43 | ------------------------ 44 | 45 | .. automodule:: boto.services.servicedef 46 | :members: 47 | :undoc-members: 48 | 49 | boto.services.sonofmmm 50 | ---------------------- 51 | 52 | .. automodule:: boto.services.sonofmmm 53 | :members: 54 | :undoc-members: 55 | 56 | boto.services.submit 57 | -------------------- 58 | 59 | .. automodule:: boto.services.submit 60 | :members: 61 | :undoc-members: 62 | -------------------------------------------------------------------------------- /boto/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All Rights Reserved 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | # 24 | -------------------------------------------------------------------------------- /tests/integration/rds/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All Rights Reserved 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 | -------------------------------------------------------------------------------- /tests/integration/cloudsearch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All Rights Reserved 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 | -------------------------------------------------------------------------------- /tests/integration/cloudformation/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All Rights Reserved 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 | -------------------------------------------------------------------------------- /boto/cloudfront/exception.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | from boto.exception import BotoServerError 23 | 24 | class CloudFrontServerError(BotoServerError): 25 | 26 | pass 27 | -------------------------------------------------------------------------------- /boto/file/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | import boto 23 | 24 | from connection import FileConnection as Connection 25 | from key import Key 26 | from bucket import Bucket 27 | 28 | __all__ = ['Connection', 'Key', 'Bucket'] 29 | -------------------------------------------------------------------------------- /boto/route53/exception.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 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 | from boto.exception import BotoServerError 24 | 25 | class DNSServerError(BotoServerError): 26 | 27 | pass 28 | -------------------------------------------------------------------------------- /boto/pyami/helloworld.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from boto.pyami.scriptbase import ScriptBase 23 | 24 | class HelloWorld(ScriptBase): 25 | 26 | def main(self): 27 | self.log('Hello World!!!') 28 | 29 | -------------------------------------------------------------------------------- /tests/unit/vpc/test_vpc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | from tests.unit import unittest 3 | from tests.unit import AWSMockServiceTestCase 4 | 5 | from boto.vpc import VPCConnection 6 | 7 | DESCRIBE_VPCS = r''' 8 | 9 | 623040d1-b51c-40bc-8080-93486f38d03d 10 | 11 | 12 | vpc-12345678 13 | available 14 | 172.16.0.0/16 15 | dopt-12345678 16 | default 17 | false 18 | 19 | 20 | ''' 21 | 22 | class TestDescriveVPCs(AWSMockServiceTestCase): 23 | 24 | connection_class = VPCConnection 25 | 26 | def default_body(self): 27 | return DESCRIBE_VPCS 28 | 29 | def test_get_vpcs(self): 30 | self.set_http_response(status_code=200) 31 | 32 | api_response = self.service_connection.get_all_vpcs() 33 | self.assertEqual(len(api_response), 1) 34 | 35 | vpc = api_response[0] 36 | self.assertFalse(vpc.is_default) 37 | self.assertEqual(vpc.instance_tenancy,'default') 38 | 39 | if __name__ == '__main__': 40 | unittest.main() -------------------------------------------------------------------------------- /boto/opsworks/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from boto.exception import JSONResponseError 23 | 24 | 25 | class ResourceNotFoundException(JSONResponseError): 26 | pass 27 | 28 | 29 | class ValidationException(JSONResponseError): 30 | pass 31 | -------------------------------------------------------------------------------- /boto/compat.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | # This allows boto modules to say "from boto.compat import json". This is 24 | # preferred so that all modules don't have to repeat this idiom. 25 | try: 26 | import simplejson as json 27 | except ImportError: 28 | import json 29 | -------------------------------------------------------------------------------- /docs/source/ref/autoscale.rst: -------------------------------------------------------------------------------- 1 | .. ref-autoscale 2 | 3 | ====================== 4 | Auto Scaling Reference 5 | ====================== 6 | 7 | boto.ec2.autoscale 8 | ------------------ 9 | 10 | .. automodule:: boto.ec2.autoscale 11 | :members: 12 | :undoc-members: 13 | 14 | boto.ec2.autoscale.activity 15 | --------------------------- 16 | 17 | .. automodule:: boto.ec2.autoscale.activity 18 | :members: 19 | :undoc-members: 20 | 21 | boto.ec2.autoscale.group 22 | ------------------------ 23 | 24 | .. automodule:: boto.ec2.autoscale.group 25 | :members: 26 | :undoc-members: 27 | 28 | 29 | boto.ec2.autoscale.instance 30 | --------------------------- 31 | 32 | .. automodule:: boto.ec2.autoscale.instance 33 | :members: 34 | :undoc-members: 35 | 36 | boto.ec2.autoscale.launchconfig 37 | ------------------------------- 38 | 39 | .. automodule:: boto.ec2.autoscale.launchconfig 40 | :members: 41 | :undoc-members: 42 | 43 | boto.ec2.autoscale.policy 44 | -------------------------- 45 | 46 | .. automodule:: boto.ec2.autoscale.policy 47 | :members: 48 | :undoc-members: 49 | 50 | boto.ec2.autoscale.request 51 | -------------------------- 52 | 53 | .. automodule:: boto.ec2.autoscale.request 54 | :members: 55 | :undoc-members: 56 | 57 | boto.ec2.autoscale.scheduled 58 | ---------------------------- 59 | 60 | .. automodule:: boto.ec2.autoscale.scheduled 61 | :members: 62 | :undoc-members: 63 | -------------------------------------------------------------------------------- /boto/file/simpleresultset.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class SimpleResultSet(list): 23 | """ 24 | ResultSet facade built from a simple list, rather than via XML parsing. 25 | """ 26 | 27 | def __init__(self, input_list): 28 | for x in input_list: 29 | self.append(x) 30 | self.is_truncated = False 31 | -------------------------------------------------------------------------------- /boto/ec2/cloudwatch/listelement.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class ListElement(list): 23 | 24 | def startElement(self, name, attrs, connection): 25 | pass 26 | 27 | def endElement(self, name, value, connection): 28 | if name == 'member': 29 | self.append(value) 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/source/ref/cloudfront.rst: -------------------------------------------------------------------------------- 1 | .. ref-cloudfront 2 | 3 | ========== 4 | CloudFront 5 | ========== 6 | 7 | boto.cloudfront 8 | --------------- 9 | 10 | .. automodule:: boto.cloudfront 11 | :members: 12 | :undoc-members: 13 | 14 | boto.cloudfront.distribution 15 | ---------------------------- 16 | 17 | .. automodule:: boto.cloudfront.distribution 18 | :members: 19 | :undoc-members: 20 | 21 | boto.cloudfront.origin 22 | ---------------------- 23 | 24 | .. automodule:: boto.cloudfront.origin 25 | :members: 26 | :undoc-members: 27 | 28 | boto.cloudfront.identity 29 | ------------------------ 30 | 31 | .. automodule:: boto.cloudfront.identity 32 | :members: 33 | :undoc-members: 34 | 35 | boto.cloudfront.signers 36 | ----------------------- 37 | 38 | .. automodule:: boto.cloudfront.signers 39 | :members: 40 | :undoc-members: 41 | 42 | boto.cloudfront.invalidation 43 | ---------------------------- 44 | 45 | .. automodule:: boto.cloudfront.invalidation 46 | :members: 47 | :undoc-members: 48 | 49 | boto.cloudfront.object 50 | ---------------------- 51 | 52 | .. automodule:: boto.cloudfront.object 53 | :members: 54 | :undoc-members: 55 | 56 | boto.cloudfront.logging 57 | ----------------------- 58 | 59 | .. automodule:: boto.cloudfront.logging 60 | :members: 61 | :undoc-members: 62 | 63 | boto.cloudfront.exception 64 | ------------------------- 65 | 66 | .. automodule:: boto.cloudfront.exception 67 | :members: 68 | :undoc-members: 69 | -------------------------------------------------------------------------------- /boto/support/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from boto.exception import JSONResponseError 23 | 24 | 25 | class CaseIdNotFound(JSONResponseError): 26 | pass 27 | 28 | 29 | class CaseCreationLimitExceeded(JSONResponseError): 30 | pass 31 | 32 | 33 | class InternalServerError(JSONResponseError): 34 | pass 35 | -------------------------------------------------------------------------------- /boto/cloudformation/template.py: -------------------------------------------------------------------------------- 1 | from boto.resultset import ResultSet 2 | 3 | class Template: 4 | def __init__(self, connection=None): 5 | self.connection = connection 6 | self.description = None 7 | self.template_parameters = None 8 | 9 | def startElement(self, name, attrs, connection): 10 | if name == "Parameters": 11 | self.template_parameters = ResultSet([('member', TemplateParameter)]) 12 | return self.template_parameters 13 | else: 14 | return None 15 | 16 | def endElement(self, name, value, connection): 17 | if name == "Description": 18 | self.description = value 19 | else: 20 | setattr(self, name, value) 21 | 22 | class TemplateParameter: 23 | def __init__(self, parent): 24 | self.parent = parent 25 | self.default_value = None 26 | self.description = None 27 | self.no_echo = None 28 | self.parameter_key = None 29 | 30 | def startElement(self, name, attrs, connection): 31 | return None 32 | 33 | def endElement(self, name, value, connection): 34 | if name == "DefaultValue": 35 | self.default_value = value 36 | elif name == "Description": 37 | self.description = value 38 | elif name == "NoEcho": 39 | self.no_echo = bool(value) 40 | elif name == "ParameterKey": 41 | self.parameter_key = value 42 | else: 43 | setattr(self, name, value) 44 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | ============ 2 | Contributing 3 | ============ 4 | 5 | For more information, please see the official contribution docs at 6 | http://docs.pythonboto.org/en/latest/contributing.html. 7 | 8 | 9 | Contributing Code 10 | ================= 11 | 12 | * A good patch: 13 | 14 | * is clear. 15 | * works across all supported versions of Python. 16 | * follows the existing style of the code base (PEP-8). 17 | * has comments included as needed. 18 | 19 | * A test case that demonstrates the previous flaw that now passes 20 | with the included patch. 21 | * If it adds/changes a public API, it must also include documentation 22 | for those changes. 23 | * Must be appropriately licensed (New BSD). 24 | 25 | 26 | Reporting An Issue/Feature 27 | ========================== 28 | 29 | * Check to see if there's an existing issue/pull request for the 30 | bug/feature. All issues are at https://github.com/boto/boto/issues 31 | and pull reqs are at https://github.com/boto/boto/pulls. 32 | * If there isn't an existing issue there, please file an issue. The ideal 33 | report includes: 34 | 35 | * A description of the problem/suggestion. 36 | * How to recreate the bug. 37 | * If relevant, including the versions of your: 38 | 39 | * Python interpreter 40 | * boto 41 | * Optionally of the other dependencies involved 42 | 43 | * If possile, create a pull request with a (failing) test case demonstrating 44 | what's wrong. This makes the process for fixing bugs quicker & gets issues 45 | resolved sooner. 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/source/ref/gs.rst: -------------------------------------------------------------------------------- 1 | .. ref-gs: 2 | 3 | == 4 | GS 5 | == 6 | 7 | boto.gs.acl 8 | ----------- 9 | 10 | .. automodule:: boto.gs.acl 11 | :members: 12 | :inherited-members: 13 | :undoc-members: 14 | 15 | boto.gs.bucket 16 | -------------- 17 | 18 | .. automodule:: boto.gs.bucket 19 | :members: 20 | :inherited-members: 21 | :undoc-members: 22 | :exclude-members: BucketPaymentBody, LoggingGroup, MFADeleteRE, VersionRE, 23 | VersioningBody, WebsiteBody, WebsiteErrorFragment, 24 | WebsiteMainPageFragment, startElement, endElement 25 | 26 | boto.gs.bucketlistresultset 27 | --------------------------- 28 | 29 | .. automodule:: boto.gs.bucketlistresultset 30 | :members: 31 | :inherited-members: 32 | :undoc-members: 33 | 34 | boto.gs.connection 35 | ------------------ 36 | 37 | .. automodule:: boto.gs.connection 38 | :members: 39 | :inherited-members: 40 | :undoc-members: 41 | 42 | boto.gs.cors 43 | ------------ 44 | 45 | .. automodule:: boto.gs.cors 46 | :members: 47 | :undoc-members: 48 | 49 | boto.gs.key 50 | ----------- 51 | 52 | .. automodule:: boto.gs.key 53 | :members: 54 | :inherited-members: 55 | :undoc-members: 56 | 57 | boto.gs.user 58 | ------------ 59 | 60 | .. automodule:: boto.gs.user 61 | :members: 62 | :inherited-members: 63 | :undoc-members: 64 | 65 | boto.gs.resumable_upload_handler 66 | -------------------------------- 67 | 68 | .. automodule:: boto.gs.resumable_upload_handler 69 | :members: 70 | :inherited-members: 71 | :undoc-members: 72 | 73 | -------------------------------------------------------------------------------- /tests/integration/support/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | from tests.unit import unittest 24 | import boto.support 25 | 26 | 27 | class CertVerificationTest(unittest.TestCase): 28 | 29 | support = True 30 | ssl = True 31 | 32 | def test_certs(self): 33 | for region in boto.support.regions(): 34 | c = region.connect() 35 | c.describe_services() 36 | -------------------------------------------------------------------------------- /tests/integration/redshift/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | from tests.unit import unittest 24 | import boto.redshift 25 | 26 | 27 | class CertVerificationTest(unittest.TestCase): 28 | 29 | redshift = True 30 | ssl = True 31 | 32 | def test_certs(self): 33 | for region in boto.redshift.regions(): 34 | c = region.connect() 35 | c.describe_cluster_versions() 36 | -------------------------------------------------------------------------------- /boto/rds/regioninfo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | # 24 | 25 | from boto.regioninfo import RegionInfo 26 | 27 | class RDSRegionInfo(RegionInfo): 28 | 29 | def __init__(self, connection=None, name=None, endpoint=None): 30 | from boto.rds import RDSConnection 31 | RegionInfo.__init__(self, connection, name, endpoint, 32 | RDSConnection) 33 | -------------------------------------------------------------------------------- /boto/sdb/regioninfo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | # 24 | 25 | from boto.regioninfo import RegionInfo 26 | 27 | class SDBRegionInfo(RegionInfo): 28 | 29 | def __init__(self, connection=None, name=None, endpoint=None): 30 | from boto.sdb.connection import SDBConnection 31 | RegionInfo.__init__(self, connection, name, endpoint, 32 | SDBConnection) 33 | -------------------------------------------------------------------------------- /boto/sqs/regioninfo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | # 24 | 25 | from boto.regioninfo import RegionInfo 26 | 27 | class SQSRegionInfo(RegionInfo): 28 | 29 | def __init__(self, connection=None, name=None, endpoint=None): 30 | from boto.sqs.connection import SQSConnection 31 | RegionInfo.__init__(self, connection, name, endpoint, 32 | SQSConnection) 33 | -------------------------------------------------------------------------------- /boto/pyami/scriptbase.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from boto.utils import ShellCommand, get_ts 4 | import boto 5 | import boto.utils 6 | 7 | class ScriptBase: 8 | 9 | def __init__(self, config_file=None): 10 | self.instance_id = boto.config.get('Instance', 'instance-id', 'default') 11 | self.name = self.__class__.__name__ 12 | self.ts = get_ts() 13 | if config_file: 14 | boto.config.read(config_file) 15 | 16 | def notify(self, subject, body=''): 17 | boto.utils.notify(subject, body) 18 | 19 | def mkdir(self, path): 20 | if not os.path.isdir(path): 21 | try: 22 | os.mkdir(path) 23 | except: 24 | boto.log.error('Error creating directory: %s' % path) 25 | 26 | def umount(self, path): 27 | if os.path.ismount(path): 28 | self.run('umount %s' % path) 29 | 30 | def run(self, command, notify=True, exit_on_error=False, cwd=None): 31 | self.last_command = ShellCommand(command, cwd=cwd) 32 | if self.last_command.status != 0: 33 | boto.log.error('Error running command: "%s". Output: "%s"' % (command, self.last_command.output)) 34 | if notify: 35 | self.notify('Error encountered', \ 36 | 'Error running the following command:\n\t%s\n\nCommand output:\n\t%s' % \ 37 | (command, self.last_command.output)) 38 | if exit_on_error: 39 | sys.exit(-1) 40 | return self.last_command.status 41 | 42 | def main(self): 43 | pass 44 | 45 | -------------------------------------------------------------------------------- /tests/integration/elastictranscoder/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | from tests.unit import unittest 24 | import boto.elastictranscoder 25 | 26 | 27 | class CertVerificationTest(unittest.TestCase): 28 | 29 | elastictranscoder = True 30 | ssl = True 31 | 32 | def test_certs(self): 33 | for region in boto.elastictranscoder.regions(): 34 | c = region.connect() 35 | c.list_pipelines() 36 | -------------------------------------------------------------------------------- /boto/file/connection.py: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Google Inc. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | # File representation of connection, for use with "file://" URIs. 23 | 24 | from bucket import Bucket 25 | 26 | class FileConnection(object): 27 | 28 | def __init__(self, file_storage_uri): 29 | # FileConnections are per-file storage URI. 30 | self.file_storage_uri = file_storage_uri 31 | 32 | def get_bucket(self, bucket_name, validate=True, headers=None): 33 | return Bucket(bucket_name, self.file_storage_uri.object_name) 34 | -------------------------------------------------------------------------------- /bin/bundle_image: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from boto.manage.server import Server 3 | if __name__ == "__main__": 4 | from optparse import OptionParser 5 | parser = OptionParser(version="%prog 1.0", usage="Usage: %prog [options] instance-id [instance-id-2]") 6 | 7 | # Commands 8 | parser.add_option("-b", "--bucket", help="Destination Bucket", dest="bucket", default=None) 9 | parser.add_option("-p", "--prefix", help="AMI Prefix", dest="prefix", default=None) 10 | parser.add_option("-k", "--key", help="Private Key File", dest="key_file", default=None) 11 | parser.add_option("-c", "--cert", help="Public Certificate File", dest="cert_file", default=None) 12 | parser.add_option("-s", "--size", help="AMI Size", dest="size", default=None) 13 | parser.add_option("-i", "--ssh-key", help="SSH Keyfile", dest="ssh_key", default=None) 14 | parser.add_option("-u", "--user-name", help="SSH Username", dest="uname", default="root") 15 | parser.add_option("-n", "--name", help="Name of Image", dest="name") 16 | (options, args) = parser.parse_args() 17 | 18 | for instance_id in args: 19 | try: 20 | s = Server.find(instance_id=instance_id).next() 21 | print "Found old server object" 22 | except StopIteration: 23 | print "New Server Object Created" 24 | s = Server.create_from_instance_id(instance_id, options.name) 25 | assert(s.hostname is not None) 26 | b = s.get_bundler(uname=options.uname) 27 | b.bundle(bucket=options.bucket,prefix=options.prefix,key_file=options.key_file,cert_file=options.cert_file,size=int(options.size),ssh_key=options.ssh_key) 28 | -------------------------------------------------------------------------------- /boto/datapipeline/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from boto.exception import JSONResponseError 23 | 24 | 25 | class PipelineDeletedException(JSONResponseError): 26 | pass 27 | 28 | 29 | class InvalidRequestException(JSONResponseError): 30 | pass 31 | 32 | 33 | class TaskNotFoundException(JSONResponseError): 34 | pass 35 | 36 | 37 | class PipelineNotFoundException(JSONResponseError): 38 | pass 39 | 40 | 41 | class InternalServiceError(JSONResponseError): 42 | pass 43 | -------------------------------------------------------------------------------- /boto/ec2/regioninfo.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | from boto.regioninfo import RegionInfo 25 | 26 | class EC2RegionInfo(RegionInfo): 27 | """ 28 | Represents an EC2 Region 29 | """ 30 | 31 | def __init__(self, connection=None, name=None, endpoint=None): 32 | from boto.ec2.connection import EC2Connection 33 | RegionInfo.__init__(self, connection, name, endpoint, 34 | EC2Connection) 35 | -------------------------------------------------------------------------------- /boto/ec2/elb/listelement.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All Rights Reserved 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | 25 | class ListElement(list): 26 | """ 27 | A :py:class:`list` subclass that has some additional methods 28 | for interacting with Amazon's XML API. 29 | """ 30 | 31 | def startElement(self, name, attrs, connection): 32 | pass 33 | 34 | def endElement(self, name, value, connection): 35 | if name == 'member': 36 | self.append(value) 37 | -------------------------------------------------------------------------------- /tests/integration/ses/test_connection.py: -------------------------------------------------------------------------------- 1 | from tests.unit import unittest 2 | 3 | from boto.ses.connection import SESConnection 4 | from boto.ses import exceptions 5 | 6 | 7 | class SESConnectionTest(unittest.TestCase): 8 | ses = True 9 | 10 | def setUp(self): 11 | self.ses = SESConnection() 12 | 13 | def test_get_dkim_attributes(self): 14 | response = self.ses.get_identity_dkim_attributes(['example.com']) 15 | # Verify we get the structure we expect, we don't care about the 16 | # values. 17 | self.assertTrue('GetIdentityDkimAttributesResponse' in response) 18 | self.assertTrue('GetIdentityDkimAttributesResult' in 19 | response['GetIdentityDkimAttributesResponse']) 20 | self.assertTrue( 21 | 'DkimAttributes' in response['GetIdentityDkimAttributesResponse']\ 22 | ['GetIdentityDkimAttributesResult']) 23 | 24 | def test_set_identity_dkim_enabled(self): 25 | # This api call should fail because have not verified the domain, 26 | # so we can test that it at least fails we we expect. 27 | with self.assertRaises(exceptions.SESIdentityNotVerifiedError): 28 | self.ses.set_identity_dkim_enabled('example.com', True) 29 | 30 | def test_verify_domain_dkim(self): 31 | # This api call should fail because have not confirmed the domain, 32 | # so we can test that it at least fails we we expect. 33 | with self.assertRaises(exceptions.SESDomainNotConfirmedError): 34 | self.ses.verify_domain_dkim('example.com') 35 | 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /tests/mturk/cleanup_tests.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | 3 | from _init_environment import SetHostMTurkConnection 4 | from _init_environment import config_environment 5 | 6 | def description_filter(substring): 7 | return lambda hit: substring in hit.Title 8 | 9 | def disable_hit(hit): 10 | return conn.disable_hit(hit.HITId) 11 | 12 | def dispose_hit(hit): 13 | # assignments must be first approved or rejected 14 | for assignment in conn.get_assignments(hit.HITId): 15 | if assignment.AssignmentStatus == 'Submitted': 16 | conn.approve_assignment(assignment.AssignmentId) 17 | return conn.dispose_hit(hit.HITId) 18 | 19 | def cleanup(): 20 | """Remove any boto test related HIT's""" 21 | config_environment() 22 | 23 | global conn 24 | 25 | conn = SetHostMTurkConnection() 26 | 27 | 28 | is_boto = description_filter('Boto') 29 | print 'getting hits...' 30 | all_hits = list(conn.get_all_hits()) 31 | is_reviewable = lambda hit: hit.HITStatus == 'Reviewable' 32 | is_not_reviewable = lambda hit: not is_reviewable(hit) 33 | hits_to_process = filter(is_boto, all_hits) 34 | hits_to_disable = filter(is_not_reviewable, hits_to_process) 35 | hits_to_dispose = filter(is_reviewable, hits_to_process) 36 | print 'disabling/disposing %d/%d hits' % (len(hits_to_disable), len(hits_to_dispose)) 37 | map(disable_hit, hits_to_disable) 38 | map(dispose_hit, hits_to_dispose) 39 | 40 | total_hits = len(all_hits) 41 | hits_processed = len(hits_to_process) 42 | skipped = total_hits - hits_processed 43 | fmt = 'Processed: %(total_hits)d HITs, disabled/disposed: %(hits_processed)d, skipped: %(skipped)d' 44 | print fmt % vars() 45 | 46 | if __name__ == '__main__': 47 | cleanup() 48 | -------------------------------------------------------------------------------- /tests/integration/s3/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on SQS endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.s3 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | s3 = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.s3.regions(): 39 | c = region.connect() 40 | c.get_all_buckets() 41 | -------------------------------------------------------------------------------- /tests/integration/sns/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on SQS endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.sns 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | sns = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.sns.regions(): 39 | c = region.connect() 40 | c.get_all_topics() 41 | -------------------------------------------------------------------------------- /tests/integration/iam/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.iam 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | iam = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.iam.regions(): 39 | c = region.connect() 40 | c.get_all_users() 41 | -------------------------------------------------------------------------------- /tests/integration/sqs/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on SQS endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.sqs 30 | 31 | 32 | class SQSCertVerificationTest(unittest.TestCase): 33 | 34 | sqs = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.sqs.regions(): 39 | c = region.connect() 40 | c.get_all_queues() 41 | -------------------------------------------------------------------------------- /tests/integration/ec2/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.ec2 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | ec2 = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.ec2.regions(): 39 | c = region.connect() 40 | c.get_all_instances() 41 | -------------------------------------------------------------------------------- /tests/integration/emr/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all EMR endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.emr 30 | 31 | 32 | class EMRCertVerificationTest(unittest.TestCase): 33 | 34 | emr = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.emr.regions(): 39 | c = region.connect() 40 | c.describe_jobflows() 41 | -------------------------------------------------------------------------------- /tests/integration/sdb/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.sdb 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | sdb = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.sdb.regions(): 39 | c = region.connect() 40 | c.get_all_domains() 41 | -------------------------------------------------------------------------------- /tests/integration/sts/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.sts 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | sts = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.sts.regions(): 39 | c = region.connect() 40 | c.get_session_token() 41 | -------------------------------------------------------------------------------- /tests/integration/rds/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.rds 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | rds = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.rds.regions(): 39 | c = region.connect() 40 | c.get_all_dbinstances() 41 | -------------------------------------------------------------------------------- /boto/ec2/cloudwatch/dimension.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | class Dimension(dict): 24 | 25 | def startElement(self, name, attrs, connection): 26 | pass 27 | 28 | def endElement(self, name, value, connection): 29 | if name == 'Name': 30 | self._name = value 31 | elif name == 'Value': 32 | if self._name in self: 33 | self[self._name].append(value) 34 | else: 35 | self[self._name] = [value] 36 | else: 37 | setattr(self, name, value) 38 | 39 | -------------------------------------------------------------------------------- /tests/integration/glacier/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.glacier 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | glacier = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.glacier.regions(): 39 | c = region.connect() 40 | c.list_vaults() 41 | -------------------------------------------------------------------------------- /tests/integration/swf/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.swf 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | swf = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.swf.regions(): 39 | c = region.connect() 40 | c.list_domains('REGISTERED') 41 | -------------------------------------------------------------------------------- /tests/integration/ses/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.ses 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | ses = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.ses.regions(): 39 | c = region.connect() 40 | c.list_verified_email_addresses() 41 | -------------------------------------------------------------------------------- /boto/services/sonofmmm.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Your AWS Credentials 3 | # You only need to supply these in this file if you are not using 4 | # the boto tools to start your service 5 | # 6 | #[Credentials] 7 | #aws_access_key_id = 8 | #aws_secret_access_key = 9 | 10 | # 11 | # Fill out this section if you want emails from the service 12 | # when it starts and stops 13 | # 14 | #[Notification] 15 | #smtp_host = 16 | #smtp_user = 17 | #smtp_pass = 18 | #smtp_from = 19 | #smtp_to = 20 | 21 | [Pyami] 22 | scripts = boto.services.sonofmmm.SonOfMMM 23 | 24 | [SonOfMMM] 25 | # id of the AMI to be launched 26 | ami_id = ami-dc799cb5 27 | # number of times service will read an empty queue before exiting 28 | # a negative value will cause the service to run forever 29 | retry_count = 5 30 | # seconds to wait after empty queue read before reading again 31 | loop_delay = 10 32 | # average time it takes to process a transaction 33 | # controls invisibility timeout of messages 34 | processing_time = 60 35 | ffmpeg_args = -y -i %%s -f mov -r 29.97 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -ar 48000 -ab 19200 -s 320x240 -vcodec mpeg4 -acodec libfaac %%s 36 | output_mimetype = video/quicktime 37 | output_ext = .mov 38 | input_bucket = 39 | output_bucket = 40 | output_domain = 41 | output_queue = 42 | input_queue = 43 | 44 | -------------------------------------------------------------------------------- /tests/integration/dynamodb/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.dynamodb 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | dynamodb = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.dynamodb.regions(): 39 | c = region.connect() 40 | c.layer1.list_tables() 41 | -------------------------------------------------------------------------------- /tests/integration/dynamodb2/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.dynamodb2 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | dynamodb2 = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.dynamodb2.regions(): 39 | c = region.connect() 40 | c.list_tables() 41 | -------------------------------------------------------------------------------- /tests/integration/ec2/elb/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.ec2.elb 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | elb = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.ec2.elb.regions(): 39 | c = region.connect() 40 | c.get_all_load_balancers() 41 | -------------------------------------------------------------------------------- /tests/integration/route53/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.route53 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | route53 = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.route53.regions(): 39 | c = region.connect() 40 | c.get_all_hosted_zones() 41 | -------------------------------------------------------------------------------- /boto/ec2/autoscale/request.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009 Reza Lotun http://reza.lotun.name/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class Request(object): 23 | def __init__(self, connection=None): 24 | self.connection = connection 25 | self.request_id = '' 26 | 27 | def __repr__(self): 28 | return 'Request:%s' % self.request_id 29 | 30 | def startElement(self, name, attrs, connection): 31 | return None 32 | 33 | def endElement(self, name, value, connection): 34 | if name == 'RequestId': 35 | self.request_id = value 36 | else: 37 | setattr(self, name, value) 38 | 39 | -------------------------------------------------------------------------------- /boto/ec2/group.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 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 | class Group: 24 | 25 | def __init__(self, parent=None): 26 | self.id = None 27 | self.name = None 28 | 29 | def startElement(self, name, attrs, connection): 30 | return None 31 | 32 | def endElement(self, name, value, connection): 33 | if name == 'groupId': 34 | self.id = value 35 | elif name == 'groupName': 36 | self.name = value 37 | else: 38 | setattr(self, name, value) 39 | 40 | -------------------------------------------------------------------------------- /tests/integration/cloudsearch/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.cloudsearch 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | rds = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.cloudsearch.regions(): 39 | c = region.connect() 40 | c.describe_domains() 41 | -------------------------------------------------------------------------------- /boto/cloudfront/logging.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class LoggingInfo(object): 23 | 24 | def __init__(self, bucket='', prefix=''): 25 | self.bucket = bucket 26 | self.prefix = prefix 27 | 28 | def startElement(self, name, attrs, connection): 29 | return None 30 | 31 | def endElement(self, name, value, connection): 32 | if name == 'Bucket': 33 | self.bucket = value 34 | elif name == 'Prefix': 35 | self.prefix = value 36 | else: 37 | setattr(self, name, value) 38 | 39 | -------------------------------------------------------------------------------- /tests/integration/ec2/autoscale/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.ec2.autoscale 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | autoscale = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.ec2.autoscale.regions(): 39 | c = region.connect() 40 | c.get_all_groups() 41 | -------------------------------------------------------------------------------- /tests/integration/ec2/cloudwatch/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.ec2.cloudwatch 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | cloudwatch = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.ec2.cloudwatch.regions(): 39 | c = region.connect() 40 | c.describe_alarms() 41 | -------------------------------------------------------------------------------- /tests/integration/cloudformation/test_cert_verification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. 3 | # All rights reserved. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a 6 | # copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, dis- 9 | # tribute, sublicense, and/or sell copies of the Software, and to permit 10 | # persons to whom the Software is furnished to do so, subject to the fol- 11 | # lowing conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be included 14 | # in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 18 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | # IN THE SOFTWARE. 23 | 24 | """ 25 | Check that all of the certs on all service endpoints validate. 26 | """ 27 | 28 | import unittest 29 | import boto.cloudformation 30 | 31 | 32 | class CertVerificationTest(unittest.TestCase): 33 | 34 | cloudformation = True 35 | ssl = True 36 | 37 | def test_certs(self): 38 | for region in boto.cloudformation.regions(): 39 | c = region.connect() 40 | c.describe_stacks() 41 | -------------------------------------------------------------------------------- /tests/unit/s3/test_tagging.py: -------------------------------------------------------------------------------- 1 | from tests.unit import AWSMockServiceTestCase 2 | 3 | from boto.s3.connection import S3Connection 4 | from boto.s3.bucket import Bucket 5 | from boto.s3.tagging import Tag 6 | 7 | 8 | class TestS3Tagging(AWSMockServiceTestCase): 9 | connection_class = S3Connection 10 | 11 | def default_body(self): 12 | return """ 13 | 14 | 15 | 16 | Project 17 | Project One 18 | 19 | 20 | User 21 | jsmith 22 | 23 | 24 | 25 | """ 26 | 27 | def test_parse_tagging_response(self): 28 | self.set_http_response(status_code=200) 29 | b = Bucket(self.service_connection, 'mybucket') 30 | api_response = b.get_tags() 31 | # The outer list is a list of tag sets. 32 | self.assertEqual(len(api_response), 1) 33 | # The inner list is a list of tags. 34 | self.assertEqual(len(api_response[0]), 2) 35 | self.assertEqual(api_response[0][0].key, 'Project') 36 | self.assertEqual(api_response[0][0].value, 'Project One') 37 | self.assertEqual(api_response[0][1].key, 'User') 38 | self.assertEqual(api_response[0][1].value, 'jsmith') 39 | 40 | def test_tag_equality(self): 41 | t1 = Tag('foo', 'bar') 42 | t2 = Tag('foo', 'bar') 43 | t3 = Tag('foo', 'baz') 44 | t4 = Tag('baz', 'bar') 45 | self.assertEqual(t1, t2) 46 | self.assertNotEqual(t1, t3) 47 | self.assertNotEqual(t1, t4) 48 | -------------------------------------------------------------------------------- /boto/ec2/elb/securitygroup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class SecurityGroup(object): 23 | def __init__(self, connection=None): 24 | self.name = None 25 | self.owner_alias = None 26 | 27 | def __repr__(self): 28 | return 'SecurityGroup(%s, %s)' % (self.name, self.owner_alias) 29 | 30 | def startElement(self, name, attrs, connection): 31 | pass 32 | 33 | def endElement(self, name, value, connection): 34 | if name == 'GroupName': 35 | self.name = value 36 | elif name == 'OwnerAlias': 37 | self.owner_alias = value 38 | 39 | -------------------------------------------------------------------------------- /tests/unit/sqs/test_queue.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from tests.unit import unittest 23 | from mock import Mock 24 | 25 | from boto.sqs.queue import Queue 26 | 27 | 28 | class TestQueue(unittest.TestCase): 29 | 30 | def test_queue_arn(self): 31 | connection = Mock() 32 | connection.region.name = 'us-east-1' 33 | q = Queue( 34 | connection=connection, 35 | url='https://sqs.us-east-1.amazonaws.com/id/queuename') 36 | self.assertEqual(q.arn, 'arn:aws:sqs:us-east-1:id:queuename') 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /docs/source/ref/sdb_db.rst: -------------------------------------------------------------------------------- 1 | .. ref-sdbdb 2 | 3 | ================ 4 | SDB DB Reference 5 | ================ 6 | 7 | This module offers an ORM-like layer on top of SimpleDB. 8 | 9 | boto.sdb.db 10 | ----------- 11 | 12 | .. automodule:: boto.sdb.db 13 | :members: 14 | :undoc-members: 15 | 16 | boto.sdb.db.blob 17 | ---------------- 18 | 19 | .. automodule:: boto.sdb.db.blob 20 | :members: 21 | :undoc-members: 22 | 23 | boto.sdb.db.key 24 | --------------- 25 | 26 | .. automodule:: boto.sdb.db.key 27 | :members: 28 | :undoc-members: 29 | 30 | boto.sdb.db.manager 31 | ------------------- 32 | 33 | .. automodule:: boto.sdb.db.manager 34 | :members: 35 | :undoc-members: 36 | 37 | boto.sdb.db.manager.pgmanager 38 | ----------------------------- 39 | 40 | .. note:: 41 | 42 | This module requires psycopg2__ to be installed in the Python path. 43 | 44 | __ http://initd.org/ 45 | 46 | .. automodule:: boto.sdb.db.manager.pgmanager 47 | :members: 48 | :undoc-members: 49 | 50 | boto.sdb.db.manager.sdbmanager 51 | ------------------------------ 52 | 53 | .. automodule:: boto.sdb.db.manager.sdbmanager 54 | :members: 55 | :undoc-members: 56 | 57 | boto.sdb.db.manager.xmlmanager 58 | ------------------------------ 59 | 60 | .. automodule:: boto.sdb.db.manager.xmlmanager 61 | :members: 62 | :undoc-members: 63 | 64 | boto.sdb.db.model 65 | ----------------- 66 | 67 | .. automodule:: boto.sdb.db.model 68 | :members: 69 | :undoc-members: 70 | 71 | boto.sdb.db.property 72 | -------------------- 73 | 74 | .. automodule:: boto.sdb.db.property 75 | :members: 76 | :undoc-members: 77 | 78 | boto.sdb.db.query 79 | ----------------- 80 | 81 | .. automodule:: boto.sdb.db.query 82 | :members: 83 | :undoc-members: 84 | -------------------------------------------------------------------------------- /boto/elastictranscoder/exceptions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from boto.exception import JSONResponseError 23 | 24 | 25 | class LimitExceededException(JSONResponseError): 26 | pass 27 | 28 | 29 | class ResourceInUseException(JSONResponseError): 30 | pass 31 | 32 | 33 | class AccessDeniedException(JSONResponseError): 34 | pass 35 | 36 | 37 | class ResourceNotFoundException(JSONResponseError): 38 | pass 39 | 40 | 41 | class InternalServiceException(JSONResponseError): 42 | pass 43 | 44 | 45 | class ValidationException(JSONResponseError): 46 | pass 47 | 48 | 49 | class IncompatibleVersionException(JSONResponseError): 50 | pass 51 | -------------------------------------------------------------------------------- /boto/iam/summarymap.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ 2 | # Copyright (c) 2010, Eucalyptus Systems, Inc. 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 | class SummaryMap(dict): 24 | 25 | def __init__(self, parent=None): 26 | self.parent = parent 27 | dict.__init__(self) 28 | 29 | def startElement(self, name, attrs, connection): 30 | pass 31 | 32 | def endElement(self, name, value, connection): 33 | if name == 'key': 34 | self._name = value 35 | elif name == 'value': 36 | try: 37 | self[self._name] = int(value) 38 | except ValueError: 39 | self[self._name] = value 40 | else: 41 | setattr(self, name, value) 42 | 43 | -------------------------------------------------------------------------------- /boto/s3/prefix.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | class Prefix(object): 23 | def __init__(self, bucket=None, name=None): 24 | self.bucket = bucket 25 | self.name = name 26 | 27 | def startElement(self, name, attrs, connection): 28 | return None 29 | 30 | def endElement(self, name, value, connection): 31 | if name == 'Prefix': 32 | self.name = value 33 | else: 34 | setattr(self, name, value) 35 | 36 | @property 37 | def provider(self): 38 | provider = None 39 | if self.bucket and self.bucket.connection: 40 | provider = self.bucket.connection.provider 41 | return provider 42 | 43 | -------------------------------------------------------------------------------- /docs/source/releasenotes/v2.9.1.rst: -------------------------------------------------------------------------------- 1 | boto v2.9.1 2 | =========== 3 | 4 | :date: 2013/04/30 5 | 6 | Primarily a bugfix release, this release also includes support for the new 7 | AWS Support API. 8 | 9 | 10 | Features 11 | -------- 12 | 13 | * AWS Support API - A client was added to support the new AWS Support API. It 14 | gives programmatic access to Support cases opened with AWS. A short example 15 | might look like:: 16 | 17 | >>> from boto.support.layer1 import SupportConnection 18 | >>> conn = SupportConnection() 19 | >>> new_case = conn.create_case( 20 | ... subject='Description of the issue', 21 | ... service_code='amazon-cloudsearch', 22 | ... category_code='performance', 23 | ... communication_body="We're seeing some latency from one of our...", 24 | ... severity_code='low' 25 | ... ) 26 | >>> new_case['caseId'] 27 | u'case-...' 28 | 29 | The :ref:`Support Tutorial ` has more information on how to use 30 | the new API. (:sha:`8c0451`) 31 | 32 | 33 | Bugfixes 34 | -------- 35 | 36 | * The reintroduction of ``ResumableUploadHandler.get_upload_id`` that was 37 | accidentally removed in a previous commit. (:sha:`758322`) 38 | * Added ``OrdinaryCallingFormat`` to support Google Storage's certificate 39 | verification. (:sha:`4ca83b`) 40 | * Added the ``eu-west-1`` region for Redshift. (:sha:`e98b95`) 41 | * Added support for overriding the port any connection in ``boto`` uses. 42 | (:sha:`08e893`) 43 | * Added retry/checksumming support to the DynamoDB v2 client. (:sha:`969ae2`) 44 | * Several documentation improvements/fixes: 45 | 46 | * Incorrect docs on EC2's ``import_key_pair``. (:sha:`6ada7d`) 47 | * Clearer docs on the DynamoDB ``count`` parameter. (:sha:`dfa456`) 48 | * Fixed a typo in the ``autoscale_tut``. (:sha:`6df1ae`) 49 | -------------------------------------------------------------------------------- /tests/unit/ec2/test_address.py: -------------------------------------------------------------------------------- 1 | import mock 2 | import unittest 3 | 4 | from boto.ec2.address import Address 5 | 6 | class AddressTest(unittest.TestCase): 7 | def setUp(self): 8 | self.address = Address() 9 | self.address.connection = mock.Mock() 10 | self.address.public_ip = "192.168.1.1" 11 | 12 | def check_that_attribute_has_been_set(self, name, value, attribute): 13 | self.address.endElement(name, value, None) 14 | self.assertEqual(getattr(self.address, attribute), value) 15 | 16 | def test_endElement_sets_correct_attributes_with_values(self): 17 | for arguments in [("publicIp", "192.168.1.1", "public_ip"), 18 | ("instanceId", 1, "instance_id"), 19 | ("domain", "some domain", "domain"), 20 | ("allocationId", 1, "allocation_id"), 21 | ("associationId", 1, "association_id"), 22 | ("somethingRandom", "somethingRandom", "somethingRandom")]: 23 | self.check_that_attribute_has_been_set(arguments[0], arguments[1], arguments[2]) 24 | 25 | 26 | def test_release_calls_connection_release_address_with_correct_args(self): 27 | self.address.release() 28 | self.address.connection.release_address.assert_called_with("192.168.1.1") 29 | 30 | def test_associate_calls_connection_associate_address_with_correct_args(self): 31 | self.address.associate(1) 32 | self.address.connection.associate_address.assert_called_with(1, "192.168.1.1") 33 | 34 | def test_disassociate_calls_connection_disassociate_address_with_correct_args(self): 35 | self.address.disassociate() 36 | self.address.connection.disassociate_address.assert_called_with("192.168.1.1") 37 | 38 | if __name__ == "__main__": 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /boto/ec2/cloudwatch/datapoint.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | from datetime import datetime 23 | 24 | class Datapoint(dict): 25 | 26 | def __init__(self, connection=None): 27 | dict.__init__(self) 28 | self.connection = connection 29 | 30 | def startElement(self, name, attrs, connection): 31 | pass 32 | 33 | def endElement(self, name, value, connection): 34 | if name in ['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount']: 35 | self[name] = float(value) 36 | elif name == 'Timestamp': 37 | self[name] = datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ') 38 | elif name != 'member': 39 | self[name] = value 40 | 41 | -------------------------------------------------------------------------------- /boto/sqs/jsonmessage.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | import base64 22 | 23 | from boto.sqs.message import MHMessage 24 | from boto.exception import SQSDecodeError 25 | from boto.compat import json 26 | 27 | 28 | class JSONMessage(MHMessage): 29 | """ 30 | Acts like a dictionary but encodes it's data as a Base64 encoded JSON payload. 31 | """ 32 | 33 | def decode(self, value): 34 | try: 35 | value = base64.b64decode(value) 36 | value = json.loads(value) 37 | except: 38 | raise SQSDecodeError('Unable to decode message', self) 39 | return value 40 | 41 | def encode(self, value): 42 | value = json.dumps(value) 43 | return base64.b64encode(value) 44 | -------------------------------------------------------------------------------- /tests/integration/opsworks/test_layer1.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | import unittest 23 | import time 24 | 25 | from boto.opsworks.layer1 import OpsWorksConnection 26 | from boto.opsworks.exceptions import ValidationException 27 | 28 | 29 | class TestOpsWorksConnection(unittest.TestCase): 30 | def setUp(self): 31 | self.api = OpsWorksConnection() 32 | 33 | def test_describe_stacks(self): 34 | response = self.api.describe_stacks() 35 | self.assertIn('Stacks', response) 36 | 37 | def test_validation_errors(self): 38 | with self.assertRaises(ValidationException): 39 | self.api.create_stack('testbotostack', 'us-east-1', 40 | 'badarn', 'badarn2') 41 | -------------------------------------------------------------------------------- /boto/sqs/attributes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | """ 23 | Represents an SQS Attribute Name/Value set 24 | """ 25 | 26 | class Attributes(dict): 27 | 28 | def __init__(self, parent): 29 | self.parent = parent 30 | self.current_key = None 31 | self.current_value = None 32 | 33 | def startElement(self, name, attrs, connection): 34 | pass 35 | 36 | def endElement(self, name, value, connection): 37 | if name == 'Attribute': 38 | self[self.current_key] = self.current_value 39 | elif name == 'Name': 40 | self.current_key = value 41 | elif name == 'Value': 42 | self.current_value = value 43 | else: 44 | setattr(self, name, value) 45 | 46 | 47 | -------------------------------------------------------------------------------- /tests/unit/s3/test_bucket.py: -------------------------------------------------------------------------------- 1 | from tests.unit import unittest 2 | from tests.unit import AWSMockServiceTestCase 3 | 4 | from boto.s3.connection import S3Connection 5 | from boto.s3.bucket import Bucket 6 | 7 | class TestS3Bucket(AWSMockServiceTestCase): 8 | connection_class = S3Connection 9 | 10 | def setUp(self): 11 | super(TestS3Bucket, self).setUp() 12 | 13 | def test_bucket_create_bucket(self): 14 | self.set_http_response(status_code=200) 15 | bucket = self.service_connection.create_bucket('mybucket_create') 16 | self.assertEqual(bucket.name, 'mybucket_create') 17 | 18 | def test_bucket_constructor(self): 19 | self.set_http_response(status_code=200) 20 | bucket = Bucket(self.service_connection, 'mybucket_constructor') 21 | self.assertEqual(bucket.name, 'mybucket_constructor') 22 | 23 | def test_bucket_basics(self): 24 | self.set_http_response(status_code=200) 25 | bucket = self.service_connection.create_bucket('mybucket') 26 | self.assertEqual(bucket.__repr__(), '') 27 | 28 | def test_bucket_new_key(self): 29 | self.set_http_response(status_code=200) 30 | bucket = self.service_connection.create_bucket('mybucket') 31 | key = bucket.new_key('mykey') 32 | 33 | self.assertEqual(key.bucket, bucket) 34 | self.assertEqual(key.key, 'mykey') 35 | 36 | def test_bucket_new_key_missing_name(self): 37 | self.set_http_response(status_code=200) 38 | bucket = self.service_connection.create_bucket('mybucket') 39 | 40 | with self.assertRaises(ValueError): 41 | key = bucket.new_key('') 42 | 43 | def test_bucket_delete_key_missing_name(self): 44 | self.set_http_response(status_code=200) 45 | bucket = self.service_connection.create_bucket('mybucket') 46 | 47 | with self.assertRaises(ValueError): 48 | key = bucket.delete_key('') 49 | -------------------------------------------------------------------------------- /boto/support/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | # 22 | 23 | from boto.regioninfo import RegionInfo 24 | 25 | 26 | def regions(): 27 | """ 28 | Get all available regions for the Amazon Support service. 29 | 30 | :rtype: list 31 | :return: A list of :class:`boto.regioninfo.RegionInfo` 32 | """ 33 | from boto.support.layer1 import SupportConnection 34 | return [ 35 | RegionInfo( 36 | name='us-east-1', 37 | endpoint='support.us-east-1.amazonaws.com', 38 | connection_cls=SupportConnection 39 | ), 40 | ] 41 | 42 | 43 | def connect_to_region(region_name, **kw_params): 44 | for region in regions(): 45 | if region.name == region_name: 46 | return region.connect(**kw_params) 47 | return None 48 | -------------------------------------------------------------------------------- /boto/pyami/copybot.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Your AWS Credentials 3 | # 4 | [Credentials] 5 | aws_access_key_id = 6 | aws_secret_access_key = 7 | 8 | # 9 | # If you want to use a separate set of credentials when writing 10 | # to the destination bucket, put them here 11 | #dest_aws_access_key_id = 12 | #dest_aws_secret_access_key = 13 | 14 | # 15 | # Fill out this section if you want emails from CopyBot 16 | # when it starts and stops 17 | # 18 | [Notification] 19 | #smtp_host = 20 | #smtp_user = 21 | #smtp_pass = 22 | #smtp_from = 23 | #smtp_to = 24 | 25 | # 26 | # If you leave this section as is, it will automatically 27 | # update boto from subversion upon start up. 28 | # If you don't want that to happen, comment this out 29 | # 30 | [Boto] 31 | boto_location = /usr/local/boto 32 | boto_update = svn:HEAD 33 | 34 | # 35 | # This tells the Pyami code in boto what scripts 36 | # to run during startup 37 | # 38 | [Pyami] 39 | scripts = boto.pyami.copybot.CopyBot 40 | 41 | # 42 | # Source bucket and Destination Bucket, obviously. 43 | # If the Destination bucket does not exist, it will 44 | # attempt to create it. 45 | # If exit_on_completion is false, the instance 46 | # will keep running after the copy operation is 47 | # complete which might be handy for debugging. 48 | # If copy_acls is false, the ACL's will not be 49 | # copied with the objects to the new bucket. 50 | # If replace_dst is false, copybot will not 51 | # will only store the source file in the dest if 52 | # that file does not already exist. If it's true 53 | # it will replace it even if it does exist. 54 | # 55 | [CopyBot] 56 | src_bucket = 57 | dst_bucket = 58 | exit_on_completion = true 59 | copy_acls = true 60 | replace_dst = true 61 | -------------------------------------------------------------------------------- /boto/dynamodb/exceptions.py: -------------------------------------------------------------------------------- 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 65 | -------------------------------------------------------------------------------- /boto/cloudfront/object.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a 4 | # copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, dis- 7 | # tribute, sublicense, and/or sell copies of the Software, and to permit 8 | # persons to whom the Software is furnished to do so, subject to the fol- 9 | # lowing conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included 12 | # in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 16 | # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 17 | # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | # IN THE SOFTWARE. 21 | 22 | from boto.s3.key import Key 23 | 24 | class Object(Key): 25 | 26 | def __init__(self, bucket, name=None): 27 | Key.__init__(self, bucket, name=name) 28 | self.distribution = bucket.distribution 29 | 30 | def __repr__(self): 31 | return '' % (self.distribution.config.origin, self.name) 32 | 33 | def url(self, scheme='http'): 34 | url = '%s://' % scheme 35 | url += self.distribution.domain_name 36 | if scheme.lower().startswith('rtmp'): 37 | url += '/cfx/st/' 38 | else: 39 | url += '/' 40 | url += self.name 41 | return url 42 | 43 | class StreamingObject(Object): 44 | 45 | def url(self, scheme='rtmp'): 46 | return Object.url(self, scheme) 47 | 48 | 49 | --------------------------------------------------------------------------------