blob: a91898c180e7be8c0c3b8ac5d0b2b26c11f5f81e [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="bigquery_v2.html">BigQuery API</a> . <a href="bigquery_v2.tables.html">tables</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(projectId, datasetId, tableId)</a></code></p>
79<p class="firstline">Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.</p>
80<p class="toc_element">
81 <code><a href="#get">get(projectId, datasetId, tableId)</a></code></p>
82<p class="firstline">Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(projectId, datasetId, body)</a></code></p>
85<p class="firstline">Creates a new, empty table in the dataset.</p>
86<p class="toc_element">
87 <code><a href="#list">list(projectId, datasetId, pageToken=None, maxResults=None)</a></code></p>
88<p class="firstline">Lists all tables in the specified dataset.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#patch">patch(projectId, datasetId, tableId, body)</a></code></p>
94<p class="firstline">Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.</p>
95<p class="toc_element">
96 <code><a href="#update">update(projectId, datasetId, tableId, body)</a></code></p>
97<p class="firstline">Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.</p>
98<h3>Method Details</h3>
99<div class="method">
100 <code class="details" id="delete">delete(projectId, datasetId, tableId)</code>
101 <pre>Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
102
103Args:
104 projectId: string, Project ID of the table to delete (required)
105 datasetId: string, Dataset ID of the table to delete (required)
106 tableId: string, Table ID of the table to delete (required)
107</pre>
108</div>
109
110<div class="method">
111 <code class="details" id="get">get(projectId, datasetId, tableId)</code>
112 <pre>Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
113
114Args:
115 projectId: string, Project ID of the requested table (required)
116 datasetId: string, Dataset ID of the requested table (required)
117 tableId: string, Table ID of the requested table (required)
118
119Returns:
120 An object of the form:
121
122 {
123 "kind": "bigquery#table", # [Output-only] The type of the resource.
124 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
125 "description": "A String", # [Optional] A user-friendly description of this table.
126 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
127 "tableReference": { # [Required] Reference describing the ID of this table.
128 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
129 "tableId": "A String", # [Required] ID of the table.
130 "datasetId": "A String", # [Required] ID of the dataset containing the table.
131 },
132 "numRows": "A String", # [Output-only] The number of rows of data in this table.
133 "numBytes": "A String", # [Output-only] The size of the table in bytes.
134 "etag": "A String", # [Output-only] A hash of this resource.
135 "friendlyName": "A String", # [Optional] A descriptive name for this table.
136 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
137 "view": { # [Optional] The view definition.
138 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
139 },
140 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
141 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
142 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
143 "schema": { # [Optional] Describes the schema of this table.
144 "fields": [ # Describes the fields in a table.
145 {
146 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
147 # Object with schema name: TableFieldSchema
148 ],
149 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
150 "description": "A String", # [Optional] The field description.
151 "name": "A String", # [Required] The field name.
152 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
153 },
154 ],
155 },
156 }</pre>
157</div>
158
159<div class="method">
160 <code class="details" id="insert">insert(projectId, datasetId, body)</code>
161 <pre>Creates a new, empty table in the dataset.
162
163Args:
164 projectId: string, Project ID of the new table (required)
165 datasetId: string, Dataset ID of the new table (required)
166 body: object, The request body. (required)
167 The object takes the form of:
168
169{
170 "kind": "bigquery#table", # [Output-only] The type of the resource.
171 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
172 "description": "A String", # [Optional] A user-friendly description of this table.
173 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
174 "tableReference": { # [Required] Reference describing the ID of this table.
175 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
176 "tableId": "A String", # [Required] ID of the table.
177 "datasetId": "A String", # [Required] ID of the dataset containing the table.
178 },
179 "numRows": "A String", # [Output-only] The number of rows of data in this table.
180 "numBytes": "A String", # [Output-only] The size of the table in bytes.
181 "etag": "A String", # [Output-only] A hash of this resource.
182 "friendlyName": "A String", # [Optional] A descriptive name for this table.
183 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
184 "view": { # [Optional] The view definition.
185 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
186 },
187 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
188 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
189 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
190 "schema": { # [Optional] Describes the schema of this table.
191 "fields": [ # Describes the fields in a table.
192 {
193 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
194 # Object with schema name: TableFieldSchema
195 ],
196 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
197 "description": "A String", # [Optional] The field description.
198 "name": "A String", # [Required] The field name.
199 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
200 },
201 ],
202 },
203 }
204
205
206Returns:
207 An object of the form:
208
209 {
210 "kind": "bigquery#table", # [Output-only] The type of the resource.
211 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
212 "description": "A String", # [Optional] A user-friendly description of this table.
213 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
214 "tableReference": { # [Required] Reference describing the ID of this table.
215 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
216 "tableId": "A String", # [Required] ID of the table.
217 "datasetId": "A String", # [Required] ID of the dataset containing the table.
218 },
219 "numRows": "A String", # [Output-only] The number of rows of data in this table.
220 "numBytes": "A String", # [Output-only] The size of the table in bytes.
221 "etag": "A String", # [Output-only] A hash of this resource.
222 "friendlyName": "A String", # [Optional] A descriptive name for this table.
223 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
224 "view": { # [Optional] The view definition.
225 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
226 },
227 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
228 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
229 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
230 "schema": { # [Optional] Describes the schema of this table.
231 "fields": [ # Describes the fields in a table.
232 {
233 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
234 # Object with schema name: TableFieldSchema
235 ],
236 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
237 "description": "A String", # [Optional] The field description.
238 "name": "A String", # [Required] The field name.
239 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
240 },
241 ],
242 },
243 }</pre>
244</div>
245
246<div class="method">
247 <code class="details" id="list">list(projectId, datasetId, pageToken=None, maxResults=None)</code>
248 <pre>Lists all tables in the specified dataset.
249
250Args:
251 projectId: string, Project ID of the tables to list (required)
252 datasetId: string, Dataset ID of the tables to list (required)
253 pageToken: string, Page token, returned by a previous call, to request the next page of results
254 maxResults: integer, Maximum number of results to return
255
256Returns:
257 An object of the form:
258
259 {
260 "nextPageToken": "A String", # A token to request the next page of results.
261 "tables": [ # Tables in the requested dataset.
262 {
263 "friendlyName": "A String", # The user-friendly name for this table.
264 "kind": "bigquery#table", # The resource type.
265 "type": "A String", # The type of table. Possible values are: TABLE, VIEW.
266 "id": "A String", # An opaque ID of the table
267 "tableReference": { # A reference uniquely identifying the table.
268 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
269 "tableId": "A String", # [Required] ID of the table.
270 "datasetId": "A String", # [Required] ID of the dataset containing the table.
271 },
272 },
273 ],
274 "kind": "bigquery#tableList", # The type of list.
275 "etag": "A String", # A hash of this page of results.
276 "totalItems": 42, # The total number of tables in the dataset.
277 }</pre>
278</div>
279
280<div class="method">
281 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
282 <pre>Retrieves the next page of results.
283
284Args:
285 previous_request: The request for the previous page. (required)
286 previous_response: The response from the request for the previous page. (required)
287
288Returns:
289 A request object that you can call 'execute()' on to request the next
290 page. Returns None if there are no more items in the collection.
291 </pre>
292</div>
293
294<div class="method">
295 <code class="details" id="patch">patch(projectId, datasetId, tableId, body)</code>
296 <pre>Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
297
298Args:
299 projectId: string, Project ID of the table to update (required)
300 datasetId: string, Dataset ID of the table to update (required)
301 tableId: string, Table ID of the table to update (required)
302 body: object, The request body. (required)
303 The object takes the form of:
304
305{
306 "kind": "bigquery#table", # [Output-only] The type of the resource.
307 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
308 "description": "A String", # [Optional] A user-friendly description of this table.
309 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
310 "tableReference": { # [Required] Reference describing the ID of this table.
311 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
312 "tableId": "A String", # [Required] ID of the table.
313 "datasetId": "A String", # [Required] ID of the dataset containing the table.
314 },
315 "numRows": "A String", # [Output-only] The number of rows of data in this table.
316 "numBytes": "A String", # [Output-only] The size of the table in bytes.
317 "etag": "A String", # [Output-only] A hash of this resource.
318 "friendlyName": "A String", # [Optional] A descriptive name for this table.
319 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
320 "view": { # [Optional] The view definition.
321 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
322 },
323 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
324 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
325 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
326 "schema": { # [Optional] Describes the schema of this table.
327 "fields": [ # Describes the fields in a table.
328 {
329 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
330 # Object with schema name: TableFieldSchema
331 ],
332 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
333 "description": "A String", # [Optional] The field description.
334 "name": "A String", # [Required] The field name.
335 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
336 },
337 ],
338 },
339 }
340
341
342Returns:
343 An object of the form:
344
345 {
346 "kind": "bigquery#table", # [Output-only] The type of the resource.
347 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
348 "description": "A String", # [Optional] A user-friendly description of this table.
349 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
350 "tableReference": { # [Required] Reference describing the ID of this table.
351 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
352 "tableId": "A String", # [Required] ID of the table.
353 "datasetId": "A String", # [Required] ID of the dataset containing the table.
354 },
355 "numRows": "A String", # [Output-only] The number of rows of data in this table.
356 "numBytes": "A String", # [Output-only] The size of the table in bytes.
357 "etag": "A String", # [Output-only] A hash of this resource.
358 "friendlyName": "A String", # [Optional] A descriptive name for this table.
359 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
360 "view": { # [Optional] The view definition.
361 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
362 },
363 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
364 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
365 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
366 "schema": { # [Optional] Describes the schema of this table.
367 "fields": [ # Describes the fields in a table.
368 {
369 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
370 # Object with schema name: TableFieldSchema
371 ],
372 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
373 "description": "A String", # [Optional] The field description.
374 "name": "A String", # [Required] The field name.
375 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
376 },
377 ],
378 },
379 }</pre>
380</div>
381
382<div class="method">
383 <code class="details" id="update">update(projectId, datasetId, tableId, body)</code>
384 <pre>Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
385
386Args:
387 projectId: string, Project ID of the table to update (required)
388 datasetId: string, Dataset ID of the table to update (required)
389 tableId: string, Table ID of the table to update (required)
390 body: object, The request body. (required)
391 The object takes the form of:
392
393{
394 "kind": "bigquery#table", # [Output-only] The type of the resource.
395 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
396 "description": "A String", # [Optional] A user-friendly description of this table.
397 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
398 "tableReference": { # [Required] Reference describing the ID of this table.
399 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
400 "tableId": "A String", # [Required] ID of the table.
401 "datasetId": "A String", # [Required] ID of the dataset containing the table.
402 },
403 "numRows": "A String", # [Output-only] The number of rows of data in this table.
404 "numBytes": "A String", # [Output-only] The size of the table in bytes.
405 "etag": "A String", # [Output-only] A hash of this resource.
406 "friendlyName": "A String", # [Optional] A descriptive name for this table.
407 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
408 "view": { # [Optional] The view definition.
409 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
410 },
411 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
412 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
413 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
414 "schema": { # [Optional] Describes the schema of this table.
415 "fields": [ # Describes the fields in a table.
416 {
417 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
418 # Object with schema name: TableFieldSchema
419 ],
420 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
421 "description": "A String", # [Optional] The field description.
422 "name": "A String", # [Required] The field name.
423 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
424 },
425 ],
426 },
427 }
428
429
430Returns:
431 An object of the form:
432
433 {
434 "kind": "bigquery#table", # [Output-only] The type of the resource.
435 "lastModifiedTime": "A String", # [Output-only] The time when this table was last modified, in milliseconds since the epoch.
436 "description": "A String", # [Optional] A user-friendly description of this table.
437 "creationTime": "A String", # [Output-only] The time when this table was created, in milliseconds since the epoch.
438 "tableReference": { # [Required] Reference describing the ID of this table.
439 "projectId": "A String", # [Required] ID of the project billed for storage of the table.
440 "tableId": "A String", # [Required] ID of the table.
441 "datasetId": "A String", # [Required] ID of the dataset containing the table.
442 },
443 "numRows": "A String", # [Output-only] The number of rows of data in this table.
444 "numBytes": "A String", # [Output-only] The size of the table in bytes.
445 "etag": "A String", # [Output-only] A hash of this resource.
446 "friendlyName": "A String", # [Optional] A descriptive name for this table.
447 "expirationTime": "A String", # [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
448 "view": { # [Optional] The view definition.
449 "query": "A String", # [Required] A query that BigQuery executes when the view is referenced.
450 },
451 "type": "A String", # [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL query. The default value is TABLE.
452 "id": "A String", # [Output-only] An opaque ID uniquely identifying the table.
453 "selfLink": "A String", # [Output-only] A URL that can be used to access this resource again.
454 "schema": { # [Optional] Describes the schema of this table.
455 "fields": [ # Describes the fields in a table.
456 {
457 "fields": [ # [Optional] Describes the nested schema fields if the type property is set to RECORD.
458 # Object with schema name: TableFieldSchema
459 ],
460 "type": "A String", # [Required] The field data type. Possible values include STRING, INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates that the field contains a nested schema).
461 "description": "A String", # [Optional] The field description.
462 "name": "A String", # [Required] The field name.
463 "mode": "A String", # [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
464 },
465 ],
466 },
467 }</pre>
468</div>
469
470</body></html>