Repository navigation
Expand file tree
/
Copy pathspanner-instance-api.html
More file actions
665 lines (529 loc) · 40.9 KB
/
Copy pathspanner-instance-api.html
File metadata and controls
665 lines (529 loc) · 40.9 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
<!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>Instance API — google-cloud 0.23.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.23.0 documentation" href="index.html"/>
<link rel="next" title="Database API" href="spanner-database-api.html"/>
<link rel="prev" title="Spanner Client" href="spanner-client-api.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>
<li class="toctree-l1"><a class="reference internal" href="google-cloud-api.html">Shared Core Modules</a></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-batch.html">Vision Batch</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-crop-hint.html">Vision Crop Hint</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>
<li class="toctree-l1"><a class="reference internal" href="vision-text.html">Vision Full Text</a></li>
<li class="toctree-l1"><a class="reference internal" href="vision-web.html">Vision Web Annotations</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">Spanner</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="spanner-usage.html">Using the API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-client-usage.html">Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-instance-usage.html">Instance Admin API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-database-usage.html">Database Admin API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-session-crud-usage.html">Session Creation / Deletion</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-session-implicit-txn-usage.html">Implicit Transactions</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-session-pool-usage.html">Session Pools</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-batch-usage.html">Batching Modifications</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-snapshot-usage.html">Read-only Transactions via Snapshots</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-transaction-usage.html">Read-write Transactions</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-client-api.html">Spanner Client</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Instance API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-database-api.html">Database API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-session-api.html">Session API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-session-api.html#module-google.cloud.spanner.pool">Session Pools API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-keyset-api.html">Keyset API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-snapshot-api.html">Snapshot API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-batch-api.html">Batch API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-transaction-api.html">Transaction API</a></li>
<li class="toctree-l1"><a class="reference internal" href="spanner-streamed-api.html">StreamedResultSet API</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>Instance API</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/spanner-instance-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="module-google.cloud.spanner.instance">
<span id="instance-api"></span><h1>Instance API<a class="headerlink" href="#module-google.cloud.spanner.instance" title="Permalink to this headline">#</a></h1>
<p>User friendly container for Cloud Spanner Instance.</p>
<dl class="class">
<dt id="google.cloud.spanner.instance.Instance">
<em class="property">class </em><code class="descclassname">google.cloud.spanner.instance.</code><code class="descname">Instance</code><span class="sig-paren">(</span><em>instance_id</em>, <em>client</em>, <em>configuration_name=None</em>, <em>node_count=1</em>, <em>display_name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2/library/functions.html#object" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<p>Representation of a Cloud Spanner Instance.</p>
<p>We can use a <a class="reference internal" href="#google.cloud.spanner.instance.Instance" title="google.cloud.spanner.instance.Instance"><code class="xref py py-class docutils literal"><span class="pre">Instance</span></code></a> to:</p>
<ul class="simple">
<li><a class="reference internal" href="#google.cloud.spanner.instance.Instance.reload" title="google.cloud.spanner.instance.Instance.reload"><code class="xref py py-meth docutils literal"><span class="pre">reload()</span></code></a> itself</li>
<li><a class="reference internal" href="#google.cloud.spanner.instance.Instance.create" title="google.cloud.spanner.instance.Instance.create"><code class="xref py py-meth docutils literal"><span class="pre">create()</span></code></a> itself</li>
<li><a class="reference internal" href="#google.cloud.spanner.instance.Instance.update" title="google.cloud.spanner.instance.Instance.update"><code class="xref py py-meth docutils literal"><span class="pre">update()</span></code></a> itself</li>
<li><a class="reference internal" href="#google.cloud.spanner.instance.Instance.delete" title="google.cloud.spanner.instance.Instance.delete"><code class="xref py py-meth docutils literal"><span class="pre">delete()</span></code></a> itself</li>
</ul>
<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>instance_id</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 ID of the instance.</li>
<li><strong>client</strong> (<a class="reference internal" href="spanner-client-api.html#google.cloud.spanner.client.Client" title="google.cloud.spanner.client.Client"><code class="xref py py-class docutils literal"><span class="pre">Client</span></code></a>) – The client that owns the instance. Provides
authorization and a project ID.</li>
<li><strong>configuration_name</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Name of the instance configuration defining
how the instance will be created.
Required for instances which do not yet exist.</li>
<li><strong>node_count</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) – (Optional) Number of nodes allocated to the instance.</li>
<li><strong>display_name</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 display name for the instance in the
Cloud Console UI. (Must be between 4 and 30
characters.) If this value is not set in the
constructor, will fall back to the instance ID.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.copy" title="Permalink to this definition">#</a></dt>
<dd><p>Make a copy of this instance.</p>
<p>Copies the local data stored as simple types and copies the client
attached to this instance.</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 internal" href="#google.cloud.spanner.instance.Instance" title="google.cloud.spanner.instance.Instance"><code class="xref py py-class docutils literal"><span class="pre">Instance</span></code></a></td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A copy of the current instance.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.create">
<code class="descname">create</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.create"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.create" title="Permalink to this definition">#</a></dt>
<dd><p>Create this instance.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance</a></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Uses the <code class="docutils literal"><span class="pre">project</span></code> and <code class="docutils literal"><span class="pre">instance_id</span></code> on the current
<a class="reference internal" href="#google.cloud.spanner.instance.Instance" title="google.cloud.spanner.instance.Instance"><code class="xref py py-class docutils literal"><span class="pre">Instance</span></code></a> in addition to the <code class="docutils literal"><span class="pre">display_name</span></code>.
To change them before creating, reset the values via</p>
<div class="code python highlight-default"><div class="highlight"><pre><span></span><span class="n">instance</span><span class="o">.</span><span class="n">display_name</span> <span class="o">=</span> <span class="s1">'New display name'</span>
<span class="n">instance</span><span class="o">.</span><span class="n">instance_id</span> <span class="o">=</span> <span class="s1">'i-changed-my-mind'</span>
</pre></div>
</div>
<p class="last">before calling <a class="reference internal" href="#google.cloud.spanner.instance.Instance.create" title="google.cloud.spanner.instance.Instance.create"><code class="xref py py-meth docutils literal"><span class="pre">create()</span></code></a>.</p>
</div>
<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 internal" href="operation-api.html#google.cloud.operation.Operation" title="google.cloud.operation.Operation"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.operation.Operation</span></code></a></td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">an operation instance</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.database">
<code class="descname">database</code><span class="sig-paren">(</span><em>database_id</em>, <em>ddl_statements=()</em>, <em>pool=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.database"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.database" title="Permalink to this definition">#</a></dt>
<dd><p>Factory to create a database within this instance.</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>database_id</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 ID of the instance.</li>
<li><strong>ddl_statements</strong> (<em>list of string</em>) – (Optional) DDL statements, excluding the
‘CREATE DATABSE’ statement.</li>
<li><strong>pool</strong> (concrete subclass of
<a class="reference internal" href="spanner-session-api.html#google.cloud.spanner.pool.AbstractSessionPool" title="google.cloud.spanner.pool.AbstractSessionPool"><code class="xref py py-class docutils literal"><span class="pre">AbstractSessionPool</span></code></a>.) – (Optional) session pool to be used by database.</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="spanner-database-api.html#google.cloud.spanner.database.Database" title="google.cloud.spanner.database.Database"><code class="xref py py-class docutils literal"><span class="pre">Database</span></code></a></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a database owned by this instance.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.delete" title="Permalink to this definition">#</a></dt>
<dd><p>Mark an instance and all of its databases for permanent deletion.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.DeleteInstance</a></p>
<p>Immediately upon completion of the request:</p>
<ul class="simple">
<li>Billing will cease for all of the instance’s reserved resources.</li>
</ul>
<p>Soon afterward:</p>
<ul class="simple">
<li>The instance and all databases within the instance will be deleteed.
All data in the databases will be permanently deleted.</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.exists">
<code class="descname">exists</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.exists" title="Permalink to this definition">#</a></dt>
<dd><p>Test whether this instance exists.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig</a></p>
</dd></dl>
<dl class="classmethod">
<dt id="google.cloud.spanner.instance.Instance.from_pb">
<em class="property">classmethod </em><code class="descname">from_pb</code><span class="sig-paren">(</span><em>instance_pb</em>, <em>client</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.from_pb"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.from_pb" title="Permalink to this definition">#</a></dt>
<dd><p>Creates an instance from a protobuf.</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>instance_pb</strong> (<code class="xref py py-class docutils literal"><span class="pre">google.spanner.v2.spanner_instance_admin_pb2.Instance</span></code>) – A instance protobuf object.</li>
<li><strong>client</strong> (<a class="reference internal" href="spanner-client-api.html#google.cloud.spanner.client.Client" title="google.cloud.spanner.client.Client"><code class="xref py py-class docutils literal"><span class="pre">Client</span></code></a>) – The client that owns the instance.</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="#google.cloud.spanner.instance.Instance" title="google.cloud.spanner.instance.Instance"><code class="xref py py-class docutils literal"><span class="pre">Instance</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 instance parsed from the protobuf response.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/2/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">ValueError</span></code></a> if the instance
name does not match
<code class="docutils literal"><span class="pre">projects/{project}/instances/{instance_id}</span></code>
or if the parsed project ID does not match the project ID
on the client.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.list_databases">
<code class="descname">list_databases</code><span class="sig-paren">(</span><em>page_size=None</em>, <em>page_token=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.list_databases"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.list_databases" title="Permalink to this definition">#</a></dt>
<dd><p>List databases for the instance.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases</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">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>page_size</strong> (<a class="reference external" href="https://docs.python.org/2/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) – (Optional) Maximum number of results to return.</li>
<li><strong>page_token</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) Token for fetching next page of results.</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="iterators.html#google.cloud.iterator.Iterator" title="google.cloud.iterator.Iterator"><code class="xref py py-class docutils literal"><span class="pre">Iterator</span></code></a></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Iterator of <a class="reference internal" href="spanner-database-api.html#google.cloud.spanner.database.Database" title="google.cloud.spanner.database.Database"><code class="xref py py-class docutils literal"><span class="pre">Database</span></code></a>
resources within the current instance.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="google.cloud.spanner.instance.Instance.name">
<code class="descname">name</code><a class="headerlink" href="#google.cloud.spanner.instance.Instance.name" title="Permalink to this definition">#</a></dt>
<dd><p>Instance name used in requests.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This property will not change if <code class="docutils literal"><span class="pre">instance_id</span></code> does not,
but the return value is not cached.</p>
</div>
<p>The instance name is of the form</p>
<blockquote>
<div><code class="docutils literal"><span class="pre">"projects/{project}/instances/{instance_id}"</span></code></div></blockquote>
<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#str" title="(in Python v2.7)">str</a></td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The instance name.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.reload">
<code class="descname">reload</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.reload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.reload" title="Permalink to this definition">#</a></dt>
<dd><p>Reload the metadata for this instance.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig</a></p>
</dd></dl>
<dl class="method">
<dt id="google.cloud.spanner.instance.Instance.update">
<code class="descname">update</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/google/cloud/spanner/instance.html#Instance.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#google.cloud.spanner.instance.Instance.update" title="Permalink to this definition">#</a></dt>
<dd><p>Update this instance.</p>
<p>See:
<a class="reference external" href="https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance">https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.UpdateInstance</a></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Updates the <code class="docutils literal"><span class="pre">display_name</span></code> and <code class="docutils literal"><span class="pre">node_count</span></code>. To change those
values before updating, set them via</p>
<div class="code python last highlight-default"><div class="highlight"><pre><span></span> instance.display_name = 'New display name'
instance.node_count = 5
before calling :meth:`update`.
</pre></div>
</div>
</div>
<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 internal" href="operation-api.html#google.cloud.operation.Operation" title="google.cloud.operation.Operation"><code class="xref py py-class docutils literal"><span class="pre">google.cloud.operation.Operation</span></code></a></td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">an operation instance</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="spanner-database-api.html" class="btn btn-neutral float-right" title="Database API" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="spanner-client-api.html" class="btn btn-neutral" title="Spanner Client" 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.23.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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>