Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [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 | |
| 75 | <h1><a href="sql_v1beta4.html">Cloud SQL Admin API</a> . <a href="sql_v1beta4.users.html">users</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#delete">delete(project, instance, host=None, name=None, x__xgafv=None)</a></code></p> |
| 79 | <p class="firstline">Deletes a user from a Cloud SQL instance.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#insert">insert(project, instance, body=None, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Creates a new user in a Cloud SQL instance.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#list">list(project, instance, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Lists users in the specified Cloud SQL instance.</p> |
| 86 | <p class="toc_element"> |
| 87 | <code><a href="#update">update(project, instance, body=None, host=None, name=None, x__xgafv=None)</a></code></p> |
| 88 | <p class="firstline">Updates an existing user in a Cloud SQL instance.</p> |
| 89 | <h3>Method Details</h3> |
| 90 | <div class="method"> |
| 91 | <code class="details" id="delete">delete(project, instance, host=None, name=None, x__xgafv=None)</code> |
| 92 | <pre>Deletes a user from a Cloud SQL instance. |
| 93 | |
| 94 | Args: |
| 95 | project: string, Project ID of the project that contains the instance. (required) |
| 96 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 97 | host: string, Host of the user in the instance. |
| 98 | name: string, Name of the user in the instance. |
| 99 | x__xgafv: string, V1 error format. |
| 100 | Allowed values |
| 101 | 1 - v1 error format |
| 102 | 2 - v2 error format |
| 103 | |
| 104 | Returns: |
| 105 | An object of the form: |
| 106 | |
| 107 | { # An Operation resource.&nbsp;For successful operations that return an |
| 108 | # Operation resource, only the fields relevant to the operation are populated |
| 109 | # in the resource. |
| 110 | "user": "A String", # The email address of the user who initiated this operation. |
| 111 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 112 | "selfLink": "A String", # The URI of this resource. |
| 113 | "targetLink": "A String", |
| 114 | "operationType": "A String", # The type of the operation. Valid values are <code>CREATE</code>, |
| 115 | # <code>DELETE</code>, <code>UPDATE</code>, <code>RESTART</code>, |
| 116 | # <code>IMPORT</code>, <code>EXPORT</code>, <code>BACKUP_VOLUME</code>, |
| 117 | # <code>RESTORE_VOLUME</code>, <code>CREATE_USER</code>, |
| 118 | # <code>DELETE_USER</code>, <code>CREATE_DATABASE</code>, |
| 119 | # <code>DELETE_DATABASE</code> . |
| 120 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be |
| 121 | # populated. |
| 122 | "errors": [ # The list of errors encountered while processing this operation. |
| 123 | { # Database instance operation error. |
| 124 | "code": "A String", # Identifies the specific error that occurred. |
| 125 | "message": "A String", # Additional information about the error encountered. |
| 126 | "kind": "A String", # This is always <code>sql#operationError</code>. |
| 127 | }, |
| 128 | ], |
| 129 | "kind": "A String", # This is always <code>sql#operationErrors</code>. |
| 130 | }, |
| 131 | "kind": "A String", # This is always <code>sql#operation</code>. |
| 132 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 133 | "csvImportOptions": { # Options for importing data as CSV. |
| 134 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns |
| 135 | # of the database table are loaded with CSV data. |
| 136 | "A String", |
| 137 | ], |
| 138 | "table": "A String", # The table to which CSV data is imported. |
| 139 | }, |
| 140 | "kind": "A String", # This is always <code>sql#importContext</code>. |
| 141 | "database": "A String", # The target database for the import. If <code>fileType</code> is |
| 142 | # <code>SQL</code>, this field is required only if the import file does not |
| 143 | # specify a database, and is overridden by any database specification in the |
| 144 | # import file. If <code>fileType</code> is <code>CSV</code>, one database |
| 145 | # must be specified. |
| 146 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 147 | "bakImportOptions": { # Import parameters specific to SQL Server .BAK files |
| 148 | "encryptionOptions": { |
| 149 | "pvkPassword": "A String", # Password that encrypts the private key |
| 150 | "certPath": "A String", # Path to the Certificate (.cer) in Cloud Storage, in the form |
| 151 | # <code>gs://bucketName/fileName</code>. The instance must have |
| 152 | # write permissions to the bucket and read access to the file. |
| 153 | "pvkPath": "A String", # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the |
| 154 | # form <code>gs://bucketName/fileName</code>. The instance must have |
| 155 | # write permissions to the bucket and read access to the file. |
| 156 | }, |
| 157 | }, |
| 158 | "uri": "A String", # Path to the import file in Cloud Storage, in the form |
| 159 | # <code>gs: |
| 160 | # //bucketName/fileName</code>. Compressed gzip files (.gz) are supported |
| 161 | # // when <code>fileType</code> is <code>SQL</code>. The instance must have |
| 162 | # // write permissions to the bucket and read access to the file. |
| 163 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 164 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 165 | }, |
| 166 | "status": "A String", # The status of an operation. Valid values are <code>PENDING</code>, |
| 167 | # <code>RUNNING</code>, <code>DONE</code>, |
| 168 | # <code>SQL_OPERATION_STATUS_UNSPECIFIED</code>. |
| 169 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this |
| 170 | # identifier to retrieve the Operations resource that has information about |
| 171 | # the operation. |
| 172 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 173 | "databases": [ # Databases to be exported. <br /> <b>MySQL instances:</b> If |
| 174 | # <code>fileType</code> is <code>SQL</code> and no database is specified, all |
| 175 | # databases are exported, except for the <code>mysql</code> system database. |
| 176 | # If <code>fileType</code> is <code>CSV</code>, you can specify one database, |
| 177 | # either by using this property or by using the |
| 178 | # <code>csvExportOptions.selectQuery</code> property, which takes precedence |
| 179 | # over this property. <br /> <b>PostgreSQL instances:</b> You must specify |
| 180 | # one database to be exported. If <code>fileType</code> is <code>CSV</code>, |
| 181 | # this database must match the one specified in the |
| 182 | # <code>csvExportOptions.selectQuery</code> property. |
| 183 | "A String", |
| 184 | ], |
| 185 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 186 | "tables": [ # Tables to export, or that were exported, from the specified database. If |
| 187 | # you specify tables, specify one and only one database. For PostgreSQL |
| 188 | # instances, you can specify only one table. |
| 189 | "A String", |
| 190 | ], |
| 191 | "schemaOnly": True or False, # Export only schemas. |
| 192 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 193 | "masterData": 42, # Option to include SQL statement required to set up replication. |
| 194 | # If set to <code>1</code>, the dump file includes |
| 195 | # a CHANGE MASTER TO statement with the binary log coordinates. |
| 196 | # If set to <code>2</code>, the CHANGE MASTER TO statement is written as |
| 197 | # a SQL comment, and has no effect. |
| 198 | # All other values are ignored. |
| 199 | }, |
| 200 | }, |
| 201 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 202 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 203 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be |
| 204 | # stored. The URI is in the form <code>gs: |
| 205 | # //bucketName/fileName</code>. If the file already exists, the requests |
| 206 | # // succeeds, but the operation fails. If <code>fileType</code> is |
| 207 | # // <code>SQL</code> and the filename ends with .gz, the contents are |
| 208 | # // compressed. |
| 209 | "csvExportOptions": { # Options for exporting data as CSV. |
| 210 | "selectQuery": "A String", # The select query used to extract the data. |
| 211 | }, |
| 212 | "kind": "A String", # This is always <code>sql#exportContext</code>. |
| 213 | }, |
| 214 | "targetId": "A String", # Name of the database instance related to this operation. |
| 215 | "endTime": "A String", # The time this operation finished in UTC timezone in <a |
| 216 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 217 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 218 | "startTime": "A String", # The time this operation actually started in UTC timezone in <a |
| 219 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 220 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 221 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in <a |
| 222 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 223 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 224 | }</pre> |
| 225 | </div> |
| 226 | |
| 227 | <div class="method"> |
| 228 | <code class="details" id="insert">insert(project, instance, body=None, x__xgafv=None)</code> |
| 229 | <pre>Creates a new user in a Cloud SQL instance. |
| 230 | |
| 231 | Args: |
| 232 | project: string, Project ID of the project that contains the instance. (required) |
| 233 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 234 | body: object, The request body. |
| 235 | The object takes the form of: |
| 236 | |
| 237 | { # A Cloud SQL user resource. |
| 238 | "host": "A String", # The host name from which the user can connect. For <code>insert</code> |
| 239 | # operations, host defaults to an empty string. For <code>update</code> |
| 240 | # operations, host is specified as part of the request URL. The host name |
| 241 | # cannot be updated after insertion. |
| 242 | "kind": "A String", # This is always <code>sql#user</code>. |
| 243 | "password": "A String", # The password for the user. |
| 244 | "etag": "A String", # This field is deprecated and will be removed from a future version of the |
| 245 | # API. |
| 246 | "sqlserverUserDetails": { # Represents a Sql Server user on the Cloud SQL instance. |
| 247 | "disabled": True or False, # If the user has been disabled |
| 248 | "serverRoles": [ # The server roles for this user |
| 249 | "A String", |
| 250 | ], |
| 251 | }, |
| 252 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for |
| 253 | # <code>update</code> since it is already specified in the URL. |
| 254 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. |
| 255 | # Can be omitted for <code>update</code> since it is already specified on the |
| 256 | # URL. |
| 257 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google |
| 258 | # apps domain is prefixed if applicable. Can be omitted for |
| 259 | # <code>update</code> since it is already specified on the URL. |
| 260 | } |
| 261 | |
| 262 | x__xgafv: string, V1 error format. |
| 263 | Allowed values |
| 264 | 1 - v1 error format |
| 265 | 2 - v2 error format |
| 266 | |
| 267 | Returns: |
| 268 | An object of the form: |
| 269 | |
| 270 | { # An Operation resource.&nbsp;For successful operations that return an |
| 271 | # Operation resource, only the fields relevant to the operation are populated |
| 272 | # in the resource. |
| 273 | "user": "A String", # The email address of the user who initiated this operation. |
| 274 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 275 | "selfLink": "A String", # The URI of this resource. |
| 276 | "targetLink": "A String", |
| 277 | "operationType": "A String", # The type of the operation. Valid values are <code>CREATE</code>, |
| 278 | # <code>DELETE</code>, <code>UPDATE</code>, <code>RESTART</code>, |
| 279 | # <code>IMPORT</code>, <code>EXPORT</code>, <code>BACKUP_VOLUME</code>, |
| 280 | # <code>RESTORE_VOLUME</code>, <code>CREATE_USER</code>, |
| 281 | # <code>DELETE_USER</code>, <code>CREATE_DATABASE</code>, |
| 282 | # <code>DELETE_DATABASE</code> . |
| 283 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be |
| 284 | # populated. |
| 285 | "errors": [ # The list of errors encountered while processing this operation. |
| 286 | { # Database instance operation error. |
| 287 | "code": "A String", # Identifies the specific error that occurred. |
| 288 | "message": "A String", # Additional information about the error encountered. |
| 289 | "kind": "A String", # This is always <code>sql#operationError</code>. |
| 290 | }, |
| 291 | ], |
| 292 | "kind": "A String", # This is always <code>sql#operationErrors</code>. |
| 293 | }, |
| 294 | "kind": "A String", # This is always <code>sql#operation</code>. |
| 295 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 296 | "csvImportOptions": { # Options for importing data as CSV. |
| 297 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns |
| 298 | # of the database table are loaded with CSV data. |
| 299 | "A String", |
| 300 | ], |
| 301 | "table": "A String", # The table to which CSV data is imported. |
| 302 | }, |
| 303 | "kind": "A String", # This is always <code>sql#importContext</code>. |
| 304 | "database": "A String", # The target database for the import. If <code>fileType</code> is |
| 305 | # <code>SQL</code>, this field is required only if the import file does not |
| 306 | # specify a database, and is overridden by any database specification in the |
| 307 | # import file. If <code>fileType</code> is <code>CSV</code>, one database |
| 308 | # must be specified. |
| 309 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 310 | "bakImportOptions": { # Import parameters specific to SQL Server .BAK files |
| 311 | "encryptionOptions": { |
| 312 | "pvkPassword": "A String", # Password that encrypts the private key |
| 313 | "certPath": "A String", # Path to the Certificate (.cer) in Cloud Storage, in the form |
| 314 | # <code>gs://bucketName/fileName</code>. The instance must have |
| 315 | # write permissions to the bucket and read access to the file. |
| 316 | "pvkPath": "A String", # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the |
| 317 | # form <code>gs://bucketName/fileName</code>. The instance must have |
| 318 | # write permissions to the bucket and read access to the file. |
| 319 | }, |
| 320 | }, |
| 321 | "uri": "A String", # Path to the import file in Cloud Storage, in the form |
| 322 | # <code>gs: |
| 323 | # //bucketName/fileName</code>. Compressed gzip files (.gz) are supported |
| 324 | # // when <code>fileType</code> is <code>SQL</code>. The instance must have |
| 325 | # // write permissions to the bucket and read access to the file. |
| 326 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 327 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 328 | }, |
| 329 | "status": "A String", # The status of an operation. Valid values are <code>PENDING</code>, |
| 330 | # <code>RUNNING</code>, <code>DONE</code>, |
| 331 | # <code>SQL_OPERATION_STATUS_UNSPECIFIED</code>. |
| 332 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this |
| 333 | # identifier to retrieve the Operations resource that has information about |
| 334 | # the operation. |
| 335 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 336 | "databases": [ # Databases to be exported. <br /> <b>MySQL instances:</b> If |
| 337 | # <code>fileType</code> is <code>SQL</code> and no database is specified, all |
| 338 | # databases are exported, except for the <code>mysql</code> system database. |
| 339 | # If <code>fileType</code> is <code>CSV</code>, you can specify one database, |
| 340 | # either by using this property or by using the |
| 341 | # <code>csvExportOptions.selectQuery</code> property, which takes precedence |
| 342 | # over this property. <br /> <b>PostgreSQL instances:</b> You must specify |
| 343 | # one database to be exported. If <code>fileType</code> is <code>CSV</code>, |
| 344 | # this database must match the one specified in the |
| 345 | # <code>csvExportOptions.selectQuery</code> property. |
| 346 | "A String", |
| 347 | ], |
| 348 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 349 | "tables": [ # Tables to export, or that were exported, from the specified database. If |
| 350 | # you specify tables, specify one and only one database. For PostgreSQL |
| 351 | # instances, you can specify only one table. |
| 352 | "A String", |
| 353 | ], |
| 354 | "schemaOnly": True or False, # Export only schemas. |
| 355 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 356 | "masterData": 42, # Option to include SQL statement required to set up replication. |
| 357 | # If set to <code>1</code>, the dump file includes |
| 358 | # a CHANGE MASTER TO statement with the binary log coordinates. |
| 359 | # If set to <code>2</code>, the CHANGE MASTER TO statement is written as |
| 360 | # a SQL comment, and has no effect. |
| 361 | # All other values are ignored. |
| 362 | }, |
| 363 | }, |
| 364 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 365 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 366 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be |
| 367 | # stored. The URI is in the form <code>gs: |
| 368 | # //bucketName/fileName</code>. If the file already exists, the requests |
| 369 | # // succeeds, but the operation fails. If <code>fileType</code> is |
| 370 | # // <code>SQL</code> and the filename ends with .gz, the contents are |
| 371 | # // compressed. |
| 372 | "csvExportOptions": { # Options for exporting data as CSV. |
| 373 | "selectQuery": "A String", # The select query used to extract the data. |
| 374 | }, |
| 375 | "kind": "A String", # This is always <code>sql#exportContext</code>. |
| 376 | }, |
| 377 | "targetId": "A String", # Name of the database instance related to this operation. |
| 378 | "endTime": "A String", # The time this operation finished in UTC timezone in <a |
| 379 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 380 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 381 | "startTime": "A String", # The time this operation actually started in UTC timezone in <a |
| 382 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 383 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 384 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in <a |
| 385 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 386 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 387 | }</pre> |
| 388 | </div> |
| 389 | |
| 390 | <div class="method"> |
| 391 | <code class="details" id="list">list(project, instance, x__xgafv=None)</code> |
| 392 | <pre>Lists users in the specified Cloud SQL instance. |
| 393 | |
| 394 | Args: |
| 395 | project: string, Project ID of the project that contains the instance. (required) |
| 396 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 397 | x__xgafv: string, V1 error format. |
| 398 | Allowed values |
| 399 | 1 - v1 error format |
| 400 | 2 - v2 error format |
| 401 | |
| 402 | Returns: |
| 403 | An object of the form: |
| 404 | |
| 405 | { # User list response. |
| 406 | "nextPageToken": "A String", # An identifier that uniquely identifies the operation. You can use this |
| 407 | # identifier to retrieve the Operations resource that has information about |
| 408 | # the operation. |
| 409 | "kind": "A String", # This is always <code>sql#usersList</code>. |
| 410 | "items": [ # List of user resources in the instance. |
| 411 | { # A Cloud SQL user resource. |
| 412 | "host": "A String", # The host name from which the user can connect. For <code>insert</code> |
| 413 | # operations, host defaults to an empty string. For <code>update</code> |
| 414 | # operations, host is specified as part of the request URL. The host name |
| 415 | # cannot be updated after insertion. |
| 416 | "kind": "A String", # This is always <code>sql#user</code>. |
| 417 | "password": "A String", # The password for the user. |
| 418 | "etag": "A String", # This field is deprecated and will be removed from a future version of the |
| 419 | # API. |
| 420 | "sqlserverUserDetails": { # Represents a Sql Server user on the Cloud SQL instance. |
| 421 | "disabled": True or False, # If the user has been disabled |
| 422 | "serverRoles": [ # The server roles for this user |
| 423 | "A String", |
| 424 | ], |
| 425 | }, |
| 426 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for |
| 427 | # <code>update</code> since it is already specified in the URL. |
| 428 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. |
| 429 | # Can be omitted for <code>update</code> since it is already specified on the |
| 430 | # URL. |
| 431 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google |
| 432 | # apps domain is prefixed if applicable. Can be omitted for |
| 433 | # <code>update</code> since it is already specified on the URL. |
| 434 | }, |
| 435 | ], |
| 436 | }</pre> |
| 437 | </div> |
| 438 | |
| 439 | <div class="method"> |
| 440 | <code class="details" id="update">update(project, instance, body=None, host=None, name=None, x__xgafv=None)</code> |
| 441 | <pre>Updates an existing user in a Cloud SQL instance. |
| 442 | |
| 443 | Args: |
| 444 | project: string, Project ID of the project that contains the instance. (required) |
| 445 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 446 | body: object, The request body. |
| 447 | The object takes the form of: |
| 448 | |
| 449 | { # A Cloud SQL user resource. |
| 450 | "host": "A String", # The host name from which the user can connect. For <code>insert</code> |
| 451 | # operations, host defaults to an empty string. For <code>update</code> |
| 452 | # operations, host is specified as part of the request URL. The host name |
| 453 | # cannot be updated after insertion. |
| 454 | "kind": "A String", # This is always <code>sql#user</code>. |
| 455 | "password": "A String", # The password for the user. |
| 456 | "etag": "A String", # This field is deprecated and will be removed from a future version of the |
| 457 | # API. |
| 458 | "sqlserverUserDetails": { # Represents a Sql Server user on the Cloud SQL instance. |
| 459 | "disabled": True or False, # If the user has been disabled |
| 460 | "serverRoles": [ # The server roles for this user |
| 461 | "A String", |
| 462 | ], |
| 463 | }, |
| 464 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for |
| 465 | # <code>update</code> since it is already specified in the URL. |
| 466 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. |
| 467 | # Can be omitted for <code>update</code> since it is already specified on the |
| 468 | # URL. |
| 469 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google |
| 470 | # apps domain is prefixed if applicable. Can be omitted for |
| 471 | # <code>update</code> since it is already specified on the URL. |
| 472 | } |
| 473 | |
| 474 | host: string, Optional. Host of the user in the instance. |
| 475 | name: string, Name of the user in the instance. |
| 476 | x__xgafv: string, V1 error format. |
| 477 | Allowed values |
| 478 | 1 - v1 error format |
| 479 | 2 - v2 error format |
| 480 | |
| 481 | Returns: |
| 482 | An object of the form: |
| 483 | |
| 484 | { # An Operation resource.&nbsp;For successful operations that return an |
| 485 | # Operation resource, only the fields relevant to the operation are populated |
| 486 | # in the resource. |
| 487 | "user": "A String", # The email address of the user who initiated this operation. |
| 488 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 489 | "selfLink": "A String", # The URI of this resource. |
| 490 | "targetLink": "A String", |
| 491 | "operationType": "A String", # The type of the operation. Valid values are <code>CREATE</code>, |
| 492 | # <code>DELETE</code>, <code>UPDATE</code>, <code>RESTART</code>, |
| 493 | # <code>IMPORT</code>, <code>EXPORT</code>, <code>BACKUP_VOLUME</code>, |
| 494 | # <code>RESTORE_VOLUME</code>, <code>CREATE_USER</code>, |
| 495 | # <code>DELETE_USER</code>, <code>CREATE_DATABASE</code>, |
| 496 | # <code>DELETE_DATABASE</code> . |
| 497 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be |
| 498 | # populated. |
| 499 | "errors": [ # The list of errors encountered while processing this operation. |
| 500 | { # Database instance operation error. |
| 501 | "code": "A String", # Identifies the specific error that occurred. |
| 502 | "message": "A String", # Additional information about the error encountered. |
| 503 | "kind": "A String", # This is always <code>sql#operationError</code>. |
| 504 | }, |
| 505 | ], |
| 506 | "kind": "A String", # This is always <code>sql#operationErrors</code>. |
| 507 | }, |
| 508 | "kind": "A String", # This is always <code>sql#operation</code>. |
| 509 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
| 510 | "csvImportOptions": { # Options for importing data as CSV. |
| 511 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns |
| 512 | # of the database table are loaded with CSV data. |
| 513 | "A String", |
| 514 | ], |
| 515 | "table": "A String", # The table to which CSV data is imported. |
| 516 | }, |
| 517 | "kind": "A String", # This is always <code>sql#importContext</code>. |
| 518 | "database": "A String", # The target database for the import. If <code>fileType</code> is |
| 519 | # <code>SQL</code>, this field is required only if the import file does not |
| 520 | # specify a database, and is overridden by any database specification in the |
| 521 | # import file. If <code>fileType</code> is <code>CSV</code>, one database |
| 522 | # must be specified. |
| 523 | "importUser": "A String", # The PostgreSQL user for this import operation. PostgreSQL instances only. |
| 524 | "bakImportOptions": { # Import parameters specific to SQL Server .BAK files |
| 525 | "encryptionOptions": { |
| 526 | "pvkPassword": "A String", # Password that encrypts the private key |
| 527 | "certPath": "A String", # Path to the Certificate (.cer) in Cloud Storage, in the form |
| 528 | # <code>gs://bucketName/fileName</code>. The instance must have |
| 529 | # write permissions to the bucket and read access to the file. |
| 530 | "pvkPath": "A String", # Path to the Certificate Private Key (.pvk) in Cloud Storage, in the |
| 531 | # form <code>gs://bucketName/fileName</code>. The instance must have |
| 532 | # write permissions to the bucket and read access to the file. |
| 533 | }, |
| 534 | }, |
| 535 | "uri": "A String", # Path to the import file in Cloud Storage, in the form |
| 536 | # <code>gs: |
| 537 | # //bucketName/fileName</code>. Compressed gzip files (.gz) are supported |
| 538 | # // when <code>fileType</code> is <code>SQL</code>. The instance must have |
| 539 | # // write permissions to the bucket and read access to the file. |
| 540 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 541 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 542 | }, |
| 543 | "status": "A String", # The status of an operation. Valid values are <code>PENDING</code>, |
| 544 | # <code>RUNNING</code>, <code>DONE</code>, |
| 545 | # <code>SQL_OPERATION_STATUS_UNSPECIFIED</code>. |
| 546 | "name": "A String", # An identifier that uniquely identifies the operation. You can use this |
| 547 | # identifier to retrieve the Operations resource that has information about |
| 548 | # the operation. |
| 549 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 550 | "databases": [ # Databases to be exported. <br /> <b>MySQL instances:</b> If |
| 551 | # <code>fileType</code> is <code>SQL</code> and no database is specified, all |
| 552 | # databases are exported, except for the <code>mysql</code> system database. |
| 553 | # If <code>fileType</code> is <code>CSV</code>, you can specify one database, |
| 554 | # either by using this property or by using the |
| 555 | # <code>csvExportOptions.selectQuery</code> property, which takes precedence |
| 556 | # over this property. <br /> <b>PostgreSQL instances:</b> You must specify |
| 557 | # one database to be exported. If <code>fileType</code> is <code>CSV</code>, |
| 558 | # this database must match the one specified in the |
| 559 | # <code>csvExportOptions.selectQuery</code> property. |
| 560 | "A String", |
| 561 | ], |
| 562 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
| 563 | "tables": [ # Tables to export, or that were exported, from the specified database. If |
| 564 | # you specify tables, specify one and only one database. For PostgreSQL |
| 565 | # instances, you can specify only one table. |
| 566 | "A String", |
| 567 | ], |
| 568 | "schemaOnly": True or False, # Export only schemas. |
| 569 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 570 | "masterData": 42, # Option to include SQL statement required to set up replication. |
| 571 | # If set to <code>1</code>, the dump file includes |
| 572 | # a CHANGE MASTER TO statement with the binary log coordinates. |
| 573 | # If set to <code>2</code>, the CHANGE MASTER TO statement is written as |
| 574 | # a SQL comment, and has no effect. |
| 575 | # All other values are ignored. |
| 576 | }, |
| 577 | }, |
| 578 | "fileType": "A String", # The file type for the specified uri. <br><code>SQL</code>: The file |
| 579 | # contains SQL statements. <br><code>CSV</code>: The file contains CSV data. |
| 580 | "uri": "A String", # The path to the file in Google Cloud Storage where the export will be |
| 581 | # stored. The URI is in the form <code>gs: |
| 582 | # //bucketName/fileName</code>. If the file already exists, the requests |
| 583 | # // succeeds, but the operation fails. If <code>fileType</code> is |
| 584 | # // <code>SQL</code> and the filename ends with .gz, the contents are |
| 585 | # // compressed. |
| 586 | "csvExportOptions": { # Options for exporting data as CSV. |
| 587 | "selectQuery": "A String", # The select query used to extract the data. |
| 588 | }, |
| 589 | "kind": "A String", # This is always <code>sql#exportContext</code>. |
| 590 | }, |
| 591 | "targetId": "A String", # Name of the database instance related to this operation. |
| 592 | "endTime": "A String", # The time this operation finished in UTC timezone in <a |
| 593 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 594 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 595 | "startTime": "A String", # The time this operation actually started in UTC timezone in <a |
| 596 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 597 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 598 | "insertTime": "A String", # The time this operation was enqueued in UTC timezone in <a |
| 599 | # href="https://tools.ietf.org/html/rfc3339">RFC 3339</a> format, for example |
| 600 | # <code>2012-11-15T16:19:00.094Z</code>. |
| 601 | }</pre> |
| 602 | </div> |
| 603 | |
| 604 | </body></html> |