Skip to content

Commit 416071b

Browse files
committed
Renaming "from gcloud import *" statements as google.cloud.
Done via: $ git grep -l 'from gcloud import' | \ > xargs sed -i s/'from gcloud import'/'from google.cloud import'/g
1 parent e55a1d8 commit 416071b

58 files changed

Lines changed: 168 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ to activate Cloud Datastore for your project.
8888

8989
.. code:: python
9090
91-
from gcloud import datastore
91+
from google.cloud import datastore
9292
# Create, populate and persist an entity
9393
entity = datastore.Entity(key=datastore.Key('EntityKind'))
9494
entity.update({
@@ -124,7 +124,7 @@ how to create a bucket.
124124

125125
.. code:: python
126126
127-
from gcloud import storage
127+
from google.cloud import storage
128128
client = storage.Client()
129129
bucket = client.get_bucket('bucket-id-here')
130130
# Then do other things...
@@ -156,7 +156,7 @@ To get started with this API, you'll need to create
156156

157157
.. code:: python
158158
159-
from gcloud import pubsub
159+
from google.cloud import pubsub
160160
161161
client = pubsub.Client()
162162
topic = client.topic('topic_name')
@@ -185,7 +185,7 @@ Load data from CSV
185185
186186
import csv
187187
188-
from gcloud import bigquery
188+
from google.cloud import bigquery
189189
from gcloud.bigquery import SchemaField
190190
191191
client = bigquery.Client()
@@ -252,7 +252,7 @@ analyze, monitor, and alert on log data and events from Google Cloud Platform.
252252

253253
.. code:: python
254254
255-
from gcloud import logging
255+
from google.cloud import logging
256256
client = logging.Client()
257257
logger = client.logger('log_name')
258258
logger.log_text("A simple entry") # API call
@@ -290,7 +290,7 @@ List available metric types:
290290

291291
.. code:: python
292292
293-
from gcloud import monitoring
293+
from google.cloud import monitoring
294294
client = monitoring.Client()
295295
for descriptor in client.list_metric_descriptors():
296296
print(descriptor.type)

docs/bigquery-usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Authentication / Configuration
2222

2323
.. doctest::
2424

25-
>>> from gcloud import bigquery
25+
>>> from google.cloud import bigquery
2626
>>> client = bigquery.Client()
2727

2828

@@ -41,7 +41,7 @@ To override the project inferred from the environment, pass an explicit
4141

4242
.. doctest::
4343

44-
>>> from gcloud import bigquery
44+
>>> from google.cloud import bigquery
4545
>>> client = bigquery.Client(project='PROJECT_ID')
4646

4747

@@ -103,7 +103,7 @@ Replace the ACL for a dataset, and update all writeable fields:
103103

104104
.. doctest::
105105

106-
>>> from gcloud import bigquery
106+
>>> from google.cloud import bigquery
107107
>>> client = bigquery.Client()
108108
>>> dataset = client.dataset('dataset_name')
109109
>>> dataset.get() # API request
@@ -232,7 +232,7 @@ Background a query, loading the results into a table:
232232

233233
.. doctest::
234234

235-
>>> from gcloud import bigquery
235+
>>> from google.cloud import bigquery
236236
>>> client = bigquery.Client()
237237
>>> query = """\
238238
SELECT firstname + ' ' + last_name AS full_name,
@@ -294,7 +294,7 @@ the job locally:
294294

295295
.. doctest::
296296

297-
>>> from gcloud import bigquery
297+
>>> from google.cloud import bigquery
298298
>>> from gcloud.bigquery import SchemaField
299299
>>> client = bigquery.Client()
300300
>>> table = dataset.table(name='person_ages')
@@ -355,7 +355,7 @@ located on Google Cloud Storage. First, create the job locally:
355355

356356
.. doctest::
357357

358-
>>> from gcloud import bigquery
358+
>>> from google.cloud import bigquery
359359
>>> client = bigquery.Client()
360360
>>> table = dataset.table(name='person_ages')
361361
>>> job = client.extract_table_to_storage(
@@ -412,7 +412,7 @@ First, create the job locally:
412412

413413
.. doctest::
414414

415-
>>> from gcloud import bigquery
415+
>>> from google.cloud import bigquery
416416
>>> client = bigquery.Client()
417417
>>> source_table = dataset.table(name='person_ages')
418418
>>> destination_table = dataset.table(name='person_ages_copy')

docs/bigtable-client-intro.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ Configuration
3838

3939
.. code::
4040
41-
>>> from gcloud import bigtable
41+
>>> from google.cloud import bigtable
4242
>>> client = bigtable.Client()
4343
4444
or pass in ``credentials`` and ``project`` explicitly
4545

4646
.. code::
4747
48-
>>> from gcloud import bigtable
48+
>>> from google.cloud import bigtable
4949
>>> client = bigtable.Client(project='my-project', credentials=creds)
5050
5151
.. tip::

docs/dns-usage.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create an instance of :class:`Client <gcloud.dns.client.Client>`.
1515

1616
.. doctest::
1717

18-
>>> from gcloud import dns
18+
>>> from google.cloud import dns
1919
>>> client = dns.Client()
2020

2121
Projects
@@ -33,7 +33,7 @@ To override the project inferred from the environment, pass an explicit
3333

3434
.. doctest::
3535

36-
>>> from gcloud import dns
36+
>>> from google.cloud import dns
3737
>>> client = dns.Client(project='PROJECT_ID')
3838

3939
Project Quotas
@@ -43,7 +43,7 @@ Query the quotas for a given project:
4343

4444
.. doctest::
4545

46-
>>> from gcloud import dns
46+
>>> from google.cloud import dns
4747
>>> client = dns.Client(project='PROJECT_ID')
4848
>>> quotas = client.quotas() # API request
4949
>>> for key, value in sorted(quotas.items()):
@@ -72,7 +72,7 @@ suffix and has a set of name servers that accept and responds to queries:
7272

7373
.. doctest::
7474

75-
>>> from gcloud import dns
75+
>>> from google.cloud import dns
7676
>>> client = dns.Client(project='PROJECT_ID')
7777
>>> zone = client.zone('acme-co', 'example.com',
7878
... description='Acme Company zone')
@@ -87,7 +87,7 @@ List the zones for a given project:
8787

8888
.. doctest::
8989

90-
>>> from gcloud import dns
90+
>>> from google.cloud import dns
9191
>>> client = dns.Client(project='PROJECT_ID')
9292
>>> zones = client.list_zones() # API request
9393
>>> [zone.name for zone in zones]
@@ -101,7 +101,7 @@ Each managed zone exposes a read-only set of resource records:
101101

102102
.. doctest::
103103

104-
>>> from gcloud import dns
104+
>>> from google.cloud import dns
105105
>>> client = dns.Client(project='PROJECT_ID')
106106
>>> zone = client.zone('acme-co', 'example.com')
107107
>>> records, page_token = zone.list_resource_record_sets() # API request
@@ -135,7 +135,7 @@ bundling additions to or deletions from the set.
135135
.. doctest::
136136

137137
>>> import time
138-
>>> from gcloud import dns
138+
>>> from google.cloud import dns
139139
>>> client = dns.Client(project='PROJECT_ID')
140140
>>> zone = client.zone('acme-co', 'example.com')
141141
>>> TWO_HOURS = 2 * 60 * 60 # seconds
@@ -154,7 +154,7 @@ List changes made to the resource record set for a given zone:
154154

155155
.. doctest::
156156

157-
>>> from gcloud import dns
157+
>>> from google.cloud import dns
158158
>>> client = dns.Client(project='PROJECT_ID')
159159
>>> zone = client.zone('acme-co', 'example.com')
160160
>>> changes = []

docs/error-reporting-usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Authentication and Configuration
1818

1919
.. doctest::
2020

21-
>>> from gcloud import error_reporting
21+
>>> from google.cloud import error_reporting
2222
>>> client = error_reporting.Client()
2323

2424
or pass in ``credentials`` and ``project`` explicitly
2525

2626
.. doctest::
2727

28-
>>> from gcloud import error_reporting
28+
>>> from google.cloud import error_reporting
2929
>>> client = error_reporting.Client(project='my-project', credentials=creds)
3030

3131
Error Reporting associates errors with a service, which is an identifier for an executable,
@@ -36,7 +36,7 @@ Authentication and Configuration
3636

3737
.. doctest::
3838

39-
>>> from gcloud import error_reporting
39+
>>> from google.cloud import error_reporting
4040
>>> client = error_reporting.Client(project='my-project',
4141
... service="login_service",
4242
... version="0.1.0")
@@ -48,7 +48,7 @@ Report a stacktrace to Stackdriver Error Reporting after an exception
4848

4949
.. doctest::
5050

51-
>>> from gcloud import error_reporting
51+
>>> from google.cloud import error_reporting
5252
>>> client = error_reporting.Client()
5353
>>> try:
5454
>>> raise NameError
@@ -65,7 +65,7 @@ be used by Stackdriver Error Reporting to help group exceptions.
6565

6666
.. doctest::
6767

68-
>>> from gcloud import error_reporting
68+
>>> from google.cloud import error_reporting
6969
>>> client = error_reporting.Client()
7070
>>> user = 'example@gmail.com'
7171
>>> http_context = HTTPContext(method='GET', url='/', userAgent='test agent',
@@ -85,15 +85,15 @@ error was reported.
8585

8686
.. doctest::
8787

88-
>>> from gcloud import error_reporting
88+
>>> from google.cloud import error_reporting
8989
>>> client = error_reporting.Client()
9090
>>> error_reporting.report("Found an error!")
9191

9292
Similarly to reporting an exception, the user and HTTP context can be provided:
9393

9494
.. doctest::
9595

96-
>>> from gcloud import error_reporting
96+
>>> from google.cloud import error_reporting
9797
>>> client = error_reporting.Client()
9898
>>> user = 'example@gmail.com'
9999
>>> http_context = HTTPContext(method='GET', url='/', userAgent='test agent',

docs/gcloud-auth.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For example:
5050

5151
.. code-block:: python
5252
53-
from gcloud import datastore
53+
from google.cloud import datastore
5454
client = datastore.Client()
5555
5656
Passing no arguments at all will "just work" if you've followed the

docs/gcloud-config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For example:
1010

1111
.. code-block:: python
1212
13-
>>> from gcloud import bigquery
13+
>>> from google.cloud import bigquery
1414
>>> client = bigquery.Client()
1515
1616
When creating a client in this way, the project ID will be determined by
@@ -28,7 +28,7 @@ You can override the detection of your default project by setting the
2828

2929
.. code-block:: python
3030
31-
>>> from gcloud import bigquery
31+
>>> from google.cloud import bigquery
3232
>>> client = bigquery.Client(project='my-project')
3333
3434
You can see what project ID a client is referencing by accessing the ``project``

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Cloud Datastore
201201

202202
.. code-block:: python
203203
204-
from gcloud import datastore
204+
from google.cloud import datastore
205205
206206
client = datastore.Client()
207207
key = client.key('Person')
@@ -220,7 +220,7 @@ Cloud Storage
220220

221221
.. code-block:: python
222222
223-
from gcloud import storage
223+
from google.cloud import storage
224224
225225
client = storage.Client()
226226
bucket = client.get_bucket('<your-bucket-name>')

docs/json/json/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h3 class="block-title">What is it?</h3>
7979

8080
<div class="quote-box--supplementary">
8181
<h4>Retrieve Datastore Entities</h4>
82-
<pre><code class="hljs python">from gcloud import datastore
82+
<pre><code class="hljs python">from google.cloud import datastore
8383

8484
client = datastore.Client()
8585
product_key = client.key('Product', 123)

docs/json/json/master/overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h3>Cloud Datastore</h3>
3030

3131
<div hljs>
3232

33-
from gcloud import datastore
33+
from google.cloud import datastore
3434

3535
client = datastore.Client()
3636
key = client.key('Person')
@@ -48,7 +48,7 @@ <h3>Cloud Storage</h3>
4848
</p>
4949

5050
<div hljs>
51-
from gcloud import storage
51+
from google.cloud import storage
5252

5353
client = storage.Client()
5454
bucket = client.get_bucket('<your-bucket-name>')

0 commit comments

Comments
 (0)