blob: 81c939f38a7cb2701d50544d30b020ce47e2692e [file] [log] [blame]
Craig Citroe633be12015-03-02 13:40:36 -08001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070075<h1><a href="sqladmin_v1beta4.html">Cloud SQL Admin API</a> . <a href="sqladmin_v1beta4.databases.html">databases</a></h1>
Craig Citroe633be12015-03-02 13:40:36 -080076<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#delete">delete(project, instance, database, x__xgafv=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070082<p class="firstline">Deletes a database from a Cloud SQL instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080083<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#get">get(project, instance, database, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070085<p class="firstline">Retrieves a resource containing information about a database inside a Cloud SQL instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080086<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#insert">insert(project, instance, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088<p class="firstline">Inserts a resource containing information about a database inside a Cloud SQL instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080089<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#list">list(project, instance, x__xgafv=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080091<p class="firstline">Lists databases in the specified Cloud SQL instance.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#patch">patch(project, instance, database, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094<p class="firstline">Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.</p>
Craig Citroe633be12015-03-02 13:40:36 -080095<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#update">update(project, instance, database, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097<p class="firstline">Updates a resource containing information about a database inside a Cloud SQL instance.</p>
Craig Citroe633be12015-03-02 13:40:36 -080098<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code class="details" id="delete">delete(project, instance, database, x__xgafv=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700106 <pre>Deletes a database from a Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800107
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)
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 x__xgafv: string, V1 error format.
113 Allowed values
114 1 - v1 error format
115 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800116
117Returns:
118 An object of the form:
119
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700120 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800121 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700123 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800124 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700125 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800126 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700130 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800131 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
132 },
133 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700134 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800135 },
136 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
yoshi-code-bot312da312021-09-21 00:22:28 -0700137 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700138 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
139 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
140 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
141 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800142 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800143 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700144 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800145 &quot;A String&quot;,
146 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700147 &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.
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700148 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800149 &quot;offload&quot;: True or False, # Option for export offload.
150 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
151 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
yoshi-code-bot312da312021-09-21 00:22:28 -0700152 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800153 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800154 &quot;schemaOnly&quot;: True or False, # Export only schemas.
155 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800156 &quot;A String&quot;,
157 ],
158 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700159 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800160 },
161 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
162 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
163 &quot;encryptionOptions&quot;: {
yoshi-code-bot312da312021-09-21 00:22:28 -0700164 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800165 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700166 &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.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800167 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800168 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800169 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
170 &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.
171 &quot;A String&quot;,
172 ],
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700173 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
174 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
175 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
176 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800177 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
178 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700179 &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.
180 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800181 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
yoshi-code-bot312da312021-09-21 00:22:28 -0700182 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
183 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800184 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700185 &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**.
186 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800187 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700188 &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**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800189 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
yoshi-code-bot312da312021-09-21 00:22:28 -0700190 &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**.
191 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: * **PENDING** * **RUNNING** * **DONE** * **SQL_OPERATION_STATUS_UNSPECIFIED**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800192 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
193 &quot;targetLink&quot;: &quot;A String&quot;,
194 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
195 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
196}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800197</div>
198
199<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 <code class="details" id="get">get(project, instance, database, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700201 <pre>Retrieves a resource containing information about a database inside a Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800202
203Args:
204 project: string, Project ID of the project that contains the instance. (required)
205 instance: string, Database instance ID. This does not include the project ID. (required)
206 database: string, Name of the database in the instance. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700207 x__xgafv: string, V1 error format.
208 Allowed values
209 1 - v1 error format
210 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800211
212Returns:
213 An object of the form:
214
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700215 { # Represents a SQL database on the Cloud SQL instance.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800216 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
217 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
218 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
219 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
yoshi-code-bot312da312021-09-21 00:22:28 -0700220 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800221 &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.
222 &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.
223 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
224 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
225 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
226 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
227 },
228}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800229</div>
230
231<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700232 <code class="details" id="insert">insert(project, instance, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700233 <pre>Inserts a resource containing information about a database inside a Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800234
235Args:
236 project: string, Project ID of the project that contains the instance. (required)
237 instance: string, Database instance ID. This does not include the project ID. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700238 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800239 The object takes the form of:
240
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700241{ # Represents a SQL database on the Cloud SQL instance.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800242 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
243 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
244 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
245 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
yoshi-code-bot312da312021-09-21 00:22:28 -0700246 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800247 &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.
248 &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.
249 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
250 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
251 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
252 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
253 },
254}
Craig Citroe633be12015-03-02 13:40:36 -0800255
Dan O'Mearadd494642020-05-01 07:42:23 -0700256 x__xgafv: string, V1 error format.
257 Allowed values
258 1 - v1 error format
259 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800260
261Returns:
262 An object of the form:
263
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700264 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800265 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
266 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
yoshi-code-bot312da312021-09-21 00:22:28 -0700267 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800268 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700269 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800270 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
271 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
272 { # Database instance operation error.
273 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
yoshi-code-bot312da312021-09-21 00:22:28 -0700274 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800275 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
276 },
277 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700278 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800279 },
280 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
yoshi-code-bot312da312021-09-21 00:22:28 -0700281 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700282 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
283 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
284 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
285 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800286 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800287 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700288 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800289 &quot;A String&quot;,
290 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700291 &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.
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700292 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800293 &quot;offload&quot;: True or False, # Option for export offload.
294 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
295 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
yoshi-code-bot312da312021-09-21 00:22:28 -0700296 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800297 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800298 &quot;schemaOnly&quot;: True or False, # Export only schemas.
299 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800300 &quot;A String&quot;,
301 ],
302 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700303 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800304 },
305 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
306 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
307 &quot;encryptionOptions&quot;: {
yoshi-code-bot312da312021-09-21 00:22:28 -0700308 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800309 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700310 &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.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800311 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800312 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800313 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
314 &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.
315 &quot;A String&quot;,
316 ],
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700317 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
318 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
319 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
320 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800321 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
322 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700323 &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.
324 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800325 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
yoshi-code-bot312da312021-09-21 00:22:28 -0700326 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
327 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800328 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700329 &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**.
330 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800331 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700332 &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**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800333 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
yoshi-code-bot312da312021-09-21 00:22:28 -0700334 &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**.
335 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: * **PENDING** * **RUNNING** * **DONE** * **SQL_OPERATION_STATUS_UNSPECIFIED**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800336 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
337 &quot;targetLink&quot;: &quot;A String&quot;,
338 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
339 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
340}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800341</div>
342
343<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700344 <code class="details" id="list">list(project, instance, x__xgafv=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800345 <pre>Lists databases in the specified Cloud SQL instance.
346
347Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700348 project: string, Project ID of the project that contains the instance. (required)
Craig Citroe633be12015-03-02 13:40:36 -0800349 instance: string, Cloud SQL instance ID. This does not include the project ID. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700350 x__xgafv: string, V1 error format.
351 Allowed values
352 1 - v1 error format
353 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800354
355Returns:
356 An object of the form:
357
358 { # Database list response.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800359 &quot;items&quot;: [ # List of database resources in the instance.
360 { # Represents a SQL database on the Cloud SQL instance.
361 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
362 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
363 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
364 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
yoshi-code-bot312da312021-09-21 00:22:28 -0700365 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800366 &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.
367 &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.
368 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
369 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
370 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
371 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
372 },
373 },
374 ],
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700375 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#databasesList**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800376}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800377</div>
378
379<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700380 <code class="details" id="patch">patch(project, instance, database, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700381 <pre>Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
Craig Citroe633be12015-03-02 13:40:36 -0800382
383Args:
384 project: string, Project ID of the project that contains the instance. (required)
385 instance: string, Database instance ID. This does not include the project ID. (required)
386 database: string, Name of the database to be updated in the instance. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700387 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800388 The object takes the form of:
389
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390{ # Represents a SQL database on the Cloud SQL instance.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800391 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
392 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
393 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
394 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
yoshi-code-bot312da312021-09-21 00:22:28 -0700395 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800396 &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.
397 &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.
398 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
399 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
400 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
401 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
402 },
403}
Craig Citroe633be12015-03-02 13:40:36 -0800404
Dan O'Mearadd494642020-05-01 07:42:23 -0700405 x__xgafv: string, V1 error format.
406 Allowed values
407 1 - v1 error format
408 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800409
410Returns:
411 An object of the form:
412
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700413 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800414 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
415 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
yoshi-code-bot312da312021-09-21 00:22:28 -0700416 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800417 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700418 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800419 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
420 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
421 { # Database instance operation error.
422 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
yoshi-code-bot312da312021-09-21 00:22:28 -0700423 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800424 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
425 },
426 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700427 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800428 },
429 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
yoshi-code-bot312da312021-09-21 00:22:28 -0700430 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700431 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
432 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
433 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
434 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800435 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800436 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700437 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800438 &quot;A String&quot;,
439 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700440 &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.
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700441 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800442 &quot;offload&quot;: True or False, # Option for export offload.
443 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
444 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
yoshi-code-bot312da312021-09-21 00:22:28 -0700445 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800446 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800447 &quot;schemaOnly&quot;: True or False, # Export only schemas.
448 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800449 &quot;A String&quot;,
450 ],
451 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700452 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800453 },
454 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
455 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
456 &quot;encryptionOptions&quot;: {
yoshi-code-bot312da312021-09-21 00:22:28 -0700457 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800458 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700459 &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.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800460 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800461 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800462 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
463 &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.
464 &quot;A String&quot;,
465 ],
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700466 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
467 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
468 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
469 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800470 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
471 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700472 &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.
473 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800474 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
yoshi-code-bot312da312021-09-21 00:22:28 -0700475 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
476 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800477 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700478 &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**.
479 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800480 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700481 &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**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800482 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
yoshi-code-bot312da312021-09-21 00:22:28 -0700483 &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**.
484 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: * **PENDING** * **RUNNING** * **DONE** * **SQL_OPERATION_STATUS_UNSPECIFIED**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800485 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
486 &quot;targetLink&quot;: &quot;A String&quot;,
487 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
488 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
489}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800490</div>
491
492<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700493 <code class="details" id="update">update(project, instance, database, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700494 <pre>Updates a resource containing information about a database inside a Cloud SQL instance.
Craig Citroe633be12015-03-02 13:40:36 -0800495
496Args:
497 project: string, Project ID of the project that contains the instance. (required)
498 instance: string, Database instance ID. This does not include the project ID. (required)
499 database: string, Name of the database to be updated in the instance. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700500 body: object, The request body.
Craig Citroe633be12015-03-02 13:40:36 -0800501 The object takes the form of:
502
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700503{ # Represents a SQL database on the Cloud SQL instance.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800504 &quot;charset&quot;: &quot;A String&quot;, # The Cloud SQL charset value.
505 &quot;collation&quot;: &quot;A String&quot;, # The Cloud SQL collation value.
506 &quot;etag&quot;: &quot;A String&quot;, # This field is deprecated and will be removed from a future version of the API.
507 &quot;instance&quot;: &quot;A String&quot;, # The name of the Cloud SQL instance. This does not include the project ID.
yoshi-code-bot312da312021-09-21 00:22:28 -0700508 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#database**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800509 &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.
510 &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.
511 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
512 &quot;sqlserverDatabaseDetails&quot;: { # Represents a Sql Server database on the Cloud SQL instance.
513 &quot;compatibilityLevel&quot;: 42, # The version of SQL Server with which the database is to be made compatible
514 &quot;recoveryModel&quot;: &quot;A String&quot;, # The recovery model of a SQL Server database
515 },
516}
Craig Citroe633be12015-03-02 13:40:36 -0800517
Dan O'Mearadd494642020-05-01 07:42:23 -0700518 x__xgafv: string, V1 error format.
519 Allowed values
520 1 - v1 error format
521 2 - v2 error format
Craig Citroe633be12015-03-02 13:40:36 -0800522
523Returns:
524 An object of the form:
525
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700526 { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800527 &quot;backupContext&quot;: { # Backup context. # The context for backup operation, if applicable.
528 &quot;backupId&quot;: &quot;A String&quot;, # The identifier of the backup.
yoshi-code-bot312da312021-09-21 00:22:28 -0700529 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#backupContext**.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800530 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700531 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800532 &quot;error&quot;: { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
533 &quot;errors&quot;: [ # The list of errors encountered while processing this operation.
534 { # Database instance operation error.
535 &quot;code&quot;: &quot;A String&quot;, # Identifies the specific error that occurred.
yoshi-code-bot312da312021-09-21 00:22:28 -0700536 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationError**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800537 &quot;message&quot;: &quot;A String&quot;, # Additional information about the error encountered.
538 },
539 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700540 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operationErrors**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800541 },
542 &quot;exportContext&quot;: { # Database instance export context. # The context for export operation, if applicable.
yoshi-code-bot312da312021-09-21 00:22:28 -0700543 &quot;csvExportOptions&quot;: { # Options for exporting data as CSV. **MySQL** and **PostgreSQL** instances only.
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700544 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
545 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
546 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
547 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800548 &quot;selectQuery&quot;: &quot;A String&quot;, # The select query used to extract the data.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800549 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700550 &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**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800551 &quot;A String&quot;,
552 ],
yoshi-code-bot312da312021-09-21 00:22:28 -0700553 &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.
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700554 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#exportContext**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800555 &quot;offload&quot;: True or False, # Option for export offload.
556 &quot;sqlExportOptions&quot;: { # Options for exporting data as SQL statements.
557 &quot;mysqlExportOptions&quot;: { # Options for exporting from MySQL.
yoshi-code-bot312da312021-09-21 00:22:28 -0700558 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800559 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800560 &quot;schemaOnly&quot;: True or False, # Export only schemas.
561 &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.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800562 &quot;A String&quot;,
563 ],
564 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700565 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800566 },
567 &quot;importContext&quot;: { # Database instance import context. # The context for import operation, if applicable.
568 &quot;bakImportOptions&quot;: { # Import parameters specific to SQL Server .BAK files
569 &quot;encryptionOptions&quot;: {
yoshi-code-bot312da312021-09-21 00:22:28 -0700570 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800571 &quot;pvkPassword&quot;: &quot;A String&quot;, # Password that encrypts the private key
yoshi-code-bot1c9dcfd2021-10-12 00:20:31 -0700572 &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.
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800573 },
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800574 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800575 &quot;csvImportOptions&quot;: { # Options for importing data as CSV.
576 &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.
577 &quot;A String&quot;,
578 ],
yoshi-code-bot2da5ed12021-09-07 00:20:27 -0700579 &quot;escapeCharacter&quot;: &quot;A String&quot;, # Specifies the character that should appear before a data character that needs to be escaped.
580 &quot;fieldsTerminatedBy&quot;: &quot;A String&quot;, # Specifies the character that separates columns within each row (line) of the file.
581 &quot;linesTerminatedBy&quot;: &quot;A String&quot;, # This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values.
582 &quot;quoteCharacter&quot;: &quot;A String&quot;, # Specifies the quoting character to be used when a data value is quoted.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800583 &quot;table&quot;: &quot;A String&quot;, # The table to which CSV data is imported.
584 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700585 &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.
586 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800587 &quot;importUser&quot;: &quot;A String&quot;, # The PostgreSQL user for this import operation. PostgreSQL instances only.
yoshi-code-bot312da312021-09-21 00:22:28 -0700588 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#importContext**.
589 &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.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800590 },
yoshi-code-bot312da312021-09-21 00:22:28 -0700591 &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**.
592 &quot;kind&quot;: &quot;A String&quot;, # This is always **sql#operation**.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800593 &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.
yoshi-code-bot312da312021-09-21 00:22:28 -0700594 &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**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800595 &quot;selfLink&quot;: &quot;A String&quot;, # The URI of this resource.
yoshi-code-bot312da312021-09-21 00:22:28 -0700596 &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**.
597 &quot;status&quot;: &quot;A String&quot;, # The status of an operation. Valid values are: * **PENDING** * **RUNNING** * **DONE** * **SQL_OPERATION_STATUS_UNSPECIFIED**
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800598 &quot;targetId&quot;: &quot;A String&quot;, # Name of the database instance related to this operation.
599 &quot;targetLink&quot;: &quot;A String&quot;,
600 &quot;targetProject&quot;: &quot;A String&quot;, # The project ID of the target instance related to this operation.
601 &quot;user&quot;: &quot;A String&quot;, # The email address of the user who initiated this operation.
602}</pre>
Craig Citroe633be12015-03-02 13:40:36 -0800603</div>
604
605</body></html>