google-apis-sqladmin_v1 0.2.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,19 +49,124 @@ module Google
49
49
  @batch_path = 'batch'
50
50
  end
51
51
 
52
- # Lists instances under a given project.
52
+ # Deletes the backup taken by a backup run.
53
53
  # @param [String] project
54
- # Project ID of the project for which to list Cloud SQL instances.
55
- # @param [String] filter
56
- # A filter expression that filters resources listed in the response. The
57
- # expression is in the form of field:value. For example, 'instanceType:
58
- # CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON
59
- # representation, such as 'settings.userLabels.auto_start:true'. Multiple filter
60
- # queries are space-separated. For example. 'state:RUNNABLE instanceType:
61
- # CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However,
62
- # you can include AND and OR expressions explicitly.
54
+ # Project ID of the project that contains the instance.
55
+ # @param [String] instance
56
+ # Cloud SQL instance ID. This does not include the project ID.
57
+ # @param [Fixnum] id
58
+ # The ID of the backup run to delete. To find a backup run ID, use the list
59
+ # method.
60
+ # @param [String] fields
61
+ # Selector specifying which fields to include in a partial response.
62
+ # @param [String] quota_user
63
+ # Available to use for quota purposes for server-side applications. Can be any
64
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::SqladminV1::Operation]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
78
+ command = make_simple_command(:delete, 'v1/projects/{project}/instances/{instance}/backupRuns/{id}', options)
79
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
80
+ command.response_class = Google::Apis::SqladminV1::Operation
81
+ command.params['project'] = project unless project.nil?
82
+ command.params['instance'] = instance unless instance.nil?
83
+ command.params['id'] = id unless id.nil?
84
+ command.query['fields'] = fields unless fields.nil?
85
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
86
+ execute_or_queue_command(command, &block)
87
+ end
88
+
89
+ # Retrieves a resource containing information about a backup run.
90
+ # @param [String] project
91
+ # Project ID of the project that contains the instance.
92
+ # @param [String] instance
93
+ # Cloud SQL instance ID. This does not include the project ID.
94
+ # @param [Fixnum] id
95
+ # The ID of this backup run.
96
+ # @param [String] fields
97
+ # Selector specifying which fields to include in a partial response.
98
+ # @param [String] quota_user
99
+ # Available to use for quota purposes for server-side applications. Can be any
100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
101
+ # @param [Google::Apis::RequestOptions] options
102
+ # Request-specific options
103
+ #
104
+ # @yield [result, err] Result & error if block supplied
105
+ # @yieldparam result [Google::Apis::SqladminV1::BackupRun] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::SqladminV1::BackupRun]
109
+ #
110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
113
+ def get_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
114
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/backupRuns/{id}', options)
115
+ command.response_representation = Google::Apis::SqladminV1::BackupRun::Representation
116
+ command.response_class = Google::Apis::SqladminV1::BackupRun
117
+ command.params['project'] = project unless project.nil?
118
+ command.params['instance'] = instance unless instance.nil?
119
+ command.params['id'] = id unless id.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Creates a new backup run on demand.
126
+ # @param [String] project
127
+ # Project ID of the project that contains the instance.
128
+ # @param [String] instance
129
+ # Cloud SQL instance ID. This does not include the project ID.
130
+ # @param [Google::Apis::SqladminV1::BackupRun] backup_run_object
131
+ # @param [String] fields
132
+ # Selector specifying which fields to include in a partial response.
133
+ # @param [String] quota_user
134
+ # Available to use for quota purposes for server-side applications. Can be any
135
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
136
+ # @param [Google::Apis::RequestOptions] options
137
+ # Request-specific options
138
+ #
139
+ # @yield [result, err] Result & error if block supplied
140
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::SqladminV1::Operation]
144
+ #
145
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
146
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
147
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
148
+ def insert_backup_run(project, instance, backup_run_object = nil, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/backupRuns', options)
150
+ command.request_representation = Google::Apis::SqladminV1::BackupRun::Representation
151
+ command.request_object = backup_run_object
152
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
153
+ command.response_class = Google::Apis::SqladminV1::Operation
154
+ command.params['project'] = project unless project.nil?
155
+ command.params['instance'] = instance unless instance.nil?
156
+ command.query['fields'] = fields unless fields.nil?
157
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
158
+ execute_or_queue_command(command, &block)
159
+ end
160
+
161
+ # Lists all backup runs associated with the project or a given instance and
162
+ # configuration in the reverse chronological order of the backup initiation time.
163
+ # @param [String] project
164
+ # Project ID of the project that contains the instance.
165
+ # @param [String] instance
166
+ # Cloud SQL instance ID, or "-" for all instances. This does not include the
167
+ # project ID.
63
168
  # @param [Fixnum] max_results
64
- # The maximum number of results to return per response.
169
+ # Maximum number of backup runs per response.
65
170
  # @param [String] page_token
66
171
  # A previously-returned page token representing part of the larger set of
67
172
  # results to view.
@@ -74,20 +179,20 @@ module Google
74
179
  # Request-specific options
75
180
  #
76
181
  # @yield [result, err] Result & error if block supplied
77
- # @yieldparam result [Google::Apis::SqladminV1::InstancesListResponse] parsed result object
182
+ # @yieldparam result [Google::Apis::SqladminV1::BackupRunsListResponse] parsed result object
78
183
  # @yieldparam err [StandardError] error object if request failed
79
184
  #
80
- # @return [Google::Apis::SqladminV1::InstancesListResponse]
185
+ # @return [Google::Apis::SqladminV1::BackupRunsListResponse]
81
186
  #
82
187
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
83
188
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
84
189
  # @raise [Google::Apis::AuthorizationError] Authorization is required
85
- def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
86
- command = make_simple_command(:get, 'v1/projects/{project}/instances', options)
87
- command.response_representation = Google::Apis::SqladminV1::InstancesListResponse::Representation
88
- command.response_class = Google::Apis::SqladminV1::InstancesListResponse
190
+ def list_backup_runs(project, instance, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
191
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/backupRuns', options)
192
+ command.response_representation = Google::Apis::SqladminV1::BackupRunsListResponse::Representation
193
+ command.response_class = Google::Apis::SqladminV1::BackupRunsListResponse
89
194
  command.params['project'] = project unless project.nil?
90
- command.query['filter'] = filter unless filter.nil?
195
+ command.params['instance'] = instance unless instance.nil?
91
196
  command.query['maxResults'] = max_results unless max_results.nil?
92
197
  command.query['pageToken'] = page_token unless page_token.nil?
93
198
  command.query['fields'] = fields unless fields.nil?
@@ -120,7 +225,7 @@ module Google
120
225
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
121
226
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
122
227
  # @raise [Google::Apis::AuthorizationError] Authorization is required
123
- def generate_instance_ephemeral_cert(project, instance, generate_ephemeral_cert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
228
+ def generate_connect_ephemeral_cert(project, instance, generate_ephemeral_cert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
124
229
  command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}:generateEphemeralCert', options)
125
230
  command.request_representation = Google::Apis::SqladminV1::GenerateEphemeralCertRequest::Representation
126
231
  command.request_object = generate_ephemeral_cert_request_object
@@ -133,11 +238,49 @@ module Google
133
238
  execute_or_queue_command(command, &block)
134
239
  end
135
240
 
136
- # Retrieves a resource containing information about a Cloud SQL instance.
241
+ # Retrieves connect settings about a Cloud SQL instance.
242
+ # @param [String] project
243
+ # Project ID of the project that contains the instance.
244
+ # @param [String] instance
245
+ # Cloud SQL instance ID. This does not include the project ID.
246
+ # @param [String] read_time
247
+ # Optional. Optional snapshot read timestamp to trade freshness for performance.
248
+ # @param [String] fields
249
+ # Selector specifying which fields to include in a partial response.
250
+ # @param [String] quota_user
251
+ # Available to use for quota purposes for server-side applications. Can be any
252
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
253
+ # @param [Google::Apis::RequestOptions] options
254
+ # Request-specific options
255
+ #
256
+ # @yield [result, err] Result & error if block supplied
257
+ # @yieldparam result [Google::Apis::SqladminV1::ConnectSettings] parsed result object
258
+ # @yieldparam err [StandardError] error object if request failed
259
+ #
260
+ # @return [Google::Apis::SqladminV1::ConnectSettings]
261
+ #
262
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
263
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
264
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
265
+ def get_connect(project, instance, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
266
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/connectSettings', options)
267
+ command.response_representation = Google::Apis::SqladminV1::ConnectSettings::Representation
268
+ command.response_class = Google::Apis::SqladminV1::ConnectSettings
269
+ command.params['project'] = project unless project.nil?
270
+ command.params['instance'] = instance unless instance.nil?
271
+ command.query['readTime'] = read_time unless read_time.nil?
272
+ command.query['fields'] = fields unless fields.nil?
273
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
274
+ execute_or_queue_command(command, &block)
275
+ end
276
+
277
+ # Deletes a database from a Cloud SQL instance.
137
278
  # @param [String] project
138
279
  # Project ID of the project that contains the instance.
139
280
  # @param [String] instance
140
281
  # Database instance ID. This does not include the project ID.
282
+ # @param [String] database
283
+ # Name of the database to be deleted in the instance.
141
284
  # @param [String] fields
142
285
  # Selector specifying which fields to include in a partial response.
143
286
  # @param [String] quota_user
@@ -147,32 +290,34 @@ module Google
147
290
  # Request-specific options
148
291
  #
149
292
  # @yield [result, err] Result & error if block supplied
150
- # @yieldparam result [Google::Apis::SqladminV1::DatabaseInstance] parsed result object
293
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
151
294
  # @yieldparam err [StandardError] error object if request failed
152
295
  #
153
- # @return [Google::Apis::SqladminV1::DatabaseInstance]
296
+ # @return [Google::Apis::SqladminV1::Operation]
154
297
  #
155
298
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
156
299
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
157
300
  # @raise [Google::Apis::AuthorizationError] Authorization is required
158
- def get_project_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
159
- command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}', options)
160
- command.response_representation = Google::Apis::SqladminV1::DatabaseInstance::Representation
161
- command.response_class = Google::Apis::SqladminV1::DatabaseInstance
301
+ def delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
302
+ command = make_simple_command(:delete, 'v1/projects/{project}/instances/{instance}/databases/{database}', options)
303
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
304
+ command.response_class = Google::Apis::SqladminV1::Operation
162
305
  command.params['project'] = project unless project.nil?
163
306
  command.params['instance'] = instance unless instance.nil?
307
+ command.params['database'] = database unless database.nil?
164
308
  command.query['fields'] = fields unless fields.nil?
165
309
  command.query['quotaUser'] = quota_user unless quota_user.nil?
166
310
  execute_or_queue_command(command, &block)
167
311
  end
168
312
 
169
- # Retrieves connect settings about a Cloud SQL instance.
313
+ # Retrieves a resource containing information about a database inside a Cloud
314
+ # SQL instance.
170
315
  # @param [String] project
171
316
  # Project ID of the project that contains the instance.
172
317
  # @param [String] instance
173
- # Cloud SQL instance ID. This does not include the project ID.
174
- # @param [String] read_time
175
- # Optional. Optional snapshot read timestamp to trade freshness for performance.
318
+ # Database instance ID. This does not include the project ID.
319
+ # @param [String] database
320
+ # Name of the database in the instance.
176
321
  # @param [String] fields
177
322
  # Selector specifying which fields to include in a partial response.
178
323
  # @param [String] quota_user
@@ -182,34 +327,68 @@ module Google
182
327
  # Request-specific options
183
328
  #
184
329
  # @yield [result, err] Result & error if block supplied
185
- # @yieldparam result [Google::Apis::SqladminV1::ConnectSettings] parsed result object
330
+ # @yieldparam result [Google::Apis::SqladminV1::Database] parsed result object
186
331
  # @yieldparam err [StandardError] error object if request failed
187
332
  #
188
- # @return [Google::Apis::SqladminV1::ConnectSettings]
333
+ # @return [Google::Apis::SqladminV1::Database]
189
334
  #
190
335
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
336
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
337
  # @raise [Google::Apis::AuthorizationError] Authorization is required
193
- def get_project_instance_connect_settings(project, instance, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
194
- command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/connectSettings', options)
195
- command.response_representation = Google::Apis::SqladminV1::ConnectSettings::Representation
196
- command.response_class = Google::Apis::SqladminV1::ConnectSettings
338
+ def get_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
339
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/databases/{database}', options)
340
+ command.response_representation = Google::Apis::SqladminV1::Database::Representation
341
+ command.response_class = Google::Apis::SqladminV1::Database
197
342
  command.params['project'] = project unless project.nil?
198
343
  command.params['instance'] = instance unless instance.nil?
199
- command.query['readTime'] = read_time unless read_time.nil?
344
+ command.params['database'] = database unless database.nil?
200
345
  command.query['fields'] = fields unless fields.nil?
201
346
  command.query['quotaUser'] = quota_user unless quota_user.nil?
202
347
  execute_or_queue_command(command, &block)
203
348
  end
204
349
 
205
- # Generates a short-lived X509 certificate containing the provided public key
206
- # and signed by a private key specific to the target instance. Users may use the
207
- # certificate to authenticate as themselves when connecting to the database.
350
+ # Inserts a resource containing information about a database inside a Cloud SQL
351
+ # instance.
208
352
  # @param [String] project
209
- # Project ID of the Cloud SQL project.
353
+ # Project ID of the project that contains the instance.
354
+ # @param [String] instance
355
+ # Database instance ID. This does not include the project ID.
356
+ # @param [Google::Apis::SqladminV1::Database] database_object
357
+ # @param [String] fields
358
+ # Selector specifying which fields to include in a partial response.
359
+ # @param [String] quota_user
360
+ # Available to use for quota purposes for server-side applications. Can be any
361
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
362
+ # @param [Google::Apis::RequestOptions] options
363
+ # Request-specific options
364
+ #
365
+ # @yield [result, err] Result & error if block supplied
366
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
367
+ # @yieldparam err [StandardError] error object if request failed
368
+ #
369
+ # @return [Google::Apis::SqladminV1::Operation]
370
+ #
371
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
372
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
373
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
374
+ def insert_database(project, instance, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
375
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/databases', options)
376
+ command.request_representation = Google::Apis::SqladminV1::Database::Representation
377
+ command.request_object = database_object
378
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
379
+ command.response_class = Google::Apis::SqladminV1::Operation
380
+ command.params['project'] = project unless project.nil?
381
+ command.params['instance'] = instance unless instance.nil?
382
+ command.query['fields'] = fields unless fields.nil?
383
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
384
+ execute_or_queue_command(command, &block)
385
+ end
386
+
387
+ # Lists databases in the specified Cloud SQL instance.
388
+ # @param [String] project
389
+ # Project ID of the project that contains the instance.
210
390
  # @param [String] instance
211
391
  # Cloud SQL instance ID. This does not include the project ID.
212
- # @param [Google::Apis::SqladminV1::SslCertsCreateEphemeralRequest] ssl_certs_create_ephemeral_request_object
213
392
  # @param [String] fields
214
393
  # Selector specifying which fields to include in a partial response.
215
394
  # @param [String] quota_user
@@ -219,22 +398,1437 @@ module Google
219
398
  # Request-specific options
220
399
  #
221
400
  # @yield [result, err] Result & error if block supplied
222
- # @yieldparam result [Google::Apis::SqladminV1::SslCert] parsed result object
401
+ # @yieldparam result [Google::Apis::SqladminV1::DatabasesListResponse] parsed result object
223
402
  # @yieldparam err [StandardError] error object if request failed
224
403
  #
225
- # @return [Google::Apis::SqladminV1::SslCert]
404
+ # @return [Google::Apis::SqladminV1::DatabasesListResponse]
226
405
  #
227
406
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
228
407
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
229
408
  # @raise [Google::Apis::AuthorizationError] Authorization is required
230
- def create_project_instance_create_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
231
- command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/createEphemeral', options)
232
- command.request_representation = Google::Apis::SqladminV1::SslCertsCreateEphemeralRequest::Representation
233
- command.request_object = ssl_certs_create_ephemeral_request_object
234
- command.response_representation = Google::Apis::SqladminV1::SslCert::Representation
235
- command.response_class = Google::Apis::SqladminV1::SslCert
409
+ def list_databases(project, instance, fields: nil, quota_user: nil, options: nil, &block)
410
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/databases', options)
411
+ command.response_representation = Google::Apis::SqladminV1::DatabasesListResponse::Representation
412
+ command.response_class = Google::Apis::SqladminV1::DatabasesListResponse
413
+ command.params['project'] = project unless project.nil?
414
+ command.params['instance'] = instance unless instance.nil?
415
+ command.query['fields'] = fields unless fields.nil?
416
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
417
+ execute_or_queue_command(command, &block)
418
+ end
419
+
420
+ # Partially updates a resource containing information about a database inside a
421
+ # Cloud SQL instance. This method supports patch semantics.
422
+ # @param [String] project
423
+ # Project ID of the project that contains the instance.
424
+ # @param [String] instance
425
+ # Database instance ID. This does not include the project ID.
426
+ # @param [String] database
427
+ # Name of the database to be updated in the instance.
428
+ # @param [Google::Apis::SqladminV1::Database] database_object
429
+ # @param [String] fields
430
+ # Selector specifying which fields to include in a partial response.
431
+ # @param [String] quota_user
432
+ # Available to use for quota purposes for server-side applications. Can be any
433
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
434
+ # @param [Google::Apis::RequestOptions] options
435
+ # Request-specific options
436
+ #
437
+ # @yield [result, err] Result & error if block supplied
438
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
439
+ # @yieldparam err [StandardError] error object if request failed
440
+ #
441
+ # @return [Google::Apis::SqladminV1::Operation]
442
+ #
443
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
444
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
445
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
446
+ def patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
447
+ command = make_simple_command(:patch, 'v1/projects/{project}/instances/{instance}/databases/{database}', options)
448
+ command.request_representation = Google::Apis::SqladminV1::Database::Representation
449
+ command.request_object = database_object
450
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
451
+ command.response_class = Google::Apis::SqladminV1::Operation
452
+ command.params['project'] = project unless project.nil?
453
+ command.params['instance'] = instance unless instance.nil?
454
+ command.params['database'] = database unless database.nil?
455
+ command.query['fields'] = fields unless fields.nil?
456
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
457
+ execute_or_queue_command(command, &block)
458
+ end
459
+
460
+ # Updates a resource containing information about a database inside a Cloud SQL
461
+ # instance.
462
+ # @param [String] project
463
+ # Project ID of the project that contains the instance.
464
+ # @param [String] instance
465
+ # Database instance ID. This does not include the project ID.
466
+ # @param [String] database
467
+ # Name of the database to be updated in the instance.
468
+ # @param [Google::Apis::SqladminV1::Database] database_object
469
+ # @param [String] fields
470
+ # Selector specifying which fields to include in a partial response.
471
+ # @param [String] quota_user
472
+ # Available to use for quota purposes for server-side applications. Can be any
473
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
474
+ # @param [Google::Apis::RequestOptions] options
475
+ # Request-specific options
476
+ #
477
+ # @yield [result, err] Result & error if block supplied
478
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
479
+ # @yieldparam err [StandardError] error object if request failed
480
+ #
481
+ # @return [Google::Apis::SqladminV1::Operation]
482
+ #
483
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
484
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
485
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
486
+ def update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
487
+ command = make_simple_command(:put, 'v1/projects/{project}/instances/{instance}/databases/{database}', options)
488
+ command.request_representation = Google::Apis::SqladminV1::Database::Representation
489
+ command.request_object = database_object
490
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
491
+ command.response_class = Google::Apis::SqladminV1::Operation
492
+ command.params['project'] = project unless project.nil?
493
+ command.params['instance'] = instance unless instance.nil?
494
+ command.params['database'] = database unless database.nil?
495
+ command.query['fields'] = fields unless fields.nil?
496
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
497
+ execute_or_queue_command(command, &block)
498
+ end
499
+
500
+ # Lists all available database flags for Cloud SQL instances.
501
+ # @param [String] database_version
502
+ # Database type and version you want to retrieve flags for. By default, this
503
+ # method returns flags for all database types and versions.
504
+ # @param [String] fields
505
+ # Selector specifying which fields to include in a partial response.
506
+ # @param [String] quota_user
507
+ # Available to use for quota purposes for server-side applications. Can be any
508
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
509
+ # @param [Google::Apis::RequestOptions] options
510
+ # Request-specific options
511
+ #
512
+ # @yield [result, err] Result & error if block supplied
513
+ # @yieldparam result [Google::Apis::SqladminV1::FlagsListResponse] parsed result object
514
+ # @yieldparam err [StandardError] error object if request failed
515
+ #
516
+ # @return [Google::Apis::SqladminV1::FlagsListResponse]
517
+ #
518
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
519
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
520
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
521
+ def list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block)
522
+ command = make_simple_command(:get, 'v1/flags', options)
523
+ command.response_representation = Google::Apis::SqladminV1::FlagsListResponse::Representation
524
+ command.response_class = Google::Apis::SqladminV1::FlagsListResponse
525
+ command.query['databaseVersion'] = database_version unless database_version.nil?
526
+ command.query['fields'] = fields unless fields.nil?
527
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
528
+ execute_or_queue_command(command, &block)
529
+ end
530
+
531
+ # Adds a new trusted Certificate Authority (CA) version for the specified
532
+ # instance. Required to prepare for a certificate rotation. If a CA version was
533
+ # previously added but never used in a certificate rotation, this operation
534
+ # replaces that version. There cannot be more than one CA version waiting to be
535
+ # rotated in.
536
+ # @param [String] project
537
+ # Project ID of the project that contains the instance.
538
+ # @param [String] instance
539
+ # Cloud SQL instance ID. This does not include the project ID.
540
+ # @param [String] fields
541
+ # Selector specifying which fields to include in a partial response.
542
+ # @param [String] quota_user
543
+ # Available to use for quota purposes for server-side applications. Can be any
544
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
545
+ # @param [Google::Apis::RequestOptions] options
546
+ # Request-specific options
547
+ #
548
+ # @yield [result, err] Result & error if block supplied
549
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
550
+ # @yieldparam err [StandardError] error object if request failed
551
+ #
552
+ # @return [Google::Apis::SqladminV1::Operation]
553
+ #
554
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
555
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
556
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
557
+ def add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block)
558
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/addServerCa', options)
559
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
560
+ command.response_class = Google::Apis::SqladminV1::Operation
561
+ command.params['project'] = project unless project.nil?
562
+ command.params['instance'] = instance unless instance.nil?
563
+ command.query['fields'] = fields unless fields.nil?
564
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
565
+ execute_or_queue_command(command, &block)
566
+ end
567
+
568
+ # Creates a Cloud SQL instance as a clone of the source instance. Using this
569
+ # operation might cause your instance to restart.
570
+ # @param [String] project
571
+ # Project ID of the source as well as the clone Cloud SQL instance.
572
+ # @param [String] instance
573
+ # The ID of the Cloud SQL instance to be cloned (source). This does not include
574
+ # the project ID.
575
+ # @param [Google::Apis::SqladminV1::InstancesCloneRequest] instances_clone_request_object
576
+ # @param [String] fields
577
+ # Selector specifying which fields to include in a partial response.
578
+ # @param [String] quota_user
579
+ # Available to use for quota purposes for server-side applications. Can be any
580
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
581
+ # @param [Google::Apis::RequestOptions] options
582
+ # Request-specific options
583
+ #
584
+ # @yield [result, err] Result & error if block supplied
585
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
586
+ # @yieldparam err [StandardError] error object if request failed
587
+ #
588
+ # @return [Google::Apis::SqladminV1::Operation]
589
+ #
590
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
591
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
592
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
593
+ def clone_instance(project, instance, instances_clone_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
594
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/clone', options)
595
+ command.request_representation = Google::Apis::SqladminV1::InstancesCloneRequest::Representation
596
+ command.request_object = instances_clone_request_object
597
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
598
+ command.response_class = Google::Apis::SqladminV1::Operation
599
+ command.params['project'] = project unless project.nil?
600
+ command.params['instance'] = instance unless instance.nil?
601
+ command.query['fields'] = fields unless fields.nil?
602
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
603
+ execute_or_queue_command(command, &block)
604
+ end
605
+
606
+ # Deletes a Cloud SQL instance.
607
+ # @param [String] project
608
+ # Project ID of the project that contains the instance to be deleted.
609
+ # @param [String] instance
610
+ # Cloud SQL instance ID. This does not include the project ID.
611
+ # @param [String] fields
612
+ # Selector specifying which fields to include in a partial response.
613
+ # @param [String] quota_user
614
+ # Available to use for quota purposes for server-side applications. Can be any
615
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
616
+ # @param [Google::Apis::RequestOptions] options
617
+ # Request-specific options
618
+ #
619
+ # @yield [result, err] Result & error if block supplied
620
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
621
+ # @yieldparam err [StandardError] error object if request failed
622
+ #
623
+ # @return [Google::Apis::SqladminV1::Operation]
624
+ #
625
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
626
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
627
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
628
+ def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
629
+ command = make_simple_command(:delete, 'v1/projects/{project}/instances/{instance}', options)
630
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
631
+ command.response_class = Google::Apis::SqladminV1::Operation
632
+ command.params['project'] = project unless project.nil?
633
+ command.params['instance'] = instance unless instance.nil?
634
+ command.query['fields'] = fields unless fields.nil?
635
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
636
+ execute_or_queue_command(command, &block)
637
+ end
638
+
639
+ # Demotes the stand-alone instance to be a Cloud SQL read replica for an
640
+ # external database server.
641
+ # @param [String] project
642
+ # ID of the project that contains the instance.
643
+ # @param [String] instance
644
+ # Cloud SQL instance name.
645
+ # @param [Google::Apis::SqladminV1::InstancesDemoteMasterRequest] instances_demote_master_request_object
646
+ # @param [String] fields
647
+ # Selector specifying which fields to include in a partial response.
648
+ # @param [String] quota_user
649
+ # Available to use for quota purposes for server-side applications. Can be any
650
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
651
+ # @param [Google::Apis::RequestOptions] options
652
+ # Request-specific options
653
+ #
654
+ # @yield [result, err] Result & error if block supplied
655
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
656
+ # @yieldparam err [StandardError] error object if request failed
657
+ #
658
+ # @return [Google::Apis::SqladminV1::Operation]
659
+ #
660
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
661
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
662
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
663
+ def demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
664
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/demoteMaster', options)
665
+ command.request_representation = Google::Apis::SqladminV1::InstancesDemoteMasterRequest::Representation
666
+ command.request_object = instances_demote_master_request_object
667
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
668
+ command.response_class = Google::Apis::SqladminV1::Operation
669
+ command.params['project'] = project unless project.nil?
670
+ command.params['instance'] = instance unless instance.nil?
671
+ command.query['fields'] = fields unless fields.nil?
672
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
673
+ execute_or_queue_command(command, &block)
674
+ end
675
+
676
+ # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump
677
+ # or CSV file.
678
+ # @param [String] project
679
+ # Project ID of the project that contains the instance to be exported.
680
+ # @param [String] instance
681
+ # Cloud SQL instance ID. This does not include the project ID.
682
+ # @param [Google::Apis::SqladminV1::InstancesExportRequest] instances_export_request_object
683
+ # @param [String] fields
684
+ # Selector specifying which fields to include in a partial response.
685
+ # @param [String] quota_user
686
+ # Available to use for quota purposes for server-side applications. Can be any
687
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
688
+ # @param [Google::Apis::RequestOptions] options
689
+ # Request-specific options
690
+ #
691
+ # @yield [result, err] Result & error if block supplied
692
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
693
+ # @yieldparam err [StandardError] error object if request failed
694
+ #
695
+ # @return [Google::Apis::SqladminV1::Operation]
696
+ #
697
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
698
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
699
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
700
+ def export_instance(project, instance, instances_export_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
701
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/export', options)
702
+ command.request_representation = Google::Apis::SqladminV1::InstancesExportRequest::Representation
703
+ command.request_object = instances_export_request_object
704
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
705
+ command.response_class = Google::Apis::SqladminV1::Operation
706
+ command.params['project'] = project unless project.nil?
707
+ command.params['instance'] = instance unless instance.nil?
708
+ command.query['fields'] = fields unless fields.nil?
709
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
710
+ execute_or_queue_command(command, &block)
711
+ end
712
+
713
+ # Initiates a manual failover of a high availability (HA) primary instance to a
714
+ # standby instance, which becomes the primary instance. Users are then rerouted
715
+ # to the new primary. For more information, see the Overview of high
716
+ # availability page in the Cloud SQL documentation. If using Legacy HA (MySQL
717
+ # only), this causes the instance to failover to its failover replica instance.
718
+ # @param [String] project
719
+ # ID of the project that contains the read replica.
720
+ # @param [String] instance
721
+ # Cloud SQL instance ID. This does not include the project ID.
722
+ # @param [Google::Apis::SqladminV1::InstancesFailoverRequest] instances_failover_request_object
723
+ # @param [String] fields
724
+ # Selector specifying which fields to include in a partial response.
725
+ # @param [String] quota_user
726
+ # Available to use for quota purposes for server-side applications. Can be any
727
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
728
+ # @param [Google::Apis::RequestOptions] options
729
+ # Request-specific options
730
+ #
731
+ # @yield [result, err] Result & error if block supplied
732
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
733
+ # @yieldparam err [StandardError] error object if request failed
734
+ #
735
+ # @return [Google::Apis::SqladminV1::Operation]
736
+ #
737
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
738
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
739
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
740
+ def failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
741
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/failover', options)
742
+ command.request_representation = Google::Apis::SqladminV1::InstancesFailoverRequest::Representation
743
+ command.request_object = instances_failover_request_object
744
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
745
+ command.response_class = Google::Apis::SqladminV1::Operation
746
+ command.params['project'] = project unless project.nil?
747
+ command.params['instance'] = instance unless instance.nil?
748
+ command.query['fields'] = fields unless fields.nil?
749
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
750
+ execute_or_queue_command(command, &block)
751
+ end
752
+
753
+ # Retrieves a resource containing information about a Cloud SQL instance.
754
+ # @param [String] project
755
+ # Project ID of the project that contains the instance.
756
+ # @param [String] instance
757
+ # Database instance ID. This does not include the project ID.
758
+ # @param [String] fields
759
+ # Selector specifying which fields to include in a partial response.
760
+ # @param [String] quota_user
761
+ # Available to use for quota purposes for server-side applications. Can be any
762
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
763
+ # @param [Google::Apis::RequestOptions] options
764
+ # Request-specific options
765
+ #
766
+ # @yield [result, err] Result & error if block supplied
767
+ # @yieldparam result [Google::Apis::SqladminV1::DatabaseInstance] parsed result object
768
+ # @yieldparam err [StandardError] error object if request failed
769
+ #
770
+ # @return [Google::Apis::SqladminV1::DatabaseInstance]
771
+ #
772
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
773
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
774
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
775
+ def get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
776
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}', options)
777
+ command.response_representation = Google::Apis::SqladminV1::DatabaseInstance::Representation
778
+ command.response_class = Google::Apis::SqladminV1::DatabaseInstance
779
+ command.params['project'] = project unless project.nil?
780
+ command.params['instance'] = instance unless instance.nil?
781
+ command.query['fields'] = fields unless fields.nil?
782
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
783
+ execute_or_queue_command(command, &block)
784
+ end
785
+
786
+ # Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud
787
+ # Storage.
788
+ # @param [String] project
789
+ # Project ID of the project that contains the instance.
790
+ # @param [String] instance
791
+ # Cloud SQL instance ID. This does not include the project ID.
792
+ # @param [Google::Apis::SqladminV1::InstancesImportRequest] instances_import_request_object
793
+ # @param [String] fields
794
+ # Selector specifying which fields to include in a partial response.
795
+ # @param [String] quota_user
796
+ # Available to use for quota purposes for server-side applications. Can be any
797
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
798
+ # @param [Google::Apis::RequestOptions] options
799
+ # Request-specific options
800
+ #
801
+ # @yield [result, err] Result & error if block supplied
802
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
803
+ # @yieldparam err [StandardError] error object if request failed
804
+ #
805
+ # @return [Google::Apis::SqladminV1::Operation]
806
+ #
807
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
808
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
809
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
810
+ def import_instance(project, instance, instances_import_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
811
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/import', options)
812
+ command.request_representation = Google::Apis::SqladminV1::InstancesImportRequest::Representation
813
+ command.request_object = instances_import_request_object
814
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
815
+ command.response_class = Google::Apis::SqladminV1::Operation
816
+ command.params['project'] = project unless project.nil?
817
+ command.params['instance'] = instance unless instance.nil?
818
+ command.query['fields'] = fields unless fields.nil?
819
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
820
+ execute_or_queue_command(command, &block)
821
+ end
822
+
823
+ # Creates a new Cloud SQL instance.
824
+ # @param [String] project
825
+ # Project ID of the project to which the newly created Cloud SQL instances
826
+ # should belong.
827
+ # @param [Google::Apis::SqladminV1::DatabaseInstance] database_instance_object
828
+ # @param [String] fields
829
+ # Selector specifying which fields to include in a partial response.
830
+ # @param [String] quota_user
831
+ # Available to use for quota purposes for server-side applications. Can be any
832
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
833
+ # @param [Google::Apis::RequestOptions] options
834
+ # Request-specific options
835
+ #
836
+ # @yield [result, err] Result & error if block supplied
837
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
838
+ # @yieldparam err [StandardError] error object if request failed
839
+ #
840
+ # @return [Google::Apis::SqladminV1::Operation]
841
+ #
842
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
843
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
844
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
845
+ def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
846
+ command = make_simple_command(:post, 'v1/projects/{project}/instances', options)
847
+ command.request_representation = Google::Apis::SqladminV1::DatabaseInstance::Representation
848
+ command.request_object = database_instance_object
849
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
850
+ command.response_class = Google::Apis::SqladminV1::Operation
851
+ command.params['project'] = project unless project.nil?
852
+ command.query['fields'] = fields unless fields.nil?
853
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
854
+ execute_or_queue_command(command, &block)
855
+ end
856
+
857
+ # Lists instances under a given project.
858
+ # @param [String] project
859
+ # Project ID of the project for which to list Cloud SQL instances.
860
+ # @param [String] filter
861
+ # A filter expression that filters resources listed in the response. The
862
+ # expression is in the form of field:value. For example, 'instanceType:
863
+ # CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON
864
+ # representation, such as 'settings.userLabels.auto_start:true'. Multiple filter
865
+ # queries are space-separated. For example. 'state:RUNNABLE instanceType:
866
+ # CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However,
867
+ # you can include AND and OR expressions explicitly.
868
+ # @param [Fixnum] max_results
869
+ # The maximum number of results to return per response.
870
+ # @param [String] page_token
871
+ # A previously-returned page token representing part of the larger set of
872
+ # results to view.
873
+ # @param [String] fields
874
+ # Selector specifying which fields to include in a partial response.
875
+ # @param [String] quota_user
876
+ # Available to use for quota purposes for server-side applications. Can be any
877
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
878
+ # @param [Google::Apis::RequestOptions] options
879
+ # Request-specific options
880
+ #
881
+ # @yield [result, err] Result & error if block supplied
882
+ # @yieldparam result [Google::Apis::SqladminV1::InstancesListResponse] parsed result object
883
+ # @yieldparam err [StandardError] error object if request failed
884
+ #
885
+ # @return [Google::Apis::SqladminV1::InstancesListResponse]
886
+ #
887
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
888
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
889
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
890
+ def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
891
+ command = make_simple_command(:get, 'v1/projects/{project}/instances', options)
892
+ command.response_representation = Google::Apis::SqladminV1::InstancesListResponse::Representation
893
+ command.response_class = Google::Apis::SqladminV1::InstancesListResponse
894
+ command.params['project'] = project unless project.nil?
895
+ command.query['filter'] = filter unless filter.nil?
896
+ command.query['maxResults'] = max_results unless max_results.nil?
897
+ command.query['pageToken'] = page_token unless page_token.nil?
898
+ command.query['fields'] = fields unless fields.nil?
899
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
900
+ execute_or_queue_command(command, &block)
901
+ end
902
+
903
+ # Lists all of the trusted Certificate Authorities (CAs) for the specified
904
+ # instance. There can be up to three CAs listed: the CA that was used to sign
905
+ # the certificate that is currently in use, a CA that has been added but not yet
906
+ # used to sign a certificate, and a CA used to sign a certificate that has
907
+ # previously rotated out.
908
+ # @param [String] project
909
+ # Project ID of the project that contains the instance.
910
+ # @param [String] instance
911
+ # Cloud SQL instance ID. This does not include the project ID.
912
+ # @param [String] fields
913
+ # Selector specifying which fields to include in a partial response.
914
+ # @param [String] quota_user
915
+ # Available to use for quota purposes for server-side applications. Can be any
916
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
917
+ # @param [Google::Apis::RequestOptions] options
918
+ # Request-specific options
919
+ #
920
+ # @yield [result, err] Result & error if block supplied
921
+ # @yieldparam result [Google::Apis::SqladminV1::InstancesListServerCasResponse] parsed result object
922
+ # @yieldparam err [StandardError] error object if request failed
923
+ #
924
+ # @return [Google::Apis::SqladminV1::InstancesListServerCasResponse]
925
+ #
926
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
927
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
928
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
929
+ def list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block)
930
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/listServerCas', options)
931
+ command.response_representation = Google::Apis::SqladminV1::InstancesListServerCasResponse::Representation
932
+ command.response_class = Google::Apis::SqladminV1::InstancesListServerCasResponse
933
+ command.params['project'] = project unless project.nil?
934
+ command.params['instance'] = instance unless instance.nil?
935
+ command.query['fields'] = fields unless fields.nil?
936
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
937
+ execute_or_queue_command(command, &block)
938
+ end
939
+
940
+ # Updates settings of a Cloud SQL instance. This method supports patch semantics.
941
+ # @param [String] project
942
+ # Project ID of the project that contains the instance.
943
+ # @param [String] instance
944
+ # Cloud SQL instance ID. This does not include the project ID.
945
+ # @param [Google::Apis::SqladminV1::DatabaseInstance] database_instance_object
946
+ # @param [String] fields
947
+ # Selector specifying which fields to include in a partial response.
948
+ # @param [String] quota_user
949
+ # Available to use for quota purposes for server-side applications. Can be any
950
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
951
+ # @param [Google::Apis::RequestOptions] options
952
+ # Request-specific options
953
+ #
954
+ # @yield [result, err] Result & error if block supplied
955
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
956
+ # @yieldparam err [StandardError] error object if request failed
957
+ #
958
+ # @return [Google::Apis::SqladminV1::Operation]
959
+ #
960
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
961
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
962
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
963
+ def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
964
+ command = make_simple_command(:patch, 'v1/projects/{project}/instances/{instance}', options)
965
+ command.request_representation = Google::Apis::SqladminV1::DatabaseInstance::Representation
966
+ command.request_object = database_instance_object
967
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
968
+ command.response_class = Google::Apis::SqladminV1::Operation
969
+ command.params['project'] = project unless project.nil?
970
+ command.params['instance'] = instance unless instance.nil?
971
+ command.query['fields'] = fields unless fields.nil?
972
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
973
+ execute_or_queue_command(command, &block)
974
+ end
975
+
976
+ # Promotes the read replica instance to be a stand-alone Cloud SQL instance.
977
+ # Using this operation might cause your instance to restart.
978
+ # @param [String] project
979
+ # ID of the project that contains the read replica.
980
+ # @param [String] instance
981
+ # Cloud SQL read replica instance name.
982
+ # @param [String] fields
983
+ # Selector specifying which fields to include in a partial response.
984
+ # @param [String] quota_user
985
+ # Available to use for quota purposes for server-side applications. Can be any
986
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
987
+ # @param [Google::Apis::RequestOptions] options
988
+ # Request-specific options
989
+ #
990
+ # @yield [result, err] Result & error if block supplied
991
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
992
+ # @yieldparam err [StandardError] error object if request failed
993
+ #
994
+ # @return [Google::Apis::SqladminV1::Operation]
995
+ #
996
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
997
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
998
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
999
+ def promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1000
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/promoteReplica', options)
1001
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1002
+ command.response_class = Google::Apis::SqladminV1::Operation
1003
+ command.params['project'] = project unless project.nil?
1004
+ command.params['instance'] = instance unless instance.nil?
1005
+ command.query['fields'] = fields unless fields.nil?
1006
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1007
+ execute_or_queue_command(command, &block)
1008
+ end
1009
+
1010
+ # Deletes all client certificates and generates a new server SSL certificate for
1011
+ # the instance.
1012
+ # @param [String] project
1013
+ # Project ID of the project that contains the instance.
1014
+ # @param [String] instance
1015
+ # Cloud SQL instance ID. This does not include the project ID.
1016
+ # @param [String] fields
1017
+ # Selector specifying which fields to include in a partial response.
1018
+ # @param [String] quota_user
1019
+ # Available to use for quota purposes for server-side applications. Can be any
1020
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1021
+ # @param [Google::Apis::RequestOptions] options
1022
+ # Request-specific options
1023
+ #
1024
+ # @yield [result, err] Result & error if block supplied
1025
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1026
+ # @yieldparam err [StandardError] error object if request failed
1027
+ #
1028
+ # @return [Google::Apis::SqladminV1::Operation]
1029
+ #
1030
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1031
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1032
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1033
+ def reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1034
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/resetSslConfig', options)
1035
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1036
+ command.response_class = Google::Apis::SqladminV1::Operation
1037
+ command.params['project'] = project unless project.nil?
1038
+ command.params['instance'] = instance unless instance.nil?
1039
+ command.query['fields'] = fields unless fields.nil?
1040
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1041
+ execute_or_queue_command(command, &block)
1042
+ end
1043
+
1044
+ # Restarts a Cloud SQL instance.
1045
+ # @param [String] project
1046
+ # Project ID of the project that contains the instance to be restarted.
1047
+ # @param [String] instance
1048
+ # Cloud SQL instance ID. This does not include the project ID.
1049
+ # @param [String] fields
1050
+ # Selector specifying which fields to include in a partial response.
1051
+ # @param [String] quota_user
1052
+ # Available to use for quota purposes for server-side applications. Can be any
1053
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1054
+ # @param [Google::Apis::RequestOptions] options
1055
+ # Request-specific options
1056
+ #
1057
+ # @yield [result, err] Result & error if block supplied
1058
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1059
+ # @yieldparam err [StandardError] error object if request failed
1060
+ #
1061
+ # @return [Google::Apis::SqladminV1::Operation]
1062
+ #
1063
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1064
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1065
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1066
+ def restart_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1067
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/restart', options)
1068
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1069
+ command.response_class = Google::Apis::SqladminV1::Operation
1070
+ command.params['project'] = project unless project.nil?
1071
+ command.params['instance'] = instance unless instance.nil?
1072
+ command.query['fields'] = fields unless fields.nil?
1073
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1074
+ execute_or_queue_command(command, &block)
1075
+ end
1076
+
1077
+ # Restores a backup of a Cloud SQL instance. Using this operation might cause
1078
+ # your instance to restart.
1079
+ # @param [String] project
1080
+ # Project ID of the project that contains the instance.
1081
+ # @param [String] instance
1082
+ # Cloud SQL instance ID. This does not include the project ID.
1083
+ # @param [Google::Apis::SqladminV1::InstancesRestoreBackupRequest] instances_restore_backup_request_object
1084
+ # @param [String] fields
1085
+ # Selector specifying which fields to include in a partial response.
1086
+ # @param [String] quota_user
1087
+ # Available to use for quota purposes for server-side applications. Can be any
1088
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1089
+ # @param [Google::Apis::RequestOptions] options
1090
+ # Request-specific options
1091
+ #
1092
+ # @yield [result, err] Result & error if block supplied
1093
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1094
+ # @yieldparam err [StandardError] error object if request failed
1095
+ #
1096
+ # @return [Google::Apis::SqladminV1::Operation]
1097
+ #
1098
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1099
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1100
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1101
+ def restore_instance_backup(project, instance, instances_restore_backup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1102
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/restoreBackup', options)
1103
+ command.request_representation = Google::Apis::SqladminV1::InstancesRestoreBackupRequest::Representation
1104
+ command.request_object = instances_restore_backup_request_object
1105
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1106
+ command.response_class = Google::Apis::SqladminV1::Operation
1107
+ command.params['project'] = project unless project.nil?
1108
+ command.params['instance'] = instance unless instance.nil?
1109
+ command.query['fields'] = fields unless fields.nil?
1110
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1111
+ execute_or_queue_command(command, &block)
1112
+ end
1113
+
1114
+ # Rotates the server certificate to one signed by the Certificate Authority (CA)
1115
+ # version previously added with the addServerCA method.
1116
+ # @param [String] project
1117
+ # Project ID of the project that contains the instance.
1118
+ # @param [String] instance
1119
+ # Cloud SQL instance ID. This does not include the project ID.
1120
+ # @param [Google::Apis::SqladminV1::InstancesRotateServerCaRequest] instances_rotate_server_ca_request_object
1121
+ # @param [String] fields
1122
+ # Selector specifying which fields to include in a partial response.
1123
+ # @param [String] quota_user
1124
+ # Available to use for quota purposes for server-side applications. Can be any
1125
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1126
+ # @param [Google::Apis::RequestOptions] options
1127
+ # Request-specific options
1128
+ #
1129
+ # @yield [result, err] Result & error if block supplied
1130
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1131
+ # @yieldparam err [StandardError] error object if request failed
1132
+ #
1133
+ # @return [Google::Apis::SqladminV1::Operation]
1134
+ #
1135
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1136
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1137
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1138
+ def rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1139
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/rotateServerCa', options)
1140
+ command.request_representation = Google::Apis::SqladminV1::InstancesRotateServerCaRequest::Representation
1141
+ command.request_object = instances_rotate_server_ca_request_object
1142
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1143
+ command.response_class = Google::Apis::SqladminV1::Operation
1144
+ command.params['project'] = project unless project.nil?
1145
+ command.params['instance'] = instance unless instance.nil?
1146
+ command.query['fields'] = fields unless fields.nil?
1147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1148
+ execute_or_queue_command(command, &block)
1149
+ end
1150
+
1151
+ # Starts the replication in the read replica instance.
1152
+ # @param [String] project
1153
+ # ID of the project that contains the read replica.
1154
+ # @param [String] instance
1155
+ # Cloud SQL read replica instance name.
1156
+ # @param [String] fields
1157
+ # Selector specifying which fields to include in a partial response.
1158
+ # @param [String] quota_user
1159
+ # Available to use for quota purposes for server-side applications. Can be any
1160
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1161
+ # @param [Google::Apis::RequestOptions] options
1162
+ # Request-specific options
1163
+ #
1164
+ # @yield [result, err] Result & error if block supplied
1165
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1166
+ # @yieldparam err [StandardError] error object if request failed
1167
+ #
1168
+ # @return [Google::Apis::SqladminV1::Operation]
1169
+ #
1170
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1171
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1172
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1173
+ def start_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1174
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/startReplica', options)
1175
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1176
+ command.response_class = Google::Apis::SqladminV1::Operation
1177
+ command.params['project'] = project unless project.nil?
1178
+ command.params['instance'] = instance unless instance.nil?
1179
+ command.query['fields'] = fields unless fields.nil?
1180
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1181
+ execute_or_queue_command(command, &block)
1182
+ end
1183
+
1184
+ # Stops the replication in the read replica instance.
1185
+ # @param [String] project
1186
+ # ID of the project that contains the read replica.
1187
+ # @param [String] instance
1188
+ # Cloud SQL read replica instance name.
1189
+ # @param [String] fields
1190
+ # Selector specifying which fields to include in a partial response.
1191
+ # @param [String] quota_user
1192
+ # Available to use for quota purposes for server-side applications. Can be any
1193
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1194
+ # @param [Google::Apis::RequestOptions] options
1195
+ # Request-specific options
1196
+ #
1197
+ # @yield [result, err] Result & error if block supplied
1198
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1199
+ # @yieldparam err [StandardError] error object if request failed
1200
+ #
1201
+ # @return [Google::Apis::SqladminV1::Operation]
1202
+ #
1203
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1204
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1205
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1206
+ def stop_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1207
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/stopReplica', options)
1208
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1209
+ command.response_class = Google::Apis::SqladminV1::Operation
1210
+ command.params['project'] = project unless project.nil?
1211
+ command.params['instance'] = instance unless instance.nil?
1212
+ command.query['fields'] = fields unless fields.nil?
1213
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1214
+ execute_or_queue_command(command, &block)
1215
+ end
1216
+
1217
+ # Truncate MySQL general and slow query log tables MySQL only.
1218
+ # @param [String] project
1219
+ # Project ID of the Cloud SQL project.
1220
+ # @param [String] instance
1221
+ # Cloud SQL instance ID. This does not include the project ID.
1222
+ # @param [Google::Apis::SqladminV1::InstancesTruncateLogRequest] instances_truncate_log_request_object
1223
+ # @param [String] fields
1224
+ # Selector specifying which fields to include in a partial response.
1225
+ # @param [String] quota_user
1226
+ # Available to use for quota purposes for server-side applications. Can be any
1227
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1228
+ # @param [Google::Apis::RequestOptions] options
1229
+ # Request-specific options
1230
+ #
1231
+ # @yield [result, err] Result & error if block supplied
1232
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1233
+ # @yieldparam err [StandardError] error object if request failed
1234
+ #
1235
+ # @return [Google::Apis::SqladminV1::Operation]
1236
+ #
1237
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1238
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1239
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1240
+ def truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1241
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/truncateLog', options)
1242
+ command.request_representation = Google::Apis::SqladminV1::InstancesTruncateLogRequest::Representation
1243
+ command.request_object = instances_truncate_log_request_object
1244
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1245
+ command.response_class = Google::Apis::SqladminV1::Operation
1246
+ command.params['project'] = project unless project.nil?
1247
+ command.params['instance'] = instance unless instance.nil?
1248
+ command.query['fields'] = fields unless fields.nil?
1249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1250
+ execute_or_queue_command(command, &block)
1251
+ end
1252
+
1253
+ # Updates settings of a Cloud SQL instance. Using this operation might cause
1254
+ # your instance to restart.
1255
+ # @param [String] project
1256
+ # Project ID of the project that contains the instance.
1257
+ # @param [String] instance
1258
+ # Cloud SQL instance ID. This does not include the project ID.
1259
+ # @param [Google::Apis::SqladminV1::DatabaseInstance] database_instance_object
1260
+ # @param [String] fields
1261
+ # Selector specifying which fields to include in a partial response.
1262
+ # @param [String] quota_user
1263
+ # Available to use for quota purposes for server-side applications. Can be any
1264
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1265
+ # @param [Google::Apis::RequestOptions] options
1266
+ # Request-specific options
1267
+ #
1268
+ # @yield [result, err] Result & error if block supplied
1269
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1270
+ # @yieldparam err [StandardError] error object if request failed
1271
+ #
1272
+ # @return [Google::Apis::SqladminV1::Operation]
1273
+ #
1274
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1275
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1276
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1277
+ def update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1278
+ command = make_simple_command(:put, 'v1/projects/{project}/instances/{instance}', options)
1279
+ command.request_representation = Google::Apis::SqladminV1::DatabaseInstance::Representation
1280
+ command.request_object = database_instance_object
1281
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1282
+ command.response_class = Google::Apis::SqladminV1::Operation
1283
+ command.params['project'] = project unless project.nil?
1284
+ command.params['instance'] = instance unless instance.nil?
1285
+ command.query['fields'] = fields unless fields.nil?
1286
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1287
+ execute_or_queue_command(command, &block)
1288
+ end
1289
+
1290
+ # Retrieves an instance operation that has been performed on an instance.
1291
+ # @param [String] project
1292
+ # Project ID of the project that contains the instance.
1293
+ # @param [String] operation
1294
+ # Instance operation ID.
1295
+ # @param [String] fields
1296
+ # Selector specifying which fields to include in a partial response.
1297
+ # @param [String] quota_user
1298
+ # Available to use for quota purposes for server-side applications. Can be any
1299
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1300
+ # @param [Google::Apis::RequestOptions] options
1301
+ # Request-specific options
1302
+ #
1303
+ # @yield [result, err] Result & error if block supplied
1304
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1305
+ # @yieldparam err [StandardError] error object if request failed
1306
+ #
1307
+ # @return [Google::Apis::SqladminV1::Operation]
1308
+ #
1309
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1310
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1311
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1312
+ def get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
1313
+ command = make_simple_command(:get, 'v1/projects/{project}/operations/{operation}', options)
1314
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1315
+ command.response_class = Google::Apis::SqladminV1::Operation
1316
+ command.params['project'] = project unless project.nil?
1317
+ command.params['operation'] = operation unless operation.nil?
1318
+ command.query['fields'] = fields unless fields.nil?
1319
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1320
+ execute_or_queue_command(command, &block)
1321
+ end
1322
+
1323
+ # Lists all instance operations that have been performed on the given Cloud SQL
1324
+ # instance in the reverse chronological order of the start time.
1325
+ # @param [String] project
1326
+ # Project ID of the project that contains the instance.
1327
+ # @param [String] instance
1328
+ # Cloud SQL instance ID. This does not include the project ID.
1329
+ # @param [Fixnum] max_results
1330
+ # Maximum number of operations per response.
1331
+ # @param [String] page_token
1332
+ # A previously-returned page token representing part of the larger set of
1333
+ # results to view.
1334
+ # @param [String] fields
1335
+ # Selector specifying which fields to include in a partial response.
1336
+ # @param [String] quota_user
1337
+ # Available to use for quota purposes for server-side applications. Can be any
1338
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1339
+ # @param [Google::Apis::RequestOptions] options
1340
+ # Request-specific options
1341
+ #
1342
+ # @yield [result, err] Result & error if block supplied
1343
+ # @yieldparam result [Google::Apis::SqladminV1::OperationsListResponse] parsed result object
1344
+ # @yieldparam err [StandardError] error object if request failed
1345
+ #
1346
+ # @return [Google::Apis::SqladminV1::OperationsListResponse]
1347
+ #
1348
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1349
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1350
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1351
+ def list_operations(project, instance: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1352
+ command = make_simple_command(:get, 'v1/projects/{project}/operations', options)
1353
+ command.response_representation = Google::Apis::SqladminV1::OperationsListResponse::Representation
1354
+ command.response_class = Google::Apis::SqladminV1::OperationsListResponse
1355
+ command.params['project'] = project unless project.nil?
1356
+ command.query['instance'] = instance unless instance.nil?
1357
+ command.query['maxResults'] = max_results unless max_results.nil?
1358
+ command.query['pageToken'] = page_token unless page_token.nil?
1359
+ command.query['fields'] = fields unless fields.nil?
1360
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1361
+ execute_or_queue_command(command, &block)
1362
+ end
1363
+
1364
+ # Reschedules the maintenance on the given instance.
1365
+ # @param [String] project
1366
+ # ID of the project that contains the instance.
1367
+ # @param [String] instance
1368
+ # Cloud SQL instance ID. This does not include the project ID.
1369
+ # @param [Google::Apis::SqladminV1::SqlInstancesRescheduleMaintenanceRequestBody] sql_instances_reschedule_maintenance_request_body_object
1370
+ # @param [String] fields
1371
+ # Selector specifying which fields to include in a partial response.
1372
+ # @param [String] quota_user
1373
+ # Available to use for quota purposes for server-side applications. Can be any
1374
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1375
+ # @param [Google::Apis::RequestOptions] options
1376
+ # Request-specific options
1377
+ #
1378
+ # @yield [result, err] Result & error if block supplied
1379
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1380
+ # @yieldparam err [StandardError] error object if request failed
1381
+ #
1382
+ # @return [Google::Apis::SqladminV1::Operation]
1383
+ #
1384
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1385
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1386
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1387
+ def reschedule_project_instance_maintenance(project, instance, sql_instances_reschedule_maintenance_request_body_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1388
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/rescheduleMaintenance', options)
1389
+ command.request_representation = Google::Apis::SqladminV1::SqlInstancesRescheduleMaintenanceRequestBody::Representation
1390
+ command.request_object = sql_instances_reschedule_maintenance_request_body_object
1391
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1392
+ command.response_class = Google::Apis::SqladminV1::Operation
1393
+ command.params['project'] = project unless project.nil?
1394
+ command.params['instance'] = instance unless instance.nil?
1395
+ command.query['fields'] = fields unless fields.nil?
1396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1397
+ execute_or_queue_command(command, &block)
1398
+ end
1399
+
1400
+ # Start External primary instance migration.
1401
+ # @param [String] project
1402
+ # ID of the project that contains the instance.
1403
+ # @param [String] instance
1404
+ # Cloud SQL instance ID. This does not include the project ID.
1405
+ # @param [Google::Apis::SqladminV1::SqlInstancesStartExternalSyncRequest] sql_instances_start_external_sync_request_object
1406
+ # @param [String] fields
1407
+ # Selector specifying which fields to include in a partial response.
1408
+ # @param [String] quota_user
1409
+ # Available to use for quota purposes for server-side applications. Can be any
1410
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1411
+ # @param [Google::Apis::RequestOptions] options
1412
+ # Request-specific options
1413
+ #
1414
+ # @yield [result, err] Result & error if block supplied
1415
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1416
+ # @yieldparam err [StandardError] error object if request failed
1417
+ #
1418
+ # @return [Google::Apis::SqladminV1::Operation]
1419
+ #
1420
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1421
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1422
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1423
+ def start_project_instance_external_sync(project, instance, sql_instances_start_external_sync_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1424
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/startExternalSync', options)
1425
+ command.request_representation = Google::Apis::SqladminV1::SqlInstancesStartExternalSyncRequest::Representation
1426
+ command.request_object = sql_instances_start_external_sync_request_object
1427
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1428
+ command.response_class = Google::Apis::SqladminV1::Operation
1429
+ command.params['project'] = project unless project.nil?
1430
+ command.params['instance'] = instance unless instance.nil?
1431
+ command.query['fields'] = fields unless fields.nil?
1432
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1433
+ execute_or_queue_command(command, &block)
1434
+ end
1435
+
1436
+ # Verify External primary instance external sync settings.
1437
+ # @param [String] project
1438
+ # Project ID of the project that contains the instance.
1439
+ # @param [String] instance
1440
+ # Cloud SQL instance ID. This does not include the project ID.
1441
+ # @param [Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsRequest] sql_instances_verify_external_sync_settings_request_object
1442
+ # @param [String] fields
1443
+ # Selector specifying which fields to include in a partial response.
1444
+ # @param [String] quota_user
1445
+ # Available to use for quota purposes for server-side applications. Can be any
1446
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1447
+ # @param [Google::Apis::RequestOptions] options
1448
+ # Request-specific options
1449
+ #
1450
+ # @yield [result, err] Result & error if block supplied
1451
+ # @yieldparam result [Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsResponse] parsed result object
1452
+ # @yieldparam err [StandardError] error object if request failed
1453
+ #
1454
+ # @return [Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsResponse]
1455
+ #
1456
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1457
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1458
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1459
+ def verify_project_instance_external_sync_settings(project, instance, sql_instances_verify_external_sync_settings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1460
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/verifyExternalSyncSettings', options)
1461
+ command.request_representation = Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsRequest::Representation
1462
+ command.request_object = sql_instances_verify_external_sync_settings_request_object
1463
+ command.response_representation = Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsResponse::Representation
1464
+ command.response_class = Google::Apis::SqladminV1::SqlInstancesVerifyExternalSyncSettingsResponse
1465
+ command.params['project'] = project unless project.nil?
1466
+ command.params['instance'] = instance unless instance.nil?
1467
+ command.query['fields'] = fields unless fields.nil?
1468
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1469
+ execute_or_queue_command(command, &block)
1470
+ end
1471
+
1472
+ # Generates a short-lived X509 certificate containing the provided public key
1473
+ # and signed by a private key specific to the target instance. Users may use the
1474
+ # certificate to authenticate as themselves when connecting to the database.
1475
+ # @param [String] project
1476
+ # Project ID of the Cloud SQL project.
1477
+ # @param [String] instance
1478
+ # Cloud SQL instance ID. This does not include the project ID.
1479
+ # @param [Google::Apis::SqladminV1::SslCertsCreateEphemeralRequest] ssl_certs_create_ephemeral_request_object
1480
+ # @param [String] fields
1481
+ # Selector specifying which fields to include in a partial response.
1482
+ # @param [String] quota_user
1483
+ # Available to use for quota purposes for server-side applications. Can be any
1484
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1485
+ # @param [Google::Apis::RequestOptions] options
1486
+ # Request-specific options
1487
+ #
1488
+ # @yield [result, err] Result & error if block supplied
1489
+ # @yieldparam result [Google::Apis::SqladminV1::SslCert] parsed result object
1490
+ # @yieldparam err [StandardError] error object if request failed
1491
+ #
1492
+ # @return [Google::Apis::SqladminV1::SslCert]
1493
+ #
1494
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1495
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1496
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1497
+ def create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1498
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/createEphemeral', options)
1499
+ command.request_representation = Google::Apis::SqladminV1::SslCertsCreateEphemeralRequest::Representation
1500
+ command.request_object = ssl_certs_create_ephemeral_request_object
1501
+ command.response_representation = Google::Apis::SqladminV1::SslCert::Representation
1502
+ command.response_class = Google::Apis::SqladminV1::SslCert
1503
+ command.params['project'] = project unless project.nil?
1504
+ command.params['instance'] = instance unless instance.nil?
1505
+ command.query['fields'] = fields unless fields.nil?
1506
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1507
+ execute_or_queue_command(command, &block)
1508
+ end
1509
+
1510
+ # Deletes the SSL certificate. For First Generation instances, the certificate
1511
+ # remains valid until the instance is restarted.
1512
+ # @param [String] project
1513
+ # Project ID of the project that contains the instance.
1514
+ # @param [String] instance
1515
+ # Cloud SQL instance ID. This does not include the project ID.
1516
+ # @param [String] sha1_fingerprint
1517
+ # Sha1 FingerPrint.
1518
+ # @param [String] fields
1519
+ # Selector specifying which fields to include in a partial response.
1520
+ # @param [String] quota_user
1521
+ # Available to use for quota purposes for server-side applications. Can be any
1522
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1523
+ # @param [Google::Apis::RequestOptions] options
1524
+ # Request-specific options
1525
+ #
1526
+ # @yield [result, err] Result & error if block supplied
1527
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1528
+ # @yieldparam err [StandardError] error object if request failed
1529
+ #
1530
+ # @return [Google::Apis::SqladminV1::Operation]
1531
+ #
1532
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1533
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1534
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1535
+ def delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
1536
+ command = make_simple_command(:delete, 'v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
1537
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1538
+ command.response_class = Google::Apis::SqladminV1::Operation
1539
+ command.params['project'] = project unless project.nil?
1540
+ command.params['instance'] = instance unless instance.nil?
1541
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1542
+ command.query['fields'] = fields unless fields.nil?
1543
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1544
+ execute_or_queue_command(command, &block)
1545
+ end
1546
+
1547
+ # Retrieves a particular SSL certificate. Does not include the private key (
1548
+ # required for usage). The private key must be saved from the response to
1549
+ # initial creation.
1550
+ # @param [String] project
1551
+ # Project ID of the project that contains the instance.
1552
+ # @param [String] instance
1553
+ # Cloud SQL instance ID. This does not include the project ID.
1554
+ # @param [String] sha1_fingerprint
1555
+ # Sha1 FingerPrint.
1556
+ # @param [String] fields
1557
+ # Selector specifying which fields to include in a partial response.
1558
+ # @param [String] quota_user
1559
+ # Available to use for quota purposes for server-side applications. Can be any
1560
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1561
+ # @param [Google::Apis::RequestOptions] options
1562
+ # Request-specific options
1563
+ #
1564
+ # @yield [result, err] Result & error if block supplied
1565
+ # @yieldparam result [Google::Apis::SqladminV1::SslCert] parsed result object
1566
+ # @yieldparam err [StandardError] error object if request failed
1567
+ #
1568
+ # @return [Google::Apis::SqladminV1::SslCert]
1569
+ #
1570
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1571
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1572
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1573
+ def get_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
1574
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
1575
+ command.response_representation = Google::Apis::SqladminV1::SslCert::Representation
1576
+ command.response_class = Google::Apis::SqladminV1::SslCert
1577
+ command.params['project'] = project unless project.nil?
1578
+ command.params['instance'] = instance unless instance.nil?
1579
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1580
+ command.query['fields'] = fields unless fields.nil?
1581
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1582
+ execute_or_queue_command(command, &block)
1583
+ end
1584
+
1585
+ # Creates an SSL certificate and returns it along with the private key and
1586
+ # server certificate authority. The new certificate will not be usable until the
1587
+ # instance is restarted.
1588
+ # @param [String] project
1589
+ # Project ID of the project that contains the instance.
1590
+ # @param [String] instance
1591
+ # Cloud SQL instance ID. This does not include the project ID.
1592
+ # @param [Google::Apis::SqladminV1::SslCertsInsertRequest] ssl_certs_insert_request_object
1593
+ # @param [String] fields
1594
+ # Selector specifying which fields to include in a partial response.
1595
+ # @param [String] quota_user
1596
+ # Available to use for quota purposes for server-side applications. Can be any
1597
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1598
+ # @param [Google::Apis::RequestOptions] options
1599
+ # Request-specific options
1600
+ #
1601
+ # @yield [result, err] Result & error if block supplied
1602
+ # @yieldparam result [Google::Apis::SqladminV1::SslCertsInsertResponse] parsed result object
1603
+ # @yieldparam err [StandardError] error object if request failed
1604
+ #
1605
+ # @return [Google::Apis::SqladminV1::SslCertsInsertResponse]
1606
+ #
1607
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1608
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1609
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1610
+ def insert_ssl_cert(project, instance, ssl_certs_insert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1611
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/sslCerts', options)
1612
+ command.request_representation = Google::Apis::SqladminV1::SslCertsInsertRequest::Representation
1613
+ command.request_object = ssl_certs_insert_request_object
1614
+ command.response_representation = Google::Apis::SqladminV1::SslCertsInsertResponse::Representation
1615
+ command.response_class = Google::Apis::SqladminV1::SslCertsInsertResponse
1616
+ command.params['project'] = project unless project.nil?
1617
+ command.params['instance'] = instance unless instance.nil?
1618
+ command.query['fields'] = fields unless fields.nil?
1619
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1620
+ execute_or_queue_command(command, &block)
1621
+ end
1622
+
1623
+ # Lists all of the current SSL certificates for the instance.
1624
+ # @param [String] project
1625
+ # Project ID of the project that contains the instance.
1626
+ # @param [String] instance
1627
+ # Cloud SQL instance ID. This does not include the project ID.
1628
+ # @param [String] fields
1629
+ # Selector specifying which fields to include in a partial response.
1630
+ # @param [String] quota_user
1631
+ # Available to use for quota purposes for server-side applications. Can be any
1632
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1633
+ # @param [Google::Apis::RequestOptions] options
1634
+ # Request-specific options
1635
+ #
1636
+ # @yield [result, err] Result & error if block supplied
1637
+ # @yieldparam result [Google::Apis::SqladminV1::SslCertsListResponse] parsed result object
1638
+ # @yieldparam err [StandardError] error object if request failed
1639
+ #
1640
+ # @return [Google::Apis::SqladminV1::SslCertsListResponse]
1641
+ #
1642
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1643
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1644
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1645
+ def list_ssl_certs(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1646
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/sslCerts', options)
1647
+ command.response_representation = Google::Apis::SqladminV1::SslCertsListResponse::Representation
1648
+ command.response_class = Google::Apis::SqladminV1::SslCertsListResponse
1649
+ command.params['project'] = project unless project.nil?
1650
+ command.params['instance'] = instance unless instance.nil?
1651
+ command.query['fields'] = fields unless fields.nil?
1652
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1653
+ execute_or_queue_command(command, &block)
1654
+ end
1655
+
1656
+ # Lists all available machine types (tiers) for Cloud SQL, for example, db-
1657
+ # custom-1-3840. For more information, see https://cloud.google.com/sql/pricing.
1658
+ # @param [String] project
1659
+ # Project ID of the project for which to list tiers.
1660
+ # @param [String] fields
1661
+ # Selector specifying which fields to include in a partial response.
1662
+ # @param [String] quota_user
1663
+ # Available to use for quota purposes for server-side applications. Can be any
1664
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1665
+ # @param [Google::Apis::RequestOptions] options
1666
+ # Request-specific options
1667
+ #
1668
+ # @yield [result, err] Result & error if block supplied
1669
+ # @yieldparam result [Google::Apis::SqladminV1::TiersListResponse] parsed result object
1670
+ # @yieldparam err [StandardError] error object if request failed
1671
+ #
1672
+ # @return [Google::Apis::SqladminV1::TiersListResponse]
1673
+ #
1674
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1675
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1676
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1677
+ def list_tiers(project, fields: nil, quota_user: nil, options: nil, &block)
1678
+ command = make_simple_command(:get, 'v1/projects/{project}/tiers', options)
1679
+ command.response_representation = Google::Apis::SqladminV1::TiersListResponse::Representation
1680
+ command.response_class = Google::Apis::SqladminV1::TiersListResponse
1681
+ command.params['project'] = project unless project.nil?
1682
+ command.query['fields'] = fields unless fields.nil?
1683
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1684
+ execute_or_queue_command(command, &block)
1685
+ end
1686
+
1687
+ # Deletes a user from a Cloud SQL instance.
1688
+ # @param [String] project
1689
+ # Project ID of the project that contains the instance.
1690
+ # @param [String] instance
1691
+ # Database instance ID. This does not include the project ID.
1692
+ # @param [String] host
1693
+ # Host of the user in the instance.
1694
+ # @param [String] name
1695
+ # Name of the user in the instance.
1696
+ # @param [String] fields
1697
+ # Selector specifying which fields to include in a partial response.
1698
+ # @param [String] quota_user
1699
+ # Available to use for quota purposes for server-side applications. Can be any
1700
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1701
+ # @param [Google::Apis::RequestOptions] options
1702
+ # Request-specific options
1703
+ #
1704
+ # @yield [result, err] Result & error if block supplied
1705
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1706
+ # @yieldparam err [StandardError] error object if request failed
1707
+ #
1708
+ # @return [Google::Apis::SqladminV1::Operation]
1709
+ #
1710
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1711
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1712
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1713
+ def delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
1714
+ command = make_simple_command(:delete, 'v1/projects/{project}/instances/{instance}/users', options)
1715
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1716
+ command.response_class = Google::Apis::SqladminV1::Operation
1717
+ command.params['project'] = project unless project.nil?
1718
+ command.params['instance'] = instance unless instance.nil?
1719
+ command.query['host'] = host unless host.nil?
1720
+ command.query['name'] = name unless name.nil?
1721
+ command.query['fields'] = fields unless fields.nil?
1722
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1723
+ execute_or_queue_command(command, &block)
1724
+ end
1725
+
1726
+ # Creates a new user in a Cloud SQL instance.
1727
+ # @param [String] project
1728
+ # Project ID of the project that contains the instance.
1729
+ # @param [String] instance
1730
+ # Database instance ID. This does not include the project ID.
1731
+ # @param [Google::Apis::SqladminV1::User] user_object
1732
+ # @param [String] fields
1733
+ # Selector specifying which fields to include in a partial response.
1734
+ # @param [String] quota_user
1735
+ # Available to use for quota purposes for server-side applications. Can be any
1736
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1737
+ # @param [Google::Apis::RequestOptions] options
1738
+ # Request-specific options
1739
+ #
1740
+ # @yield [result, err] Result & error if block supplied
1741
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1742
+ # @yieldparam err [StandardError] error object if request failed
1743
+ #
1744
+ # @return [Google::Apis::SqladminV1::Operation]
1745
+ #
1746
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1747
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1748
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1749
+ def insert_user(project, instance, user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1750
+ command = make_simple_command(:post, 'v1/projects/{project}/instances/{instance}/users', options)
1751
+ command.request_representation = Google::Apis::SqladminV1::User::Representation
1752
+ command.request_object = user_object
1753
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1754
+ command.response_class = Google::Apis::SqladminV1::Operation
1755
+ command.params['project'] = project unless project.nil?
1756
+ command.params['instance'] = instance unless instance.nil?
1757
+ command.query['fields'] = fields unless fields.nil?
1758
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1759
+ execute_or_queue_command(command, &block)
1760
+ end
1761
+
1762
+ # Lists users in the specified Cloud SQL instance.
1763
+ # @param [String] project
1764
+ # Project ID of the project that contains the instance.
1765
+ # @param [String] instance
1766
+ # Database instance ID. This does not include the project ID.
1767
+ # @param [String] fields
1768
+ # Selector specifying which fields to include in a partial response.
1769
+ # @param [String] quota_user
1770
+ # Available to use for quota purposes for server-side applications. Can be any
1771
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1772
+ # @param [Google::Apis::RequestOptions] options
1773
+ # Request-specific options
1774
+ #
1775
+ # @yield [result, err] Result & error if block supplied
1776
+ # @yieldparam result [Google::Apis::SqladminV1::UsersListResponse] parsed result object
1777
+ # @yieldparam err [StandardError] error object if request failed
1778
+ #
1779
+ # @return [Google::Apis::SqladminV1::UsersListResponse]
1780
+ #
1781
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1782
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1783
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1784
+ def list_users(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1785
+ command = make_simple_command(:get, 'v1/projects/{project}/instances/{instance}/users', options)
1786
+ command.response_representation = Google::Apis::SqladminV1::UsersListResponse::Representation
1787
+ command.response_class = Google::Apis::SqladminV1::UsersListResponse
1788
+ command.params['project'] = project unless project.nil?
1789
+ command.params['instance'] = instance unless instance.nil?
1790
+ command.query['fields'] = fields unless fields.nil?
1791
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1792
+ execute_or_queue_command(command, &block)
1793
+ end
1794
+
1795
+ # Updates an existing user in a Cloud SQL instance.
1796
+ # @param [String] project
1797
+ # Project ID of the project that contains the instance.
1798
+ # @param [String] instance
1799
+ # Database instance ID. This does not include the project ID.
1800
+ # @param [Google::Apis::SqladminV1::User] user_object
1801
+ # @param [String] host
1802
+ # Optional. Host of the user in the instance.
1803
+ # @param [String] name
1804
+ # Name of the user in the instance.
1805
+ # @param [String] fields
1806
+ # Selector specifying which fields to include in a partial response.
1807
+ # @param [String] quota_user
1808
+ # Available to use for quota purposes for server-side applications. Can be any
1809
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1810
+ # @param [Google::Apis::RequestOptions] options
1811
+ # Request-specific options
1812
+ #
1813
+ # @yield [result, err] Result & error if block supplied
1814
+ # @yieldparam result [Google::Apis::SqladminV1::Operation] parsed result object
1815
+ # @yieldparam err [StandardError] error object if request failed
1816
+ #
1817
+ # @return [Google::Apis::SqladminV1::Operation]
1818
+ #
1819
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1820
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1821
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1822
+ def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
1823
+ command = make_simple_command(:put, 'v1/projects/{project}/instances/{instance}/users', options)
1824
+ command.request_representation = Google::Apis::SqladminV1::User::Representation
1825
+ command.request_object = user_object
1826
+ command.response_representation = Google::Apis::SqladminV1::Operation::Representation
1827
+ command.response_class = Google::Apis::SqladminV1::Operation
236
1828
  command.params['project'] = project unless project.nil?
237
1829
  command.params['instance'] = instance unless instance.nil?
1830
+ command.query['host'] = host unless host.nil?
1831
+ command.query['name'] = name unless name.nil?
238
1832
  command.query['fields'] = fields unless fields.nil?
239
1833
  command.query['quotaUser'] = quota_user unless quota_user.nil?
240
1834
  execute_or_queue_command(command, &block)