• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="sqladmin_v1beta4.html">Cloud SQL Administration API</a> . <a href="sqladmin_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, 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">
87  <code><a href="#update">update(project, instance, host, name, body)</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, name)</code>
92  <pre>Deletes a user from a Cloud SQL instance.
93
94Args:
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
100Returns:
101  An object of the form:
102
103    { # An Operations resource contains information about database instance operations such as create, delete, and restart. Operations resources are created in response to operations that were initiated; you never create them directly.
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.
106      "kind": "sql#importContext", # This is always sql#importContext.
107      "database": "A String", # The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified.
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.
111      "uri": "A String", # A path to the file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL.
112      "importUser": "A String", # The PostgreSQL user to use for this import operation. Defaults to cloudsqlsuperuser. Does not apply to MySQL instances.
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    },
120    "kind": "sql#operation", # This is always sql#operation.
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.
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 operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
128      "csvExportOptions": { # Options for exporting data as CSV.
129        "selectQuery": "A String", # The select query used to extract the data.
130      },
131      "databases": [ # Databases (for example, guestbook) from which the export is made. If fileType is SQL and no database is specified, all databases are exported. If fileType is CSV, you can optionally specify at most one database to export. If csvExportOptions.selectQuery also specifies the database, this field will be ignored.
132        "A String",
133      ],
134      "sqlExportOptions": { # Options for exporting data as SQL statements.
135        "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database.
136          "A String",
137        ],
138        "schemaOnly": True or False, # Export only schemas.
139      },
140    },
141    "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
142    "targetProject": "A String", # The project ID of the target instance related to this operation.
143    "targetId": "A String", # Name of the database instance related to this operation.
144    "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 .
145    "targetLink": "A String",
146    "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
147    "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
148      "kind": "sql#operationErrors", # This is always sql#operationErrors.
149      "errors": [ # The list of errors encountered while processing this operation.
150        { # Database instance operation error.
151          "kind": "sql#operationError", # This is always sql#operationError.
152          "code": "A String", # Identifies the specific error that occurred.
153          "message": "A String", # Additional information about the error encountered.
154        },
155      ],
156    },
157    "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
158    "selfLink": "A String", # The URI of this resource.
159    "user": "A String", # The email address of the user who initiated this operation.
160  }</pre>
161</div>
162
163<div class="method">
164    <code class="details" id="insert">insert(project, instance, body)</code>
165  <pre>Creates a new user in a Cloud SQL instance.
166
167Args:
168  project: string, Project ID of the project that contains the instance. (required)
169  instance: string, Database instance ID. This does not include the project ID. (required)
170  body: object, The request body. (required)
171    The object takes the form of:
172
173{ # A Cloud SQL user resource.
174    "kind": "sql#user", # This is always sql#user.
175    "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified on the URL.
176    "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.
177    "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.
178    "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.
179    "etag": "A String", # HTTP 1.1 Entity tag for the resource.
180    "password": "A String", # The password for the user.
181  }
182
183
184Returns:
185  An object of the form:
186
187    { # An Operations resource contains information about database instance operations such as create, delete, and restart. Operations resources are created in response to operations that were initiated; you never create them directly.
188    "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
189    "importContext": { # Database instance import context. # The context for import operation, if applicable.
190      "kind": "sql#importContext", # This is always sql#importContext.
191      "database": "A String", # The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified.
192      "fileType": "A String", # The file type for the specified uri.
193          # SQL: The file contains SQL statements.
194          # CSV: The file contains CSV data.
195      "uri": "A String", # A path to the file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL.
196      "importUser": "A String", # The PostgreSQL user to use for this import operation. Defaults to cloudsqlsuperuser. Does not apply to MySQL instances.
197      "csvImportOptions": { # Options for importing data as CSV.
198        "table": "A String", # The table to which CSV data is imported.
199        "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
200          "A String",
201        ],
202      },
203    },
204    "kind": "sql#operation", # This is always sql#operation.
205    "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.
206    "exportContext": { # Database instance export context. # The context for export operation, if applicable.
207      "kind": "sql#exportContext", # This is always sql#exportContext.
208      "fileType": "A String", # The file type for the specified uri.
209          # SQL: The file contains SQL statements.
210          # CSV: The file contains CSV data.
211      "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 operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
212      "csvExportOptions": { # Options for exporting data as CSV.
213        "selectQuery": "A String", # The select query used to extract the data.
214      },
215      "databases": [ # Databases (for example, guestbook) from which the export is made. If fileType is SQL and no database is specified, all databases are exported. If fileType is CSV, you can optionally specify at most one database to export. If csvExportOptions.selectQuery also specifies the database, this field will be ignored.
216        "A String",
217      ],
218      "sqlExportOptions": { # Options for exporting data as SQL statements.
219        "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database.
220          "A String",
221        ],
222        "schemaOnly": True or False, # Export only schemas.
223      },
224    },
225    "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
226    "targetProject": "A String", # The project ID of the target instance related to this operation.
227    "targetId": "A String", # Name of the database instance related to this operation.
228    "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 .
229    "targetLink": "A String",
230    "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
231    "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
232      "kind": "sql#operationErrors", # This is always sql#operationErrors.
233      "errors": [ # The list of errors encountered while processing this operation.
234        { # Database instance operation error.
235          "kind": "sql#operationError", # This is always sql#operationError.
236          "code": "A String", # Identifies the specific error that occurred.
237          "message": "A String", # Additional information about the error encountered.
238        },
239      ],
240    },
241    "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
242    "selfLink": "A String", # The URI of this resource.
243    "user": "A String", # The email address of the user who initiated this operation.
244  }</pre>
245</div>
246
247<div class="method">
248    <code class="details" id="list">list(project, instance)</code>
249  <pre>Lists users in the specified Cloud SQL instance.
250
251Args:
252  project: string, Project ID of the project that contains the instance. (required)
253  instance: string, Database instance ID. This does not include the project ID. (required)
254
255Returns:
256  An object of the form:
257
258    { # User list response.
259    "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.
260    "items": [ # List of user resources in the instance.
261      { # A Cloud SQL user resource.
262          "kind": "sql#user", # This is always sql#user.
263          "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified on the URL.
264          "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.
265          "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.
266          "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.
267          "etag": "A String", # HTTP 1.1 Entity tag for the resource.
268          "password": "A String", # The password for the user.
269        },
270    ],
271    "kind": "sql#usersList", # This is always sql#usersList.
272  }</pre>
273</div>
274
275<div class="method">
276    <code class="details" id="update">update(project, instance, host, name, body)</code>
277  <pre>Updates an existing user in a Cloud SQL instance.
278
279Args:
280  project: string, Project ID of the project that contains the instance. (required)
281  instance: string, Database instance ID. This does not include the project ID. (required)
282  host: string, Host of the user in the instance. (required)
283  name: string, Name of the user in the instance. (required)
284  body: object, The request body. (required)
285    The object takes the form of:
286
287{ # A Cloud SQL user resource.
288    "kind": "sql#user", # This is always sql#user.
289    "name": "A String", # The name of the user in the Cloud SQL instance. Can be omitted for update since it is already specified on the URL.
290    "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.
291    "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.
292    "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.
293    "etag": "A String", # HTTP 1.1 Entity tag for the resource.
294    "password": "A String", # The password for the user.
295  }
296
297
298Returns:
299  An object of the form:
300
301    { # An Operations resource contains information about database instance operations such as create, delete, and restart. Operations resources are created in response to operations that were initiated; you never create them directly.
302    "status": "A String", # The status of an operation. Valid values are PENDING, RUNNING, DONE, UNKNOWN.
303    "importContext": { # Database instance import context. # The context for import operation, if applicable.
304      "kind": "sql#importContext", # This is always sql#importContext.
305      "database": "A String", # The database (for example, guestbook) to which the import is made. If fileType is SQL and no database is specified, it is assumed that the database is specified in the file to be imported. If fileType is CSV, it must be specified.
306      "fileType": "A String", # The file type for the specified uri.
307          # SQL: The file contains SQL statements.
308          # CSV: The file contains CSV data.
309      "uri": "A String", # A path to the file in Google Cloud Storage from which the import is made. The URI is in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL.
310      "importUser": "A String", # The PostgreSQL user to use for this import operation. Defaults to cloudsqlsuperuser. Does not apply to MySQL instances.
311      "csvImportOptions": { # Options for importing data as CSV.
312        "table": "A String", # The table to which CSV data is imported.
313        "columns": [ # The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data.
314          "A String",
315        ],
316      },
317    },
318    "kind": "sql#operation", # This is always sql#operation.
319    "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.
320    "exportContext": { # Database instance export context. # The context for export operation, if applicable.
321      "kind": "sql#exportContext", # This is always sql#exportContext.
322      "fileType": "A String", # The file type for the specified uri.
323          # SQL: The file contains SQL statements.
324          # CSV: The file contains CSV data.
325      "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 operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed.
326      "csvExportOptions": { # Options for exporting data as CSV.
327        "selectQuery": "A String", # The select query used to extract the data.
328      },
329      "databases": [ # Databases (for example, guestbook) from which the export is made. If fileType is SQL and no database is specified, all databases are exported. If fileType is CSV, you can optionally specify at most one database to export. If csvExportOptions.selectQuery also specifies the database, this field will be ignored.
330        "A String",
331      ],
332      "sqlExportOptions": { # Options for exporting data as SQL statements.
333        "tables": [ # Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database.
334          "A String",
335        ],
336        "schemaOnly": True or False, # Export only schemas.
337      },
338    },
339    "startTime": "A String", # The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
340    "targetProject": "A String", # The project ID of the target instance related to this operation.
341    "targetId": "A String", # Name of the database instance related to this operation.
342    "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 .
343    "targetLink": "A String",
344    "insertTime": "A String", # The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
345    "error": { # Database instance operation errors list wrapper. # If errors occurred during processing of this operation, this field will be populated.
346      "kind": "sql#operationErrors", # This is always sql#operationErrors.
347      "errors": [ # The list of errors encountered while processing this operation.
348        { # Database instance operation error.
349          "kind": "sql#operationError", # This is always sql#operationError.
350          "code": "A String", # Identifies the specific error that occurred.
351          "message": "A String", # Additional information about the error encountered.
352        },
353      ],
354    },
355    "endTime": "A String", # The time this operation finished in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
356    "selfLink": "A String", # The URI of this resource.
357    "user": "A String", # The email address of the user who initiated this operation.
358  }</pre>
359</div>
360
361</body></html>