forked from googleapis/google-cloud-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle-cloud-api.html
More file actions
844 lines (703 loc) · 65.1 KB
/
google-cloud-api.html
File metadata and controls
844 lines (703 loc) · 65.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shared Core Modules — google-cloud 0.22.0 documentation</title>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="google-cloud 0.22.0 documentation" href="index.html"/>
<link rel="next" title="Configuration" href="google-cloud-config.html"/>
<link rel="prev" title="Getting started" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> google-cloud
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">google-cloud</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Shared Core Modules</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-google.cloud.client">Base Client</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-google.cloud.credentials">Credentials Helpers</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-google.cloud.exceptions">Exceptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-google.cloud.environment_vars">Environment Variables</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="google-cloud-config.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="google-cloud-auth.html">Authentication</a></li>
<li class="toctree-l1"><a class="reference internal" href="iterators.html">Iterators</a></li>
<li class="toctree-l1"><a class="reference internal" href="operation-api.html">Long-Running Operations</a></li>
</ul>
<p class="caption"><span class="caption-text">Datastore</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="datastore-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-entities.html">Entities</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-keys.html">Keys</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-queries.html">Queries</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-transactions.html">Transactions</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-batches.html">Batches</a></li>
<li class="toctree-l1"><a class="reference internal" href="datastore-helpers.html">Helpers</a></li>
</ul>
<p class="caption"><span class="caption-text">Storage</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="storage-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="storage-blobs.html">Blobs / Objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="storage-buckets.html">Buckets</a></li>
<li class="toctree-l1"><a class="reference internal" href="storage-acl.html">ACL</a></li>
<li class="toctree-l1"><a class="reference internal" href="storage-batch.html">Batches</a></li>
</ul>
<p class="caption"><span class="caption-text">Pub/Sub</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="pubsub-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub-topic.html">Topics</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub-subscription.html">Subscriptions</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub-message.html">Message</a></li>
<li class="toctree-l1"><a class="reference internal" href="pubsub-iam.html">IAM Policy</a></li>
</ul>
<p class="caption"><span class="caption-text">BigQuery</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="bigquery-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-dataset.html">Datasets</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-job.html">Jobs</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-table.html">Tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-query.html">Query</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigquery-schema.html">Schemas</a></li>
</ul>
<p class="caption"><span class="caption-text">Cloud Bigtable</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="bigtable-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-client-intro.html">Base for Everything</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-instance-api.html">Instance Admin API</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-table-api.html">Table Admin API</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-data-api.html">Data API</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-instance.html">Instance</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-cluster.html">Cluster</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-table.html">Table</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-column-family.html">Column Families</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-row.html">Bigtable Row</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-row-filters.html">Bigtable Row Filters</a></li>
<li class="toctree-l1"><a class="reference internal" href="bigtable-row-data.html">Row Data</a></li>
</ul>
<p class="caption"><span class="caption-text">Resource Manager</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="resource-manager-api.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="resource-manager-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="resource-manager-project.html">Projects</a></li>
</ul>
<p class="caption"><span class="caption-text">DNS</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="dns-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="dns-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="dns-zone.html">Managed Zones</a></li>
<li class="toctree-l1"><a class="reference internal" href="dns-resource-record-set.html">Resource Record Sets</a></li>
<li class="toctree-l1"><a class="reference internal" href="dns-changes.html">Change Sets</a></li>
</ul>
<p class="caption"><span class="caption-text">Stackdriver Logging</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="logging-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-usage.html#cloud-logging-handler">Cloud Logging Handler</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-usage.html#fluentd-logging-handlers">fluentd logging handlers</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-usage.html#cloud-logging-handler-transports">Cloud Logging Handler transports</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-logger.html">Logger</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-entries.html">Entries</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-metric.html">Metrics</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-sink.html">Sinks</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-stdlib-usage.html">Integration with Python logging module</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-handlers.html">Python Logging Module Handler</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-handlers-app-engine.html">Google App Engine flexible Log Handler</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-handlers-container-engine.html">Google Container Engine Log Handler</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-transports-sync.html">Python Logging Handler Sync Transport</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-transports-thread.html">Python Logging Handler Threaded Transport</a></li>
<li class="toctree-l1"><a class="reference internal" href="logging-transports-base.html">Python Logging Handler Sync Transport</a></li>
</ul>
<p class="caption"><span class="caption-text">Stackdriver Error Reporting</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="error-reporting-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="error-reporting-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="error-reporting-util.html">Error Reporting Utilities</a></li>
</ul>
<p class="caption"><span class="caption-text">Stackdriver Monitoring</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="monitoring-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-metric.html">Metric Descriptors</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-resource.html">Monitored Resource Descriptors</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-group.html">Groups</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-query.html">Time Series Query</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-timeseries.html">Time Series</a></li>
<li class="toctree-l1"><a class="reference internal" href="monitoring-label.html">Label Descriptors</a></li>
</ul>
<p class="caption"><span class="caption-text">Translate</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="translate-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="translate-client.html">Client</a></li>
</ul>
<p class="caption"><span class="caption-text">Vision</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="vision-usage.html">Using the Vision API</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-annotations.html">Vision Annotations</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-client.html">Vision Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-color.html">Vision Image Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-entity.html">Vision Entity</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-feature.html">Vision Feature</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-face.html">Vision Face</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-image.html">Vision Image</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-safe-search.html">Vision Safe Search</a></li>
</ul>
<p class="caption"><span class="caption-text">Natural Language</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="language-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="language-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="language-document.html">Document</a></li>
<li class="toctree-l1"><a class="reference internal" href="language-responses.html">Natural Language Response Classes</a></li>
</ul>
<p class="caption"><span class="caption-text">Speech</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="speech-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-encoding.html">Speech Encoding</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-operation.html">Speech Operation</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-result.html">Speech Result</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-sample.html">Speech Sample</a></li>
<li class="toctree-l1"><a class="reference internal" href="speech-alternative.html">Speech Alternative</a></li>
</ul>
<p class="caption"><span class="caption-text">Runtime Configuration</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="runtimeconfig-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="runtimeconfig-client.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="runtimeconfig-config.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="runtimeconfig-variable.html">Variables</a></li>
</ul>
<p class="caption"><span class="caption-text">External Links</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/GoogleCloudPlatform/google-cloud-python/">GitHub</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/GoogleCloudPlatform/google-cloud-python/issues">Issues</a></li>
<li class="toctree-l1"><a class="reference external" href="http://stackoverflow.com/questions/tagged/google-cloud-python">Stack Overflow</a></li>
<li class="toctree-l1"><a class="reference external" href="https://pypi.python.org/pypi/google-cloud">PyPI</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">google-cloud</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Shared Core Modules</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/google-cloud-api.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="shared-core-modules">
<h1>Shared Core Modules<a class="headerlink" href="#shared-core-modules" title="Permalink to this headline">#</a></h1>
<div class="section" id="module-google.cloud.client">
<span id="base-client"></span><h2>Base Client<a class="headerlink" href="#module-google.cloud.client" title="Permalink to this headline">#</a></h2>
<p>Base classes for client used to interact with Google Cloud APIs.</p>
<dl class="class">
<dt id="google.cloud.client.Client">
<em class="property">class </em><code class="descclassname">google.cloud.client.</code><code class="descname">Client</code><span class="sig-paren">(</span><em>credentials=None</em>, <em>http=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/client.html#Client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.client.Client" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">google.cloud.client._ClientFactoryMixin</span></code></p>
<p>Client to bundle configuration needed for API requests.</p>
<p>Assumes that the associated <code class="docutils literal"><span class="pre">_connection_class</span></code> only accepts
<code class="docutils literal"><span class="pre">http</span></code> and <code class="docutils literal"><span class="pre">credentials</span></code> in its constructor.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>credentials</strong> (<a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.credentials.html#google.auth.credentials.Credentials" title="(in google-auth v0.4.0)"><code class="xref py py-class docutils literal"><span class="pre">google.auth.credentials.Credentials</span></code></a> or
<code class="xref py py-class docutils literal"><span class="pre">NoneType</span></code>) – The OAuth2 Credentials to use for the connection
owned by this client. If not passed (and if no <code class="docutils literal"><span class="pre">http</span></code>
object is passed), falls back to the default inferred
from the environment.</li>
<li><strong>http</strong> (<a class="reference external" href="http://httplib2.readthedocs.io/en/latest/libhttplib2.html#httplib2.Http" title="(in httplib2 v0.4)"><code class="xref py py-class docutils literal"><span class="pre">httplib2.Http</span></code></a> or class that defines <code class="docutils literal"><span class="pre">request()</span></code>.) – An optional HTTP object to make requests. If not passed, an
<code class="docutils literal"><span class="pre">http</span></code> object is created that is bound to the
<code class="docutils literal"><span class="pre">credentials</span></code> for the current object.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="google.cloud.client.Client.from_service_account_json">
<code class="descname">from_service_account_json</code><span class="sig-paren">(</span><em>json_credentials_path</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#google.cloud.client.Client.from_service_account_json" title="Permalink to this definition">#</a></dt>
<dd><p>Factory to retrieve JSON credentials while creating client.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>json_credentials_path</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – The path to a private key file (this file
was given to you when you created the
service account). This file must contain
a JSON object with a private key and
other credentials information (downloaded
from the Google APIs console).</li>
<li><strong>args</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#tuple" title="(in Python v2.7)"><em>tuple</em></a>) – Remaining positional arguments to pass to constructor.</li>
<li><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) – Remaining keyword arguments to pass to constructor.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="pubsub-client.html#google.cloud.pubsub.client.Client" title="google.cloud.pubsub.client.Client"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.pubsub.client.Client</span></code></a></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The client created with the retrieved JSON credentials.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">TypeError</span></code> if there is a conflict with the kwargs
and the credentials created by the factory.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="google.cloud.client.JSONClient">
<em class="property">class </em><code class="descclassname">google.cloud.client.</code><code class="descname">JSONClient</code><span class="sig-paren">(</span><em>project=None</em>, <em>credentials=None</em>, <em>http=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/client.html#JSONClient"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.client.JSONClient" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.client.Client" title="google.cloud.client.Client"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.client.Client</span></code></a>, <code class="xref py py-class docutils literal"><span class="pre">google.cloud.client._ClientProjectMixin</span></code></p>
<p>Client for Google JSON-based API.</p>
<p>Assumes such APIs use the <code class="docutils literal"><span class="pre">project</span></code> and the client needs to store this
value.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>project</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – the project which the client acts on behalf of. If not
passed falls back to the default inferred from the
environment.</li>
<li><strong>credentials</strong> (<a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.credentials.html#google.auth.credentials.Credentials" title="(in google-auth v0.4.0)"><code class="xref py py-class docutils literal"><span class="pre">google.auth.credentials.Credentials</span></code></a> or
<code class="xref py py-class docutils literal"><span class="pre">NoneType</span></code>) – The OAuth2 Credentials to use for the connection
owned by this client. If not passed (and if no <code class="docutils literal"><span class="pre">http</span></code>
object is passed), falls back to the default inferred
from the environment.</li>
<li><strong>http</strong> (<a class="reference external" href="http://httplib2.readthedocs.io/en/latest/libhttplib2.html#httplib2.Http" title="(in httplib2 v0.4)"><code class="xref py py-class docutils literal"><span class="pre">httplib2.Http</span></code></a> or class that defines <code class="docutils literal"><span class="pre">request()</span></code>.) – An optional HTTP object to make requests. If not passed, an
<code class="docutils literal"><span class="pre">http</span></code> object is created that is bound to the
<code class="docutils literal"><span class="pre">credentials</span></code> for the current object.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">ValueError</span></code> if the project is neither passed in nor
set in the environment.</p>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="google.cloud.client.JSONClient.from_service_account_json">
<code class="descname">from_service_account_json</code><span class="sig-paren">(</span><em>json_credentials_path</em>, <em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#google.cloud.client.JSONClient.from_service_account_json" title="Permalink to this definition">#</a></dt>
<dd><p>Factory to retrieve JSON credentials while creating client.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>json_credentials_path</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – The path to a private key file (this file
was given to you when you created the
service account). This file must contain
a JSON object with a private key and
other credentials information (downloaded
from the Google APIs console).</li>
<li><strong>args</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#tuple" title="(in Python v2.7)"><em>tuple</em></a>) – Remaining positional arguments to pass to constructor.</li>
<li><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) – Remaining keyword arguments to pass to constructor.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference internal" href="pubsub-client.html#google.cloud.pubsub.client.Client" title="google.cloud.pubsub.client.Client"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.pubsub.client.Client</span></code></a></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The client created with the retrieved JSON credentials.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal"><span class="pre">TypeError</span></code> if there is a conflict with the kwargs
and the credentials created by the factory.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-google.cloud.credentials">
<span id="credentials-helpers"></span><h2>Credentials Helpers<a class="headerlink" href="#module-google.cloud.credentials" title="Permalink to this headline">#</a></h2>
<p>A simple wrapper around the OAuth2 credentials library.</p>
<dl class="function">
<dt id="google.cloud.credentials.generate_signed_url">
<code class="descclassname">google.cloud.credentials.</code><code class="descname">generate_signed_url</code><span class="sig-paren">(</span><em>credentials</em>, <em>resource</em>, <em>expiration</em>, <em>api_access_endpoint=''</em>, <em>method='GET'</em>, <em>content_md5=None</em>, <em>content_type=None</em>, <em>response_type=None</em>, <em>response_disposition=None</em>, <em>generation=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/credentials.html#generate_signed_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.credentials.generate_signed_url" title="Permalink to this definition">#</a></dt>
<dd><p>Generate signed URL to provide query-string auth’n to a resource.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Assumes <code class="docutils literal"><span class="pre">credentials</span></code> implements the
<a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.credentials.html#google.auth.credentials.Signing" title="(in google-auth v0.4.0)"><code class="xref py py-class docutils literal"><span class="pre">google.auth.credentials.Signing</span></code></a> interface. Also assumes
<code class="docutils literal"><span class="pre">credentials</span></code> has a <code class="docutils literal"><span class="pre">service_account_email</span></code> property which
identifies the credentials.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you are on Google Compute Engine, you can’t generate a signed URL.
Follow <a class="reference external" href="https://github.com/GoogleCloudPlatform/google-cloud-python/issues/922">Issue 922</a> for updates on this. If you’d like to be able to
generate a signed URL from GCE, you can use a standard service account
from a JSON file rather than a GCE service account.</p>
</div>
<p>See headers <a class="reference external" href="https://cloud.google.com/storage/docs/reference-headers">reference</a> for more details on optional arguments.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>credentials</strong> (<a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.credentials.html#google.auth.credentials.Signing" title="(in google-auth v0.4.0)"><code class="xref py py-class docutils literal"><span class="pre">google.auth.credentials.Signing</span></code></a>) – Credentials object with an associated private key to
sign text.</li>
<li><strong>resource</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – A pointer to a specific resource
(typically, <code class="docutils literal"><span class="pre">/bucket-name/path/to/blob.txt</span></code>).</li>
<li><strong>expiration</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">int</span></code></a>, <a class="reference external" href="https://docs.python.org/2/library/functions.html#long" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">long</span></code></a>, <a class="reference external" href="https://docs.python.org/2/library/datetime.html#datetime.datetime" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></code></a>,
<a class="reference external" href="https://docs.python.org/2/library/datetime.html#datetime.timedelta" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">datetime.timedelta</span></code></a>) – When the signed URL should expire.</li>
<li><strong>api_access_endpoint</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Optional URI base. Defaults to empty string.</li>
<li><strong>method</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – The HTTP verb that will be used when requesting the URL.
Defaults to <code class="docutils literal"><span class="pre">'GET'</span></code>.</li>
<li><strong>content_md5</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – (Optional) The MD5 hash of the object referenced by
<code class="docutils literal"><span class="pre">resource</span></code>.</li>
<li><strong>content_type</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – (Optional) The content type of the object referenced
by <code class="docutils literal"><span class="pre">resource</span></code>.</li>
<li><strong>response_type</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – (Optional) Content type of responses to requests for
the signed URL. Used to over-ride the content type of
the underlying resource.</li>
<li><strong>response_disposition</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – (Optional) Content disposition of responses to
requests for the signed URL.</li>
<li><strong>generation</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – (Optional) A value that indicates which generation of
the resource to fetch.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first"><a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)">str</a></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A signed URL you can use to access the resource
until expiration.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="google.cloud.credentials.get_credentials">
<code class="descclassname">google.cloud.credentials.</code><code class="descname">get_credentials</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/credentials.html#get_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.credentials.get_credentials" title="Permalink to this definition">#</a></dt>
<dd><p>Gets credentials implicitly from the current environment.</p>
<p>Uses <a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.html#google.auth.default" title="(in google-auth v0.4.0)"><code class="xref py py-func docutils literal"><span class="pre">google.auth.default()</span></code></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://google-auth.readthedocs.io/en/stable/reference/google.auth.credentials.html#google.auth.credentials.Credentials" title="(in google-auth v0.4.0)"><code class="xref py py-class docutils literal"><span class="pre">google.auth.credentials.Credentials</span></code></a>,</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A new credentials instance corresponding to the implicit
environment.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-google.cloud.exceptions">
<span id="exceptions"></span><h2>Exceptions<a class="headerlink" href="#module-google.cloud.exceptions" title="Permalink to this headline">#</a></h2>
<p>Custom exceptions for <code class="xref py py-mod docutils literal"><span class="pre">google.cloud</span></code> package.</p>
<p>See: <a class="reference external" href="https://cloud.google.com/storage/docs/json_api/v1/status-codes">https://cloud.google.com/storage/docs/json_api/v1/status-codes</a></p>
<dl class="exception">
<dt id="google.cloud.exceptions.BadGateway">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">BadGateway</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#BadGateway"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.BadGateway" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ServerError" title="google.cloud.exceptions.ServerError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ServerError</span></code></a></p>
<p>Exception mapping a ‘502 Bad Gateway’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.BadRequest">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">BadRequest</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#BadRequest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.BadRequest" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘400 Bad Request’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.ClientError">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">ClientError</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#ClientError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.ClientError" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.GoogleCloudError" title="google.cloud.exceptions.GoogleCloudError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.GoogleCloudError</span></code></a></p>
<p>Base for 4xx responses</p>
<p>This class is abstract</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.Conflict">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">Conflict</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#Conflict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.Conflict" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘409 Conflict’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.Forbidden">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">Forbidden</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#Forbidden"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.Forbidden" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘403 Forbidden’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.GatewayTimeout">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">GatewayTimeout</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#GatewayTimeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.GatewayTimeout" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ServerError" title="google.cloud.exceptions.ServerError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ServerError</span></code></a></p>
<p>Excepption mapping a <cite>504 Gateway Timeout’</cite> response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.GoogleCloudError">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">GoogleCloudError</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#GoogleCloudError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.GoogleCloudError" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/exceptions.html#exceptions.Exception" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></code></a></p>
<p>Base error class for Google Cloud errors (abstract).</p>
<p>Each subclass represents a single type of HTTP error response.</p>
<dl class="attribute">
<dt id="google.cloud.exceptions.GoogleCloudError.code">
<code class="descname">code</code><em class="property"> = None</em><a class="headerlink" href="#google.cloud.exceptions.GoogleCloudError.code" title="Permalink to this definition">#</a></dt>
<dd><p>HTTP status code. Concrete subclasses <em>must</em> define.</p>
<p>See: <a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html</a></p>
</dd></dl>
<dl class="attribute">
<dt id="google.cloud.exceptions.GoogleCloudError.errors">
<code class="descname">errors</code><a class="headerlink" href="#google.cloud.exceptions.GoogleCloudError.errors" title="Permalink to this definition">#</a></dt>
<dd><p>Detailed error information.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2/library/functions.html#list" title="(in Python v2.7)">list</a>(<a class="reference external" href="https://docs.python.org/2/library/stdtypes.html#dict" title="(in Python v2.7)">dict</a>)</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a list of mappings describing each error.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="attribute">
<dt id="google.cloud.exceptions.GrpcRendezvous">
<code class="descclassname">google.cloud.exceptions.</code><code class="descname">GrpcRendezvous</code><a class="headerlink" href="#google.cloud.exceptions.GrpcRendezvous" title="Permalink to this definition">#</a></dt>
<dd><p>Exception class raised by gRPC stable.</p>
<p>alias of <code class="xref py py-class docutils literal"><span class="pre">_Rendezvous</span></code></p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.InternalServerError">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">InternalServerError</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#InternalServerError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.InternalServerError" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ServerError" title="google.cloud.exceptions.ServerError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ServerError</span></code></a></p>
<p>Exception mapping a ‘500 Internal Server Error’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.LengthRequired">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">LengthRequired</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#LengthRequired"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.LengthRequired" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘411 Length Required’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.MethodNotAllowed">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">MethodNotAllowed</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#MethodNotAllowed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.MethodNotAllowed" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘405 Method Not Allowed’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.MethodNotImplemented">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">MethodNotImplemented</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#MethodNotImplemented"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.MethodNotImplemented" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ServerError" title="google.cloud.exceptions.ServerError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ServerError</span></code></a></p>
<p>Exception mapping a ‘501 Not Implemented’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.MovedPermanently">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">MovedPermanently</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#MovedPermanently"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.MovedPermanently" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.Redirection" title="google.cloud.exceptions.Redirection"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.Redirection</span></code></a></p>
<p>Exception mapping a ‘301 Moved Permanently’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.NotFound">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">NotFound</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#NotFound"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.NotFound" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘404 Not Found’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.NotModified">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">NotModified</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#NotModified"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.NotModified" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.Redirection" title="google.cloud.exceptions.Redirection"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.Redirection</span></code></a></p>
<p>Exception mapping a ‘304 Not Modified’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.PreconditionFailed">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">PreconditionFailed</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#PreconditionFailed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.PreconditionFailed" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘412 Precondition Failed’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.Redirection">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">Redirection</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#Redirection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.Redirection" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.GoogleCloudError" title="google.cloud.exceptions.GoogleCloudError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.GoogleCloudError</span></code></a></p>
<p>Base for 3xx responses</p>
<p>This class is abstract.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.RequestRangeNotSatisfiable">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">RequestRangeNotSatisfiable</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#RequestRangeNotSatisfiable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.RequestRangeNotSatisfiable" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘416 Request Range Not Satisfiable’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.ResumeIncomplete">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">ResumeIncomplete</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#ResumeIncomplete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.ResumeIncomplete" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.Redirection" title="google.cloud.exceptions.Redirection"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.Redirection</span></code></a></p>
<p>Exception mapping a ‘308 Resume Incomplete’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.ServerError">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">ServerError</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#ServerError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.ServerError" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.GoogleCloudError" title="google.cloud.exceptions.GoogleCloudError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.GoogleCloudError</span></code></a></p>
<p>Base for 5xx responses: (abstract)</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.ServiceUnavailable">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">ServiceUnavailable</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#ServiceUnavailable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.ServiceUnavailable" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ServerError" title="google.cloud.exceptions.ServerError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ServerError</span></code></a></p>
<p>Exception mapping a ‘503 Service Unavailable’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.TemporaryRedirect">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">TemporaryRedirect</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#TemporaryRedirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.TemporaryRedirect" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.Redirection" title="google.cloud.exceptions.Redirection"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.Redirection</span></code></a></p>
<p>Exception mapping a ‘307 Temporary Redirect’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.TooManyRequests">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">TooManyRequests</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#TooManyRequests"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.TooManyRequests" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘429 Too Many Requests’ response.</p>
</dd></dl>
<dl class="exception">
<dt id="google.cloud.exceptions.Unauthorized">
<em class="property">exception </em><code class="descclassname">google.cloud.exceptions.</code><code class="descname">Unauthorized</code><span class="sig-paren">(</span><em>message</em>, <em>errors=()</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#Unauthorized"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.Unauthorized" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference internal" href="#google.cloud.exceptions.ClientError" title="google.cloud.exceptions.ClientError"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.exceptions.ClientError</span></code></a></p>
<p>Exception mapping a ‘401 Unauthorized’ response.</p>
</dd></dl>
<dl class="function">
<dt id="google.cloud.exceptions.make_exception">
<code class="descclassname">google.cloud.exceptions.</code><code class="descname">make_exception</code><span class="sig-paren">(</span><em>response</em>, <em>content</em>, <em>error_info=None</em>, <em>use_json=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/exceptions.html#make_exception"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.exceptions.make_exception" title="Permalink to this definition">#</a></dt>
<dd><p>Factory: create exception based on HTTP response code.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>response</strong> (<a class="reference external" href="http://httplib2.readthedocs.io/en/latest/libhttplib2.html#httplib2.Response" title="(in httplib2 v0.4)"><code class="xref py py-class docutils literal"><span class="pre">httplib2.Response</span></code></a> or other HTTP response object) – A response object that defines a status code as the
status attribute.</li>
<li><strong>content</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a><em> or </em><em>dictionary</em>) – The body of the HTTP error response.</li>
<li><strong>error_info</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Optional string giving extra information about the
failed request.</li>
<li><strong>use_json</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) – Flag indicating if <code class="docutils literal"><span class="pre">content</span></code> is expected to be JSON.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">instance of <a class="reference internal" href="#google.cloud.exceptions.GoogleCloudError" title="google.cloud.exceptions.GoogleCloudError"><code class="xref py py-class docutils literal"><span class="pre">GoogleCloudError</span></code></a>, or a concrete subclass.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Exception specific to the error response.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-google.cloud.environment_vars">
<span id="environment-variables"></span><h2>Environment Variables<a class="headerlink" href="#module-google.cloud.environment_vars" title="Permalink to this headline">#</a></h2>
<p>Comprehensive list of environment variables used in google-cloud.</p>
<p>These enable many types of implicit behavior in both production
and tests.</p>
<dl class="data">
<dt id="google.cloud.environment_vars.BIGTABLE_EMULATOR">
<code class="descclassname">google.cloud.environment_vars.</code><code class="descname">BIGTABLE_EMULATOR</code><em class="property"> = 'BIGTABLE_EMULATOR_HOST'</em><a class="headerlink" href="#google.cloud.environment_vars.BIGTABLE_EMULATOR" title="Permalink to this definition">#</a></dt>
<dd><p>Environment variable defining host for Bigtable emulator.</p>
</dd></dl>
<dl class="data">
<dt id="google.cloud.environment_vars.DISABLE_GRPC">
<code class="descclassname">google.cloud.environment_vars.</code><code class="descname">DISABLE_GRPC</code><em class="property"> = 'GOOGLE_CLOUD_DISABLE_GRPC'</em><a class="headerlink" href="#google.cloud.environment_vars.DISABLE_GRPC" title="Permalink to this definition">#</a></dt>
<dd><p>Environment variable acting as flag to disable gRPC.</p>
<p>To be used for APIs where both an HTTP and gRPC implementation
exist.</p>
</dd></dl>
<dl class="data">
<dt id="google.cloud.environment_vars.GCD_DATASET">
<code class="descclassname">google.cloud.environment_vars.</code><code class="descname">GCD_DATASET</code><em class="property"> = 'DATASTORE_DATASET'</em><a class="headerlink" href="#google.cloud.environment_vars.GCD_DATASET" title="Permalink to this definition">#</a></dt>
<dd><p>Environment variable defining default dataset ID under GCD.</p>
</dd></dl>
<dl class="data">
<dt id="google.cloud.environment_vars.GCD_HOST">
<code class="descclassname">google.cloud.environment_vars.</code><code class="descname">GCD_HOST</code><em class="property"> = 'DATASTORE_EMULATOR_HOST'</em><a class="headerlink" href="#google.cloud.environment_vars.GCD_HOST" title="Permalink to this definition">#</a></dt>
<dd><p>Environment variable defining host for GCD dataset server.</p>
</dd></dl>
<dl class="data">
<dt id="google.cloud.environment_vars.PUBSUB_EMULATOR">
<code class="descclassname">google.cloud.environment_vars.</code><code class="descname">PUBSUB_EMULATOR</code><em class="property"> = 'PUBSUB_EMULATOR_HOST'</em><a class="headerlink" href="#google.cloud.environment_vars.PUBSUB_EMULATOR" title="Permalink to this definition">#</a></dt>
<dd><p>Environment variable defining host for Pub/Sub emulator.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="google-cloud-config.html" class="btn btn-neutral float-right" title="Configuration" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="index.html" class="btn btn-neutral" title="Getting started" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2014, Google.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.22.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>