Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 75 | <h1><a href="sqladmin_v1beta4.html">Cloud SQL Admin API</a> . <a href="sqladmin_v1beta4.instances.html">instances</a></h1> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 78 | <code><a href="#addServerCa">addServerCa(project, instance)</a></code></p> |
| 79 | <p class="firstline">Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.</p> |
| 80 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 81 | <code><a href="#clone">clone(project, instance, body)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 82 | <p class="firstline">Creates a Cloud SQL instance as a clone of the source instance.</p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 83 | <p class="toc_element"> |
| 84 | <code><a href="#delete">delete(project, instance)</a></code></p> |
| 85 | <p class="firstline">Deletes a Cloud SQL instance.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 87 | <code><a href="#demoteMaster">demoteMaster(project, instance, body)</a></code></p> |
| 88 | <p class="firstline">Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.</p> |
| 89 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 90 | <code><a href="#export">export(project, instance, body)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 91 | <p class="firstline">Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.</p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 92 | <p class="toc_element"> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 93 | <code><a href="#failover">failover(project, instance, body)</a></code></p> |
| 94 | <p class="firstline">Failover the instance to its failover replica instance.</p> |
| 95 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 96 | <code><a href="#get">get(project, instance)</a></code></p> |
| 97 | <p class="firstline">Retrieves a resource containing information about a Cloud SQL instance.</p> |
| 98 | <p class="toc_element"> |
| 99 | <code><a href="#import_">import_(project, instance, body)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 100 | <p class="firstline">Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.</p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 101 | <p class="toc_element"> |
| 102 | <code><a href="#insert">insert(project, body)</a></code></p> |
| 103 | <p class="firstline">Creates a new Cloud SQL instance.</p> |
| 104 | <p class="toc_element"> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 105 | <code><a href="#list">list(project, maxResults=None, pageToken=None, filter=None)</a></code></p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 106 | <p class="firstline">Lists instances under a given project in the alphabetical order of the instance name.</p> |
| 107 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 108 | <code><a href="#listServerCas">listServerCas(project, instance)</a></code></p> |
| 109 | <p class="firstline">Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.</p> |
| 110 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 111 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 112 | <p class="firstline">Retrieves the next page of results.</p> |
| 113 | <p class="toc_element"> |
| 114 | <code><a href="#patch">patch(project, instance, body)</a></code></p> |
| 115 | <p class="firstline">Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics.</p> |
| 116 | <p class="toc_element"> |
| 117 | <code><a href="#promoteReplica">promoteReplica(project, instance)</a></code></p> |
| 118 | <p class="firstline">Promotes the read replica instance to be a stand-alone Cloud SQL instance.</p> |
| 119 | <p class="toc_element"> |
| 120 | <code><a href="#resetSslConfig">resetSslConfig(project, instance)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 121 | <p class="firstline">Deletes all client certificates and generates a new server SSL certificate for the instance.</p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 122 | <p class="toc_element"> |
| 123 | <code><a href="#restart">restart(project, instance)</a></code></p> |
| 124 | <p class="firstline">Restarts a Cloud SQL instance.</p> |
| 125 | <p class="toc_element"> |
| 126 | <code><a href="#restoreBackup">restoreBackup(project, instance, body)</a></code></p> |
| 127 | <p class="firstline">Restores a backup of a Cloud SQL instance.</p> |
| 128 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 129 | <code><a href="#rotateServerCa">rotateServerCa(project, instance, body)</a></code></p> |
| 130 | <p class="firstline">Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.</p> |
| 131 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 132 | <code><a href="#startReplica">startReplica(project, instance)</a></code></p> |
| 133 | <p class="firstline">Starts the replication in the read replica instance.</p> |
| 134 | <p class="toc_element"> |
| 135 | <code><a href="#stopReplica">stopReplica(project, instance)</a></code></p> |
| 136 | <p class="firstline">Stops the replication in the read replica instance.</p> |
| 137 | <p class="toc_element"> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 138 | <code><a href="#truncateLog">truncateLog(project, instance, body)</a></code></p> |
| 139 | <p class="firstline">Truncate MySQL general and slow query log tables</p> |
| 140 | <p class="toc_element"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 141 | <code><a href="#update">update(project, instance, body)</a></code></p> |
| 142 | <p class="firstline">Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.</p> |
| 143 | <h3>Method Details</h3> |
| 144 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 145 | <code class="details" id="addServerCa">addServerCa(project, instance)</code> |
| 146 | <pre>Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 147 | |
| 148 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 149 | project: string, Project ID of the project that contains the instance. (required) |
| 150 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 151 | |
| 152 | Returns: |
| 153 | An object of the form: |
| 154 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 155 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 156 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 157 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 158 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 159 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 160 | "fileType": "A String", # The file type for the specified uri. |
| 161 | # SQL: The file contains SQL statements. |
| 162 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 163 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 164 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 165 | "csvImportOptions": { # Options for importing data as CSV. |
| 166 | "table": "A String", # The table to which CSV data is imported. |
| 167 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 168 | "A String", |
| 169 | ], |
| 170 | }, |
| 171 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 172 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 173 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 174 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 175 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 176 | "fileType": "A String", # The file type for the specified uri. |
| 177 | # SQL: The file contains SQL statements. |
| 178 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 179 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 180 | "csvExportOptions": { # Options for exporting data as CSV. |
| 181 | "selectQuery": "A String", # The select query used to extract the data. |
| 182 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 183 | "databases": [ # Databases to be exported. |
| 184 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 185 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 186 | "A String", |
| 187 | ], |
| 188 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 189 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 190 | "A String", |
| 191 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 192 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 193 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 194 | }, |
| 195 | "schemaOnly": True or False, # Export only schemas. |
| 196 | }, |
| 197 | }, |
| 198 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 199 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 200 | "targetId": "A String", # Name of the database instance related to this operation. |
| 201 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
| 202 | "targetLink": "A String", |
| 203 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 204 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 205 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
| 206 | "errors": [ # The list of errors encountered while processing this operation. |
| 207 | { # Database instance operation error. |
| 208 | "kind": "sql#operationError", # This is always sql#operationError. |
| 209 | "code": "A String", # Identifies the specific error that occurred. |
| 210 | "message": "A String", # Additional information about the error encountered. |
| 211 | }, |
| 212 | ], |
| 213 | }, |
| 214 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 215 | "selfLink": "A String", # The URI of this resource. |
| 216 | "user": "A String", # The email address of the user who initiated this operation. |
| 217 | }</pre> |
| 218 | </div> |
| 219 | |
| 220 | <div class="method"> |
| 221 | <code class="details" id="clone">clone(project, instance, body)</code> |
| 222 | <pre>Creates a Cloud SQL instance as a clone of the source instance. |
| 223 | |
| 224 | Args: |
| 225 | project: string, Project ID of the source as well as the clone Cloud SQL instance. (required) |
| 226 | instance: string, The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. (required) |
| 227 | body: object, The request body. (required) |
| 228 | The object takes the form of: |
| 229 | |
| 230 | { # Database instance clone request. |
| 231 | "cloneContext": { # Database instance clone context. # Contains details about the clone operation. |
| 232 | "binLogCoordinates": { # Binary log coordinates. # Binary log coordinates, if specified, identify the position up to which the source instance should be cloned. If not specified, the source instance is cloned up to the most recent binary log coordinates. |
| 233 | "binLogPosition": "A String", # Position (offset) within the binary log file. |
| 234 | "kind": "sql#binLogCoordinates", # This is always sql#binLogCoordinates. |
| 235 | "binLogFileName": "A String", # Name of the binary log file for a Cloud SQL instance. |
| 236 | }, |
| 237 | "kind": "sql#cloneContext", # This is always sql#cloneContext. |
| 238 | "pitrTimestampMs": "A String", # Reserved for future use. |
| 239 | "destinationInstanceName": "A String", # Name of the Cloud SQL instance to be created as a clone. |
| 240 | }, |
| 241 | } |
| 242 | |
| 243 | |
| 244 | Returns: |
| 245 | An object of the form: |
| 246 | |
| 247 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
| 248 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 249 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 250 | "kind": "sql#importContext", # This is always sql#importContext. |
| 251 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
| 252 | "fileType": "A String", # The file type for the specified uri. |
| 253 | # SQL: The file contains SQL statements. |
| 254 | # CSV: The file contains CSV data. |
| 255 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 256 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 257 | "csvImportOptions": { # Options for importing data as CSV. |
| 258 | "table": "A String", # The table to which CSV data is imported. |
| 259 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 260 | "A String", |
| 261 | ], |
| 262 | }, |
| 263 | }, |
| 264 | "kind": "sql#operation", # This is always sql#operation. |
| 265 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 266 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 267 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 268 | "fileType": "A String", # The file type for the specified uri. |
| 269 | # SQL: The file contains SQL statements. |
| 270 | # CSV: The file contains CSV data. |
| 271 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
| 272 | "csvExportOptions": { # Options for exporting data as CSV. |
| 273 | "selectQuery": "A String", # The select query used to extract the data. |
| 274 | }, |
| 275 | "databases": [ # Databases to be exported. |
| 276 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 277 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
| 278 | "A String", |
| 279 | ], |
| 280 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 281 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
| 282 | "A String", |
| 283 | ], |
| 284 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 285 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 286 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 287 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 288 | }, |
| 289 | }, |
| 290 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 291 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 292 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 293 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 294 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 295 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 296 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 297 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 298 | "errors": [ # The list of errors encountered while processing this operation. |
| 299 | { # Database instance operation error. |
| 300 | "kind": "sql#operationError", # This is always sql#operationError. |
| 301 | "code": "A String", # Identifies the specific error that occurred. |
| 302 | "message": "A String", # Additional information about the error encountered. |
| 303 | }, |
| 304 | ], |
| 305 | }, |
| 306 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 307 | "selfLink": "A String", # The URI of this resource. |
| 308 | "user": "A String", # The email address of the user who initiated this operation. |
| 309 | }</pre> |
| 310 | </div> |
| 311 | |
| 312 | <div class="method"> |
| 313 | <code class="details" id="delete">delete(project, instance)</code> |
| 314 | <pre>Deletes a Cloud SQL instance. |
| 315 | |
| 316 | Args: |
| 317 | project: string, Project ID of the project that contains the instance to be deleted. (required) |
| 318 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 319 | |
| 320 | Returns: |
| 321 | An object of the form: |
| 322 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 323 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 324 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 325 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 326 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 327 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 328 | "fileType": "A String", # The file type for the specified uri. |
| 329 | # SQL: The file contains SQL statements. |
| 330 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 331 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 332 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 333 | "csvImportOptions": { # Options for importing data as CSV. |
| 334 | "table": "A String", # The table to which CSV data is imported. |
| 335 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 336 | "A String", |
| 337 | ], |
| 338 | }, |
| 339 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 340 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 341 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 342 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 343 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 344 | "fileType": "A String", # The file type for the specified uri. |
| 345 | # SQL: The file contains SQL statements. |
| 346 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 347 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 348 | "csvExportOptions": { # Options for exporting data as CSV. |
| 349 | "selectQuery": "A String", # The select query used to extract the data. |
| 350 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 351 | "databases": [ # Databases to be exported. |
| 352 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 353 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 354 | "A String", |
| 355 | ], |
| 356 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 357 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 358 | "A String", |
| 359 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 360 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 361 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 362 | }, |
| 363 | "schemaOnly": True or False, # Export only schemas. |
| 364 | }, |
| 365 | }, |
| 366 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 367 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 368 | "targetId": "A String", # Name of the database instance related to this operation. |
| 369 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
| 370 | "targetLink": "A String", |
| 371 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 372 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 373 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
| 374 | "errors": [ # The list of errors encountered while processing this operation. |
| 375 | { # Database instance operation error. |
| 376 | "kind": "sql#operationError", # This is always sql#operationError. |
| 377 | "code": "A String", # Identifies the specific error that occurred. |
| 378 | "message": "A String", # Additional information about the error encountered. |
| 379 | }, |
| 380 | ], |
| 381 | }, |
| 382 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 383 | "selfLink": "A String", # The URI of this resource. |
| 384 | "user": "A String", # The email address of the user who initiated this operation. |
| 385 | }</pre> |
| 386 | </div> |
| 387 | |
| 388 | <div class="method"> |
| 389 | <code class="details" id="demoteMaster">demoteMaster(project, instance, body)</code> |
| 390 | <pre>Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server. |
| 391 | |
| 392 | Args: |
| 393 | project: string, ID of the project that contains the instance. (required) |
| 394 | instance: string, Cloud SQL instance name. (required) |
| 395 | body: object, The request body. (required) |
| 396 | The object takes the form of: |
| 397 | |
| 398 | { # Database demote master request. |
| 399 | "demoteMasterContext": { # Database instance demote master context. # Contains details about the demoteMaster operation. |
| 400 | "kind": "sql#demoteMasterContext", # This is always sql#demoteMasterContext. |
| 401 | "masterInstanceName": "A String", # The name of the instance which will act as on-premises master in the replication setup. |
| 402 | "verifyGtidConsistency": True or False, # Verify GTID consistency for demote operation. Default value: True. Second Generation instances only. Setting this flag to false enables you to bypass GTID consistency check between on-premises master and Cloud SQL instance during the demotion operation but also exposes you to the risk of future replication failures. Change the value only if you know the reason for the GTID divergence and are confident that doing so will not cause any replication issues. |
| 403 | "replicaConfiguration": { # Read-replica configuration for connecting to the on-premises master. # Configuration specific to read-replicas replicating from the on-premises master. |
| 404 | "kind": "sql#demoteMasterConfiguration", # This is always sql#demoteMasterConfiguration. |
| 405 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 406 | "username": "A String", # The username for the replication connection. |
| 407 | "kind": "sql#demoteMasterMysqlReplicaConfiguration", # This is always sql#demoteMasterMysqlReplicaConfiguration. |
| 408 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. The format of the slave's private key can be either PKCS #1 or PKCS #8. |
| 409 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 410 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 411 | "password": "A String", # The password for the replication connection. |
| 412 | }, |
| 413 | }, |
| 414 | }, |
| 415 | } |
| 416 | |
| 417 | |
| 418 | Returns: |
| 419 | An object of the form: |
| 420 | |
| 421 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
| 422 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 423 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 424 | "kind": "sql#importContext", # This is always sql#importContext. |
| 425 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
| 426 | "fileType": "A String", # The file type for the specified uri. |
| 427 | # SQL: The file contains SQL statements. |
| 428 | # CSV: The file contains CSV data. |
| 429 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 430 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 431 | "csvImportOptions": { # Options for importing data as CSV. |
| 432 | "table": "A String", # The table to which CSV data is imported. |
| 433 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 434 | "A String", |
| 435 | ], |
| 436 | }, |
| 437 | }, |
| 438 | "kind": "sql#operation", # This is always sql#operation. |
| 439 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 440 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 441 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 442 | "fileType": "A String", # The file type for the specified uri. |
| 443 | # SQL: The file contains SQL statements. |
| 444 | # CSV: The file contains CSV data. |
| 445 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
| 446 | "csvExportOptions": { # Options for exporting data as CSV. |
| 447 | "selectQuery": "A String", # The select query used to extract the data. |
| 448 | }, |
| 449 | "databases": [ # Databases to be exported. |
| 450 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 451 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
| 452 | "A String", |
| 453 | ], |
| 454 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 455 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
| 456 | "A String", |
| 457 | ], |
| 458 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 459 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 460 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 461 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 462 | }, |
| 463 | }, |
| 464 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 465 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 466 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 467 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 468 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 469 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 470 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 471 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 472 | "errors": [ # The list of errors encountered while processing this operation. |
| 473 | { # Database instance operation error. |
| 474 | "kind": "sql#operationError", # This is always sql#operationError. |
| 475 | "code": "A String", # Identifies the specific error that occurred. |
| 476 | "message": "A String", # Additional information about the error encountered. |
| 477 | }, |
| 478 | ], |
| 479 | }, |
| 480 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 481 | "selfLink": "A String", # The URI of this resource. |
| 482 | "user": "A String", # The email address of the user who initiated this operation. |
| 483 | }</pre> |
| 484 | </div> |
| 485 | |
| 486 | <div class="method"> |
| 487 | <code class="details" id="export">export(project, instance, body)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 488 | <pre>Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 489 | |
| 490 | Args: |
| 491 | project: string, Project ID of the project that contains the instance to be exported. (required) |
| 492 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 493 | body: object, The request body. (required) |
| 494 | The object takes the form of: |
| 495 | |
| 496 | { # Database instance export request. |
| 497 | "exportContext": { # Database instance export context. # Contains details about the export operation. |
| 498 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 499 | "fileType": "A String", # The file type for the specified uri. |
| 500 | # SQL: The file contains SQL statements. |
| 501 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 502 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 503 | "csvExportOptions": { # Options for exporting data as CSV. |
| 504 | "selectQuery": "A String", # The select query used to extract the data. |
| 505 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 506 | "databases": [ # Databases to be exported. |
| 507 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 508 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 509 | "A String", |
| 510 | ], |
| 511 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 512 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 513 | "A String", |
| 514 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 515 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 516 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 517 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 518 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 519 | }, |
| 520 | }, |
| 521 | } |
| 522 | |
| 523 | |
| 524 | Returns: |
| 525 | An object of the form: |
| 526 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 527 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 528 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 529 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 530 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 531 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 532 | "fileType": "A String", # The file type for the specified uri. |
| 533 | # SQL: The file contains SQL statements. |
| 534 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 535 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 536 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 537 | "csvImportOptions": { # Options for importing data as CSV. |
| 538 | "table": "A String", # The table to which CSV data is imported. |
| 539 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 540 | "A String", |
| 541 | ], |
| 542 | }, |
| 543 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 544 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 545 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 546 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 547 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 548 | "fileType": "A String", # The file type for the specified uri. |
| 549 | # SQL: The file contains SQL statements. |
| 550 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 551 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 552 | "csvExportOptions": { # Options for exporting data as CSV. |
| 553 | "selectQuery": "A String", # The select query used to extract the data. |
| 554 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 555 | "databases": [ # Databases to be exported. |
| 556 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 557 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 558 | "A String", |
| 559 | ], |
| 560 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 561 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 562 | "A String", |
| 563 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 564 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 565 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 566 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 567 | "schemaOnly": True or False, # Export only schemas. |
| 568 | }, |
| 569 | }, |
| 570 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 571 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 572 | "targetId": "A String", # Name of the database instance related to this operation. |
| 573 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 574 | "targetLink": "A String", |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 575 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 576 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 577 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
| 578 | "errors": [ # The list of errors encountered while processing this operation. |
| 579 | { # Database instance operation error. |
| 580 | "kind": "sql#operationError", # This is always sql#operationError. |
| 581 | "code": "A String", # Identifies the specific error that occurred. |
| 582 | "message": "A String", # Additional information about the error encountered. |
| 583 | }, |
| 584 | ], |
| 585 | }, |
| 586 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 587 | "selfLink": "A String", # The URI of this resource. |
| 588 | "user": "A String", # The email address of the user who initiated this operation. |
| 589 | }</pre> |
| 590 | </div> |
| 591 | |
| 592 | <div class="method"> |
| 593 | <code class="details" id="failover">failover(project, instance, body)</code> |
| 594 | <pre>Failover the instance to its failover replica instance. |
| 595 | |
| 596 | Args: |
| 597 | project: string, ID of the project that contains the read replica. (required) |
| 598 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 599 | body: object, The request body. (required) |
| 600 | The object takes the form of: |
| 601 | |
| 602 | { # Instance failover request. |
| 603 | "failoverContext": { # Database instance failover context. # Failover Context. |
| 604 | "kind": "sql#failoverContext", # This is always sql#failoverContext. |
| 605 | "settingsVersion": "A String", # The current settings version of this instance. Request will be rejected if this version doesn't match the current settings version. |
| 606 | }, |
| 607 | } |
| 608 | |
| 609 | |
| 610 | Returns: |
| 611 | An object of the form: |
| 612 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 613 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 614 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 615 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 616 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 617 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 618 | "fileType": "A String", # The file type for the specified uri. |
| 619 | # SQL: The file contains SQL statements. |
| 620 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 621 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 622 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 623 | "csvImportOptions": { # Options for importing data as CSV. |
| 624 | "table": "A String", # The table to which CSV data is imported. |
| 625 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 626 | "A String", |
| 627 | ], |
| 628 | }, |
| 629 | }, |
| 630 | "kind": "sql#operation", # This is always sql#operation. |
| 631 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 632 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 633 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 634 | "fileType": "A String", # The file type for the specified uri. |
| 635 | # SQL: The file contains SQL statements. |
| 636 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 637 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 638 | "csvExportOptions": { # Options for exporting data as CSV. |
| 639 | "selectQuery": "A String", # The select query used to extract the data. |
| 640 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 641 | "databases": [ # Databases to be exported. |
| 642 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 643 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 644 | "A String", |
| 645 | ], |
| 646 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 647 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 648 | "A String", |
| 649 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 650 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 651 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 652 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 653 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 654 | }, |
| 655 | }, |
| 656 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 657 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 658 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 659 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 660 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 661 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 662 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 663 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 664 | "errors": [ # The list of errors encountered while processing this operation. |
| 665 | { # Database instance operation error. |
| 666 | "kind": "sql#operationError", # This is always sql#operationError. |
| 667 | "code": "A String", # Identifies the specific error that occurred. |
| 668 | "message": "A String", # Additional information about the error encountered. |
| 669 | }, |
| 670 | ], |
| 671 | }, |
| 672 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 673 | "selfLink": "A String", # The URI of this resource. |
| 674 | "user": "A String", # The email address of the user who initiated this operation. |
| 675 | }</pre> |
| 676 | </div> |
| 677 | |
| 678 | <div class="method"> |
| 679 | <code class="details" id="get">get(project, instance)</code> |
| 680 | <pre>Retrieves a resource containing information about a Cloud SQL instance. |
| 681 | |
| 682 | Args: |
| 683 | project: string, Project ID of the project that contains the instance. (required) |
| 684 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 685 | |
| 686 | Returns: |
| 687 | An object of the form: |
| 688 | |
| 689 | { # A Cloud SQL instance resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 690 | "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only. |
| 691 | # SECOND_GEN: Second Generation instance or PostgreSQL instance. |
| 692 | # EXTERNAL: A database server that is not managed by Google. |
| 693 | # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. |
| 694 | "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 695 | "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances. |
| 696 | "ipAddresses": [ # The assigned IP addresses for the instance. |
| 697 | { # Database instance IP Mapping. |
| 698 | "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. |
| 699 | "ipAddress": "A String", # The IP address assigned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 700 | "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 701 | }, |
| 702 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 703 | "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 704 | "instanceType": "A String", # The instance type. This can be one of the following. |
| 705 | # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. |
| 706 | # ON_PREMISES_INSTANCE: An instance running on the customer's premises. |
| 707 | # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. |
| 708 | "maxDiskSize": "A String", # The maximum disk size of the instance in bytes. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 709 | "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances. |
| 710 | "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration. |
| 711 | "kmsKeyName": "A String", # KMS key resource name |
| 712 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 713 | "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension. |
| 714 | "A String", |
| 715 | ], |
| 716 | "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 717 | "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances. |
| 718 | "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk |
| 719 | "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus. |
| 720 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 721 | "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following. |
| 722 | # RUNNABLE: The instance is running, or is ready to run when accessed. |
| 723 | # SUSPENDED: The instance is not available, for example due to problems with billing. |
| 724 | # PENDING_CREATE: The instance is being created. |
| 725 | # MAINTENANCE: The instance is down for maintenance. |
| 726 | # FAILED: The instance creation failed. |
| 727 | # UNKNOWN_STATE: The state of the instance is unknown. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 728 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
| 729 | "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 730 | "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances. |
| 731 | "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 732 | "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 733 | }, |
| 734 | "replicaNames": [ # The replicas of the instance. |
| 735 | "A String", |
| 736 | ], |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 737 | "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances. |
| 738 | "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration. |
| 739 | "hostPort": "A String", # The host and port of the on-premises instance in host:port format |
| 740 | }, |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 741 | "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 742 | "kind": "sql#instance", # This is always sql#instance. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 743 | "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID. |
| 744 | "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. |
| 745 | "serverCaCert": { # SslCerts Resource # SSL configuration. |
| 746 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 747 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 748 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 749 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 750 | "instance": "A String", # Name of the database instance. |
| 751 | "cert": "A String", # PEM representation. |
| 752 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 753 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 754 | "selfLink": "A String", # The URI of this resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 755 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 756 | "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. |
| 757 | "settings": { # Database instance settings. # The user settings. |
| 758 | "databaseFlags": [ # The database flags passed to the instance at startup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 759 | { # Database flags for Cloud SQL instances. |
| 760 | "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 761 | "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. |
| 762 | }, |
| 763 | ], |
| 764 | "kind": "sql#settings", # This is always sql#settings. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 765 | "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. |
| 766 | "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values: |
| 767 | # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. |
| 768 | # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). |
| 769 | # For more information, see Overview of the High Availability Configuration. |
| 770 | "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 771 | "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 772 | "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later). |
| 773 | # Learn more. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 774 | "day": 42, # day of week (1-7), starting on Monday. |
| 775 | "hour": 42, # hour of day - 0 to 23. |
| 776 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 777 | "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 778 | "A String", |
| 779 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 780 | "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: |
| 781 | # ALWAYS: The instance is on, and remains so even in the absence of connection requests. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 782 | # NEVER: The instance is off; it is not activated, even if a connection request arrives. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 783 | # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 784 | "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance. |
| 785 | "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration. |
| 786 | "enabled": True or False, # Whether this configuration is enabled. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 787 | "replicationLogArchivingEnabled": True or False, # Reserved for future use. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 788 | "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 789 | "location": "A String", # The location of the backup. |
| 790 | "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 791 | }, |
| 792 | "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 793 | "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 794 | "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not. |
| 795 | "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). |
| 796 | { # An entry for an Access Control list. |
| 797 | "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 798 | "kind": "sql#aclEntry", # This is always sql#aclEntry. |
| 799 | "value": "A String", # The whitelisted value for the access control list. |
| 800 | "name": "A String", # An optional label to identify this entry. |
| 801 | }, |
| 802 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 803 | "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 804 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 805 | "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. |
| 806 | "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair. |
| 807 | "a_key": "A String", # An individual label entry, composed of a key and a value. |
| 808 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 809 | "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not. |
| 810 | "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 811 | "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 812 | "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. |
| 813 | "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. |
| 814 | "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 815 | "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. |
| 816 | "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 817 | "kind": "sql#locationPreference", # This is always sql#locationPreference. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 818 | "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 819 | "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. |
| 820 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 821 | "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 822 | }, |
| 823 | "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 824 | "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 825 | "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 826 | "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. |
| 827 | # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 828 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 829 | "username": "A String", # The username for the replication connection. |
| 830 | "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration. |
| 831 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. |
| 832 | "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption. |
| 833 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 834 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 835 | "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats. |
| 836 | "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. |
| 837 | "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. |
| 838 | "password": "A String", # The password for the replication connection. |
| 839 | "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds. |
| 840 | }, |
| 841 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 842 | "rootPassword": "A String", # Initial root password. Use only on creation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 843 | "selfLink": "A String", # The URI of this resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 844 | }</pre> |
| 845 | </div> |
| 846 | |
| 847 | <div class="method"> |
| 848 | <code class="details" id="import_">import_(project, instance, body)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 849 | <pre>Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 850 | |
| 851 | Args: |
| 852 | project: string, Project ID of the project that contains the instance. (required) |
| 853 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 854 | body: object, The request body. (required) |
| 855 | The object takes the form of: |
| 856 | |
| 857 | { # Database instance import request. |
| 858 | "importContext": { # Database instance import context. # Contains details about the import operation. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 859 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 860 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 861 | "fileType": "A String", # The file type for the specified uri. |
| 862 | # SQL: The file contains SQL statements. |
| 863 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 864 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 865 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 866 | "csvImportOptions": { # Options for importing data as CSV. |
| 867 | "table": "A String", # The table to which CSV data is imported. |
| 868 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 869 | "A String", |
| 870 | ], |
| 871 | }, |
| 872 | }, |
| 873 | } |
| 874 | |
| 875 | |
| 876 | Returns: |
| 877 | An object of the form: |
| 878 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 879 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 880 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 881 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 882 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 883 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 884 | "fileType": "A String", # The file type for the specified uri. |
| 885 | # SQL: The file contains SQL statements. |
| 886 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 887 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 888 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 889 | "csvImportOptions": { # Options for importing data as CSV. |
| 890 | "table": "A String", # The table to which CSV data is imported. |
| 891 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 892 | "A String", |
| 893 | ], |
| 894 | }, |
| 895 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 896 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 897 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 898 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 899 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 900 | "fileType": "A String", # The file type for the specified uri. |
| 901 | # SQL: The file contains SQL statements. |
| 902 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 903 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 904 | "csvExportOptions": { # Options for exporting data as CSV. |
| 905 | "selectQuery": "A String", # The select query used to extract the data. |
| 906 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 907 | "databases": [ # Databases to be exported. |
| 908 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 909 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 910 | "A String", |
| 911 | ], |
| 912 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 913 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 914 | "A String", |
| 915 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 916 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 917 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 918 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 919 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 920 | }, |
| 921 | }, |
| 922 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 923 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 924 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 925 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 926 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 927 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 928 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 929 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 930 | "errors": [ # The list of errors encountered while processing this operation. |
| 931 | { # Database instance operation error. |
| 932 | "kind": "sql#operationError", # This is always sql#operationError. |
| 933 | "code": "A String", # Identifies the specific error that occurred. |
| 934 | "message": "A String", # Additional information about the error encountered. |
| 935 | }, |
| 936 | ], |
| 937 | }, |
| 938 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 939 | "selfLink": "A String", # The URI of this resource. |
| 940 | "user": "A String", # The email address of the user who initiated this operation. |
| 941 | }</pre> |
| 942 | </div> |
| 943 | |
| 944 | <div class="method"> |
| 945 | <code class="details" id="insert">insert(project, body)</code> |
| 946 | <pre>Creates a new Cloud SQL instance. |
| 947 | |
| 948 | Args: |
| 949 | project: string, Project ID of the project to which the newly created Cloud SQL instances should belong. (required) |
| 950 | body: object, The request body. (required) |
| 951 | The object takes the form of: |
| 952 | |
| 953 | { # A Cloud SQL instance resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 954 | "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only. |
| 955 | # SECOND_GEN: Second Generation instance or PostgreSQL instance. |
| 956 | # EXTERNAL: A database server that is not managed by Google. |
| 957 | # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. |
| 958 | "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 959 | "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances. |
| 960 | "ipAddresses": [ # The assigned IP addresses for the instance. |
| 961 | { # Database instance IP Mapping. |
| 962 | "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. |
| 963 | "ipAddress": "A String", # The IP address assigned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 964 | "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 965 | }, |
| 966 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 967 | "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 968 | "instanceType": "A String", # The instance type. This can be one of the following. |
| 969 | # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. |
| 970 | # ON_PREMISES_INSTANCE: An instance running on the customer's premises. |
| 971 | # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. |
| 972 | "maxDiskSize": "A String", # The maximum disk size of the instance in bytes. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 973 | "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances. |
| 974 | "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration. |
| 975 | "kmsKeyName": "A String", # KMS key resource name |
| 976 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 977 | "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension. |
| 978 | "A String", |
| 979 | ], |
| 980 | "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 981 | "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances. |
| 982 | "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk |
| 983 | "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus. |
| 984 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 985 | "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following. |
| 986 | # RUNNABLE: The instance is running, or is ready to run when accessed. |
| 987 | # SUSPENDED: The instance is not available, for example due to problems with billing. |
| 988 | # PENDING_CREATE: The instance is being created. |
| 989 | # MAINTENANCE: The instance is down for maintenance. |
| 990 | # FAILED: The instance creation failed. |
| 991 | # UNKNOWN_STATE: The state of the instance is unknown. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 992 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
| 993 | "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 994 | "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances. |
| 995 | "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 996 | "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 997 | }, |
| 998 | "replicaNames": [ # The replicas of the instance. |
| 999 | "A String", |
| 1000 | ], |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1001 | "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances. |
| 1002 | "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration. |
| 1003 | "hostPort": "A String", # The host and port of the on-premises instance in host:port format |
| 1004 | }, |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1005 | "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1006 | "kind": "sql#instance", # This is always sql#instance. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1007 | "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID. |
| 1008 | "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. |
| 1009 | "serverCaCert": { # SslCerts Resource # SSL configuration. |
| 1010 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 1011 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 1012 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 1013 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 1014 | "instance": "A String", # Name of the database instance. |
| 1015 | "cert": "A String", # PEM representation. |
| 1016 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1017 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 1018 | "selfLink": "A String", # The URI of this resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1019 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1020 | "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. |
| 1021 | "settings": { # Database instance settings. # The user settings. |
| 1022 | "databaseFlags": [ # The database flags passed to the instance at startup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1023 | { # Database flags for Cloud SQL instances. |
| 1024 | "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1025 | "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. |
| 1026 | }, |
| 1027 | ], |
| 1028 | "kind": "sql#settings", # This is always sql#settings. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1029 | "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. |
| 1030 | "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values: |
| 1031 | # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. |
| 1032 | # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). |
| 1033 | # For more information, see Overview of the High Availability Configuration. |
| 1034 | "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1035 | "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1036 | "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later). |
| 1037 | # Learn more. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1038 | "day": 42, # day of week (1-7), starting on Monday. |
| 1039 | "hour": 42, # hour of day - 0 to 23. |
| 1040 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1041 | "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1042 | "A String", |
| 1043 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1044 | "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: |
| 1045 | # ALWAYS: The instance is on, and remains so even in the absence of connection requests. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 1046 | # NEVER: The instance is off; it is not activated, even if a connection request arrives. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1047 | # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1048 | "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance. |
| 1049 | "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration. |
| 1050 | "enabled": True or False, # Whether this configuration is enabled. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1051 | "replicationLogArchivingEnabled": True or False, # Reserved for future use. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1052 | "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1053 | "location": "A String", # The location of the backup. |
| 1054 | "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1055 | }, |
| 1056 | "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1057 | "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1058 | "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not. |
| 1059 | "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). |
| 1060 | { # An entry for an Access Control list. |
| 1061 | "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1062 | "kind": "sql#aclEntry", # This is always sql#aclEntry. |
| 1063 | "value": "A String", # The whitelisted value for the access control list. |
| 1064 | "name": "A String", # An optional label to identify this entry. |
| 1065 | }, |
| 1066 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1067 | "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1068 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1069 | "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. |
| 1070 | "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair. |
| 1071 | "a_key": "A String", # An individual label entry, composed of a key and a value. |
| 1072 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1073 | "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not. |
| 1074 | "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1075 | "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1076 | "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. |
| 1077 | "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. |
| 1078 | "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1079 | "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. |
| 1080 | "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1081 | "kind": "sql#locationPreference", # This is always sql#locationPreference. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1082 | "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1083 | "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. |
| 1084 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1085 | "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1086 | }, |
| 1087 | "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1088 | "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1089 | "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1090 | "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. |
| 1091 | # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1092 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 1093 | "username": "A String", # The username for the replication connection. |
| 1094 | "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration. |
| 1095 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. |
| 1096 | "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption. |
| 1097 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 1098 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 1099 | "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats. |
| 1100 | "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. |
| 1101 | "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. |
| 1102 | "password": "A String", # The password for the replication connection. |
| 1103 | "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds. |
| 1104 | }, |
| 1105 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1106 | "rootPassword": "A String", # Initial root password. Use only on creation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1107 | "selfLink": "A String", # The URI of this resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1108 | } |
| 1109 | |
| 1110 | |
| 1111 | Returns: |
| 1112 | An object of the form: |
| 1113 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1114 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1115 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1116 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1117 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1118 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1119 | "fileType": "A String", # The file type for the specified uri. |
| 1120 | # SQL: The file contains SQL statements. |
| 1121 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1122 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1123 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1124 | "csvImportOptions": { # Options for importing data as CSV. |
| 1125 | "table": "A String", # The table to which CSV data is imported. |
| 1126 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1127 | "A String", |
| 1128 | ], |
| 1129 | }, |
| 1130 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1131 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1132 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1133 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1134 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1135 | "fileType": "A String", # The file type for the specified uri. |
| 1136 | # SQL: The file contains SQL statements. |
| 1137 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1138 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1139 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1140 | "selectQuery": "A String", # The select query used to extract the data. |
| 1141 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1142 | "databases": [ # Databases to be exported. |
| 1143 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1144 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1145 | "A String", |
| 1146 | ], |
| 1147 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1148 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1149 | "A String", |
| 1150 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1151 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1152 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1153 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1154 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1155 | }, |
| 1156 | }, |
| 1157 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1158 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1159 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1160 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1161 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1162 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1163 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1164 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1165 | "errors": [ # The list of errors encountered while processing this operation. |
| 1166 | { # Database instance operation error. |
| 1167 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1168 | "code": "A String", # Identifies the specific error that occurred. |
| 1169 | "message": "A String", # Additional information about the error encountered. |
| 1170 | }, |
| 1171 | ], |
| 1172 | }, |
| 1173 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1174 | "selfLink": "A String", # The URI of this resource. |
| 1175 | "user": "A String", # The email address of the user who initiated this operation. |
| 1176 | }</pre> |
| 1177 | </div> |
| 1178 | |
| 1179 | <div class="method"> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1180 | <code class="details" id="list">list(project, maxResults=None, pageToken=None, filter=None)</code> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1181 | <pre>Lists instances under a given project in the alphabetical order of the instance name. |
| 1182 | |
| 1183 | Args: |
| 1184 | project: string, Project ID of the project for which to list Cloud SQL instances. (required) |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1185 | maxResults: integer, The maximum number of results to return per response. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1186 | pageToken: string, A previously-returned page token representing part of the larger set of results to view. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1187 | filter: string, An expression for filtering the results of the request, such as by name or label. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1188 | |
| 1189 | Returns: |
| 1190 | An object of the form: |
| 1191 | |
| 1192 | { # Database instances list response. |
| 1193 | "nextPageToken": "A String", # The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results. |
| 1194 | "items": [ # List of database instance resources. |
| 1195 | { # A Cloud SQL instance resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1196 | "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only. |
| 1197 | # SECOND_GEN: Second Generation instance or PostgreSQL instance. |
| 1198 | # EXTERNAL: A database server that is not managed by Google. |
| 1199 | # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. |
| 1200 | "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1201 | "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances. |
| 1202 | "ipAddresses": [ # The assigned IP addresses for the instance. |
| 1203 | { # Database instance IP Mapping. |
| 1204 | "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. |
| 1205 | "ipAddress": "A String", # The IP address assigned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1206 | "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1207 | }, |
| 1208 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1209 | "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1210 | "instanceType": "A String", # The instance type. This can be one of the following. |
| 1211 | # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. |
| 1212 | # ON_PREMISES_INSTANCE: An instance running on the customer's premises. |
| 1213 | # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. |
| 1214 | "maxDiskSize": "A String", # The maximum disk size of the instance in bytes. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1215 | "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances. |
| 1216 | "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration. |
| 1217 | "kmsKeyName": "A String", # KMS key resource name |
| 1218 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1219 | "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension. |
| 1220 | "A String", |
| 1221 | ], |
| 1222 | "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1223 | "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances. |
| 1224 | "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk |
| 1225 | "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus. |
| 1226 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1227 | "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following. |
| 1228 | # RUNNABLE: The instance is running, or is ready to run when accessed. |
| 1229 | # SUSPENDED: The instance is not available, for example due to problems with billing. |
| 1230 | # PENDING_CREATE: The instance is being created. |
| 1231 | # MAINTENANCE: The instance is down for maintenance. |
| 1232 | # FAILED: The instance creation failed. |
| 1233 | # UNKNOWN_STATE: The state of the instance is unknown. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1234 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
| 1235 | "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1236 | "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances. |
| 1237 | "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 1238 | "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1239 | }, |
| 1240 | "replicaNames": [ # The replicas of the instance. |
| 1241 | "A String", |
| 1242 | ], |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1243 | "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances. |
| 1244 | "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration. |
| 1245 | "hostPort": "A String", # The host and port of the on-premises instance in host:port format |
| 1246 | }, |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1247 | "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1248 | "kind": "sql#instance", # This is always sql#instance. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1249 | "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID. |
| 1250 | "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. |
| 1251 | "serverCaCert": { # SslCerts Resource # SSL configuration. |
| 1252 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 1253 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 1254 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 1255 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 1256 | "instance": "A String", # Name of the database instance. |
| 1257 | "cert": "A String", # PEM representation. |
| 1258 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1259 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 1260 | "selfLink": "A String", # The URI of this resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1261 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1262 | "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. |
| 1263 | "settings": { # Database instance settings. # The user settings. |
| 1264 | "databaseFlags": [ # The database flags passed to the instance at startup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1265 | { # Database flags for Cloud SQL instances. |
| 1266 | "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1267 | "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. |
| 1268 | }, |
| 1269 | ], |
| 1270 | "kind": "sql#settings", # This is always sql#settings. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1271 | "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. |
| 1272 | "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values: |
| 1273 | # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. |
| 1274 | # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). |
| 1275 | # For more information, see Overview of the High Availability Configuration. |
| 1276 | "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1277 | "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1278 | "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later). |
| 1279 | # Learn more. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1280 | "day": 42, # day of week (1-7), starting on Monday. |
| 1281 | "hour": 42, # hour of day - 0 to 23. |
| 1282 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1283 | "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1284 | "A String", |
| 1285 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1286 | "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: |
| 1287 | # ALWAYS: The instance is on, and remains so even in the absence of connection requests. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 1288 | # NEVER: The instance is off; it is not activated, even if a connection request arrives. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1289 | # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1290 | "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance. |
| 1291 | "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration. |
| 1292 | "enabled": True or False, # Whether this configuration is enabled. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1293 | "replicationLogArchivingEnabled": True or False, # Reserved for future use. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1294 | "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1295 | "location": "A String", # The location of the backup. |
| 1296 | "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1297 | }, |
| 1298 | "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1299 | "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1300 | "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not. |
| 1301 | "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). |
| 1302 | { # An entry for an Access Control list. |
| 1303 | "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1304 | "kind": "sql#aclEntry", # This is always sql#aclEntry. |
| 1305 | "value": "A String", # The whitelisted value for the access control list. |
| 1306 | "name": "A String", # An optional label to identify this entry. |
| 1307 | }, |
| 1308 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1309 | "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1310 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1311 | "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. |
| 1312 | "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair. |
| 1313 | "a_key": "A String", # An individual label entry, composed of a key and a value. |
| 1314 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1315 | "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not. |
| 1316 | "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1317 | "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1318 | "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. |
| 1319 | "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. |
| 1320 | "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1321 | "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. |
| 1322 | "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1323 | "kind": "sql#locationPreference", # This is always sql#locationPreference. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1324 | "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1325 | "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. |
| 1326 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1327 | "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1328 | }, |
| 1329 | "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1330 | "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1331 | "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1332 | "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. |
| 1333 | # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1334 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 1335 | "username": "A String", # The username for the replication connection. |
| 1336 | "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration. |
| 1337 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. |
| 1338 | "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption. |
| 1339 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 1340 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 1341 | "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats. |
| 1342 | "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. |
| 1343 | "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. |
| 1344 | "password": "A String", # The password for the replication connection. |
| 1345 | "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds. |
| 1346 | }, |
| 1347 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1348 | "rootPassword": "A String", # Initial root password. Use only on creation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1349 | "selfLink": "A String", # The URI of this resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1350 | }, |
| 1351 | ], |
| 1352 | "kind": "sql#instancesList", # This is always sql#instancesList. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1353 | "warnings": [ # List of warnings that ocurred while handling the request. |
| 1354 | { # An Admin API warning message. |
| 1355 | "message": "A String", # The warning message. |
| 1356 | "code": "A String", # Code to uniquely identify the warning type. |
| 1357 | }, |
| 1358 | ], |
| 1359 | }</pre> |
| 1360 | </div> |
| 1361 | |
| 1362 | <div class="method"> |
| 1363 | <code class="details" id="listServerCas">listServerCas(project, instance)</code> |
| 1364 | <pre>Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out. |
| 1365 | |
| 1366 | Args: |
| 1367 | project: string, Project ID of the project that contains the instance. (required) |
| 1368 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1369 | |
| 1370 | Returns: |
| 1371 | An object of the form: |
| 1372 | |
| 1373 | { # Instances ListServerCas response. |
| 1374 | "kind": "sql#instancesListServerCas", # This is always sql#instancesListServerCas. |
| 1375 | "certs": [ # List of server CA certificates for the instance. |
| 1376 | { # SslCerts Resource |
| 1377 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 1378 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 1379 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 1380 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 1381 | "instance": "A String", # Name of the database instance. |
| 1382 | "cert": "A String", # PEM representation. |
| 1383 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1384 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 1385 | "selfLink": "A String", # The URI of this resource. |
| 1386 | }, |
| 1387 | ], |
| 1388 | "activeVersion": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1389 | }</pre> |
| 1390 | </div> |
| 1391 | |
| 1392 | <div class="method"> |
| 1393 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 1394 | <pre>Retrieves the next page of results. |
| 1395 | |
| 1396 | Args: |
| 1397 | previous_request: The request for the previous page. (required) |
| 1398 | previous_response: The response from the request for the previous page. (required) |
| 1399 | |
| 1400 | Returns: |
| 1401 | A request object that you can call 'execute()' on to request the next |
| 1402 | page. Returns None if there are no more items in the collection. |
| 1403 | </pre> |
| 1404 | </div> |
| 1405 | |
| 1406 | <div class="method"> |
| 1407 | <code class="details" id="patch">patch(project, instance, body)</code> |
| 1408 | <pre>Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch.. This method supports patch semantics. |
| 1409 | |
| 1410 | Args: |
| 1411 | project: string, Project ID of the project that contains the instance. (required) |
| 1412 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1413 | body: object, The request body. (required) |
| 1414 | The object takes the form of: |
| 1415 | |
| 1416 | { # A Cloud SQL instance resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1417 | "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only. |
| 1418 | # SECOND_GEN: Second Generation instance or PostgreSQL instance. |
| 1419 | # EXTERNAL: A database server that is not managed by Google. |
| 1420 | # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. |
| 1421 | "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1422 | "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances. |
| 1423 | "ipAddresses": [ # The assigned IP addresses for the instance. |
| 1424 | { # Database instance IP Mapping. |
| 1425 | "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. |
| 1426 | "ipAddress": "A String", # The IP address assigned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1427 | "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1428 | }, |
| 1429 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1430 | "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1431 | "instanceType": "A String", # The instance type. This can be one of the following. |
| 1432 | # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. |
| 1433 | # ON_PREMISES_INSTANCE: An instance running on the customer's premises. |
| 1434 | # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. |
| 1435 | "maxDiskSize": "A String", # The maximum disk size of the instance in bytes. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1436 | "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances. |
| 1437 | "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration. |
| 1438 | "kmsKeyName": "A String", # KMS key resource name |
| 1439 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1440 | "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension. |
| 1441 | "A String", |
| 1442 | ], |
| 1443 | "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1444 | "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances. |
| 1445 | "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk |
| 1446 | "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus. |
| 1447 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1448 | "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following. |
| 1449 | # RUNNABLE: The instance is running, or is ready to run when accessed. |
| 1450 | # SUSPENDED: The instance is not available, for example due to problems with billing. |
| 1451 | # PENDING_CREATE: The instance is being created. |
| 1452 | # MAINTENANCE: The instance is down for maintenance. |
| 1453 | # FAILED: The instance creation failed. |
| 1454 | # UNKNOWN_STATE: The state of the instance is unknown. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1455 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
| 1456 | "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1457 | "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances. |
| 1458 | "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 1459 | "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1460 | }, |
| 1461 | "replicaNames": [ # The replicas of the instance. |
| 1462 | "A String", |
| 1463 | ], |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1464 | "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances. |
| 1465 | "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration. |
| 1466 | "hostPort": "A String", # The host and port of the on-premises instance in host:port format |
| 1467 | }, |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1468 | "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1469 | "kind": "sql#instance", # This is always sql#instance. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1470 | "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID. |
| 1471 | "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. |
| 1472 | "serverCaCert": { # SslCerts Resource # SSL configuration. |
| 1473 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 1474 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 1475 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 1476 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 1477 | "instance": "A String", # Name of the database instance. |
| 1478 | "cert": "A String", # PEM representation. |
| 1479 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1480 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 1481 | "selfLink": "A String", # The URI of this resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1482 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1483 | "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. |
| 1484 | "settings": { # Database instance settings. # The user settings. |
| 1485 | "databaseFlags": [ # The database flags passed to the instance at startup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1486 | { # Database flags for Cloud SQL instances. |
| 1487 | "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1488 | "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. |
| 1489 | }, |
| 1490 | ], |
| 1491 | "kind": "sql#settings", # This is always sql#settings. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1492 | "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. |
| 1493 | "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values: |
| 1494 | # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. |
| 1495 | # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). |
| 1496 | # For more information, see Overview of the High Availability Configuration. |
| 1497 | "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1498 | "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1499 | "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later). |
| 1500 | # Learn more. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1501 | "day": 42, # day of week (1-7), starting on Monday. |
| 1502 | "hour": 42, # hour of day - 0 to 23. |
| 1503 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1504 | "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1505 | "A String", |
| 1506 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1507 | "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: |
| 1508 | # ALWAYS: The instance is on, and remains so even in the absence of connection requests. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 1509 | # NEVER: The instance is off; it is not activated, even if a connection request arrives. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1510 | # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1511 | "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance. |
| 1512 | "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration. |
| 1513 | "enabled": True or False, # Whether this configuration is enabled. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1514 | "replicationLogArchivingEnabled": True or False, # Reserved for future use. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1515 | "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1516 | "location": "A String", # The location of the backup. |
| 1517 | "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1518 | }, |
| 1519 | "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1520 | "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1521 | "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not. |
| 1522 | "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). |
| 1523 | { # An entry for an Access Control list. |
| 1524 | "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1525 | "kind": "sql#aclEntry", # This is always sql#aclEntry. |
| 1526 | "value": "A String", # The whitelisted value for the access control list. |
| 1527 | "name": "A String", # An optional label to identify this entry. |
| 1528 | }, |
| 1529 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1530 | "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1531 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1532 | "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. |
| 1533 | "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair. |
| 1534 | "a_key": "A String", # An individual label entry, composed of a key and a value. |
| 1535 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1536 | "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not. |
| 1537 | "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1538 | "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1539 | "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. |
| 1540 | "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. |
| 1541 | "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1542 | "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. |
| 1543 | "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1544 | "kind": "sql#locationPreference", # This is always sql#locationPreference. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1545 | "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1546 | "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. |
| 1547 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1548 | "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 1549 | }, |
| 1550 | "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1551 | "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1552 | "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1553 | "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. |
| 1554 | # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1555 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 1556 | "username": "A String", # The username for the replication connection. |
| 1557 | "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration. |
| 1558 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. |
| 1559 | "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption. |
| 1560 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 1561 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 1562 | "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats. |
| 1563 | "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. |
| 1564 | "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. |
| 1565 | "password": "A String", # The password for the replication connection. |
| 1566 | "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds. |
| 1567 | }, |
| 1568 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1569 | "rootPassword": "A String", # Initial root password. Use only on creation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1570 | "selfLink": "A String", # The URI of this resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1571 | } |
| 1572 | |
| 1573 | |
| 1574 | Returns: |
| 1575 | An object of the form: |
| 1576 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1577 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1578 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1579 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1580 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1581 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1582 | "fileType": "A String", # The file type for the specified uri. |
| 1583 | # SQL: The file contains SQL statements. |
| 1584 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1585 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1586 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1587 | "csvImportOptions": { # Options for importing data as CSV. |
| 1588 | "table": "A String", # The table to which CSV data is imported. |
| 1589 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1590 | "A String", |
| 1591 | ], |
| 1592 | }, |
| 1593 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1594 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1595 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1596 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1597 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1598 | "fileType": "A String", # The file type for the specified uri. |
| 1599 | # SQL: The file contains SQL statements. |
| 1600 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1601 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1602 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1603 | "selectQuery": "A String", # The select query used to extract the data. |
| 1604 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1605 | "databases": [ # Databases to be exported. |
| 1606 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1607 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1608 | "A String", |
| 1609 | ], |
| 1610 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1611 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1612 | "A String", |
| 1613 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1614 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1615 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1616 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1617 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1618 | }, |
| 1619 | }, |
| 1620 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1621 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1622 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1623 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1624 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1625 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1626 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1627 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1628 | "errors": [ # The list of errors encountered while processing this operation. |
| 1629 | { # Database instance operation error. |
| 1630 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1631 | "code": "A String", # Identifies the specific error that occurred. |
| 1632 | "message": "A String", # Additional information about the error encountered. |
| 1633 | }, |
| 1634 | ], |
| 1635 | }, |
| 1636 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1637 | "selfLink": "A String", # The URI of this resource. |
| 1638 | "user": "A String", # The email address of the user who initiated this operation. |
| 1639 | }</pre> |
| 1640 | </div> |
| 1641 | |
| 1642 | <div class="method"> |
| 1643 | <code class="details" id="promoteReplica">promoteReplica(project, instance)</code> |
| 1644 | <pre>Promotes the read replica instance to be a stand-alone Cloud SQL instance. |
| 1645 | |
| 1646 | Args: |
| 1647 | project: string, ID of the project that contains the read replica. (required) |
| 1648 | instance: string, Cloud SQL read replica instance name. (required) |
| 1649 | |
| 1650 | Returns: |
| 1651 | An object of the form: |
| 1652 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1653 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1654 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1655 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1656 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1657 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1658 | "fileType": "A String", # The file type for the specified uri. |
| 1659 | # SQL: The file contains SQL statements. |
| 1660 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1661 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1662 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1663 | "csvImportOptions": { # Options for importing data as CSV. |
| 1664 | "table": "A String", # The table to which CSV data is imported. |
| 1665 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1666 | "A String", |
| 1667 | ], |
| 1668 | }, |
| 1669 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1670 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1671 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1672 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1673 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1674 | "fileType": "A String", # The file type for the specified uri. |
| 1675 | # SQL: The file contains SQL statements. |
| 1676 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1677 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1678 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1679 | "selectQuery": "A String", # The select query used to extract the data. |
| 1680 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1681 | "databases": [ # Databases to be exported. |
| 1682 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1683 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1684 | "A String", |
| 1685 | ], |
| 1686 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1687 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1688 | "A String", |
| 1689 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1690 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1691 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1692 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1693 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1694 | }, |
| 1695 | }, |
| 1696 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1697 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1698 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1699 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1700 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1701 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1702 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1703 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1704 | "errors": [ # The list of errors encountered while processing this operation. |
| 1705 | { # Database instance operation error. |
| 1706 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1707 | "code": "A String", # Identifies the specific error that occurred. |
| 1708 | "message": "A String", # Additional information about the error encountered. |
| 1709 | }, |
| 1710 | ], |
| 1711 | }, |
| 1712 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1713 | "selfLink": "A String", # The URI of this resource. |
| 1714 | "user": "A String", # The email address of the user who initiated this operation. |
| 1715 | }</pre> |
| 1716 | </div> |
| 1717 | |
| 1718 | <div class="method"> |
| 1719 | <code class="details" id="resetSslConfig">resetSslConfig(project, instance)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1720 | <pre>Deletes all client certificates and generates a new server SSL certificate for the instance. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1721 | |
| 1722 | Args: |
| 1723 | project: string, Project ID of the project that contains the instance. (required) |
| 1724 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1725 | |
| 1726 | Returns: |
| 1727 | An object of the form: |
| 1728 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1729 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1730 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1731 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1732 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1733 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1734 | "fileType": "A String", # The file type for the specified uri. |
| 1735 | # SQL: The file contains SQL statements. |
| 1736 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1737 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1738 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1739 | "csvImportOptions": { # Options for importing data as CSV. |
| 1740 | "table": "A String", # The table to which CSV data is imported. |
| 1741 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1742 | "A String", |
| 1743 | ], |
| 1744 | }, |
| 1745 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1746 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1747 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1748 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1749 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1750 | "fileType": "A String", # The file type for the specified uri. |
| 1751 | # SQL: The file contains SQL statements. |
| 1752 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1753 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1754 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1755 | "selectQuery": "A String", # The select query used to extract the data. |
| 1756 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1757 | "databases": [ # Databases to be exported. |
| 1758 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1759 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1760 | "A String", |
| 1761 | ], |
| 1762 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1763 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1764 | "A String", |
| 1765 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1766 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1767 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1768 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1769 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1770 | }, |
| 1771 | }, |
| 1772 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1773 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1774 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1775 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1776 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1777 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1778 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1779 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1780 | "errors": [ # The list of errors encountered while processing this operation. |
| 1781 | { # Database instance operation error. |
| 1782 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1783 | "code": "A String", # Identifies the specific error that occurred. |
| 1784 | "message": "A String", # Additional information about the error encountered. |
| 1785 | }, |
| 1786 | ], |
| 1787 | }, |
| 1788 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1789 | "selfLink": "A String", # The URI of this resource. |
| 1790 | "user": "A String", # The email address of the user who initiated this operation. |
| 1791 | }</pre> |
| 1792 | </div> |
| 1793 | |
| 1794 | <div class="method"> |
| 1795 | <code class="details" id="restart">restart(project, instance)</code> |
| 1796 | <pre>Restarts a Cloud SQL instance. |
| 1797 | |
| 1798 | Args: |
| 1799 | project: string, Project ID of the project that contains the instance to be restarted. (required) |
| 1800 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1801 | |
| 1802 | Returns: |
| 1803 | An object of the form: |
| 1804 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1805 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1806 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1807 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1808 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1809 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1810 | "fileType": "A String", # The file type for the specified uri. |
| 1811 | # SQL: The file contains SQL statements. |
| 1812 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1813 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1814 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1815 | "csvImportOptions": { # Options for importing data as CSV. |
| 1816 | "table": "A String", # The table to which CSV data is imported. |
| 1817 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1818 | "A String", |
| 1819 | ], |
| 1820 | }, |
| 1821 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1822 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1823 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1824 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1825 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1826 | "fileType": "A String", # The file type for the specified uri. |
| 1827 | # SQL: The file contains SQL statements. |
| 1828 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1829 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1830 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1831 | "selectQuery": "A String", # The select query used to extract the data. |
| 1832 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1833 | "databases": [ # Databases to be exported. |
| 1834 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1835 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1836 | "A String", |
| 1837 | ], |
| 1838 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1839 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1840 | "A String", |
| 1841 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1842 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1843 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1844 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1845 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1846 | }, |
| 1847 | }, |
| 1848 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1849 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1850 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1851 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1852 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1853 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1854 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1855 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1856 | "errors": [ # The list of errors encountered while processing this operation. |
| 1857 | { # Database instance operation error. |
| 1858 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1859 | "code": "A String", # Identifies the specific error that occurred. |
| 1860 | "message": "A String", # Additional information about the error encountered. |
| 1861 | }, |
| 1862 | ], |
| 1863 | }, |
| 1864 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1865 | "selfLink": "A String", # The URI of this resource. |
| 1866 | "user": "A String", # The email address of the user who initiated this operation. |
| 1867 | }</pre> |
| 1868 | </div> |
| 1869 | |
| 1870 | <div class="method"> |
| 1871 | <code class="details" id="restoreBackup">restoreBackup(project, instance, body)</code> |
| 1872 | <pre>Restores a backup of a Cloud SQL instance. |
| 1873 | |
| 1874 | Args: |
| 1875 | project: string, Project ID of the project that contains the instance. (required) |
| 1876 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1877 | body: object, The request body. (required) |
| 1878 | The object takes the form of: |
| 1879 | |
| 1880 | { # Database instance restore backup request. |
| 1881 | "restoreBackupContext": { # Database instance restore from backup context. # Parameters required to perform the restore backup operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1882 | "instanceId": "A String", # The ID of the instance that the backup was taken from. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1883 | "project": "A String", # The full project ID of the source instance. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1884 | "kind": "sql#restoreBackupContext", # This is always sql#restoreBackupContext. |
| 1885 | "backupRunId": "A String", # The ID of the backup run to restore from. |
| 1886 | }, |
| 1887 | } |
| 1888 | |
| 1889 | |
| 1890 | Returns: |
| 1891 | An object of the form: |
| 1892 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1893 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1894 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1895 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 1896 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1897 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1898 | "fileType": "A String", # The file type for the specified uri. |
| 1899 | # SQL: The file contains SQL statements. |
| 1900 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1901 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1902 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1903 | "csvImportOptions": { # Options for importing data as CSV. |
| 1904 | "table": "A String", # The table to which CSV data is imported. |
| 1905 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1906 | "A String", |
| 1907 | ], |
| 1908 | }, |
| 1909 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1910 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1911 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1912 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1913 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 1914 | "fileType": "A String", # The file type for the specified uri. |
| 1915 | # SQL: The file contains SQL statements. |
| 1916 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1917 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1918 | "csvExportOptions": { # Options for exporting data as CSV. |
| 1919 | "selectQuery": "A String", # The select query used to extract the data. |
| 1920 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1921 | "databases": [ # Databases to be exported. |
| 1922 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 1923 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1924 | "A String", |
| 1925 | ], |
| 1926 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1927 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 1928 | "A String", |
| 1929 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 1930 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 1931 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 1932 | }, |
| 1933 | "schemaOnly": True or False, # Export only schemas. |
| 1934 | }, |
| 1935 | }, |
| 1936 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1937 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 1938 | "targetId": "A String", # Name of the database instance related to this operation. |
| 1939 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
| 1940 | "targetLink": "A String", |
| 1941 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1942 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 1943 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
| 1944 | "errors": [ # The list of errors encountered while processing this operation. |
| 1945 | { # Database instance operation error. |
| 1946 | "kind": "sql#operationError", # This is always sql#operationError. |
| 1947 | "code": "A String", # Identifies the specific error that occurred. |
| 1948 | "message": "A String", # Additional information about the error encountered. |
| 1949 | }, |
| 1950 | ], |
| 1951 | }, |
| 1952 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 1953 | "selfLink": "A String", # The URI of this resource. |
| 1954 | "user": "A String", # The email address of the user who initiated this operation. |
| 1955 | }</pre> |
| 1956 | </div> |
| 1957 | |
| 1958 | <div class="method"> |
| 1959 | <code class="details" id="rotateServerCa">rotateServerCa(project, instance, body)</code> |
| 1960 | <pre>Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method. |
| 1961 | |
| 1962 | Args: |
| 1963 | project: string, Project ID of the project that contains the instance. (required) |
| 1964 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 1965 | body: object, The request body. (required) |
| 1966 | The object takes the form of: |
| 1967 | |
| 1968 | { # Rotate Server CA request. |
| 1969 | "rotateServerCaContext": { # Instance rotate server CA context. # Contains details about the rotate server CA operation. |
| 1970 | "kind": "sql#rotateServerCaContext", # This is always sql#rotateServerCaContext. |
| 1971 | "nextVersion": "A String", # The fingerprint of the next version to be rotated to. If left unspecified, will be rotated to the most recently added server CA version. |
| 1972 | }, |
| 1973 | } |
| 1974 | |
| 1975 | |
| 1976 | Returns: |
| 1977 | An object of the form: |
| 1978 | |
| 1979 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
| 1980 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 1981 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 1982 | "kind": "sql#importContext", # This is always sql#importContext. |
| 1983 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
| 1984 | "fileType": "A String", # The file type for the specified uri. |
| 1985 | # SQL: The file contains SQL statements. |
| 1986 | # CSV: The file contains CSV data. |
| 1987 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 1988 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 1989 | "csvImportOptions": { # Options for importing data as CSV. |
| 1990 | "table": "A String", # The table to which CSV data is imported. |
| 1991 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 1992 | "A String", |
| 1993 | ], |
| 1994 | }, |
| 1995 | }, |
| 1996 | "kind": "sql#operation", # This is always sql#operation. |
| 1997 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 1998 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 1999 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 2000 | "fileType": "A String", # The file type for the specified uri. |
| 2001 | # SQL: The file contains SQL statements. |
| 2002 | # CSV: The file contains CSV data. |
| 2003 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
| 2004 | "csvExportOptions": { # Options for exporting data as CSV. |
| 2005 | "selectQuery": "A String", # The select query used to extract the data. |
| 2006 | }, |
| 2007 | "databases": [ # Databases to be exported. |
| 2008 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 2009 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
| 2010 | "A String", |
| 2011 | ], |
| 2012 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 2013 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
| 2014 | "A String", |
| 2015 | ], |
| 2016 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 2017 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 2018 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2019 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2020 | }, |
| 2021 | }, |
| 2022 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2023 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 2024 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2025 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2026 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2027 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2028 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 2029 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2030 | "errors": [ # The list of errors encountered while processing this operation. |
| 2031 | { # Database instance operation error. |
| 2032 | "kind": "sql#operationError", # This is always sql#operationError. |
| 2033 | "code": "A String", # Identifies the specific error that occurred. |
| 2034 | "message": "A String", # Additional information about the error encountered. |
| 2035 | }, |
| 2036 | ], |
| 2037 | }, |
| 2038 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2039 | "selfLink": "A String", # The URI of this resource. |
| 2040 | "user": "A String", # The email address of the user who initiated this operation. |
| 2041 | }</pre> |
| 2042 | </div> |
| 2043 | |
| 2044 | <div class="method"> |
| 2045 | <code class="details" id="startReplica">startReplica(project, instance)</code> |
| 2046 | <pre>Starts the replication in the read replica instance. |
| 2047 | |
| 2048 | Args: |
| 2049 | project: string, ID of the project that contains the read replica. (required) |
| 2050 | instance: string, Cloud SQL read replica instance name. (required) |
| 2051 | |
| 2052 | Returns: |
| 2053 | An object of the form: |
| 2054 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2055 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2056 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 2057 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2058 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2059 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2060 | "fileType": "A String", # The file type for the specified uri. |
| 2061 | # SQL: The file contains SQL statements. |
| 2062 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2063 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 2064 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2065 | "csvImportOptions": { # Options for importing data as CSV. |
| 2066 | "table": "A String", # The table to which CSV data is imported. |
| 2067 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 2068 | "A String", |
| 2069 | ], |
| 2070 | }, |
| 2071 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2072 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2073 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 2074 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 2075 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 2076 | "fileType": "A String", # The file type for the specified uri. |
| 2077 | # SQL: The file contains SQL statements. |
| 2078 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2079 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2080 | "csvExportOptions": { # Options for exporting data as CSV. |
| 2081 | "selectQuery": "A String", # The select query used to extract the data. |
| 2082 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2083 | "databases": [ # Databases to be exported. |
| 2084 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 2085 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2086 | "A String", |
| 2087 | ], |
| 2088 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2089 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2090 | "A String", |
| 2091 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2092 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 2093 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 2094 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2095 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2096 | }, |
| 2097 | }, |
| 2098 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2099 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 2100 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2101 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2102 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2103 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2104 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 2105 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2106 | "errors": [ # The list of errors encountered while processing this operation. |
| 2107 | { # Database instance operation error. |
| 2108 | "kind": "sql#operationError", # This is always sql#operationError. |
| 2109 | "code": "A String", # Identifies the specific error that occurred. |
| 2110 | "message": "A String", # Additional information about the error encountered. |
| 2111 | }, |
| 2112 | ], |
| 2113 | }, |
| 2114 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2115 | "selfLink": "A String", # The URI of this resource. |
| 2116 | "user": "A String", # The email address of the user who initiated this operation. |
| 2117 | }</pre> |
| 2118 | </div> |
| 2119 | |
| 2120 | <div class="method"> |
| 2121 | <code class="details" id="stopReplica">stopReplica(project, instance)</code> |
| 2122 | <pre>Stops the replication in the read replica instance. |
| 2123 | |
| 2124 | Args: |
| 2125 | project: string, ID of the project that contains the read replica. (required) |
| 2126 | instance: string, Cloud SQL read replica instance name. (required) |
| 2127 | |
| 2128 | Returns: |
| 2129 | An object of the form: |
| 2130 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2131 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2132 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 2133 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2134 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2135 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2136 | "fileType": "A String", # The file type for the specified uri. |
| 2137 | # SQL: The file contains SQL statements. |
| 2138 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2139 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 2140 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2141 | "csvImportOptions": { # Options for importing data as CSV. |
| 2142 | "table": "A String", # The table to which CSV data is imported. |
| 2143 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 2144 | "A String", |
| 2145 | ], |
| 2146 | }, |
| 2147 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2148 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2149 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 2150 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 2151 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 2152 | "fileType": "A String", # The file type for the specified uri. |
| 2153 | # SQL: The file contains SQL statements. |
| 2154 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2155 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2156 | "csvExportOptions": { # Options for exporting data as CSV. |
| 2157 | "selectQuery": "A String", # The select query used to extract the data. |
| 2158 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2159 | "databases": [ # Databases to be exported. |
| 2160 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 2161 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2162 | "A String", |
| 2163 | ], |
| 2164 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2165 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2166 | "A String", |
| 2167 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2168 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 2169 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 2170 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2171 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2172 | }, |
| 2173 | }, |
| 2174 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2175 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 2176 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2177 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2178 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2179 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2180 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 2181 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2182 | "errors": [ # The list of errors encountered while processing this operation. |
| 2183 | { # Database instance operation error. |
| 2184 | "kind": "sql#operationError", # This is always sql#operationError. |
| 2185 | "code": "A String", # Identifies the specific error that occurred. |
| 2186 | "message": "A String", # Additional information about the error encountered. |
| 2187 | }, |
| 2188 | ], |
| 2189 | }, |
| 2190 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2191 | "selfLink": "A String", # The URI of this resource. |
| 2192 | "user": "A String", # The email address of the user who initiated this operation. |
| 2193 | }</pre> |
| 2194 | </div> |
| 2195 | |
| 2196 | <div class="method"> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2197 | <code class="details" id="truncateLog">truncateLog(project, instance, body)</code> |
| 2198 | <pre>Truncate MySQL general and slow query log tables |
| 2199 | |
| 2200 | Args: |
| 2201 | project: string, Project ID of the Cloud SQL project. (required) |
| 2202 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 2203 | body: object, The request body. (required) |
| 2204 | The object takes the form of: |
| 2205 | |
| 2206 | { # Instance truncate log request. |
| 2207 | "truncateLogContext": { # Database Instance truncate log context. # Contains details about the truncate log operation. |
| 2208 | "logType": "A String", # The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE. |
| 2209 | "kind": "sql#truncateLogContext", # This is always sql#truncateLogContext. |
| 2210 | }, |
| 2211 | } |
| 2212 | |
| 2213 | |
| 2214 | Returns: |
| 2215 | An object of the form: |
| 2216 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2217 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2218 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 2219 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2220 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2221 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2222 | "fileType": "A String", # The file type for the specified uri. |
| 2223 | # SQL: The file contains SQL statements. |
| 2224 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2225 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 2226 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2227 | "csvImportOptions": { # Options for importing data as CSV. |
| 2228 | "table": "A String", # The table to which CSV data is imported. |
| 2229 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 2230 | "A String", |
| 2231 | ], |
| 2232 | }, |
| 2233 | }, |
| 2234 | "kind": "sql#operation", # This is always sql#operation. |
| 2235 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 2236 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 2237 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 2238 | "fileType": "A String", # The file type for the specified uri. |
| 2239 | # SQL: The file contains SQL statements. |
| 2240 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2241 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2242 | "csvExportOptions": { # Options for exporting data as CSV. |
| 2243 | "selectQuery": "A String", # The select query used to extract the data. |
| 2244 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2245 | "databases": [ # Databases to be exported. |
| 2246 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 2247 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2248 | "A String", |
| 2249 | ], |
| 2250 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2251 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2252 | "A String", |
| 2253 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2254 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 2255 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 2256 | }, |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2257 | "schemaOnly": True or False, # Export only schemas. |
| 2258 | }, |
| 2259 | }, |
| 2260 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2261 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 2262 | "targetId": "A String", # Name of the database instance related to this operation. |
| 2263 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2264 | "targetLink": "A String", |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 2265 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2266 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 2267 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
| 2268 | "errors": [ # The list of errors encountered while processing this operation. |
| 2269 | { # Database instance operation error. |
| 2270 | "kind": "sql#operationError", # This is always sql#operationError. |
| 2271 | "code": "A String", # Identifies the specific error that occurred. |
| 2272 | "message": "A String", # Additional information about the error encountered. |
| 2273 | }, |
| 2274 | ], |
| 2275 | }, |
| 2276 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2277 | "selfLink": "A String", # The URI of this resource. |
| 2278 | "user": "A String", # The email address of the user who initiated this operation. |
| 2279 | }</pre> |
| 2280 | </div> |
| 2281 | |
| 2282 | <div class="method"> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2283 | <code class="details" id="update">update(project, instance, body)</code> |
| 2284 | <pre>Updates settings of a Cloud SQL instance. Caution: This is not a partial update, so you must include values for all the settings that you want to retain. For partial updates, use patch. |
| 2285 | |
| 2286 | Args: |
| 2287 | project: string, Project ID of the project that contains the instance. (required) |
| 2288 | instance: string, Cloud SQL instance ID. This does not include the project ID. (required) |
| 2289 | body: object, The request body. (required) |
| 2290 | The object takes the form of: |
| 2291 | |
| 2292 | { # A Cloud SQL instance resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2293 | "backendType": "A String", # FIRST_GEN: First Generation instance. MySQL only. |
| 2294 | # SECOND_GEN: Second Generation instance or PostgreSQL instance. |
| 2295 | # EXTERNAL: A database server that is not managed by Google. |
| 2296 | # This property is read-only; use the tier property in the settings object to determine the database type and Second or First Generation. |
| 2297 | "currentDiskSize": "A String", # The current disk usage of the instance in bytes. This property has been deprecated. Users should use the "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud Monitoring API instead. Please see this announcement for details. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2298 | "serviceAccountEmailAddress": "A String", # The service account email address assigned to the instance. This property is applicable only to Second Generation instances. |
| 2299 | "ipAddresses": [ # The assigned IP addresses for the instance. |
| 2300 | { # Database instance IP Mapping. |
| 2301 | "timeToRetire": "A String", # The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired. |
| 2302 | "ipAddress": "A String", # The IP address assigned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2303 | "type": "A String", # The type of this IP address. A PRIMARY address is a public address that can accept incoming connections. A PRIVATE address is a private address that can accept incoming connections. An OUTGOING address is the source address of connections originating from the instance, if supported. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2304 | }, |
| 2305 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2306 | "databaseVersion": "A String", # The database engine type and version. The databaseVersion field can not be changed after instance creation. MySQL Second Generation instances: MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 (default) or POSTGRES_11 Beta. MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2307 | "instanceType": "A String", # The instance type. This can be one of the following. |
| 2308 | # CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master. |
| 2309 | # ON_PREMISES_INSTANCE: An instance running on the customer's premises. |
| 2310 | # READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. |
| 2311 | "maxDiskSize": "A String", # The maximum disk size of the instance in bytes. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2312 | "diskEncryptionConfiguration": { # Disk encryption configuration. # Disk encryption configuration specific to an instance. Applies only to Second Generation instances. |
| 2313 | "kind": "sql#diskEncryptionConfiguration", # This is always sql#diskEncryptionConfiguration. |
| 2314 | "kmsKeyName": "A String", # KMS key resource name |
| 2315 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2316 | "suspensionReason": [ # If the instance state is SUSPENDED, the reason for the suspension. |
| 2317 | "A String", |
| 2318 | ], |
| 2319 | "masterInstanceName": "A String", # The name of the instance which will act as master in the replication setup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2320 | "diskEncryptionStatus": { # Disk encryption status. # Disk encryption status specific to an instance. Applies only to Second Generation instances. |
| 2321 | "kmsKeyVersionName": "A String", # KMS key version used to encrypt the Cloud SQL instance disk |
| 2322 | "kind": "sql#diskEncryptionStatus", # This is always sql#diskEncryptionStatus. |
| 2323 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2324 | "state": "A String", # The current serving state of the Cloud SQL instance. This can be one of the following. |
| 2325 | # RUNNABLE: The instance is running, or is ready to run when accessed. |
| 2326 | # SUSPENDED: The instance is not available, for example due to problems with billing. |
| 2327 | # PENDING_CREATE: The instance is being created. |
| 2328 | # MAINTENANCE: The instance is down for maintenance. |
| 2329 | # FAILED: The instance creation failed. |
| 2330 | # UNKNOWN_STATE: The state of the instance is unknown. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2331 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. Use the settings.settingsVersion field instead. |
| 2332 | "gceZone": "A String", # The Compute Engine zone that the instance is currently serving from. This value could be different from the zone that was specified when the instance was created if the instance has failed over to its secondary zone. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2333 | "failoverReplica": { # The name and status of the failover replica. This property is applicable only to Second Generation instances. |
| 2334 | "available": True or False, # The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 2335 | "name": "A String", # The name of the failover replica. If specified at instance creation, a failover replica is created for the instance. The name doesn't include the project ID. This property is applicable only to Second Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2336 | }, |
| 2337 | "replicaNames": [ # The replicas of the instance. |
| 2338 | "A String", |
| 2339 | ], |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2340 | "onPremisesConfiguration": { # On-premises instance configuration. # Configuration specific to on-premises instances. |
| 2341 | "kind": "sql#onPremisesConfiguration", # This is always sql#onPremisesConfiguration. |
| 2342 | "hostPort": "A String", # The host and port of the on-premises instance in host:port format |
| 2343 | }, |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 2344 | "connectionName": "A String", # Connection name of the Cloud SQL instance used in connection strings. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2345 | "kind": "sql#instance", # This is always sql#instance. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2346 | "name": "A String", # Name of the Cloud SQL instance. This does not include the project ID. |
| 2347 | "ipv6Address": "A String", # The IPv6 address assigned to the instance. This property is applicable only to First Generation instances. |
| 2348 | "serverCaCert": { # SslCerts Resource # SSL configuration. |
| 2349 | "certSerialNumber": "A String", # Serial number, as extracted from the certificate. |
| 2350 | "kind": "sql#sslCert", # This is always sql#sslCert. |
| 2351 | "sha1Fingerprint": "A String", # Sha1 Fingerprint. |
| 2352 | "commonName": "A String", # User supplied name. Constrained to [a-zA-Z.-_ ]+. |
| 2353 | "instance": "A String", # Name of the database instance. |
| 2354 | "cert": "A String", # PEM representation. |
| 2355 | "expirationTime": "A String", # The time when the certificate expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2356 | "createTime": "A String", # The time when the certificate was created in RFC 3339 format, for example 2012-11-15T16:19:00.094Z |
| 2357 | "selfLink": "A String", # The URI of this resource. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2358 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2359 | "region": "A String", # The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation. |
| 2360 | "settings": { # Database instance settings. # The user settings. |
| 2361 | "databaseFlags": [ # The database flags passed to the instance at startup. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2362 | { # Database flags for Cloud SQL instances. |
| 2363 | "name": "A String", # The name of the flag. These flags are passed at instance startup, so include both server options and system variables for MySQL. Flags should be specified with underscores, not hyphens. For more information, see Configuring Database Flags in the Cloud SQL documentation. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2364 | "value": "A String", # The value of the flag. Booleans should be set to on for true and off for false. This field must be omitted if the flag doesn't take a value. |
| 2365 | }, |
| 2366 | ], |
| 2367 | "kind": "sql#settings", # This is always sql#settings. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2368 | "dataDiskType": "A String", # The type of data disk: PD_SSD (default) or PD_HDD. Not used for First Generation instances. |
| 2369 | "availabilityType": "A String", # Availability type (PostgreSQL instances only). Potential values: |
| 2370 | # ZONAL: The instance serves data from only one zone. Outages in that zone affect data accessibility. |
| 2371 | # REGIONAL: The instance can serve data from more than one zone in a region (it is highly available). |
| 2372 | # For more information, see Overview of the High Availability Configuration. |
| 2373 | "maintenanceWindow": { # Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance purposes. # The maintenance window for this instance. This specifies when the instance can be restarted for maintenance purposes. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2374 | "kind": "sql#maintenanceWindow", # This is always sql#maintenanceWindow. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2375 | "updateTrack": "A String", # Maintenance timing setting: canary (Earlier) or stable (Later). |
| 2376 | # Learn more. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2377 | "day": 42, # day of week (1-7), starting on Monday. |
| 2378 | "hour": 42, # hour of day - 0 to 23. |
| 2379 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2380 | "authorizedGaeApplications": [ # The App Engine app IDs that can access this instance. First Generation instances only. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2381 | "A String", |
| 2382 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2383 | "activationPolicy": "A String", # The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. Valid values: |
| 2384 | # ALWAYS: The instance is on, and remains so even in the absence of connection requests. |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 2385 | # NEVER: The instance is off; it is not activated, even if a connection request arrives. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2386 | # ON_DEMAND: First Generation instances only. The instance responds to incoming requests, and turns itself off when not in use. Instances with PER_USE pricing turn off after 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of inactivity. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2387 | "backupConfiguration": { # Database instance backup configuration. # The daily backup configuration for the instance. |
| 2388 | "kind": "sql#backupConfiguration", # This is always sql#backupConfiguration. |
| 2389 | "enabled": True or False, # Whether this configuration is enabled. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2390 | "replicationLogArchivingEnabled": True or False, # Reserved for future use. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2391 | "binaryLogEnabled": True or False, # Whether binary log is enabled. If backup configuration is disabled, binary log must be disabled as well. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2392 | "location": "A String", # The location of the backup. |
| 2393 | "startTime": "A String", # Start time for the daily backup configuration in UTC timezone in the 24 hour format - HH:MM. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2394 | }, |
| 2395 | "ipConfiguration": { # IP Management configuration. # The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2396 | "requireSsl": True or False, # Whether SSL connections over IP should be enforced or not. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2397 | "ipv4Enabled": True or False, # Whether the instance should be assigned an IP address or not. |
| 2398 | "authorizedNetworks": [ # The list of external networks that are allowed to connect to the instance using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). |
| 2399 | { # An entry for an Access Control list. |
| 2400 | "expirationTime": "A String", # The time when this access control entry expires in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2401 | "kind": "sql#aclEntry", # This is always sql#aclEntry. |
| 2402 | "value": "A String", # The whitelisted value for the access control list. |
| 2403 | "name": "A String", # An optional label to identify this entry. |
| 2404 | }, |
| 2405 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2406 | "privateNetwork": "A String", # The resource link for the VPC network from which the Cloud SQL instance is accessible for private IP. For example, /projects/myProject/global/networks/default. This setting can be updated, but it cannot be removed after it is set. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2407 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2408 | "tier": "A String", # The tier (or machine type) for this instance, for example db-n1-standard-1 (MySQL instances) or db-custom-1-3840 (PostgreSQL instances). For MySQL instances, this property determines whether the instance is First or Second Generation. For more information, see Instance Settings. |
| 2409 | "userLabels": { # User-provided labels, represented as a dictionary where each label is a single key value pair. |
| 2410 | "a_key": "A String", # An individual label entry, composed of a key and a value. |
| 2411 | }, |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2412 | "databaseReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether replication is enabled or not. |
| 2413 | "replicationType": "A String", # The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2414 | "storageAutoResizeLimit": "A String", # The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2415 | "crashSafeReplicationEnabled": True or False, # Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. |
| 2416 | "pricingPlan": "A String", # The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances. |
| 2417 | "settingsVersion": "A String", # The version of instance settings. This is a required field for update method to make sure concurrent updates are handled properly. During update, use the most recent settingsVersion value for this instance and do not try to update this value. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2418 | "storageAutoResize": True or False, # Configuration to increase storage size automatically. The default value is true. Not used for First Generation instances. |
| 2419 | "locationPreference": { # Preferred location. This specifies where a Cloud SQL instance should preferably be located, either in a specific Compute Engine zone, or co-located with an App Engine application. Note that if the preferred location is not available, the instance will be located as close as possible within the region. Only one location may be specified. # The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or Compute Engine zone for better performance. App Engine co-location is only applicable to First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2420 | "kind": "sql#locationPreference", # This is always sql#locationPreference. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2421 | "zone": "A String", # The preferred Compute Engine zone (e.g. us-central1-a, us-central1-b, etc.). |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2422 | "followGaeApplication": "A String", # The AppEngine application to follow, it must be in the same region as the Cloud SQL instance. |
| 2423 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2424 | "dataDiskSizeGb": "A String", # The size of data disk, in GB. The data disk size minimum is 10GB. Not used for First Generation instances. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 2425 | }, |
| 2426 | "project": "A String", # The project ID of the project containing the Cloud SQL instance. The Google apps domain is prefixed if applicable. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2427 | "replicaConfiguration": { # Read-replica configuration for connecting to the master. # Configuration specific to failover replicas and read replicas. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2428 | "kind": "sql#replicaConfiguration", # This is always sql#replicaConfiguration. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2429 | "failoverTarget": True or False, # Specifies if the replica is the failover target. If the field is set to true the replica will be designated as a failover replica. In case the master instance fails, the replica instance will be promoted as the new master instance. |
| 2430 | # Only one replica can be specified as failover target, and the replica has to be in different zone with the master instance. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2431 | "mysqlReplicaConfiguration": { # Read-replica configuration specific to MySQL databases. # MySQL specific configuration when replicating from a MySQL on-premises master. Replication configuration information such as the username, password, certificates, and keys are not stored in the instance metadata. The configuration information is used only to set up the replication connection and is stored by MySQL in a file named master.info in the data directory. |
| 2432 | "username": "A String", # The username for the replication connection. |
| 2433 | "kind": "sql#mysqlReplicaConfiguration", # This is always sql#mysqlReplicaConfiguration. |
| 2434 | "clientKey": "A String", # PEM representation of the slave's private key. The corresponsing public key is encoded in the client's certificate. |
| 2435 | "sslCipher": "A String", # A list of permissible ciphers to use for SSL encryption. |
| 2436 | "caCertificate": "A String", # PEM representation of the trusted CA's x509 certificate. |
| 2437 | "clientCertificate": "A String", # PEM representation of the slave's x509 certificate. |
| 2438 | "masterHeartbeatPeriod": "A String", # Interval in milliseconds between replication heartbeats. |
| 2439 | "verifyServerCertificate": True or False, # Whether or not to check the master's Common Name value in the certificate that it sends during the SSL handshake. |
| 2440 | "dumpFilePath": "A String", # Path to a SQL dump file in Google Cloud Storage from which the slave instance is to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates from which replication should begin. This can be accomplished by setting --master-data to 1 when using mysqldump. |
| 2441 | "password": "A String", # The password for the replication connection. |
| 2442 | "connectRetryInterval": 42, # Seconds to wait between connect retries. MySQL's default is 60 seconds. |
| 2443 | }, |
| 2444 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2445 | "rootPassword": "A String", # Initial root password. Use only on creation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2446 | "selfLink": "A String", # The URI of this resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2447 | } |
| 2448 | |
| 2449 | |
| 2450 | Returns: |
| 2451 | An object of the form: |
| 2452 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2453 | { # An Operation resource. For successful operations that return an Operation resource, only the fields relevant to the operation are populated in the resource. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2454 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 2455 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2456 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2457 | "database": "A String", # The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2458 | "fileType": "A String", # The file type for the specified uri. |
| 2459 | # SQL: The file contains SQL statements. |
| 2460 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2461 | "uri": "A String", # Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file. |
| 2462 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2463 | "csvImportOptions": { # Options for importing data as CSV. |
| 2464 | "table": "A String", # The table to which CSV data is imported. |
| 2465 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 2466 | "A String", |
| 2467 | ], |
| 2468 | }, |
| 2469 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2470 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2471 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
| 2472 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 2473 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 2474 | "fileType": "A String", # The file type for the specified uri. |
| 2475 | # SQL: The file contains SQL statements. |
| 2476 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2477 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2478 | "csvExportOptions": { # Options for exporting data as CSV. |
| 2479 | "selectQuery": "A String", # The select query used to extract the data. |
| 2480 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2481 | "databases": [ # Databases to be exported. |
| 2482 | # MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. |
| 2483 | # PostgreSQL instances: Specify exactly one database to be exported. If fileType is CSV, this database must match the database used in the csvExportOptions.selectQuery property. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2484 | "A String", |
| 2485 | ], |
| 2486 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2487 | "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, you can specify only one table. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2488 | "A String", |
| 2489 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 2490 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 2491 | "masterData": 42, # Option to include SQL statement required to set up replication. If set to 1, the dump file includes a CHANGE MASTER TO statement with the binary log coordinates. If set to 2, the CHANGE MASTER TO statement is written as a SQL comment, and has no effect. All other values are ignored. |
| 2492 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 2493 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2494 | }, |
| 2495 | }, |
| 2496 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2497 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 2498 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2499 | "operationType": "A String", # The type of the operation. Valid values are CREATE, DELETE, UPDATE, RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 2500 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2501 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 2502 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 2503 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 2504 | "errors": [ # The list of errors encountered while processing this operation. |
| 2505 | { # Database instance operation error. |
| 2506 | "kind": "sql#operationError", # This is always sql#operationError. |
| 2507 | "code": "A String", # Identifies the specific error that occurred. |
| 2508 | "message": "A String", # Additional information about the error encountered. |
| 2509 | }, |
| 2510 | ], |
| 2511 | }, |
| 2512 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 2513 | "selfLink": "A String", # The URI of this resource. |
| 2514 | "user": "A String", # The email address of the user who initiated this operation. |
| 2515 | }</pre> |
| 2516 | </div> |
| 2517 | |
| 2518 | </body></html> |