blob: 052830b6f1f1b18ba9ec785bd5f996c6db4eb6d9 [file] [log] [blame]
Craig Citroe633be12015-03-02 13:40:36 -08001<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
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070075<h1><a href="sqladmin_v1beta4.html">Cloud SQL Admin API</a> . <a href="sqladmin_v1beta4.databases.html">databases</a></h1>
Craig Citroe633be12015-03-02 13:40:36 -080076<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(project, instance, database)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070079<p class="firstline">Deletes a database from a Cloud SQL instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080080<p class="toc_element">
81 <code><a href="#get">get(project, instance, database)</a></code></p>
82<p class="firstline">Retrieves a resource containing information about a database inside a Cloud SQL instance.</p>
83<p class="toc_element">
84 <code><a href="#insert">insert(project, instance, body)</a></code></p>
85<p class="firstline">Inserts a resource containing information about a database inside a Cloud SQL instance.</p>
86<p class="toc_element">
87 <code><a href="#list">list(project, instance)</a></code></p>
88<p class="firstline">Lists databases in the specified Cloud SQL instance.</p>
89<p class="toc_element">
90 <code><a href="#patch">patch(project, instance, database, body)</a></code></p>
91<p class="firstline">Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.</p>
92<p class="toc_element">
93 <code><a href="#update">update(project, instance, database, body)</a></code></p>
94<p class="firstline">Updates a resource containing information about a database inside a Cloud SQL instance.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="delete">delete(project, instance, database)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070098 <pre>Deletes a database from a Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -080099
100Args:
101 project: string, Project ID of the project that contains the instance. (required)
102 instance: string, Database instance ID. This does not include the project ID. (required)
103 database: string, Name of the database to be deleted in the instance. (required)
104
105Returns:
106 An object of the form:
107
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Craig Citroe633be12015-03-02 13:40:36 -0800109 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
110 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400111 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
Craig Citroe633be12015-03-02 13:40:36 -0800113 "fileType": "A String", # The file type for the specified uri.
114 # SQL: The file contains SQL statements.
115 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116 "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
117 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800118 "csvImportOptions": { # Options for importing data as CSV.
119 "table": "A String", # The table to which CSV data is imported.
120 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
121 "A String",
122 ],
123 },
124 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000125 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800126 "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
127 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
128 "kind": "sql#exportContext", # This is always sql#exportContext.
129 "fileType": "A String", # The file type for the specified uri.
130 # SQL: The file contains SQL statements.
131 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
Craig Citroe633be12015-03-02 13:40:36 -0800133 "csvExportOptions": { # Options for exporting data as CSV.
134 "selectQuery": "A String", # The select query used to extract the data.
135 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 "databases": [ # Databases to be exported.
137 # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
138 # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
Craig Citroe633be12015-03-02 13:40:36 -0800139 "A String",
140 ],
141 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
Craig Citroe633be12015-03-02 13:40:36 -0800143 "A String",
144 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700145 "mysqlExportOptions": { # Options for exporting from MySQL.
146 "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
147 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800148 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800149 },
150 },
151 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
152 "targetProject": "A String", # The project ID of the target instance related to this operation.
153 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000154 "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400155 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800156 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000157 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
158 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800159 "errors": [ # The list of errors encountered while processing this operation.
160 { # Database instance operation error.
161 "kind": "sql#operationError", # This is always sql#operationError.
162 "code": "A String", # Identifies the specific error that occurred.
163 "message": "A String", # Additional information about the error encountered.
164 },
165 ],
166 },
167 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
168 "selfLink": "A String", # The URI of this resource.
169 "user": "A String", # The email address of the user who initiated this operation.
170 }</pre>
171</div>
172
173<div class="method">
174 <code class="details" id="get">get(project, instance, database)</code>
175 <pre>Retrieves a resource containing information about a database inside a Cloud SQL instance.
176
177Args:
178 project: string, Project ID of the project that contains the instance. (required)
179 instance: string, Database instance ID. This does not include the project ID. (required)
180 database: string, Name of the database in the instance. (required)
181
182Returns:
183 An object of the form:
184
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700185 { # Represents a SQL database on the Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800186 "kind": "sql#database", # This is always sql#database.
187 "name": "A String", # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
188 "charset": "A String", # The MySQL charset value.
189 "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
190 "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700191 "etag": "A String", # This field is deprecated and will be removed from a future version of the API.
Craig Citroe633be12015-03-02 13:40:36 -0800192 "collation": "A String", # The MySQL collation value.
193 "selfLink": "A String", # The URI of this resource.
194 }</pre>
195</div>
196
197<div class="method">
198 <code class="details" id="insert">insert(project, instance, body)</code>
199 <pre>Inserts a resource containing information about a database inside a Cloud SQL instance.
200
201Args:
202 project: string, Project ID of the project that contains the instance. (required)
203 instance: string, Database instance ID. This does not include the project ID. (required)
204 body: object, The request body. (required)
205 The object takes the form of:
206
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700207{ # Represents a SQL database on the Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800208 "kind": "sql#database", # This is always sql#database.
209 "name": "A String", # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
210 "charset": "A String", # The MySQL charset value.
211 "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
212 "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 "etag": "A String", # This field is deprecated and will be removed from a future version of the API.
Craig Citroe633be12015-03-02 13:40:36 -0800214 "collation": "A String", # The MySQL collation value.
215 "selfLink": "A String", # The URI of this resource.
216 }
217
218
219Returns:
220 An object of the form:
221
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700222 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Craig Citroe633be12015-03-02 13:40:36 -0800223 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
224 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400225 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
Craig Citroe633be12015-03-02 13:40:36 -0800227 "fileType": "A String", # The file type for the specified uri.
228 # SQL: The file contains SQL statements.
229 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700230 "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
231 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800232 "csvImportOptions": { # Options for importing data as CSV.
233 "table": "A String", # The table to which CSV data is imported.
234 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
235 "A String",
236 ],
237 },
238 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000239 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800240 "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
241 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
242 "kind": "sql#exportContext", # This is always sql#exportContext.
243 "fileType": "A String", # The file type for the specified uri.
244 # SQL: The file contains SQL statements.
245 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246 "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
Craig Citroe633be12015-03-02 13:40:36 -0800247 "csvExportOptions": { # Options for exporting data as CSV.
248 "selectQuery": "A String", # The select query used to extract the data.
249 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700250 "databases": [ # Databases to be exported.
251 # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
252 # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
Craig Citroe633be12015-03-02 13:40:36 -0800253 "A String",
254 ],
255 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700256 "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
Craig Citroe633be12015-03-02 13:40:36 -0800257 "A String",
258 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 "mysqlExportOptions": { # Options for exporting from MySQL.
260 "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
261 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800262 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800263 },
264 },
265 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
266 "targetProject": "A String", # The project ID of the target instance related to this operation.
267 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000268 "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400269 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800270 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000271 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
272 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800273 "errors": [ # The list of errors encountered while processing this operation.
274 { # Database instance operation error.
275 "kind": "sql#operationError", # This is always sql#operationError.
276 "code": "A String", # Identifies the specific error that occurred.
277 "message": "A String", # Additional information about the error encountered.
278 },
279 ],
280 },
281 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
282 "selfLink": "A String", # The URI of this resource.
283 "user": "A String", # The email address of the user who initiated this operation.
284 }</pre>
285</div>
286
287<div class="method">
288 <code class="details" id="list">list(project, instance)</code>
289 <pre>Lists databases in the specified Cloud SQL instance.
290
291Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 project: string, Project ID of the project that contains the instance. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800293 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
294
295Returns:
296 An object of the form:
297
298 { # Database list response.
299 "items": [ # List of database resources in the instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 { # Represents a SQL database on the Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800301 "kind": "sql#database", # This is always sql#database.
302 "name": "A String", # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
303 "charset": "A String", # The MySQL charset value.
304 "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
305 "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700306 "etag": "A String", # This field is deprecated and will be removed from a future version of the API.
Craig Citroe633be12015-03-02 13:40:36 -0800307 "collation": "A String", # The MySQL collation value.
308 "selfLink": "A String", # The URI of this resource.
309 },
310 ],
311 "kind": "sql#databasesList", # This is always sql#databasesList.
312 }</pre>
313</div>
314
315<div class="method">
316 <code class="details" id="patch">patch(project, instance, database, body)</code>
317 <pre>Updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
318
319Args:
320 project: string, Project ID of the project that contains the instance. (required)
321 instance: string, Database instance ID. This does not include the project ID. (required)
322 database: string, Name of the database to be updated in the instance. (required)
323 body: object, The request body. (required)
324 The object takes the form of:
325
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700326{ # Represents a SQL database on the Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800327 "kind": "sql#database", # This is always sql#database.
328 "name": "A String", # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
329 "charset": "A String", # The MySQL charset value.
330 "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
331 "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700332 "etag": "A String", # This field is deprecated and will be removed from a future version of the API.
Craig Citroe633be12015-03-02 13:40:36 -0800333 "collation": "A String", # The MySQL collation value.
334 "selfLink": "A String", # The URI of this resource.
335 }
336
337
338Returns:
339 An object of the form:
340
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700341 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Craig Citroe633be12015-03-02 13:40:36 -0800342 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
343 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400344 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700345 "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
Craig Citroe633be12015-03-02 13:40:36 -0800346 "fileType": "A String", # The file type for the specified uri.
347 # SQL: The file contains SQL statements.
348 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700349 "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
350 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800351 "csvImportOptions": { # Options for importing data as CSV.
352 "table": "A String", # The table to which CSV data is imported.
353 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
354 "A String",
355 ],
356 },
357 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000358 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800359 "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
360 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
361 "kind": "sql#exportContext", # This is always sql#exportContext.
362 "fileType": "A String", # The file type for the specified uri.
363 # SQL: The file contains SQL statements.
364 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700365 "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
Craig Citroe633be12015-03-02 13:40:36 -0800366 "csvExportOptions": { # Options for exporting data as CSV.
367 "selectQuery": "A String", # The select query used to extract the data.
368 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369 "databases": [ # Databases to be exported.
370 # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
371 # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
Craig Citroe633be12015-03-02 13:40:36 -0800372 "A String",
373 ],
374 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700375 "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
Craig Citroe633be12015-03-02 13:40:36 -0800376 "A String",
377 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700378 "mysqlExportOptions": { # Options for exporting from MySQL.
379 "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
380 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800381 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800382 },
383 },
384 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
385 "targetProject": "A String", # The project ID of the target instance related to this operation.
386 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000387 "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400388 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800389 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000390 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
391 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800392 "errors": [ # The list of errors encountered while processing this operation.
393 { # Database instance operation error.
394 "kind": "sql#operationError", # This is always sql#operationError.
395 "code": "A String", # Identifies the specific error that occurred.
396 "message": "A String", # Additional information about the error encountered.
397 },
398 ],
399 },
400 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
401 "selfLink": "A String", # The URI of this resource.
402 "user": "A String", # The email address of the user who initiated this operation.
403 }</pre>
404</div>
405
406<div class="method">
407 <code class="details" id="update">update(project, instance, database, body)</code>
408 <pre>Updates a resource containing information about a database inside a Cloud SQL instance.
409
410Args:
411 project: string, Project ID of the project that contains the instance. (required)
412 instance: string, Database instance ID. This does not include the project ID. (required)
413 database: string, Name of the database to be updated in the instance. (required)
414 body: object, The request body. (required)
415 The object takes the form of:
416
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700417{ # Represents a SQL database on the Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800418 "kind": "sql#database", # This is always sql#database.
419 "name": "A String", # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
420 "charset": "A String", # The MySQL charset value.
421 "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
422 "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700423 "etag": "A String", # This field is deprecated and will be removed from a future version of the API.
Craig Citroe633be12015-03-02 13:40:36 -0800424 "collation": "A String", # The MySQL collation value.
425 "selfLink": "A String", # The URI of this resource.
426 }
427
428
429Returns:
430 An object of the form:
431
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Craig Citroe633be12015-03-02 13:40:36 -0800433 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
434 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400435 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700436 "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.
Craig Citroe633be12015-03-02 13:40:36 -0800437 "fileType": "A String", # The file type for the specified uri.
438 # SQL: The file contains SQL statements.
439 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700440 "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.
441 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800442 "csvImportOptions": { # Options for importing data as CSV.
443 "table": "A String", # The table to which CSV data is imported.
444 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
445 "A String",
446 ],
447 },
448 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000449 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800450 "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
451 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
452 "kind": "sql#exportContext", # This is always sql#exportContext.
453 "fileType": "A String", # The file type for the specified uri.
454 # SQL: The file contains SQL statements.
455 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700456 "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
Craig Citroe633be12015-03-02 13:40:36 -0800457 "csvExportOptions": { # Options for exporting data as CSV.
458 "selectQuery": "A String", # The select query used to extract the data.
459 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700460 "databases": [ # Databases to be exported.
461 # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property.
462 # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property.
Craig Citroe633be12015-03-02 13:40:36 -0800463 "A String",
464 ],
465 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700466 "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table.
Craig Citroe633be12015-03-02 13:40:36 -0800467 "A String",
468 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700469 "mysqlExportOptions": { # Options for exporting from MySQL.
470 "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored.
471 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800472 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800473 },
474 },
475 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
476 "targetProject": "A String", # The project ID of the target instance related to this operation.
477 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000478 "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE .
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400479 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800480 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000481 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
482 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800483 "errors": [ # The list of errors encountered while processing this operation.
484 { # Database instance operation error.
485 "kind": "sql#operationError", # This is always sql#operationError.
486 "code": "A String", # Identifies the specific error that occurred.
487 "message": "A String", # Additional information about the error encountered.
488 },
489 ],
490 },
491 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
492 "selfLink": "A String", # The URI of this resource.
493 "user": "A String", # The email address of the user who initiated this operation.
494 }</pre>
495</div>
496
497</body></html>