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.users.html">users</a></h1> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#delete">delete(project, instance, host, name)</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)</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)</a></code></p> |
| 85 | <p class="firstline">Lists users in the specified 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="#update">update(project, instance, name, body, host=None)</a></code></p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 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, name)</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. (required) |
| 98 | name: string, Name of the user in the instance. (required) |
| 99 | |
| 100 | Returns: |
| 101 | An object of the form: |
| 102 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 103 | { # 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] | 104 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 105 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 106 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 107 | "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] | 108 | "fileType": "A String", # The file type for the specified uri. |
| 109 | # SQL: The file contains SQL statements. |
| 110 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 111 | "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. |
| 112 | "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] | 113 | "csvImportOptions": { # Options for importing data as CSV. |
| 114 | "table": "A String", # The table to which CSV data is imported. |
| 115 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 116 | "A String", |
| 117 | ], |
| 118 | }, |
| 119 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 120 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 121 | "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. |
| 122 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 123 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 124 | "fileType": "A String", # The file type for the specified uri. |
| 125 | # SQL: The file contains SQL statements. |
| 126 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 127 | "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] | 128 | "csvExportOptions": { # Options for exporting data as CSV. |
| 129 | "selectQuery": "A String", # The select query used to extract the data. |
| 130 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 131 | "databases": [ # Databases to be exported. |
| 132 | # 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. |
| 133 | # 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] | 134 | "A String", |
| 135 | ], |
| 136 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 137 | "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] | 138 | "A String", |
| 139 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 140 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 141 | "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. |
| 142 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 143 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 144 | }, |
| 145 | }, |
| 146 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 147 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 148 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 149 | "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] | 150 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 151 | "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] | 152 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 153 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 154 | "errors": [ # The list of errors encountered while processing this operation. |
| 155 | { # Database instance operation error. |
| 156 | "kind": "sql#operationError", # This is always sql#operationError. |
| 157 | "code": "A String", # Identifies the specific error that occurred. |
| 158 | "message": "A String", # Additional information about the error encountered. |
| 159 | }, |
| 160 | ], |
| 161 | }, |
| 162 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 163 | "selfLink": "A String", # The URI of this resource. |
| 164 | "user": "A String", # The email address of the user who initiated this operation. |
| 165 | }</pre> |
| 166 | </div> |
| 167 | |
| 168 | <div class="method"> |
| 169 | <code class="details" id="insert">insert(project, instance, body)</code> |
| 170 | <pre>Creates a new user in a Cloud SQL instance. |
| 171 | |
| 172 | Args: |
| 173 | project: string, Project ID of the project that contains the instance. (required) |
| 174 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 175 | body: object, The request body. (required) |
| 176 | The object takes the form of: |
| 177 | |
| 178 | { # A Cloud SQL user resource. |
| 179 | "kind": "sql#user", # This is always sql#user. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 180 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified in the URL. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 181 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update since it is already specified on the URL. |
| 182 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update since it is already specified on the URL. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 183 | "host": "A String", # The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 184 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 185 | "password": "A String", # The password for the user. |
| 186 | } |
| 187 | |
| 188 | |
| 189 | Returns: |
| 190 | An object of the form: |
| 191 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 192 | { # 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] | 193 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 194 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 195 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 196 | "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] | 197 | "fileType": "A String", # The file type for the specified uri. |
| 198 | # SQL: The file contains SQL statements. |
| 199 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 200 | "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. |
| 201 | "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] | 202 | "csvImportOptions": { # Options for importing data as CSV. |
| 203 | "table": "A String", # The table to which CSV data is imported. |
| 204 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 205 | "A String", |
| 206 | ], |
| 207 | }, |
| 208 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 209 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 210 | "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. |
| 211 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 212 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 213 | "fileType": "A String", # The file type for the specified uri. |
| 214 | # SQL: The file contains SQL statements. |
| 215 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 216 | "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] | 217 | "csvExportOptions": { # Options for exporting data as CSV. |
| 218 | "selectQuery": "A String", # The select query used to extract the data. |
| 219 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 220 | "databases": [ # Databases to be exported. |
| 221 | # 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. |
| 222 | # 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] | 223 | "A String", |
| 224 | ], |
| 225 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 226 | "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] | 227 | "A String", |
| 228 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 229 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 230 | "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. |
| 231 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 232 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 233 | }, |
| 234 | }, |
| 235 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 236 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 237 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 238 | "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] | 239 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 240 | "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] | 241 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 242 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 243 | "errors": [ # The list of errors encountered while processing this operation. |
| 244 | { # Database instance operation error. |
| 245 | "kind": "sql#operationError", # This is always sql#operationError. |
| 246 | "code": "A String", # Identifies the specific error that occurred. |
| 247 | "message": "A String", # Additional information about the error encountered. |
| 248 | }, |
| 249 | ], |
| 250 | }, |
| 251 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 252 | "selfLink": "A String", # The URI of this resource. |
| 253 | "user": "A String", # The email address of the user who initiated this operation. |
| 254 | }</pre> |
| 255 | </div> |
| 256 | |
| 257 | <div class="method"> |
| 258 | <code class="details" id="list">list(project, instance)</code> |
| 259 | <pre>Lists users in the specified Cloud SQL instance. |
| 260 | |
| 261 | Args: |
| 262 | project: string, Project ID of the project that contains the instance. (required) |
| 263 | instance: string, Database instance ID. This does not include the project ID. (required) |
| 264 | |
| 265 | Returns: |
| 266 | An object of the form: |
| 267 | |
| 268 | { # User list response. |
| 269 | "nextPageToken": "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. |
| 270 | "items": [ # List of user resources in the instance. |
| 271 | { # A Cloud SQL user resource. |
| 272 | "kind": "sql#user", # This is always sql#user. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 273 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified in the URL. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 274 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update since it is already specified on the URL. |
| 275 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update since it is already specified on the URL. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 276 | "host": "A String", # The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 277 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 278 | "password": "A String", # The password for the user. |
| 279 | }, |
| 280 | ], |
| 281 | "kind": "sql#usersList", # This is always sql#usersList. |
| 282 | }</pre> |
| 283 | </div> |
| 284 | |
| 285 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 286 | <code class="details" id="update">update(project, instance, name, body, host=None)</code> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 287 | <pre>Updates an existing user in a Cloud SQL instance. |
| 288 | |
| 289 | Args: |
| 290 | project: string, Project ID of the project that contains the instance. (required) |
| 291 | instance: string, Database instance ID. This does not include the project ID. (required) |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 292 | name: string, Name of the user in the instance. (required) |
| 293 | body: object, The request body. (required) |
| 294 | The object takes the form of: |
| 295 | |
| 296 | { # A Cloud SQL user resource. |
| 297 | "kind": "sql#user", # This is always sql#user. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 298 | "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified in the URL. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 299 | "project": "A String", # The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. Can be omitted for update since it is already specified on the URL. |
| 300 | "instance": "A String", # The name of the Cloud SQL instance. This does not include the project ID. Can be omitted for update since it is already specified on the URL. |
Jon Wayne Parrott | 0a471d3 | 2016-05-19 10:54:38 -0700 | [diff] [blame] | 301 | "host": "A String", # The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 302 | "etag": "A String", # This field is deprecated and will be removed from a future version of the API. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 303 | "password": "A String", # The password for the user. |
| 304 | } |
| 305 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 306 | host: string, Host of the user in the instance. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 307 | |
| 308 | Returns: |
| 309 | An object of the form: |
| 310 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 311 | { # 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] | 312 | "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN. |
| 313 | "importContext": { # Database instance import context. # The context for import operation, if applicable. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 314 | "kind": "sql#importContext", # This is always sql#importContext. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 315 | "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] | 316 | "fileType": "A String", # The file type for the specified uri. |
| 317 | # SQL: The file contains SQL statements. |
| 318 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 319 | "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. |
| 320 | "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] | 321 | "csvImportOptions": { # Options for importing data as CSV. |
| 322 | "table": "A String", # The table to which CSV data is imported. |
| 323 | "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
| 324 | "A String", |
| 325 | ], |
| 326 | }, |
| 327 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 328 | "kind": "sql#operation", # This is always sql#operation. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 329 | "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. |
| 330 | "exportContext": { # Database instance export context. # The context for export operation, if applicable. |
| 331 | "kind": "sql#exportContext", # This is always sql#exportContext. |
| 332 | "fileType": "A String", # The file type for the specified uri. |
| 333 | # SQL: The file contains SQL statements. |
| 334 | # CSV: The file contains CSV data. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 335 | "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] | 336 | "csvExportOptions": { # Options for exporting data as CSV. |
| 337 | "selectQuery": "A String", # The select query used to extract the data. |
| 338 | }, |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 339 | "databases": [ # Databases to be exported. |
| 340 | # 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. |
| 341 | # 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] | 342 | "A String", |
| 343 | ], |
| 344 | "sqlExportOptions": { # Options for exporting data as SQL statements. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 345 | "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] | 346 | "A String", |
| 347 | ], |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame^] | 348 | "mysqlExportOptions": { # Options for exporting from MySQL. |
| 349 | "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. |
| 350 | }, |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 351 | "schemaOnly": True or False, # Export only schemas. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 352 | }, |
| 353 | }, |
| 354 | "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 355 | "targetProject": "A String", # The project ID of the target instance related to this operation. |
| 356 | "targetId": "A String", # Name of the database instance related to this operation. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 357 | "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] | 358 | "targetLink": "A String", |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 359 | "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] | 360 | "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated. |
| 361 | "kind": "sql#operationErrors", # This is always sql#operationErrors. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 362 | "errors": [ # The list of errors encountered while processing this operation. |
| 363 | { # Database instance operation error. |
| 364 | "kind": "sql#operationError", # This is always sql#operationError. |
| 365 | "code": "A String", # Identifies the specific error that occurred. |
| 366 | "message": "A String", # Additional information about the error encountered. |
| 367 | }, |
| 368 | ], |
| 369 | }, |
| 370 | "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. |
| 371 | "selfLink": "A String", # The URI of this resource. |
| 372 | "user": "A String", # The email address of the user who initiated this operation. |
| 373 | }</pre> |
| 374 | </div> |
| 375 | |
| 376 | </body></html> |