blob: 1e842b137b7589cd7083898d929a4a6a0bb4ad9a [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.instances.html">instances</a></h1>
Craig Citroe633be12015-03-02 13:40:36 -080076<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#addServerCa">addServerCa(project, instance)</a></code></p>
79<p class="firstline">Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.</p>
80<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -080081 <code><a href="#clone">clone(project, instance, body)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Creates a Cloud SQL instance as a clone of the source instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080083<p class="toc_element">
84 <code><a href="#delete">delete(project, instance)</a></code></p>
85<p class="firstline">Deletes a Cloud SQL instance.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#demoteMaster">demoteMaster(project, instance, body)</a></code></p>
88<p class="firstline">Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.</p>
89<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -080090 <code><a href="#export">export(project, instance, body)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.</p>
Craig Citroe633be12015-03-02 13:40:36 -080092<p class="toc_element">
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080093 <code><a href="#failover">failover(project, instance, body)</a></code></p>
94<p class="firstline">Failover the instance to its failover replica instance.</p>
95<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -080096 <code><a href="#get">get(project, instance)</a></code></p>
97<p class="firstline">Retrieves a resource containing information about a Cloud SQL instance.</p>
98<p class="toc_element">
99 <code><a href="#import_">import_(project, instance, body)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.</p>
Craig Citroe633be12015-03-02 13:40:36 -0800101<p class="toc_element">
102 <code><a href="#insert">insert(project, body)</a></code></p>
103<p class="firstline">Creates a new Cloud SQL instance.</p>
104<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400105 <code><a href="#list">list(project, maxResults=None, pageToken=None, filter=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -0800106<p class="firstline">Lists instances under a given project in the alphabetical order of the instance name.</p>
107<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108 <code><a href="#listServerCas">listServerCas(project, instance)</a></code></p>
109<p class="firstline">Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.</p>
110<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -0800111 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
112<p class="firstline">Retrieves the next page of results.</p>
113<p class="toc_element">
114 <code><a href="#patch">patch(project, instance, body)</a></code></p>
115<p class="firstline">Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.</p>
116<p class="toc_element">
117 <code><a href="#promoteReplica">promoteReplica(project, instance)</a></code></p>
118<p class="firstline">Promotes the read replica instance to be a stand-alone Cloud SQL instance.</p>
119<p class="toc_element">
120 <code><a href="#resetSslConfig">resetSslConfig(project, instance)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121<p class="firstline">Deletes all client certificates and generates a new server SSL certificate for the instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -0800122<p class="toc_element">
123 <code><a href="#restart">restart(project, instance)</a></code></p>
124<p class="firstline">Restarts a Cloud SQL instance.</p>
125<p class="toc_element">
126 <code><a href="#restoreBackup">restoreBackup(project, instance, body)</a></code></p>
127<p class="firstline">Restores a backup of a Cloud SQL instance.</p>
128<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 <code><a href="#rotateServerCa">rotateServerCa(project, instance, body)</a></code></p>
130<p class="firstline">Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.</p>
131<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -0800132 <code><a href="#startReplica">startReplica(project, instance)</a></code></p>
133<p class="firstline">Starts the replication in the read replica instance.</p>
134<p class="toc_element">
135 <code><a href="#stopReplica">stopReplica(project, instance)</a></code></p>
136<p class="firstline">Stops the replication in the read replica instance.</p>
137<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800138 <code><a href="#truncateLog">truncateLog(project, instance, body)</a></code></p>
139<p class="firstline">Truncate MySQL general and slow query log tables</p>
140<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -0800141 <code><a href="#update">update(project, instance, body)</a></code></p>
142<p class="firstline">Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.</p>
143<h3>Method Details</h3>
144<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700145 <code class="details" id="addServerCa">addServerCa(project, instance)</code>
146 <pre>Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.
Craig Citroe633be12015-03-02 13:40:36 -0800147
148Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 project: string, Project ID of the project that contains the instance. (required)
150 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800151
152Returns:
153 An object of the form:
154
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 { # 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 -0800156 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
157 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400158 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700159 "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 -0800160 "fileType": "A String", # The file type for the specified uri.
161 # SQL: The file contains SQL statements.
162 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700163 "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.
164 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800165 "csvImportOptions": { # Options for importing data as CSV.
166 "table": "A String", # The table to which CSV data is imported.
167 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
168 "A String",
169 ],
170 },
171 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000172 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800173 "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.
174 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
175 "kind": "sql#exportContext", # This is always sql#exportContext.
176 "fileType": "A String", # The file type for the specified uri.
177 # SQL: The file contains SQL statements.
178 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700179 "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 -0800180 "csvExportOptions": { # Options for exporting data as CSV.
181 "selectQuery": "A String", # The select query used to extract the data.
182 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700183 "databases": [ # Databases to be exported.
184 # 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.
185 # 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 -0800186 "A String",
187 ],
188 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700189 "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 -0800190 "A String",
191 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700192 "mysqlExportOptions": { # Options for exporting from MySQL.
193 "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.
194 },
195 "schemaOnly": True or False, # Export only schemas.
196 },
197 },
198 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
199 "targetProject": "A String", # The project ID of the target instance related to this operation.
200 "targetId": "A String", # Name of the database instance related to this operation.
201 "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 .
202 "targetLink": "A String",
203 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
204 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
205 "kind": "sql#operationErrors", # This is always sql#operationErrors.
206 "errors": [ # The list of errors encountered while processing this operation.
207 { # Database instance operation error.
208 "kind": "sql#operationError", # This is always sql#operationError.
209 "code": "A String", # Identifies the specific error that occurred.
210 "message": "A String", # Additional information about the error encountered.
211 },
212 ],
213 },
214 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
215 "selfLink": "A String", # The URI of this resource.
216 "user": "A String", # The email address of the user who initiated this operation.
217 }</pre>
218</div>
219
220<div class="method">
221 <code class="details" id="clone">clone(project, instance, body)</code>
222 <pre>Creates a Cloud SQL instance as a clone of the source instance.
223
224Args:
225 project: string, Project ID of the source as well as the clone Cloud SQL instance. (required)
226 instance: string, The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. (required)
227 body: object, The request body. (required)
228 The object takes the form of:
229
230{ # Database instance clone request.
231 "cloneContext": { # Database instance clone context. # Contains details about the clone operation.
232 "binLogCoordinates": { # Binary log coordinates. # Binary log coordinates, if specified, identify the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates.
233 "binLogPosition": "A String", # Position (offset) within the binary log file.
234 "kind": "sql#binLogCoordinates", # This is always sql#binLogCoordinates.
235 "binLogFileName": "A String", # Name of the binary log file for a Cloud SQL instance.
236 },
237 "kind": "sql#cloneContext", # This is always sql#cloneContext.
238 "pitrTimestampMs": "A String", # Reserved for future use.
239 "destinationInstanceName": "A String", # Name of the Cloud SQL instance to be created as a clone.
240 },
241 }
242
243
244Returns:
245 An object of the form:
246
247 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
248 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
249 "importContext": { # Database instance import context. # The context for import operation, if applicable.
250 "kind": "sql#importContext", # This is always sql#importContext.
251 "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.
252 "fileType": "A String", # The file type for the specified uri.
253 # SQL: The file contains SQL statements.
254 # CSV: The file contains CSV data.
255 "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.
256 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
257 "csvImportOptions": { # Options for importing data as CSV.
258 "table": "A String", # The table to which CSV data is imported.
259 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
260 "A String",
261 ],
262 },
263 },
264 "kind": "sql#operation", # This is always sql#operation.
265 "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.
266 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
267 "kind": "sql#exportContext", # This is always sql#exportContext.
268 "fileType": "A String", # The file type for the specified uri.
269 # SQL: The file contains SQL statements.
270 # CSV: The file contains CSV data.
271 "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.
272 "csvExportOptions": { # Options for exporting data as CSV.
273 "selectQuery": "A String", # The select query used to extract the data.
274 },
275 "databases": [ # Databases to be exported.
276 # 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.
277 # 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.
278 "A String",
279 ],
280 "sqlExportOptions": { # Options for exporting data as SQL statements.
281 "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.
282 "A String",
283 ],
284 "mysqlExportOptions": { # Options for exporting from MySQL.
285 "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.
286 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800287 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800288 },
289 },
290 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
291 "targetProject": "A String", # The project ID of the target instance related to this operation.
292 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000293 "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 -0400294 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800295 "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 +0000296 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
297 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800298 "errors": [ # The list of errors encountered while processing this operation.
299 { # Database instance operation error.
300 "kind": "sql#operationError", # This is always sql#operationError.
301 "code": "A String", # Identifies the specific error that occurred.
302 "message": "A String", # Additional information about the error encountered.
303 },
304 ],
305 },
306 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
307 "selfLink": "A String", # The URI of this resource.
308 "user": "A String", # The email address of the user who initiated this operation.
309 }</pre>
310</div>
311
312<div class="method">
313 <code class="details" id="delete">delete(project, instance)</code>
314 <pre>Deletes a Cloud SQL instance.
315
316Args:
317 project: string, Project ID of the project that contains the instance to be deleted. (required)
318 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
319
320Returns:
321 An object of the form:
322
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700323 { # 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 -0800324 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
325 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400326 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700327 "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 -0800328 "fileType": "A String", # The file type for the specified uri.
329 # SQL: The file contains SQL statements.
330 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "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.
332 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800333 "csvImportOptions": { # Options for importing data as CSV.
334 "table": "A String", # The table to which CSV data is imported.
335 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
336 "A String",
337 ],
338 },
339 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000340 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800341 "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.
342 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
343 "kind": "sql#exportContext", # This is always sql#exportContext.
344 "fileType": "A String", # The file type for the specified uri.
345 # SQL: The file contains SQL statements.
346 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700347 "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 -0800348 "csvExportOptions": { # Options for exporting data as CSV.
349 "selectQuery": "A String", # The select query used to extract the data.
350 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700351 "databases": [ # Databases to be exported.
352 # 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.
353 # 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 -0800354 "A String",
355 ],
356 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700357 "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 -0800358 "A String",
359 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700360 "mysqlExportOptions": { # Options for exporting from MySQL.
361 "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.
362 },
363 "schemaOnly": True or False, # Export only schemas.
364 },
365 },
366 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
367 "targetProject": "A String", # The project ID of the target instance related to this operation.
368 "targetId": "A String", # Name of the database instance related to this operation.
369 "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 .
370 "targetLink": "A String",
371 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
372 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
373 "kind": "sql#operationErrors", # This is always sql#operationErrors.
374 "errors": [ # The list of errors encountered while processing this operation.
375 { # Database instance operation error.
376 "kind": "sql#operationError", # This is always sql#operationError.
377 "code": "A String", # Identifies the specific error that occurred.
378 "message": "A String", # Additional information about the error encountered.
379 },
380 ],
381 },
382 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
383 "selfLink": "A String", # The URI of this resource.
384 "user": "A String", # The email address of the user who initiated this operation.
385 }</pre>
386</div>
387
388<div class="method">
389 <code class="details" id="demoteMaster">demoteMaster(project, instance, body)</code>
390 <pre>Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
391
392Args:
393 project: string, ID of the project that contains the instance. (required)
394 instance: string, Cloud SQL instance name. (required)
395 body: object, The request body. (required)
396 The object takes the form of:
397
398{ # Database demote master request.
399 "demoteMasterContext": { # Database instance demote master context. # Contains details about the demoteMaster operation.
400 "kind": "sql#demoteMasterContext", # This is always sql#demoteMasterContext.
401 "masterInstanceName": "A String", # The name of the instance which will act as on-premises master in the replication setup.
402 "verifyGtidConsistency": True or False, # Verify GTID consistency for demote operation. Default value: True. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises master and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues.
403 "replicaConfiguration": { # Read-replica configuration for connecting to the on-premises master. # Configuration specific to read-replicas replicating from the on-premises master.
404 "kind": "sql#demoteMasterConfiguration", # This is always sql#demoteMasterConfiguration.
405 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
406 "username": "A String", # The username for the replication connection.
407 "kind": "sql#demoteMasterMysqlReplicaConfiguration", # This is always sql#demoteMasterMysqlReplicaConfiguration.
408 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8.
409 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
410 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
411 "password": "A String", # The password for the replication connection.
412 },
413 },
414 },
415 }
416
417
418Returns:
419 An object of the form:
420
421 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
422 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
423 "importContext": { # Database instance import context. # The context for import operation, if applicable.
424 "kind": "sql#importContext", # This is always sql#importContext.
425 "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.
426 "fileType": "A String", # The file type for the specified uri.
427 # SQL: The file contains SQL statements.
428 # CSV: The file contains CSV data.
429 "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.
430 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
431 "csvImportOptions": { # Options for importing data as CSV.
432 "table": "A String", # The table to which CSV data is imported.
433 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
434 "A String",
435 ],
436 },
437 },
438 "kind": "sql#operation", # This is always sql#operation.
439 "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.
440 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
441 "kind": "sql#exportContext", # This is always sql#exportContext.
442 "fileType": "A String", # The file type for the specified uri.
443 # SQL: The file contains SQL statements.
444 # CSV: The file contains CSV data.
445 "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.
446 "csvExportOptions": { # Options for exporting data as CSV.
447 "selectQuery": "A String", # The select query used to extract the data.
448 },
449 "databases": [ # Databases to be exported.
450 # 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.
451 # 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.
452 "A String",
453 ],
454 "sqlExportOptions": { # Options for exporting data as SQL statements.
455 "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.
456 "A String",
457 ],
458 "mysqlExportOptions": { # Options for exporting from MySQL.
459 "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.
460 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800461 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800462 },
463 },
464 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
465 "targetProject": "A String", # The project ID of the target instance related to this operation.
466 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000467 "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 -0400468 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800469 "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 +0000470 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
471 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800472 "errors": [ # The list of errors encountered while processing this operation.
473 { # Database instance operation error.
474 "kind": "sql#operationError", # This is always sql#operationError.
475 "code": "A String", # Identifies the specific error that occurred.
476 "message": "A String", # Additional information about the error encountered.
477 },
478 ],
479 },
480 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
481 "selfLink": "A String", # The URI of this resource.
482 "user": "A String", # The email address of the user who initiated this operation.
483 }</pre>
484</div>
485
486<div class="method">
487 <code class="details" id="export">export(project, instance, body)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700488 <pre>Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
Craig Citroe633be12015-03-02 13:40:36 -0800489
490Args:
491 project: string, Project ID of the project that contains the instance to be exported. (required)
492 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
493 body: object, The request body. (required)
494 The object takes the form of:
495
496{ # Database instance export request.
497 "exportContext": { # Database instance export context. # Contains details about the export operation.
498 "kind": "sql#exportContext", # This is always sql#exportContext.
499 "fileType": "A String", # The file type for the specified uri.
500 # SQL: The file contains SQL statements.
501 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502 "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 -0800503 "csvExportOptions": { # Options for exporting data as CSV.
504 "selectQuery": "A String", # The select query used to extract the data.
505 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700506 "databases": [ # Databases to be exported.
507 # 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.
508 # 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 -0800509 "A String",
510 ],
511 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700512 "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 -0800513 "A String",
514 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700515 "mysqlExportOptions": { # Options for exporting from MySQL.
516 "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.
517 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800518 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800519 },
520 },
521 }
522
523
524Returns:
525 An object of the form:
526
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700527 { # 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 -0800528 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
529 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400530 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700531 "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 -0800532 "fileType": "A String", # The file type for the specified uri.
533 # SQL: The file contains SQL statements.
534 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700535 "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.
536 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800537 "csvImportOptions": { # Options for importing data as CSV.
538 "table": "A String", # The table to which CSV data is imported.
539 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
540 "A String",
541 ],
542 },
543 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000544 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800545 "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.
546 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
547 "kind": "sql#exportContext", # This is always sql#exportContext.
548 "fileType": "A String", # The file type for the specified uri.
549 # SQL: The file contains SQL statements.
550 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700551 "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 -0800552 "csvExportOptions": { # Options for exporting data as CSV.
553 "selectQuery": "A String", # The select query used to extract the data.
554 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700555 "databases": [ # Databases to be exported.
556 # 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.
557 # 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 -0800558 "A String",
559 ],
560 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700561 "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 -0800562 "A String",
563 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 "mysqlExportOptions": { # Options for exporting from MySQL.
565 "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.
566 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800567 "schemaOnly": True or False, # Export only schemas.
568 },
569 },
570 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
571 "targetProject": "A String", # The project ID of the target instance related to this operation.
572 "targetId": "A String", # Name of the database instance related to this operation.
573 "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 -0400574 "targetLink": "A String",
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800575 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
576 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
577 "kind": "sql#operationErrors", # This is always sql#operationErrors.
578 "errors": [ # The list of errors encountered while processing this operation.
579 { # Database instance operation error.
580 "kind": "sql#operationError", # This is always sql#operationError.
581 "code": "A String", # Identifies the specific error that occurred.
582 "message": "A String", # Additional information about the error encountered.
583 },
584 ],
585 },
586 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
587 "selfLink": "A String", # The URI of this resource.
588 "user": "A String", # The email address of the user who initiated this operation.
589 }</pre>
590</div>
591
592<div class="method">
593 <code class="details" id="failover">failover(project, instance, body)</code>
594 <pre>Failover the instance to its failover replica instance.
595
596Args:
597 project: string, ID of the project that contains the read replica. (required)
598 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
599 body: object, The request body. (required)
600 The object takes the form of:
601
602{ # Instance failover request.
603 "failoverContext": { # Database instance failover context. # Failover Context.
604 "kind": "sql#failoverContext", # This is always sql#failoverContext.
605 "settingsVersion": "A String", # The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version.
606 },
607 }
608
609
610Returns:
611 An object of the form:
612
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800614 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
615 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400616 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700617 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800618 "fileType": "A String", # The file type for the specified uri.
619 # SQL: The file contains SQL statements.
620 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 "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.
622 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800623 "csvImportOptions": { # Options for importing data as CSV.
624 "table": "A String", # The table to which CSV data is imported.
625 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
626 "A String",
627 ],
628 },
629 },
630 "kind": "sql#operation", # This is always sql#operation.
631 "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.
632 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
633 "kind": "sql#exportContext", # This is always sql#exportContext.
634 "fileType": "A String", # The file type for the specified uri.
635 # SQL: The file contains SQL statements.
636 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700637 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800638 "csvExportOptions": { # Options for exporting data as CSV.
639 "selectQuery": "A String", # The select query used to extract the data.
640 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700641 "databases": [ # Databases to be exported.
642 # 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.
643 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800644 "A String",
645 ],
646 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800648 "A String",
649 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700650 "mysqlExportOptions": { # Options for exporting from MySQL.
651 "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.
652 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800653 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800654 },
655 },
656 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
657 "targetProject": "A String", # The project ID of the target instance related to this operation.
658 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000659 "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 -0400660 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800661 "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 +0000662 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
663 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800664 "errors": [ # The list of errors encountered while processing this operation.
665 { # Database instance operation error.
666 "kind": "sql#operationError", # This is always sql#operationError.
667 "code": "A String", # Identifies the specific error that occurred.
668 "message": "A String", # Additional information about the error encountered.
669 },
670 ],
671 },
672 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
673 "selfLink": "A String", # The URI of this resource.
674 "user": "A String", # The email address of the user who initiated this operation.
675 }</pre>
676</div>
677
678<div class="method">
679 <code class="details" id="get">get(project, instance)</code>
680 <pre>Retrieves a resource containing information about a Cloud SQL instance.
681
682Args:
683 project: string, Project ID of the project that contains the instance. (required)
684 instance: string, Database instance ID. This does not include the project ID. (required)
685
686Returns:
687 An object of the form:
688
689 { # A Cloud SQL instance resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700690 "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only.
691 # SECOND_GEN: Second Generation instance or PostgreSQL instance.
692 # EXTERNAL: A database server that is not managed by Google.
693 # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation.
694 "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700695 "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
696 "ipAddresses": [ # The assigned IP addresses for the instance.
697 { # Database instance IP Mapping.
698 "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
699 "ipAddress": "A String", # The IP address assigned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700700 "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700701 },
702 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700703 "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700704 "instanceType": "A String", # The instance type. This can be one of the following.
705 # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
706 # ON_PREMISES_INSTANCE: An instance running on the customer's premises.
707 # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
708 "maxDiskSize": "A String", # The maximum disk size of the instance in bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700709 "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances.
710 "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration.
711 "kmsKeyName": "A String", # KMS key resource name
712 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700713 "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension.
714 "A String",
715 ],
716 "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700717 "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances.
718 "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk
719 "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus.
720 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700721 "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following.
722 # RUNNABLE: The instance is running, or is ready to run when accessed.
723 # SUSPENDED: The instance is not available, for example due to problems with billing.
724 # PENDING_CREATE: The instance is being created.
725 # MAINTENANCE: The instance is down for maintenance.
726 # FAILED: The instance creation failed.
727 # UNKNOWN_STATE: The state of the instance is unknown.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700728 "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.
729 "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700730 "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances.
731 "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700732 "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700733 },
734 "replicaNames": [ # The replicas of the instance.
735 "A String",
736 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000737 "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances.
738 "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration.
739 "hostPort": "A String", # The host and port of the on-premises instance in host:port format
740 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700741 "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings.
Craig Citroe633be12015-03-02 13:40:36 -0800742 "kind": "sql#instance", # This is always sql#instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700743 "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID.
744 "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
745 "serverCaCert": { # SslCerts Resource # SSL configuration.
746 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
747 "kind": "sql#sslCert", # This is always sql#sslCert.
748 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
749 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
750 "instance": "A String", # Name of the database instance.
751 "cert": "A String", # PEM representation.
752 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
753 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
754 "selfLink": "A String", # The URI of this resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800755 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700756 "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
757 "settings": { # Database instance settings. # The user settings.
758 "databaseFlags": [ # The database flags passed to the instance at startup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700759 { # Database flags for Cloud SQL instances.
760 "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700761 "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
762 },
763 ],
764 "kind": "sql#settings", # This is always sql#settings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700765 "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.
766 "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values:
767 # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility.
768 # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
769 # For more information, see Overview of the High Availability Configuration.
770 "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700771 "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700772 "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later).
773 # Learn more.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700774 "day": 42, # day of week (1-7), starting on Monday.
775 "hour": 42, # hour of day - 0 to 23.
776 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700777 "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700778 "A String",
779 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700780 "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values:
781 # ALWAYS: The instance is on, and remains so even in the absence of connection requests.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700782 # NEVER: The instance is off; it is not activated, even if a connection request arrives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700783 # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700784 "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance.
785 "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration.
786 "enabled": True or False, # Whether this configuration is enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700787 "replicationLogArchivingEnabled": True or False, # Reserved for future use.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700788 "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700789 "location": "A String", # The location of the backup.
790 "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700791 },
792 "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700793 "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700794 "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not.
795 "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
796 { # An entry for an Access Control list.
797 "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
798 "kind": "sql#aclEntry", # This is always sql#aclEntry.
799 "value": "A String", # The whitelisted value for the access control list.
800 "name": "A String", # An optional label to identify this entry.
801 },
802 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700803 "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700804 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700805 "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings.
806 "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair.
807 "a_key": "A String", # An individual label entry, composed of a key and a value.
808 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700809 "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not.
810 "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700811 "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700812 "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
813 "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances.
814 "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700815 "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
816 "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700817 "kind": "sql#locationPreference", # This is always sql#locationPreference.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700818 "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700819 "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
820 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700821 "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700822 },
823 "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700824 "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000825 "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800826 "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.
827 # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000828 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
829 "username": "A String", # The username for the replication connection.
830 "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration.
831 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
832 "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption.
833 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
834 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
835 "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats.
836 "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
837 "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump.
838 "password": "A String", # The password for the replication connection.
839 "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds.
840 },
841 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700842 "rootPassword": "A String", # Initial root password. Use only on creation.
Craig Citroe633be12015-03-02 13:40:36 -0800843 "selfLink": "A String", # The URI of this resource.
Craig Citroe633be12015-03-02 13:40:36 -0800844 }</pre>
845</div>
846
847<div class="method">
848 <code class="details" id="import_">import_(project, instance, body)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700849 <pre>Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
Craig Citroe633be12015-03-02 13:40:36 -0800850
851Args:
852 project: string, Project ID of the project that contains the instance. (required)
853 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
854 body: object, The request body. (required)
855 The object takes the form of:
856
857{ # Database instance import request.
858 "importContext": { # Database instance import context. # Contains details about the import operation.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400859 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700860 "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 -0800861 "fileType": "A String", # The file type for the specified uri.
862 # SQL: The file contains SQL statements.
863 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700864 "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.
865 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800866 "csvImportOptions": { # Options for importing data as CSV.
867 "table": "A String", # The table to which CSV data is imported.
868 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
869 "A String",
870 ],
871 },
872 },
873 }
874
875
876Returns:
877 An object of the form:
878
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700879 { # 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 -0800880 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
881 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400882 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700883 "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 -0800884 "fileType": "A String", # The file type for the specified uri.
885 # SQL: The file contains SQL statements.
886 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700887 "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.
888 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -0800889 "csvImportOptions": { # Options for importing data as CSV.
890 "table": "A String", # The table to which CSV data is imported.
891 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
892 "A String",
893 ],
894 },
895 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000896 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -0800897 "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.
898 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
899 "kind": "sql#exportContext", # This is always sql#exportContext.
900 "fileType": "A String", # The file type for the specified uri.
901 # SQL: The file contains SQL statements.
902 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700903 "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 -0800904 "csvExportOptions": { # Options for exporting data as CSV.
905 "selectQuery": "A String", # The select query used to extract the data.
906 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700907 "databases": [ # Databases to be exported.
908 # 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.
909 # 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 -0800910 "A String",
911 ],
912 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700913 "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 -0800914 "A String",
915 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700916 "mysqlExportOptions": { # Options for exporting from MySQL.
917 "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.
918 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800919 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -0800920 },
921 },
922 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
923 "targetProject": "A String", # The project ID of the target instance related to this operation.
924 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000925 "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 -0400926 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -0800927 "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 +0000928 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
929 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -0800930 "errors": [ # The list of errors encountered while processing this operation.
931 { # Database instance operation error.
932 "kind": "sql#operationError", # This is always sql#operationError.
933 "code": "A String", # Identifies the specific error that occurred.
934 "message": "A String", # Additional information about the error encountered.
935 },
936 ],
937 },
938 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
939 "selfLink": "A String", # The URI of this resource.
940 "user": "A String", # The email address of the user who initiated this operation.
941 }</pre>
942</div>
943
944<div class="method">
945 <code class="details" id="insert">insert(project, body)</code>
946 <pre>Creates a new Cloud SQL instance.
947
948Args:
949 project: string, Project ID of the project to which the newly created Cloud SQL instances should belong. (required)
950 body: object, The request body. (required)
951 The object takes the form of:
952
953{ # A Cloud SQL instance resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700954 "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only.
955 # SECOND_GEN: Second Generation instance or PostgreSQL instance.
956 # EXTERNAL: A database server that is not managed by Google.
957 # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation.
958 "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700959 "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
960 "ipAddresses": [ # The assigned IP addresses for the instance.
961 { # Database instance IP Mapping.
962 "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
963 "ipAddress": "A String", # The IP address assigned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700964 "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700965 },
966 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700967 "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700968 "instanceType": "A String", # The instance type. This can be one of the following.
969 # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
970 # ON_PREMISES_INSTANCE: An instance running on the customer's premises.
971 # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
972 "maxDiskSize": "A String", # The maximum disk size of the instance in bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700973 "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances.
974 "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration.
975 "kmsKeyName": "A String", # KMS key resource name
976 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700977 "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension.
978 "A String",
979 ],
980 "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700981 "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances.
982 "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk
983 "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus.
984 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700985 "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following.
986 # RUNNABLE: The instance is running, or is ready to run when accessed.
987 # SUSPENDED: The instance is not available, for example due to problems with billing.
988 # PENDING_CREATE: The instance is being created.
989 # MAINTENANCE: The instance is down for maintenance.
990 # FAILED: The instance creation failed.
991 # UNKNOWN_STATE: The state of the instance is unknown.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700992 "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.
993 "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700994 "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances.
995 "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700996 "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700997 },
998 "replicaNames": [ # The replicas of the instance.
999 "A String",
1000 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001001 "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances.
1002 "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration.
1003 "hostPort": "A String", # The host and port of the on-premises instance in host:port format
1004 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001005 "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings.
Craig Citroe633be12015-03-02 13:40:36 -08001006 "kind": "sql#instance", # This is always sql#instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001007 "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID.
1008 "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
1009 "serverCaCert": { # SslCerts Resource # SSL configuration.
1010 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
1011 "kind": "sql#sslCert", # This is always sql#sslCert.
1012 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
1013 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
1014 "instance": "A String", # Name of the database instance.
1015 "cert": "A String", # PEM representation.
1016 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1017 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
1018 "selfLink": "A String", # The URI of this resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001019 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001020 "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
1021 "settings": { # Database instance settings. # The user settings.
1022 "databaseFlags": [ # The database flags passed to the instance at startup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001023 { # Database flags for Cloud SQL instances.
1024 "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001025 "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
1026 },
1027 ],
1028 "kind": "sql#settings", # This is always sql#settings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001029 "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.
1030 "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values:
1031 # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility.
1032 # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
1033 # For more information, see Overview of the High Availability Configuration.
1034 "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001035 "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001036 "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later).
1037 # Learn more.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001038 "day": 42, # day of week (1-7), starting on Monday.
1039 "hour": 42, # hour of day - 0 to 23.
1040 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001041 "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001042 "A String",
1043 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001044 "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values:
1045 # ALWAYS: The instance is on, and remains so even in the absence of connection requests.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001046 # NEVER: The instance is off; it is not activated, even if a connection request arrives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001047 # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001048 "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance.
1049 "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration.
1050 "enabled": True or False, # Whether this configuration is enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001051 "replicationLogArchivingEnabled": True or False, # Reserved for future use.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001052 "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001053 "location": "A String", # The location of the backup.
1054 "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001055 },
1056 "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001057 "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001058 "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not.
1059 "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
1060 { # An entry for an Access Control list.
1061 "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1062 "kind": "sql#aclEntry", # This is always sql#aclEntry.
1063 "value": "A String", # The whitelisted value for the access control list.
1064 "name": "A String", # An optional label to identify this entry.
1065 },
1066 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001067 "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001068 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001069 "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings.
1070 "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair.
1071 "a_key": "A String", # An individual label entry, composed of a key and a value.
1072 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001073 "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not.
1074 "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001075 "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001076 "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
1077 "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances.
1078 "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001079 "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
1080 "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001081 "kind": "sql#locationPreference", # This is always sql#locationPreference.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001082 "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001083 "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
1084 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001085 "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001086 },
1087 "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001088 "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001089 "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001090 "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.
1091 # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001092 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
1093 "username": "A String", # The username for the replication connection.
1094 "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration.
1095 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
1096 "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption.
1097 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
1098 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
1099 "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats.
1100 "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
1101 "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump.
1102 "password": "A String", # The password for the replication connection.
1103 "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds.
1104 },
1105 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001106 "rootPassword": "A String", # Initial root password. Use only on creation.
Craig Citroe633be12015-03-02 13:40:36 -08001107 "selfLink": "A String", # The URI of this resource.
Craig Citroe633be12015-03-02 13:40:36 -08001108 }
1109
1110
1111Returns:
1112 An object of the form:
1113
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001114 { # 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 -08001115 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1116 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001117 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001118 "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 -08001119 "fileType": "A String", # The file type for the specified uri.
1120 # SQL: The file contains SQL statements.
1121 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001122 "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.
1123 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001124 "csvImportOptions": { # Options for importing data as CSV.
1125 "table": "A String", # The table to which CSV data is imported.
1126 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1127 "A String",
1128 ],
1129 },
1130 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001131 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001132 "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.
1133 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1134 "kind": "sql#exportContext", # This is always sql#exportContext.
1135 "fileType": "A String", # The file type for the specified uri.
1136 # SQL: The file contains SQL statements.
1137 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001138 "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 -08001139 "csvExportOptions": { # Options for exporting data as CSV.
1140 "selectQuery": "A String", # The select query used to extract the data.
1141 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001142 "databases": [ # Databases to be exported.
1143 # 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.
1144 # 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 -08001145 "A String",
1146 ],
1147 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001148 "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 -08001149 "A String",
1150 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001151 "mysqlExportOptions": { # Options for exporting from MySQL.
1152 "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.
1153 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001154 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08001155 },
1156 },
1157 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1158 "targetProject": "A String", # The project ID of the target instance related to this operation.
1159 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001160 "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 -04001161 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001162 "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 +00001163 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1164 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08001165 "errors": [ # The list of errors encountered while processing this operation.
1166 { # Database instance operation error.
1167 "kind": "sql#operationError", # This is always sql#operationError.
1168 "code": "A String", # Identifies the specific error that occurred.
1169 "message": "A String", # Additional information about the error encountered.
1170 },
1171 ],
1172 },
1173 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1174 "selfLink": "A String", # The URI of this resource.
1175 "user": "A String", # The email address of the user who initiated this operation.
1176 }</pre>
1177</div>
1178
1179<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001180 <code class="details" id="list">list(project, maxResults=None, pageToken=None, filter=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -08001181 <pre>Lists instances under a given project in the alphabetical order of the instance name.
1182
1183Args:
1184 project: string, Project ID of the project for which to list Cloud SQL instances. (required)
Craig Citroe633be12015-03-02 13:40:36 -08001185 maxResults: integer, The maximum number of results to return per response.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001186 pageToken: string, A previously-returned page token representing part of the larger set of results to view.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001187 filter: string, An expression for filtering the results of the request, such as by name or label.
Craig Citroe633be12015-03-02 13:40:36 -08001188
1189Returns:
1190 An object of the form:
1191
1192 { # Database instances list response.
1193 "nextPageToken": "A String", # The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
1194 "items": [ # List of database instance resources.
1195 { # A Cloud SQL instance resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001196 "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only.
1197 # SECOND_GEN: Second Generation instance or PostgreSQL instance.
1198 # EXTERNAL: A database server that is not managed by Google.
1199 # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation.
1200 "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001201 "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
1202 "ipAddresses": [ # The assigned IP addresses for the instance.
1203 { # Database instance IP Mapping.
1204 "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
1205 "ipAddress": "A String", # The IP address assigned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001206 "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001207 },
1208 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001209 "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001210 "instanceType": "A String", # The instance type. This can be one of the following.
1211 # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
1212 # ON_PREMISES_INSTANCE: An instance running on the customer's premises.
1213 # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
1214 "maxDiskSize": "A String", # The maximum disk size of the instance in bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001215 "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances.
1216 "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration.
1217 "kmsKeyName": "A String", # KMS key resource name
1218 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001219 "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension.
1220 "A String",
1221 ],
1222 "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001223 "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances.
1224 "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk
1225 "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus.
1226 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001227 "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following.
1228 # RUNNABLE: The instance is running, or is ready to run when accessed.
1229 # SUSPENDED: The instance is not available, for example due to problems with billing.
1230 # PENDING_CREATE: The instance is being created.
1231 # MAINTENANCE: The instance is down for maintenance.
1232 # FAILED: The instance creation failed.
1233 # UNKNOWN_STATE: The state of the instance is unknown.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001234 "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.
1235 "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001236 "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances.
1237 "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001238 "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001239 },
1240 "replicaNames": [ # The replicas of the instance.
1241 "A String",
1242 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001243 "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances.
1244 "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration.
1245 "hostPort": "A String", # The host and port of the on-premises instance in host:port format
1246 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001247 "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings.
Craig Citroe633be12015-03-02 13:40:36 -08001248 "kind": "sql#instance", # This is always sql#instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001249 "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID.
1250 "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
1251 "serverCaCert": { # SslCerts Resource # SSL configuration.
1252 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
1253 "kind": "sql#sslCert", # This is always sql#sslCert.
1254 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
1255 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
1256 "instance": "A String", # Name of the database instance.
1257 "cert": "A String", # PEM representation.
1258 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1259 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
1260 "selfLink": "A String", # The URI of this resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001261 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001262 "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
1263 "settings": { # Database instance settings. # The user settings.
1264 "databaseFlags": [ # The database flags passed to the instance at startup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001265 { # Database flags for Cloud SQL instances.
1266 "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001267 "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
1268 },
1269 ],
1270 "kind": "sql#settings", # This is always sql#settings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001271 "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.
1272 "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values:
1273 # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility.
1274 # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
1275 # For more information, see Overview of the High Availability Configuration.
1276 "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001277 "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001278 "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later).
1279 # Learn more.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001280 "day": 42, # day of week (1-7), starting on Monday.
1281 "hour": 42, # hour of day - 0 to 23.
1282 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001283 "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001284 "A String",
1285 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001286 "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values:
1287 # ALWAYS: The instance is on, and remains so even in the absence of connection requests.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001288 # NEVER: The instance is off; it is not activated, even if a connection request arrives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001289 # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001290 "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance.
1291 "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration.
1292 "enabled": True or False, # Whether this configuration is enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001293 "replicationLogArchivingEnabled": True or False, # Reserved for future use.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001294 "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001295 "location": "A String", # The location of the backup.
1296 "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001297 },
1298 "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001299 "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001300 "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not.
1301 "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
1302 { # An entry for an Access Control list.
1303 "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1304 "kind": "sql#aclEntry", # This is always sql#aclEntry.
1305 "value": "A String", # The whitelisted value for the access control list.
1306 "name": "A String", # An optional label to identify this entry.
1307 },
1308 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001309 "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001310 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001311 "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings.
1312 "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair.
1313 "a_key": "A String", # An individual label entry, composed of a key and a value.
1314 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001315 "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not.
1316 "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001317 "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001318 "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
1319 "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances.
1320 "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001321 "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
1322 "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001323 "kind": "sql#locationPreference", # This is always sql#locationPreference.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001324 "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001325 "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
1326 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001327 "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001328 },
1329 "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001330 "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001331 "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001332 "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.
1333 # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001334 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
1335 "username": "A String", # The username for the replication connection.
1336 "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration.
1337 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
1338 "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption.
1339 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
1340 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
1341 "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats.
1342 "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
1343 "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump.
1344 "password": "A String", # The password for the replication connection.
1345 "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds.
1346 },
1347 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001348 "rootPassword": "A String", # Initial root password. Use only on creation.
Craig Citroe633be12015-03-02 13:40:36 -08001349 "selfLink": "A String", # The URI of this resource.
Craig Citroe633be12015-03-02 13:40:36 -08001350 },
1351 ],
1352 "kind": "sql#instancesList", # This is always sql#instancesList.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001353 "warnings": [ # List of warnings that ocurred while handling the request.
1354 { # An Admin API warning message.
1355 "message": "A String", # The warning message.
1356 "code": "A String", # Code to uniquely identify the warning type.
1357 },
1358 ],
1359 }</pre>
1360</div>
1361
1362<div class="method">
1363 <code class="details" id="listServerCas">listServerCas(project, instance)</code>
1364 <pre>Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.
1365
1366Args:
1367 project: string, Project ID of the project that contains the instance. (required)
1368 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1369
1370Returns:
1371 An object of the form:
1372
1373 { # Instances ListServerCas response.
1374 "kind": "sql#instancesListServerCas", # This is always sql#instancesListServerCas.
1375 "certs": [ # List of server CA certificates for the instance.
1376 { # SslCerts Resource
1377 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
1378 "kind": "sql#sslCert", # This is always sql#sslCert.
1379 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
1380 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
1381 "instance": "A String", # Name of the database instance.
1382 "cert": "A String", # PEM representation.
1383 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1384 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
1385 "selfLink": "A String", # The URI of this resource.
1386 },
1387 ],
1388 "activeVersion": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001389 }</pre>
1390</div>
1391
1392<div class="method">
1393 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1394 <pre>Retrieves the next page of results.
1395
1396Args:
1397 previous_request: The request for the previous page. (required)
1398 previous_response: The response from the request for the previous page. (required)
1399
1400Returns:
1401 A request object that you can call 'execute()' on to request the next
1402 page. Returns None if there are no more items in the collection.
1403 </pre>
1404</div>
1405
1406<div class="method">
1407 <code class="details" id="patch">patch(project, instance, body)</code>
1408 <pre>Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.
1409
1410Args:
1411 project: string, Project ID of the project that contains the instance. (required)
1412 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1413 body: object, The request body. (required)
1414 The object takes the form of:
1415
1416{ # A Cloud SQL instance resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001417 "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only.
1418 # SECOND_GEN: Second Generation instance or PostgreSQL instance.
1419 # EXTERNAL: A database server that is not managed by Google.
1420 # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation.
1421 "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001422 "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
1423 "ipAddresses": [ # The assigned IP addresses for the instance.
1424 { # Database instance IP Mapping.
1425 "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
1426 "ipAddress": "A String", # The IP address assigned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001427 "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001428 },
1429 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001430 "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001431 "instanceType": "A String", # The instance type. This can be one of the following.
1432 # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
1433 # ON_PREMISES_INSTANCE: An instance running on the customer's premises.
1434 # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
1435 "maxDiskSize": "A String", # The maximum disk size of the instance in bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001436 "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances.
1437 "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration.
1438 "kmsKeyName": "A String", # KMS key resource name
1439 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001440 "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension.
1441 "A String",
1442 ],
1443 "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001444 "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances.
1445 "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk
1446 "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus.
1447 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001448 "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following.
1449 # RUNNABLE: The instance is running, or is ready to run when accessed.
1450 # SUSPENDED: The instance is not available, for example due to problems with billing.
1451 # PENDING_CREATE: The instance is being created.
1452 # MAINTENANCE: The instance is down for maintenance.
1453 # FAILED: The instance creation failed.
1454 # UNKNOWN_STATE: The state of the instance is unknown.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001455 "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.
1456 "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001457 "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances.
1458 "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001459 "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001460 },
1461 "replicaNames": [ # The replicas of the instance.
1462 "A String",
1463 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001464 "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances.
1465 "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration.
1466 "hostPort": "A String", # The host and port of the on-premises instance in host:port format
1467 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001468 "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings.
Craig Citroe633be12015-03-02 13:40:36 -08001469 "kind": "sql#instance", # This is always sql#instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001470 "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID.
1471 "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
1472 "serverCaCert": { # SslCerts Resource # SSL configuration.
1473 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
1474 "kind": "sql#sslCert", # This is always sql#sslCert.
1475 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
1476 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
1477 "instance": "A String", # Name of the database instance.
1478 "cert": "A String", # PEM representation.
1479 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1480 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
1481 "selfLink": "A String", # The URI of this resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001482 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001483 "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
1484 "settings": { # Database instance settings. # The user settings.
1485 "databaseFlags": [ # The database flags passed to the instance at startup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001486 { # Database flags for Cloud SQL instances.
1487 "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001488 "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
1489 },
1490 ],
1491 "kind": "sql#settings", # This is always sql#settings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001492 "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.
1493 "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values:
1494 # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility.
1495 # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
1496 # For more information, see Overview of the High Availability Configuration.
1497 "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001498 "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001499 "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later).
1500 # Learn more.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001501 "day": 42, # day of week (1-7), starting on Monday.
1502 "hour": 42, # hour of day - 0 to 23.
1503 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001504 "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001505 "A String",
1506 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001507 "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values:
1508 # ALWAYS: The instance is on, and remains so even in the absence of connection requests.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001509 # NEVER: The instance is off; it is not activated, even if a connection request arrives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001510 # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001511 "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance.
1512 "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration.
1513 "enabled": True or False, # Whether this configuration is enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001514 "replicationLogArchivingEnabled": True or False, # Reserved for future use.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001515 "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001516 "location": "A String", # The location of the backup.
1517 "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001518 },
1519 "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001520 "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001521 "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not.
1522 "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
1523 { # An entry for an Access Control list.
1524 "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1525 "kind": "sql#aclEntry", # This is always sql#aclEntry.
1526 "value": "A String", # The whitelisted value for the access control list.
1527 "name": "A String", # An optional label to identify this entry.
1528 },
1529 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001530 "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001531 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001532 "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings.
1533 "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair.
1534 "a_key": "A String", # An individual label entry, composed of a key and a value.
1535 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001536 "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not.
1537 "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001538 "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001539 "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
1540 "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances.
1541 "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001542 "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
1543 "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001544 "kind": "sql#locationPreference", # This is always sql#locationPreference.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001545 "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001546 "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
1547 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001548 "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001549 },
1550 "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001551 "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001552 "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001553 "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.
1554 # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001555 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
1556 "username": "A String", # The username for the replication connection.
1557 "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration.
1558 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
1559 "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption.
1560 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
1561 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
1562 "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats.
1563 "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
1564 "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump.
1565 "password": "A String", # The password for the replication connection.
1566 "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds.
1567 },
1568 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001569 "rootPassword": "A String", # Initial root password. Use only on creation.
Craig Citroe633be12015-03-02 13:40:36 -08001570 "selfLink": "A String", # The URI of this resource.
Craig Citroe633be12015-03-02 13:40:36 -08001571 }
1572
1573
1574Returns:
1575 An object of the form:
1576
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001577 { # 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 -08001578 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1579 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001580 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001581 "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 -08001582 "fileType": "A String", # The file type for the specified uri.
1583 # SQL: The file contains SQL statements.
1584 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001585 "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.
1586 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001587 "csvImportOptions": { # Options for importing data as CSV.
1588 "table": "A String", # The table to which CSV data is imported.
1589 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1590 "A String",
1591 ],
1592 },
1593 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001594 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001595 "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.
1596 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1597 "kind": "sql#exportContext", # This is always sql#exportContext.
1598 "fileType": "A String", # The file type for the specified uri.
1599 # SQL: The file contains SQL statements.
1600 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001601 "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 -08001602 "csvExportOptions": { # Options for exporting data as CSV.
1603 "selectQuery": "A String", # The select query used to extract the data.
1604 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001605 "databases": [ # Databases to be exported.
1606 # 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.
1607 # 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 -08001608 "A String",
1609 ],
1610 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001611 "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 -08001612 "A String",
1613 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001614 "mysqlExportOptions": { # Options for exporting from MySQL.
1615 "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.
1616 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001617 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08001618 },
1619 },
1620 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1621 "targetProject": "A String", # The project ID of the target instance related to this operation.
1622 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001623 "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 -04001624 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001625 "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 +00001626 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1627 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08001628 "errors": [ # The list of errors encountered while processing this operation.
1629 { # Database instance operation error.
1630 "kind": "sql#operationError", # This is always sql#operationError.
1631 "code": "A String", # Identifies the specific error that occurred.
1632 "message": "A String", # Additional information about the error encountered.
1633 },
1634 ],
1635 },
1636 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1637 "selfLink": "A String", # The URI of this resource.
1638 "user": "A String", # The email address of the user who initiated this operation.
1639 }</pre>
1640</div>
1641
1642<div class="method">
1643 <code class="details" id="promoteReplica">promoteReplica(project, instance)</code>
1644 <pre>Promotes the read replica instance to be a stand-alone Cloud SQL instance.
1645
1646Args:
1647 project: string, ID of the project that contains the read replica. (required)
1648 instance: string, Cloud SQL read replica instance name. (required)
1649
1650Returns:
1651 An object of the form:
1652
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001653 { # 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 -08001654 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1655 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001656 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001657 "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 -08001658 "fileType": "A String", # The file type for the specified uri.
1659 # SQL: The file contains SQL statements.
1660 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001661 "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.
1662 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001663 "csvImportOptions": { # Options for importing data as CSV.
1664 "table": "A String", # The table to which CSV data is imported.
1665 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1666 "A String",
1667 ],
1668 },
1669 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001670 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001671 "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.
1672 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1673 "kind": "sql#exportContext", # This is always sql#exportContext.
1674 "fileType": "A String", # The file type for the specified uri.
1675 # SQL: The file contains SQL statements.
1676 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001677 "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 -08001678 "csvExportOptions": { # Options for exporting data as CSV.
1679 "selectQuery": "A String", # The select query used to extract the data.
1680 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001681 "databases": [ # Databases to be exported.
1682 # 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.
1683 # 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 -08001684 "A String",
1685 ],
1686 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001687 "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 -08001688 "A String",
1689 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001690 "mysqlExportOptions": { # Options for exporting from MySQL.
1691 "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.
1692 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001693 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08001694 },
1695 },
1696 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1697 "targetProject": "A String", # The project ID of the target instance related to this operation.
1698 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001699 "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 -04001700 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001701 "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 +00001702 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1703 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08001704 "errors": [ # The list of errors encountered while processing this operation.
1705 { # Database instance operation error.
1706 "kind": "sql#operationError", # This is always sql#operationError.
1707 "code": "A String", # Identifies the specific error that occurred.
1708 "message": "A String", # Additional information about the error encountered.
1709 },
1710 ],
1711 },
1712 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1713 "selfLink": "A String", # The URI of this resource.
1714 "user": "A String", # The email address of the user who initiated this operation.
1715 }</pre>
1716</div>
1717
1718<div class="method">
1719 <code class="details" id="resetSslConfig">resetSslConfig(project, instance)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001720 <pre>Deletes all client certificates and generates a new server SSL certificate for the instance.
Craig Citroe633be12015-03-02 13:40:36 -08001721
1722Args:
1723 project: string, Project ID of the project that contains the instance. (required)
1724 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1725
1726Returns:
1727 An object of the form:
1728
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001729 { # 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 -08001730 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1731 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001732 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001733 "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 -08001734 "fileType": "A String", # The file type for the specified uri.
1735 # SQL: The file contains SQL statements.
1736 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001737 "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.
1738 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001739 "csvImportOptions": { # Options for importing data as CSV.
1740 "table": "A String", # The table to which CSV data is imported.
1741 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1742 "A String",
1743 ],
1744 },
1745 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001746 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001747 "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.
1748 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1749 "kind": "sql#exportContext", # This is always sql#exportContext.
1750 "fileType": "A String", # The file type for the specified uri.
1751 # SQL: The file contains SQL statements.
1752 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001753 "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 -08001754 "csvExportOptions": { # Options for exporting data as CSV.
1755 "selectQuery": "A String", # The select query used to extract the data.
1756 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001757 "databases": [ # Databases to be exported.
1758 # 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.
1759 # 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 -08001760 "A String",
1761 ],
1762 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001763 "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 -08001764 "A String",
1765 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001766 "mysqlExportOptions": { # Options for exporting from MySQL.
1767 "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.
1768 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001769 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08001770 },
1771 },
1772 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1773 "targetProject": "A String", # The project ID of the target instance related to this operation.
1774 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001775 "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 -04001776 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001777 "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 +00001778 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1779 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08001780 "errors": [ # The list of errors encountered while processing this operation.
1781 { # Database instance operation error.
1782 "kind": "sql#operationError", # This is always sql#operationError.
1783 "code": "A String", # Identifies the specific error that occurred.
1784 "message": "A String", # Additional information about the error encountered.
1785 },
1786 ],
1787 },
1788 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1789 "selfLink": "A String", # The URI of this resource.
1790 "user": "A String", # The email address of the user who initiated this operation.
1791 }</pre>
1792</div>
1793
1794<div class="method">
1795 <code class="details" id="restart">restart(project, instance)</code>
1796 <pre>Restarts a Cloud SQL instance.
1797
1798Args:
1799 project: string, Project ID of the project that contains the instance to be restarted. (required)
1800 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1801
1802Returns:
1803 An object of the form:
1804
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001805 { # 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 -08001806 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1807 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001808 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001809 "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 -08001810 "fileType": "A String", # The file type for the specified uri.
1811 # SQL: The file contains SQL statements.
1812 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001813 "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.
1814 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001815 "csvImportOptions": { # Options for importing data as CSV.
1816 "table": "A String", # The table to which CSV data is imported.
1817 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1818 "A String",
1819 ],
1820 },
1821 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001822 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001823 "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.
1824 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1825 "kind": "sql#exportContext", # This is always sql#exportContext.
1826 "fileType": "A String", # The file type for the specified uri.
1827 # SQL: The file contains SQL statements.
1828 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001829 "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 -08001830 "csvExportOptions": { # Options for exporting data as CSV.
1831 "selectQuery": "A String", # The select query used to extract the data.
1832 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001833 "databases": [ # Databases to be exported.
1834 # 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.
1835 # 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 -08001836 "A String",
1837 ],
1838 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001839 "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 -08001840 "A String",
1841 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001842 "mysqlExportOptions": { # Options for exporting from MySQL.
1843 "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.
1844 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001845 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08001846 },
1847 },
1848 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1849 "targetProject": "A String", # The project ID of the target instance related to this operation.
1850 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001851 "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 -04001852 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08001853 "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 +00001854 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1855 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08001856 "errors": [ # The list of errors encountered while processing this operation.
1857 { # Database instance operation error.
1858 "kind": "sql#operationError", # This is always sql#operationError.
1859 "code": "A String", # Identifies the specific error that occurred.
1860 "message": "A String", # Additional information about the error encountered.
1861 },
1862 ],
1863 },
1864 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1865 "selfLink": "A String", # The URI of this resource.
1866 "user": "A String", # The email address of the user who initiated this operation.
1867 }</pre>
1868</div>
1869
1870<div class="method">
1871 <code class="details" id="restoreBackup">restoreBackup(project, instance, body)</code>
1872 <pre>Restores a backup of a Cloud SQL instance.
1873
1874Args:
1875 project: string, Project ID of the project that contains the instance. (required)
1876 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1877 body: object, The request body. (required)
1878 The object takes the form of:
1879
1880{ # Database instance restore backup request.
1881 "restoreBackupContext": { # Database instance restore from backup context. # Parameters required to perform the restore backup operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001882 "instanceId": "A String", # The ID of the instance that the backup was taken from.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001883 "project": "A String", # The full project ID of the source instance.
Craig Citroe633be12015-03-02 13:40:36 -08001884 "kind": "sql#restoreBackupContext", # This is always sql#restoreBackupContext.
1885 "backupRunId": "A String", # The ID of the backup run to restore from.
1886 },
1887 }
1888
1889
1890Returns:
1891 An object of the form:
1892
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001893 { # 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 -08001894 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1895 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001896 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001897 "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 -08001898 "fileType": "A String", # The file type for the specified uri.
1899 # SQL: The file contains SQL statements.
1900 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001901 "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.
1902 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08001903 "csvImportOptions": { # Options for importing data as CSV.
1904 "table": "A String", # The table to which CSV data is imported.
1905 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1906 "A String",
1907 ],
1908 },
1909 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001910 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08001911 "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.
1912 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1913 "kind": "sql#exportContext", # This is always sql#exportContext.
1914 "fileType": "A String", # The file type for the specified uri.
1915 # SQL: The file contains SQL statements.
1916 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001917 "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 -08001918 "csvExportOptions": { # Options for exporting data as CSV.
1919 "selectQuery": "A String", # The select query used to extract the data.
1920 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001921 "databases": [ # Databases to be exported.
1922 # 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.
1923 # 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 -08001924 "A String",
1925 ],
1926 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001927 "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 -08001928 "A String",
1929 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001930 "mysqlExportOptions": { # Options for exporting from MySQL.
1931 "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.
1932 },
1933 "schemaOnly": True or False, # Export only schemas.
1934 },
1935 },
1936 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1937 "targetProject": "A String", # The project ID of the target instance related to this operation.
1938 "targetId": "A String", # Name of the database instance related to this operation.
1939 "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 .
1940 "targetLink": "A String",
1941 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1942 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
1943 "kind": "sql#operationErrors", # This is always sql#operationErrors.
1944 "errors": [ # The list of errors encountered while processing this operation.
1945 { # Database instance operation error.
1946 "kind": "sql#operationError", # This is always sql#operationError.
1947 "code": "A String", # Identifies the specific error that occurred.
1948 "message": "A String", # Additional information about the error encountered.
1949 },
1950 ],
1951 },
1952 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
1953 "selfLink": "A String", # The URI of this resource.
1954 "user": "A String", # The email address of the user who initiated this operation.
1955 }</pre>
1956</div>
1957
1958<div class="method">
1959 <code class="details" id="rotateServerCa">rotateServerCa(project, instance, body)</code>
1960 <pre>Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
1961
1962Args:
1963 project: string, Project ID of the project that contains the instance. (required)
1964 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
1965 body: object, The request body. (required)
1966 The object takes the form of:
1967
1968{ # Rotate Server CA request.
1969 "rotateServerCaContext": { # Instance rotate server CA context. # Contains details about the rotate server CA operation.
1970 "kind": "sql#rotateServerCaContext", # This is always sql#rotateServerCaContext.
1971 "nextVersion": "A String", # The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server CA version.
1972 },
1973 }
1974
1975
1976Returns:
1977 An object of the form:
1978
1979 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
1980 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
1981 "importContext": { # Database instance import context. # The context for import operation, if applicable.
1982 "kind": "sql#importContext", # This is always sql#importContext.
1983 "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.
1984 "fileType": "A String", # The file type for the specified uri.
1985 # SQL: The file contains SQL statements.
1986 # CSV: The file contains CSV data.
1987 "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.
1988 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
1989 "csvImportOptions": { # Options for importing data as CSV.
1990 "table": "A String", # The table to which CSV data is imported.
1991 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
1992 "A String",
1993 ],
1994 },
1995 },
1996 "kind": "sql#operation", # This is always sql#operation.
1997 "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.
1998 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
1999 "kind": "sql#exportContext", # This is always sql#exportContext.
2000 "fileType": "A String", # The file type for the specified uri.
2001 # SQL: The file contains SQL statements.
2002 # CSV: The file contains CSV data.
2003 "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.
2004 "csvExportOptions": { # Options for exporting data as CSV.
2005 "selectQuery": "A String", # The select query used to extract the data.
2006 },
2007 "databases": [ # Databases to be exported.
2008 # 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.
2009 # 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.
2010 "A String",
2011 ],
2012 "sqlExportOptions": { # Options for exporting data as SQL statements.
2013 "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.
2014 "A String",
2015 ],
2016 "mysqlExportOptions": { # Options for exporting from MySQL.
2017 "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.
2018 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002019 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08002020 },
2021 },
2022 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2023 "targetProject": "A String", # The project ID of the target instance related to this operation.
2024 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002025 "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 -04002026 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08002027 "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 +00002028 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
2029 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08002030 "errors": [ # The list of errors encountered while processing this operation.
2031 { # Database instance operation error.
2032 "kind": "sql#operationError", # This is always sql#operationError.
2033 "code": "A String", # Identifies the specific error that occurred.
2034 "message": "A String", # Additional information about the error encountered.
2035 },
2036 ],
2037 },
2038 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2039 "selfLink": "A String", # The URI of this resource.
2040 "user": "A String", # The email address of the user who initiated this operation.
2041 }</pre>
2042</div>
2043
2044<div class="method">
2045 <code class="details" id="startReplica">startReplica(project, instance)</code>
2046 <pre>Starts the replication in the read replica instance.
2047
2048Args:
2049 project: string, ID of the project that contains the read replica. (required)
2050 instance: string, Cloud SQL read replica instance name. (required)
2051
2052Returns:
2053 An object of the form:
2054
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002055 { # 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 -08002056 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
2057 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002058 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002059 "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 -08002060 "fileType": "A String", # The file type for the specified uri.
2061 # SQL: The file contains SQL statements.
2062 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002063 "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.
2064 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08002065 "csvImportOptions": { # Options for importing data as CSV.
2066 "table": "A String", # The table to which CSV data is imported.
2067 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
2068 "A String",
2069 ],
2070 },
2071 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002072 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08002073 "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.
2074 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
2075 "kind": "sql#exportContext", # This is always sql#exportContext.
2076 "fileType": "A String", # The file type for the specified uri.
2077 # SQL: The file contains SQL statements.
2078 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002079 "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 -08002080 "csvExportOptions": { # Options for exporting data as CSV.
2081 "selectQuery": "A String", # The select query used to extract the data.
2082 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002083 "databases": [ # Databases to be exported.
2084 # 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.
2085 # 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 -08002086 "A String",
2087 ],
2088 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002089 "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 -08002090 "A String",
2091 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002092 "mysqlExportOptions": { # Options for exporting from MySQL.
2093 "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.
2094 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002095 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08002096 },
2097 },
2098 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2099 "targetProject": "A String", # The project ID of the target instance related to this operation.
2100 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002101 "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 -04002102 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08002103 "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 +00002104 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
2105 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08002106 "errors": [ # The list of errors encountered while processing this operation.
2107 { # Database instance operation error.
2108 "kind": "sql#operationError", # This is always sql#operationError.
2109 "code": "A String", # Identifies the specific error that occurred.
2110 "message": "A String", # Additional information about the error encountered.
2111 },
2112 ],
2113 },
2114 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2115 "selfLink": "A String", # The URI of this resource.
2116 "user": "A String", # The email address of the user who initiated this operation.
2117 }</pre>
2118</div>
2119
2120<div class="method">
2121 <code class="details" id="stopReplica">stopReplica(project, instance)</code>
2122 <pre>Stops the replication in the read replica instance.
2123
2124Args:
2125 project: string, ID of the project that contains the read replica. (required)
2126 instance: string, Cloud SQL read replica instance name. (required)
2127
2128Returns:
2129 An object of the form:
2130
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002131 { # 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 -08002132 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
2133 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002134 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002135 "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 -08002136 "fileType": "A String", # The file type for the specified uri.
2137 # SQL: The file contains SQL statements.
2138 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002139 "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.
2140 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08002141 "csvImportOptions": { # Options for importing data as CSV.
2142 "table": "A String", # The table to which CSV data is imported.
2143 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
2144 "A String",
2145 ],
2146 },
2147 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002148 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08002149 "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.
2150 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
2151 "kind": "sql#exportContext", # This is always sql#exportContext.
2152 "fileType": "A String", # The file type for the specified uri.
2153 # SQL: The file contains SQL statements.
2154 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002155 "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 -08002156 "csvExportOptions": { # Options for exporting data as CSV.
2157 "selectQuery": "A String", # The select query used to extract the data.
2158 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002159 "databases": [ # Databases to be exported.
2160 # 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.
2161 # 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 -08002162 "A String",
2163 ],
2164 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002165 "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 -08002166 "A String",
2167 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002168 "mysqlExportOptions": { # Options for exporting from MySQL.
2169 "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.
2170 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002171 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08002172 },
2173 },
2174 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2175 "targetProject": "A String", # The project ID of the target instance related to this operation.
2176 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002177 "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 -04002178 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08002179 "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 +00002180 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
2181 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08002182 "errors": [ # The list of errors encountered while processing this operation.
2183 { # Database instance operation error.
2184 "kind": "sql#operationError", # This is always sql#operationError.
2185 "code": "A String", # Identifies the specific error that occurred.
2186 "message": "A String", # Additional information about the error encountered.
2187 },
2188 ],
2189 },
2190 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2191 "selfLink": "A String", # The URI of this resource.
2192 "user": "A String", # The email address of the user who initiated this operation.
2193 }</pre>
2194</div>
2195
2196<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002197 <code class="details" id="truncateLog">truncateLog(project, instance, body)</code>
2198 <pre>Truncate MySQL general and slow query log tables
2199
2200Args:
2201 project: string, Project ID of the Cloud SQL project. (required)
2202 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
2203 body: object, The request body. (required)
2204 The object takes the form of:
2205
2206{ # Instance truncate log request.
2207 "truncateLogContext": { # Database Instance truncate log context. # Contains details about the truncate log operation.
2208 "logType": "A String", # The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE.
2209 "kind": "sql#truncateLogContext", # This is always sql#truncateLogContext.
2210 },
2211 }
2212
2213
2214Returns:
2215 An object of the form:
2216
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002217 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002218 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
2219 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002220 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002221 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002222 "fileType": "A String", # The file type for the specified uri.
2223 # SQL: The file contains SQL statements.
2224 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002225 "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.
2226 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002227 "csvImportOptions": { # Options for importing data as CSV.
2228 "table": "A String", # The table to which CSV data is imported.
2229 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
2230 "A String",
2231 ],
2232 },
2233 },
2234 "kind": "sql#operation", # This is always sql#operation.
2235 "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.
2236 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
2237 "kind": "sql#exportContext", # This is always sql#exportContext.
2238 "fileType": "A String", # The file type for the specified uri.
2239 # SQL: The file contains SQL statements.
2240 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002241 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002242 "csvExportOptions": { # Options for exporting data as CSV.
2243 "selectQuery": "A String", # The select query used to extract the data.
2244 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002245 "databases": [ # Databases to be exported.
2246 # 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.
2247 # 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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002248 "A String",
2249 ],
2250 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002251 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002252 "A String",
2253 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002254 "mysqlExportOptions": { # Options for exporting from MySQL.
2255 "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.
2256 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002257 "schemaOnly": True or False, # Export only schemas.
2258 },
2259 },
2260 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2261 "targetProject": "A String", # The project ID of the target instance related to this operation.
2262 "targetId": "A String", # Name of the database instance related to this operation.
2263 "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 -04002264 "targetLink": "A String",
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002265 "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2266 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
2267 "kind": "sql#operationErrors", # This is always sql#operationErrors.
2268 "errors": [ # The list of errors encountered while processing this operation.
2269 { # Database instance operation error.
2270 "kind": "sql#operationError", # This is always sql#operationError.
2271 "code": "A String", # Identifies the specific error that occurred.
2272 "message": "A String", # Additional information about the error encountered.
2273 },
2274 ],
2275 },
2276 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2277 "selfLink": "A String", # The URI of this resource.
2278 "user": "A String", # The email address of the user who initiated this operation.
2279 }</pre>
2280</div>
2281
2282<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -08002283 <code class="details" id="update">update(project, instance, body)</code>
2284 <pre>Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.
2285
2286Args:
2287 project: string, Project ID of the project that contains the instance. (required)
2288 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
2289 body: object, The request body. (required)
2290 The object takes the form of:
2291
2292{ # A Cloud SQL instance resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002293 "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only.
2294 # SECOND_GEN: Second Generation instance or PostgreSQL instance.
2295 # EXTERNAL: A database server that is not managed by Google.
2296 # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation.
2297 "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002298 "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances.
2299 "ipAddresses": [ # The assigned IP addresses for the instance.
2300 { # Database instance IP Mapping.
2301 "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
2302 "ipAddress": "A String", # The IP address assigned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002303 "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002304 },
2305 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002306 "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002307 "instanceType": "A String", # The instance type. This can be one of the following.
2308 # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master.
2309 # ON_PREMISES_INSTANCE: An instance running on the customer's premises.
2310 # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica.
2311 "maxDiskSize": "A String", # The maximum disk size of the instance in bytes.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002312 "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances.
2313 "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration.
2314 "kmsKeyName": "A String", # KMS key resource name
2315 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002316 "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension.
2317 "A String",
2318 ],
2319 "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002320 "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances.
2321 "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk
2322 "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus.
2323 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002324 "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following.
2325 # RUNNABLE: The instance is running, or is ready to run when accessed.
2326 # SUSPENDED: The instance is not available, for example due to problems with billing.
2327 # PENDING_CREATE: The instance is being created.
2328 # MAINTENANCE: The instance is down for maintenance.
2329 # FAILED: The instance creation failed.
2330 # UNKNOWN_STATE: The state of the instance is unknown.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002331 "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead.
2332 "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002333 "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances.
2334 "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07002335 "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002336 },
2337 "replicaNames": [ # The replicas of the instance.
2338 "A String",
2339 ],
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002340 "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances.
2341 "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration.
2342 "hostPort": "A String", # The host and port of the on-premises instance in host:port format
2343 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07002344 "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings.
Craig Citroe633be12015-03-02 13:40:36 -08002345 "kind": "sql#instance", # This is always sql#instance.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002346 "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID.
2347 "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances.
2348 "serverCaCert": { # SslCerts Resource # SSL configuration.
2349 "certSerialNumber": "A String", # Serial number, as extracted from the certificate.
2350 "kind": "sql#sslCert", # This is always sql#sslCert.
2351 "sha1Fingerprint": "A String", # Sha1 Fingerprint.
2352 "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+.
2353 "instance": "A String", # Name of the database instance.
2354 "cert": "A String", # PEM representation.
2355 "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2356 "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z
2357 "selfLink": "A String", # The URI of this resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002358 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002359 "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation.
2360 "settings": { # Database instance settings. # The user settings.
2361 "databaseFlags": [ # The database flags passed to the instance at startup.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002362 { # Database flags for Cloud SQL instances.
2363 "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002364 "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
2365 },
2366 ],
2367 "kind": "sql#settings", # This is always sql#settings.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002368 "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances.
2369 "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values:
2370 # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility.
2371 # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
2372 # For more information, see Overview of the High Availability Configuration.
2373 "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002374 "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002375 "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later).
2376 # Learn more.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002377 "day": 42, # day of week (1-7), starting on Monday.
2378 "hour": 42, # hour of day - 0 to 23.
2379 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002380 "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002381 "A String",
2382 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002383 "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values:
2384 # ALWAYS: The instance is on, and remains so even in the absence of connection requests.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07002385 # NEVER: The instance is off; it is not activated, even if a connection request arrives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002386 # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002387 "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance.
2388 "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration.
2389 "enabled": True or False, # Whether this configuration is enabled.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002390 "replicationLogArchivingEnabled": True or False, # Reserved for future use.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002391 "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002392 "location": "A String", # The location of the backup.
2393 "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002394 },
2395 "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002396 "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002397 "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not.
2398 "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
2399 { # An entry for an Access Control list.
2400 "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2401 "kind": "sql#aclEntry", # This is always sql#aclEntry.
2402 "value": "A String", # The whitelisted value for the access control list.
2403 "name": "A String", # An optional label to identify this entry.
2404 },
2405 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002406 "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002407 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002408 "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings.
2409 "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair.
2410 "a_key": "A String", # An individual label entry, composed of a key and a value.
2411 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002412 "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not.
2413 "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002414 "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002415 "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances.
2416 "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances.
2417 "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002418 "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances.
2419 "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002420 "kind": "sql#locationPreference", # This is always sql#locationPreference.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002421 "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002422 "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance.
2423 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002424 "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07002425 },
2426 "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002427 "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002428 "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002429 "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance.
2430 # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002431 "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory.
2432 "username": "A String", # The username for the replication connection.
2433 "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration.
2434 "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate.
2435 "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption.
2436 "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate.
2437 "clientCertificate": "A String", # PEM representation of the slave's x509 certificate.
2438 "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats.
2439 "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake.
2440 "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump.
2441 "password": "A String", # The password for the replication connection.
2442 "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds.
2443 },
2444 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002445 "rootPassword": "A String", # Initial root password. Use only on creation.
Craig Citroe633be12015-03-02 13:40:36 -08002446 "selfLink": "A String", # The URI of this resource.
Craig Citroe633be12015-03-02 13:40:36 -08002447 }
2448
2449
2450Returns:
2451 An object of the form:
2452
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002453 { # 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 -08002454 "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
2455 "importContext": { # Database instance import context. # The context for import operation, if applicable.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04002456 "kind": "sql#importContext", # This is always sql#importContext.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002457 "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 -08002458 "fileType": "A String", # The file type for the specified uri.
2459 # SQL: The file contains SQL statements.
2460 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002461 "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.
2462 "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only.
Craig Citroe633be12015-03-02 13:40:36 -08002463 "csvImportOptions": { # Options for importing data as CSV.
2464 "table": "A String", # The table to which CSV data is imported.
2465 "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
2466 "A String",
2467 ],
2468 },
2469 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002470 "kind": "sql#operation", # This is always sql#operation.
Craig Citroe633be12015-03-02 13:40:36 -08002471 "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.
2472 "exportContext": { # Database instance export context. # The context for export operation, if applicable.
2473 "kind": "sql#exportContext", # This is always sql#exportContext.
2474 "fileType": "A String", # The file type for the specified uri.
2475 # SQL: The file contains SQL statements.
2476 # CSV: The file contains CSV data.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002477 "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 -08002478 "csvExportOptions": { # Options for exporting data as CSV.
2479 "selectQuery": "A String", # The select query used to extract the data.
2480 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002481 "databases": [ # Databases to be exported.
2482 # 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.
2483 # 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 -08002484 "A String",
2485 ],
2486 "sqlExportOptions": { # Options for exporting data as SQL statements.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002487 "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 -08002488 "A String",
2489 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002490 "mysqlExportOptions": { # Options for exporting from MySQL.
2491 "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.
2492 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002493 "schemaOnly": True or False, # Export only schemas.
Craig Citroe633be12015-03-02 13:40:36 -08002494 },
2495 },
2496 "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2497 "targetProject": "A String", # The project ID of the target instance related to this operation.
2498 "targetId": "A String", # Name of the database instance related to this operation.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002499 "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 -04002500 "targetLink": "A String",
Craig Citroe633be12015-03-02 13:40:36 -08002501 "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 +00002502 "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
2503 "kind": "sql#operationErrors", # This is always sql#operationErrors.
Craig Citroe633be12015-03-02 13:40:36 -08002504 "errors": [ # The list of errors encountered while processing this operation.
2505 { # Database instance operation error.
2506 "kind": "sql#operationError", # This is always sql#operationError.
2507 "code": "A String", # Identifies the specific error that occurred.
2508 "message": "A String", # Additional information about the error encountered.
2509 },
2510 ],
2511 },
2512 "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
2513 "selfLink": "A String", # The URI of this resource.
2514 "user": "A String", # The email address of the user who initiated this operation.
2515 }</pre>
2516</div>
2517
2518</body></html>