Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: third_party/gsutil/boto/docs/source/boto_config_tut.rst

Issue 10199002: Upgrade gsutil to 3.4 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 .. _ref-boto_config:
2
3 ===========
4 Boto Config
5 ===========
6
7 Introduction
8 ------------
9
10 There is a growing list of configuration options for the boto library. Many of
11 these options can be passed into the constructors for top-level objects such as
12 connections. Some options, such as credentials, can also be read from
13 environment variables (e.g. ``AWS_ACCESS_KEY_ID`` and ``AWS_SECRET_ACCESS_KEY``) .
14 But there is no central place to manage these options. So, the development
15 version of boto has now introduced the notion of boto config files.
16
17 Details
18 -------
19
20 A boto config file is simply a .ini format configuration file that specifies
21 values for options that control the behavior of the boto library. Upon startup,
22 the boto library looks for configuration files in the following locations
23 and in the following order:
24
25 * /etc/boto.cfg - for site-wide settings that all users on this machine will use
26 * ~/.boto - for user-specific settings
27
28 The options are merged into a single, in-memory configuration that is
29 available as :py:mod:`boto.config`. The :py:class:`boto.pyami.config.Config`
30 class is a subclass of the standard Python
31 :py:class:`ConfigParser.SafeConfigParser` object and inherits all of the
32 methods of that object. In addition, the boto
33 :py:class:`Config <boto.pyami.config.Config>` class defines additional
34 methods that are described on the PyamiConfigMethods page.
35
36 Sections
37 --------
38
39 The following sections and options are currently recognized within the
40 boto config file.
41
42 Credentials
43 ^^^^^^^^^^^
44
45 The Credentials section is used to specify the AWS credentials used for all
46 boto requests. The order of precedence for authentication credentials is:
47
48 * Credentials passed into Connection class constructor.
49 * Credentials specified by environment variables
50 * Credentials specified as options in the config file.
51
52 This section defines the following options: ``aws_access_key_id`` and
53 ``aws_secret_access_key``. The former being your aws key id and the latter
54 being the secret key.
55
56 For example::
57
58 [Credentials]
59 aws_access_key_id = <your access key>
60 aws_secret_access_key = <your secret key>
61
62 Please notice that quote characters are not used to either side of the '='
63 operator even when both your aws access key id and secret key are strings.
64
65 Boto
66 ^^^^
67
68 The Boto section is used to specify options that control the operaton of
69 boto itself. This section defines the following options:
70
71 :debug: Controls the level of debug messages that will be printed by the boto li brary.
72 The following values are defined::
73
74 0 - no debug messages are printed
75 1 - basic debug messages from boto are printed
76 2 - all boto debugging messages plus request/response messages from http lib
77
78 :proxy: The name of the proxy host to use for connecting to AWS.
79 :proxy_port: The port number to use to connect to the proxy host.
80 :proxy_user: The user name to use when authenticating with proxy host.
81 :proxy_pass: The password to use when authenticating with proxy host.
82 :num_retries: The number of times to retry failed requests to an AWS server.
83 If boto receives an error from AWS, it will attempt to recover and retry the
84 request. The default number of retries is 5 but you can change the default
85 with this option.
86
87 As an example::
88
89 [Boto]
90 debug = 0
91 num_retries = 10
92
93 proxy = myproxy.com
94 proxy_port = 8080
95 proxy_user = foo
96 proxy_pass = bar
97
98 Precedence
99 ----------
100
101 Even if you have your boto config setup, you can also have credentials and
102 options stored in environmental variables or you can explicitly pass them to
103 method calls i.e.::
104
105 >>> boto.connect_ec2('<KEY_ID>','<SECRET_KEY>')
106
107 In these cases where these options can be found in more than one place boto
108 will first use the explicitly supplied arguments, if none found it will then
109 look for them amidst environment variables and if that fails it will use the
110 ones in boto config.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698