OLD | NEW |
(Empty) | |
| 1 What's This All About? |
| 2 ====================== |
| 3 |
| 4 This directory contains the beginnings of what is hoped will be the |
| 5 new core of boto. We want to move from using httplib to using |
| 6 requests. We also want to offer full support for Python 2.6, 2.7, and |
| 7 3.x. This is a pretty big change and will require some time to roll |
| 8 out but this module provides a starting point. |
| 9 |
| 10 What you will find in this module: |
| 11 |
| 12 * auth.py provides a SigV2 authentication packages as a args hook for requests. |
| 13 * credentials.py provides a way of finding AWS credentials (see below). |
| 14 * dictresponse.py provides a generic response handler that parses XML responses |
| 15 and returns them as nested Python data structures. |
| 16 * service.py provides a simple example of a service that actually makes an EC2 |
| 17 request and returns a response. |
| 18 |
| 19 Credentials |
| 20 =========== |
| 21 |
| 22 Credentials are being handled a bit differently here. The following |
| 23 describes the order of search for credentials: |
| 24 |
| 25 1. If your local environment for has ACCESS_KEY and SECRET_KEY variables |
| 26 defined, these will be used. |
| 27 |
| 28 2. If your local environment has AWS_CREDENTIAL_FILE defined, it is assumed |
| 29 that it will be a config file with entries like this: |
| 30 |
| 31 [default] |
| 32 access_key = xxxxxxxxxxxxxxxx |
| 33 sercret_key = xxxxxxxxxxxxxxxxxx |
| 34 |
| 35 [test] |
| 36 access_key = yyyyyyyyyyyyyy |
| 37 secret_key = yyyyyyyyyyyyyyyyyy |
| 38 |
| 39 Each section in the config file is called a persona and you can reference |
| 40 a particular persona by name when instantiating a Service class. |
| 41 |
| 42 3. If a standard boto config file is found that contains credentials, those |
| 43 will be used. |
| 44 |
| 45 4. If temporary credentials for an IAM Role are found in the instance |
| 46 metadata of an EC2 instance, these credentials will be used. |
| 47 |
| 48 Trying Things Out |
| 49 ================= |
| 50 To try this code out, cd to the directory containing the core module. |
| 51 |
| 52 >>> import core.service |
| 53 >>> s = core.service.Service() |
| 54 >>> s.describe_instances() |
| 55 |
| 56 This code should return a Python data structure containing information |
| 57 about your currently running EC2 instances. This example should run in |
| 58 Python 2.6.x, 2.7.x and Python 3.x. |
OLD | NEW |