blob: 84c296bc59555d7d2c1652fb7f19fc1fdfcb7724 [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.tabledata.html">tabledata</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#insertAll">insertAll(projectId, datasetId, tableId, body=None)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000082<p class="firstline">Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -080084 <code><a href="#list">list(projectId, datasetId, tableId, startIndex=None, maxResults=None, pageToken=None, selectedFields=None)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000085<p class="firstline">Retrieves table data from a specified set of rows. Requires the READER dataset role.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040086<p class="toc_element">
87 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
88<p class="firstline">Retrieves the next page of results.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<h3>Method Details</h3>
90<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070091 <code class="details" id="close">close()</code>
92 <pre>Close httplib2 connections.</pre>
93</div>
94
95<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code class="details" id="insertAll">insertAll(projectId, datasetId, tableId, body=None)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000097 <pre>Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.
John Asmuth614db982014-04-24 15:46:26 -040098
99Args:
100 projectId: string, Project ID of the destination table. (required)
101 datasetId: string, Dataset ID of the destination table. (required)
102 tableId: string, Table ID of the destination table. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400104 The object takes the form of:
105
106{
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800107 &quot;ignoreUnknownValues&quot;: True or False, # [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values as errors.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800108 &quot;templateSuffix&quot;: &quot;A String&quot;, # If specified, treats the destination table as a base template, and inserts the rows into an instance table named &quot;{destination}{templateSuffix}&quot;. BigQuery will manage creation of the instance table, using the schema of the base template table. See https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables.
Bu Sun Kim65020912020-05-20 12:08:20 -0700109 &quot;rows&quot;: [ # The rows to insert.
John Asmuth614db982014-04-24 15:46:26 -0400110 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700111 &quot;json&quot;: { # Represents a single JSON object. # [Required] A JSON object that contains a row of data. The object&#x27;s properties and values must match the destination table&#x27;s schema.
112 &quot;a_key&quot;: &quot;&quot;,
John Asmuth614db982014-04-24 15:46:26 -0400113 },
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800114 &quot;insertId&quot;: &quot;A String&quot;, # [Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis.
John Asmuth614db982014-04-24 15:46:26 -0400115 },
116 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800117 &quot;kind&quot;: &quot;bigquery#tableDataInsertAllRequest&quot;, # The resource type of the response.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700118 &quot;skipInvalidRows&quot;: True or False, # [Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any invalid rows exist.
John Asmuth614db982014-04-24 15:46:26 -0400119 }
120
121
122Returns:
123 An object of the form:
124
125 {
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800126 &quot;kind&quot;: &quot;bigquery#tableDataInsertAllResponse&quot;, # The resource type of the response.
Bu Sun Kim65020912020-05-20 12:08:20 -0700127 &quot;insertErrors&quot;: [ # An array of errors for rows that were not inserted.
John Asmuth614db982014-04-24 15:46:26 -0400128 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700129 &quot;errors&quot;: [ # Error information for the row indicated by the index property.
John Asmuth614db982014-04-24 15:46:26 -0400130 {
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800131 &quot;message&quot;: &quot;A String&quot;, # A human-readable description of the error.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800132 &quot;location&quot;: &quot;A String&quot;, # Specifies where the error occurred, if present.
133 &quot;debugInfo&quot;: &quot;A String&quot;, # Debugging information. This property is internal to Google and should not be used.
134 &quot;reason&quot;: &quot;A String&quot;, # A short error code that summarizes the error.
John Asmuth614db982014-04-24 15:46:26 -0400135 },
136 ],
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800137 &quot;index&quot;: 42, # The index of the row that error applies to.
John Asmuth614db982014-04-24 15:46:26 -0400138 },
139 ],
140 }</pre>
141</div>
142
143<div class="method">
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800144 <code class="details" id="list">list(projectId, datasetId, tableId, startIndex=None, maxResults=None, pageToken=None, selectedFields=None)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000145 <pre>Retrieves table data from a specified set of rows. Requires the READER dataset role.
John Asmuth614db982014-04-24 15:46:26 -0400146
147Args:
148 projectId: string, Project ID of the table to read (required)
149 datasetId: string, Dataset ID of the table to read (required)
150 tableId: string, Table ID of the table to read (required)
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800151 startIndex: string, Zero-based index of the starting row to read
152 maxResults: integer, Maximum number of results to return
153 pageToken: string, Page token, returned by a previous call, identifying the result set
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800154 selectedFields: string, List of fields to return (comma-separated). If unspecified, all fields are returned
John Asmuth614db982014-04-24 15:46:26 -0400155
156Returns:
157 An object of the form:
158
159 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &quot;rows&quot;: [ # Rows of results.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000161 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700162 &quot;f&quot;: [ # Represents a single row in the result set, consisting of one or more fields.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000163 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700164 &quot;v&quot;: &quot;&quot;,
John Asmuth614db982014-04-24 15:46:26 -0400165 },
166 ],
167 },
168 ],
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800169 &quot;pageToken&quot;: &quot;A String&quot;, # A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table is changing.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800170 &quot;totalRows&quot;: &quot;A String&quot;, # The total number of rows in the complete table.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800171 &quot;etag&quot;: &quot;A String&quot;, # A hash of this page of results.
172 &quot;kind&quot;: &quot;bigquery#tableDataList&quot;, # The resource type of the response.
John Asmuth614db982014-04-24 15:46:26 -0400173 }</pre>
174</div>
175
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400176<div class="method">
177 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
178 <pre>Retrieves the next page of results.
179
180Args:
181 previous_request: The request for the previous page. (required)
182 previous_response: The response from the request for the previous page. (required)
183
184Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400186 page. Returns None if there are no more items in the collection.
187 </pre>
188</div>
189
John Asmuth614db982014-04-24 15:46:26 -0400190</body></html>