blob: c87c4af910fa50b28fed5755f70576b9fcde6716 [file] [log] [blame]
yoshi-code-bota36e3b12021-07-27 00:20:26 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="sqladmin_v1.html">Cloud SQL Admin API</a> . <a href="sqladmin_v1.databases.html">databases</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(project, instance, database, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a database from a Cloud SQL instance.</p>
83<p class="toc_element">
84 <code><a href="#get">get(project, instance, database, x__xgafv=None)</a></code></p>
85<p class="firstline">Retrieves a resource containing information about a database inside a Cloud SQL instance.</p>
86<p class="toc_element">
87 <code><a href="#insert">insert(project, instance, body=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Inserts a resource containing information about a database inside a Cloud SQL instance.</p>
89<p class="toc_element">
90 <code><a href="#list">list(project, instance, x__xgafv=None)</a></code></p>
91<p class="firstline">Lists databases in the specified Cloud SQL instance.</p>
92<p class="toc_element">
93 <code><a href="#patch">patch(project, instance, database, body=None, x__xgafv=None)</a></code></p>
94<p class="firstline">Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.</p>
95<p class="toc_element">
96 <code><a href="#update">update(project, instance, database, body=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Updates a resource containing information about a database inside a Cloud SQL instance.</p>
98<h3>Method Details</h3>
99<div class="method">
100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
105 <code class="details" id="delete">delete(project, instance, database, x__xgafv=None)</code>
106 <pre>Deletes a database from a Cloud SQL instance.
107
108Args:
109 project: string, Project ID of the project that contains the instance. (required)
110 instance: string, Database instance ID. This does not include the project ID. (required)
111 database: string, Name of the database to be deleted in the instance. (required)
112 x__xgafv: string, V1 error format.
113 Allowed values
114 1 - v1 error format
115 2 - v2 error format
116
117Returns:
118 An object of the form:
119
120 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
121 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
122 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
123 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
124 },
125 &quot;endTime&quot;: &quot;A String&quot;, # The time this operation finished in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
126 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
127 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
128 { # Database instance operation error.
129 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
130 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
131 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
132 },
133 ],
134 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
135 },
136 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
137 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
138 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
139 },
140 &quot;databases&quot;: [ # Databases to be exported. **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. **PostgreSQL instances:** You must specify one database to be exported. If **fileType** is **CSV**, this database must match the one specified in the **csvExportOptions.selectQuery** property. **SQL Server instances:** You must specify one database to be exported, and the **fileType** must be **BAK**.
141 &quot;A String&quot;,
142 ],
143 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data. **BAK**: The file contains backup data for a SQL Server instance.
144 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
145 &quot;offload&quot;: True or False, # Option for export offload.
146 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
147 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
148 &quot;masterData&quot;: 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, and --set-gtid-purged is set to ON. If set to **2**, the CHANGE MASTER TO statement is written as a SQL comment and has no effect. If set to any value other than **1**, --set-gtid-purged is set to OFF.
149 },
150 &quot;schemaOnly&quot;: True or False, # Export only schemas.
151 &quot;tables&quot;: [ # 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.
152 &quot;A String&quot;,
153 ],
154 },
155 &quot;uri&quot;: &quot;A String&quot;, # 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 request succeeds, but the operation fails. If **fileType** is **SQL** and the filename ends with .gz, the contents are compressed.
156 },
157 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
158 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
159 &quot;encryptionOptions&quot;: {
160 &quot;certPath&quot;: &quot;A String&quot;, # Path to the Certificate (.cer) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
161 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
162 &quot;pvkPath&quot;: &quot;A String&quot;, # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
163 },
164 },
165 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
166 &quot;columns&quot;: [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
167 &quot;A String&quot;,
168 ],
169 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
170 },
171 &quot;database&quot;: &quot;A String&quot;, # 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.
172 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data.
173 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
174 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
175 &quot;uri&quot;: &quot;A String&quot;, # 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.
176 },
177 &quot;insertTime&quot;: &quot;A String&quot;, # The time this operation was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
178 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
179 &quot;name&quot;: &quot;A String&quot;, # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
180 &quot;operationType&quot;: &quot;A String&quot;, # 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**
181 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
182 &quot;startTime&quot;: &quot;A String&quot;, # The time this operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
183 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: **PENDING** **RUNNING** **DONE** **SQL_OPERATION_STATUS_UNSPECIFIED**
184 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
185 &quot;targetLink&quot;: &quot;A String&quot;,
186 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
187 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
188}</pre>
189</div>
190
191<div class="method">
192 <code class="details" id="get">get(project, instance, database, x__xgafv=None)</code>
193 <pre>Retrieves a resource containing information about a database inside a Cloud SQL instance.
194
195Args:
196 project: string, Project ID of the project that contains the instance. (required)
197 instance: string, Database instance ID. This does not include the project ID. (required)
198 database: string, Name of the database in the instance. (required)
199 x__xgafv: string, V1 error format.
200 Allowed values
201 1 - v1 error format
202 2 - v2 error format
203
204Returns:
205 An object of the form:
206
207 { # Represents a SQL database on the Cloud SQL instance.
208 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
209 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
210 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
211 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
212 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
213 &quot;name&quot;: &quot;A String&quot;, # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
214 &quot;project&quot;: &quot;A String&quot;, # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
215 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
216 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
217 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
218 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
219 },
220}</pre>
221</div>
222
223<div class="method">
224 <code class="details" id="insert">insert(project, instance, body=None, x__xgafv=None)</code>
225 <pre>Inserts a resource containing information about a database inside a Cloud SQL instance.
226
227Args:
228 project: string, Project ID of the project that contains the instance. (required)
229 instance: string, Database instance ID. This does not include the project ID. (required)
230 body: object, The request body.
231 The object takes the form of:
232
233{ # Represents a SQL database on the Cloud SQL instance.
234 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
235 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
236 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
237 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
238 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
239 &quot;name&quot;: &quot;A String&quot;, # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
240 &quot;project&quot;: &quot;A String&quot;, # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
241 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
242 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
243 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
244 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
245 },
246}
247
248 x__xgafv: string, V1 error format.
249 Allowed values
250 1 - v1 error format
251 2 - v2 error format
252
253Returns:
254 An object of the form:
255
256 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
257 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
258 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
259 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
260 },
261 &quot;endTime&quot;: &quot;A String&quot;, # The time this operation finished in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
262 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
263 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
264 { # Database instance operation error.
265 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
266 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
267 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
268 },
269 ],
270 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
271 },
272 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
273 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
274 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
275 },
276 &quot;databases&quot;: [ # Databases to be exported. **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. **PostgreSQL instances:** You must specify one database to be exported. If **fileType** is **CSV**, this database must match the one specified in the **csvExportOptions.selectQuery** property. **SQL Server instances:** You must specify one database to be exported, and the **fileType** must be **BAK**.
277 &quot;A String&quot;,
278 ],
279 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data. **BAK**: The file contains backup data for a SQL Server instance.
280 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
281 &quot;offload&quot;: True or False, # Option for export offload.
282 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
283 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
284 &quot;masterData&quot;: 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, and --set-gtid-purged is set to ON. If set to **2**, the CHANGE MASTER TO statement is written as a SQL comment and has no effect. If set to any value other than **1**, --set-gtid-purged is set to OFF.
285 },
286 &quot;schemaOnly&quot;: True or False, # Export only schemas.
287 &quot;tables&quot;: [ # 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.
288 &quot;A String&quot;,
289 ],
290 },
291 &quot;uri&quot;: &quot;A String&quot;, # 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 request succeeds, but the operation fails. If **fileType** is **SQL** and the filename ends with .gz, the contents are compressed.
292 },
293 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
294 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
295 &quot;encryptionOptions&quot;: {
296 &quot;certPath&quot;: &quot;A String&quot;, # Path to the Certificate (.cer) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
297 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
298 &quot;pvkPath&quot;: &quot;A String&quot;, # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
299 },
300 },
301 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
302 &quot;columns&quot;: [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
303 &quot;A String&quot;,
304 ],
305 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
306 },
307 &quot;database&quot;: &quot;A String&quot;, # 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.
308 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data.
309 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
310 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
311 &quot;uri&quot;: &quot;A String&quot;, # 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.
312 },
313 &quot;insertTime&quot;: &quot;A String&quot;, # The time this operation was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
314 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
315 &quot;name&quot;: &quot;A String&quot;, # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
316 &quot;operationType&quot;: &quot;A String&quot;, # 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**
317 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
318 &quot;startTime&quot;: &quot;A String&quot;, # The time this operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
319 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: **PENDING** **RUNNING** **DONE** **SQL_OPERATION_STATUS_UNSPECIFIED**
320 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
321 &quot;targetLink&quot;: &quot;A String&quot;,
322 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
323 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
324}</pre>
325</div>
326
327<div class="method">
328 <code class="details" id="list">list(project, instance, x__xgafv=None)</code>
329 <pre>Lists databases in the specified Cloud SQL instance.
330
331Args:
332 project: string, Project ID of the project that contains the instance. (required)
333 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
334 x__xgafv: string, V1 error format.
335 Allowed values
336 1 - v1 error format
337 2 - v2 error format
338
339Returns:
340 An object of the form:
341
342 { # Database list response.
343 &quot;items&quot;: [ # List of database resources in the instance.
344 { # Represents a SQL database on the Cloud SQL instance.
345 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
346 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
347 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
348 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
349 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
350 &quot;name&quot;: &quot;A String&quot;, # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
351 &quot;project&quot;: &quot;A String&quot;, # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
352 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
353 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
354 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
355 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
356 },
357 },
358 ],
359 &quot;kind&quot;: &quot;A String&quot;, # This is always *sql#databasesList*.
360}</pre>
361</div>
362
363<div class="method">
364 <code class="details" id="patch">patch(project, instance, database, body=None, x__xgafv=None)</code>
365 <pre>Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
366
367Args:
368 project: string, Project ID of the project that contains the instance. (required)
369 instance: string, Database instance ID. This does not include the project ID. (required)
370 database: string, Name of the database to be updated in the instance. (required)
371 body: object, The request body.
372 The object takes the form of:
373
374{ # Represents a SQL database on the Cloud SQL instance.
375 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
376 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
377 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
378 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
379 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
380 &quot;name&quot;: &quot;A String&quot;, # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
381 &quot;project&quot;: &quot;A String&quot;, # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
382 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
383 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
384 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
385 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
386 },
387}
388
389 x__xgafv: string, V1 error format.
390 Allowed values
391 1 - v1 error format
392 2 - v2 error format
393
394Returns:
395 An object of the form:
396
397 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
398 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
399 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
400 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
401 },
402 &quot;endTime&quot;: &quot;A String&quot;, # The time this operation finished in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
403 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
404 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
405 { # Database instance operation error.
406 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
407 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
408 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
409 },
410 ],
411 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
412 },
413 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
414 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
415 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
416 },
417 &quot;databases&quot;: [ # Databases to be exported. **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. **PostgreSQL instances:** You must specify one database to be exported. If **fileType** is **CSV**, this database must match the one specified in the **csvExportOptions.selectQuery** property. **SQL Server instances:** You must specify one database to be exported, and the **fileType** must be **BAK**.
418 &quot;A String&quot;,
419 ],
420 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data. **BAK**: The file contains backup data for a SQL Server instance.
421 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
422 &quot;offload&quot;: True or False, # Option for export offload.
423 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
424 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
425 &quot;masterData&quot;: 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, and --set-gtid-purged is set to ON. If set to **2**, the CHANGE MASTER TO statement is written as a SQL comment and has no effect. If set to any value other than **1**, --set-gtid-purged is set to OFF.
426 },
427 &quot;schemaOnly&quot;: True or False, # Export only schemas.
428 &quot;tables&quot;: [ # 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.
429 &quot;A String&quot;,
430 ],
431 },
432 &quot;uri&quot;: &quot;A String&quot;, # 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 request succeeds, but the operation fails. If **fileType** is **SQL** and the filename ends with .gz, the contents are compressed.
433 },
434 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
435 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
436 &quot;encryptionOptions&quot;: {
437 &quot;certPath&quot;: &quot;A String&quot;, # Path to the Certificate (.cer) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
438 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
439 &quot;pvkPath&quot;: &quot;A String&quot;, # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
440 },
441 },
442 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
443 &quot;columns&quot;: [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
444 &quot;A String&quot;,
445 ],
446 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
447 },
448 &quot;database&quot;: &quot;A String&quot;, # 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.
449 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data.
450 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
451 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
452 &quot;uri&quot;: &quot;A String&quot;, # 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.
453 },
454 &quot;insertTime&quot;: &quot;A String&quot;, # The time this operation was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
455 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
456 &quot;name&quot;: &quot;A String&quot;, # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
457 &quot;operationType&quot;: &quot;A String&quot;, # 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**
458 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
459 &quot;startTime&quot;: &quot;A String&quot;, # The time this operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
460 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: **PENDING** **RUNNING** **DONE** **SQL_OPERATION_STATUS_UNSPECIFIED**
461 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
462 &quot;targetLink&quot;: &quot;A String&quot;,
463 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
464 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
465}</pre>
466</div>
467
468<div class="method">
469 <code class="details" id="update">update(project, instance, database, body=None, x__xgafv=None)</code>
470 <pre>Updates a resource containing information about a database inside a Cloud SQL instance.
471
472Args:
473 project: string, Project ID of the project that contains the instance. (required)
474 instance: string, Database instance ID. This does not include the project ID. (required)
475 database: string, Name of the database to be updated in the instance. (required)
476 body: object, The request body.
477 The object takes the form of:
478
479{ # Represents a SQL database on the Cloud SQL instance.
480 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
481 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
482 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
483 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
484 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
485 &quot;name&quot;: &quot;A String&quot;, # The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
486 &quot;project&quot;: &quot;A String&quot;, # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable.
487 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
488 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
489 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
490 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
491 },
492}
493
494 x__xgafv: string, V1 error format.
495 Allowed values
496 1 - v1 error format
497 2 - v2 error format
498
499Returns:
500 An object of the form:
501
502 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
503 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
504 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
505 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
506 },
507 &quot;endTime&quot;: &quot;A String&quot;, # The time this operation finished in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
508 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
509 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
510 { # Database instance operation error.
511 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
512 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
513 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
514 },
515 ],
516 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
517 },
518 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
519 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
520 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
521 },
522 &quot;databases&quot;: [ # Databases to be exported. **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. **PostgreSQL instances:** You must specify one database to be exported. If **fileType** is **CSV**, this database must match the one specified in the **csvExportOptions.selectQuery** property. **SQL Server instances:** You must specify one database to be exported, and the **fileType** must be **BAK**.
523 &quot;A String&quot;,
524 ],
525 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data. **BAK**: The file contains backup data for a SQL Server instance.
526 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
527 &quot;offload&quot;: True or False, # Option for export offload.
528 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
529 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
530 &quot;masterData&quot;: 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, and --set-gtid-purged is set to ON. If set to **2**, the CHANGE MASTER TO statement is written as a SQL comment and has no effect. If set to any value other than **1**, --set-gtid-purged is set to OFF.
531 },
532 &quot;schemaOnly&quot;: True or False, # Export only schemas.
533 &quot;tables&quot;: [ # 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.
534 &quot;A String&quot;,
535 ],
536 },
537 &quot;uri&quot;: &quot;A String&quot;, # 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 request succeeds, but the operation fails. If **fileType** is **SQL** and the filename ends with .gz, the contents are compressed.
538 },
539 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
540 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
541 &quot;encryptionOptions&quot;: {
542 &quot;certPath&quot;: &quot;A String&quot;, # Path to the Certificate (.cer) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
543 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
544 &quot;pvkPath&quot;: &quot;A String&quot;, # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the form **gs://bucketName/fileName**. The instance must have write permissions to the bucket and read access to the file.
545 },
546 },
547 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
548 &quot;columns&quot;: [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
549 &quot;A String&quot;,
550 ],
551 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
552 },
553 &quot;database&quot;: &quot;A String&quot;, # 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.
554 &quot;fileType&quot;: &quot;A String&quot;, # The file type for the specified uri. **SQL**: The file contains SQL statements. **CSV**: The file contains CSV data.
555 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
556 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
557 &quot;uri&quot;: &quot;A String&quot;, # 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.
558 },
559 &quot;insertTime&quot;: &quot;A String&quot;, # The time this operation was enqueued in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
560 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
561 &quot;name&quot;: &quot;A String&quot;, # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation.
562 &quot;operationType&quot;: &quot;A String&quot;, # 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**
563 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
564 &quot;startTime&quot;: &quot;A String&quot;, # The time this operation actually started in UTC timezone in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example **2012-11-15T16:19:00.094Z**.
565 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: **PENDING** **RUNNING** **DONE** **SQL_OPERATION_STATUS_UNSPECIFIED**
566 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
567 &quot;targetLink&quot;: &quot;A String&quot;,
568 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
569 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
570}</pre>
571</div>
572
573</body></html>