|
1 | 1 | Using the API |
2 | 2 | ============= |
3 | 3 |
|
4 | | -Authorization / Configuration |
5 | | ------------------------------ |
| 4 | +Client |
| 5 | +------ |
6 | 6 |
|
7 | | -- Use :class:`Client <gcloud.dns.client.Client>` objects to configure |
8 | | - your applications. |
| 7 | +:class:`Client <gcloud.dns.client.Client>` objects provide a means |
| 8 | +configure your DNS applications. Eash instance holds both a ``project`` |
| 9 | +and an authenticated connection to the DNS service. |
9 | 10 |
|
10 | | -- :class:`Client <gcloud.dns.client.Client>` objects hold both a ``project`` |
11 | | - and an authenticated connection to the PubSub service. |
| 11 | +For an overview of authentication in ``gcloud-python``, see: |
| 12 | +http://gcloud-python.readthedocs.org/en/latest/gcloud-auth.html |
12 | 13 |
|
13 | | -- The authentication credentials can be implicitly determined from the |
14 | | - environment or directly via |
15 | | - :meth:`from_service_account_json <gcloud.dns.client.Client.from_service_account_json>` |
16 | | - and |
17 | | - :meth:`from_service_account_p12 <gcloud.dns.client.Client.from_service_account_p12>`. |
18 | | - |
19 | | -- After setting ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GCLOUD_PROJECT`` |
20 | | - environment variables, create an instance of |
21 | | - :class:`Client <gcloud.dns.client.Client>`. |
| 14 | +Assuming your environment is set up as described in that document, |
| 15 | +create an instance of :class:`Client <gcloud.dns.client.Client>`. |
22 | 16 |
|
23 | 17 | .. doctest:: |
24 | 18 |
|
25 | 19 | >>> from gcloud import dns |
26 | 20 | >>> client = dns.Client() |
27 | 21 |
|
28 | | -- Override the credentials inferred from the environment by passing explicit |
29 | | - ``credentials`` to one of the alternative ``classmethod`` factories, |
30 | | - `:meth:gcloud.dns.client.Client.from_service_account_json`: |
| 22 | +Override the credentials inferred from the environment by passing explicit |
| 23 | +``credentials`` to one of the alternative ``classmethod`` factories, |
| 24 | +`:meth:gcloud.dns.client.Client.from_service_account_json`: |
31 | 25 |
|
32 | 26 | .. doctest:: |
33 | 27 |
|
34 | 28 | >>> from gcloud import dns |
35 | 29 | >>> client = dns.Client.from_service_account_json('/path/to/creds.json') |
36 | 30 |
|
37 | | - or `:meth:gcloud.dns.client.Client.from_service_account_p12`: |
| 31 | +or `:meth:gcloud.dns.client.Client.from_service_account_p12`: |
38 | 32 |
|
39 | 33 | .. doctest:: |
40 | 34 |
|
|
0 commit comments