google-api-client 0.33.0 → 0.33.1

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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/generated/google/apis/accessapproval_v1beta1.rb +1 -1
  4. data/generated/google/apis/accessapproval_v1beta1/classes.rb +19 -0
  5. data/generated/google/apis/accessapproval_v1beta1/representations.rb +12 -0
  6. data/generated/google/apis/accessapproval_v1beta1/service.rb +105 -0
  7. data/generated/google/apis/accesscontextmanager_v1.rb +1 -1
  8. data/generated/google/apis/accesscontextmanager_v1/classes.rb +1 -1
  9. data/generated/google/apis/accesscontextmanager_v1beta.rb +1 -1
  10. data/generated/google/apis/accesscontextmanager_v1beta/classes.rb +1 -1
  11. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  12. data/generated/google/apis/androidpublisher_v3.rb +1 -1
  13. data/generated/google/apis/androidpublisher_v3/classes.rb +6 -0
  14. data/generated/google/apis/androidpublisher_v3/representations.rb +1 -0
  15. data/generated/google/apis/bigquery_v2.rb +1 -1
  16. data/generated/google/apis/bigquery_v2/classes.rb +6 -0
  17. data/generated/google/apis/bigquery_v2/representations.rb +2 -0
  18. data/generated/google/apis/bigqueryconnection_v1beta1.rb +1 -1
  19. data/generated/google/apis/bigqueryconnection_v1beta1/service.rb +1 -1
  20. data/generated/google/apis/binaryauthorization_v1.rb +1 -1
  21. data/generated/google/apis/binaryauthorization_v1/service.rb +2 -0
  22. data/generated/google/apis/binaryauthorization_v1beta1.rb +1 -1
  23. data/generated/google/apis/binaryauthorization_v1beta1/service.rb +2 -0
  24. data/generated/google/apis/cloudasset_v1.rb +1 -1
  25. data/generated/google/apis/cloudasset_v1/classes.rb +14 -15
  26. data/generated/google/apis/cloudasset_v1/service.rb +1 -2
  27. data/generated/google/apis/clouddebugger_v2.rb +1 -1
  28. data/generated/google/apis/clouddebugger_v2/service.rb +14 -14
  29. data/generated/google/apis/cloudidentity_v1.rb +1 -1
  30. data/generated/google/apis/cloudidentity_v1/classes.rb +11 -8
  31. data/generated/google/apis/cloudidentity_v1/service.rb +2 -1
  32. data/generated/google/apis/cloudidentity_v1beta1.rb +1 -1
  33. data/generated/google/apis/cloudidentity_v1beta1/classes.rb +11 -8
  34. data/generated/google/apis/cloudidentity_v1beta1/service.rb +2 -1
  35. data/generated/google/apis/cloudsearch_v1.rb +1 -1
  36. data/generated/google/apis/cloudsearch_v1/classes.rb +5 -2
  37. data/generated/google/apis/cloudsearch_v1/service.rb +5 -2
  38. data/generated/google/apis/cloudshell_v1.rb +1 -1
  39. data/generated/google/apis/cloudshell_v1/classes.rb +15 -0
  40. data/generated/google/apis/cloudshell_v1/representations.rb +2 -0
  41. data/generated/google/apis/cloudshell_v1alpha1.rb +1 -1
  42. data/generated/google/apis/cloudshell_v1alpha1/classes.rb +15 -0
  43. data/generated/google/apis/cloudshell_v1alpha1/representations.rb +2 -0
  44. data/generated/google/apis/compute_alpha.rb +1 -1
  45. data/generated/google/apis/compute_alpha/classes.rb +481 -126
  46. data/generated/google/apis/compute_alpha/representations.rb +107 -2
  47. data/generated/google/apis/compute_alpha/service.rb +1035 -640
  48. data/generated/google/apis/compute_beta.rb +1 -1
  49. data/generated/google/apis/compute_beta/classes.rb +986 -241
  50. data/generated/google/apis/compute_beta/representations.rb +284 -0
  51. data/generated/google/apis/compute_beta/service.rb +1242 -532
  52. data/generated/google/apis/compute_v1.rb +1 -1
  53. data/generated/google/apis/compute_v1/classes.rb +252 -99
  54. data/generated/google/apis/compute_v1/representations.rb +24 -0
  55. data/generated/google/apis/compute_v1/service.rb +749 -472
  56. data/generated/google/apis/docs_v1.rb +1 -1
  57. data/generated/google/apis/docs_v1/classes.rb +63 -0
  58. data/generated/google/apis/docs_v1/representations.rb +17 -0
  59. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  60. data/generated/google/apis/healthcare_v1beta1.rb +1 -1
  61. data/generated/google/apis/healthcare_v1beta1/classes.rb +203 -8
  62. data/generated/google/apis/healthcare_v1beta1/representations.rb +101 -0
  63. data/generated/google/apis/healthcare_v1beta1/service.rb +100 -3
  64. data/generated/google/apis/iam_v1.rb +1 -1
  65. data/generated/google/apis/iam_v1/classes.rb +1 -1
  66. data/generated/google/apis/iap_v1.rb +1 -1
  67. data/generated/google/apis/iap_v1/classes.rb +185 -0
  68. data/generated/google/apis/iap_v1/representations.rb +102 -0
  69. data/generated/google/apis/iap_v1/service.rb +72 -0
  70. data/generated/google/apis/{speech_v2beta.rb → lifesciences_v2beta.rb} +9 -8
  71. data/generated/google/apis/lifesciences_v2beta/classes.rb +1328 -0
  72. data/generated/google/apis/lifesciences_v2beta/representations.rb +533 -0
  73. data/generated/google/apis/lifesciences_v2beta/service.rb +303 -0
  74. data/generated/google/apis/monitoring_v1.rb +36 -0
  75. data/generated/google/apis/monitoring_v1/classes.rb +260 -0
  76. data/generated/google/apis/monitoring_v1/representations.rb +123 -0
  77. data/generated/google/apis/monitoring_v1/service.rb +64 -0
  78. data/generated/google/apis/policytroubleshooter_v1beta.rb +1 -1
  79. data/generated/google/apis/run_v1.rb +1 -1
  80. data/generated/google/apis/run_v1/classes.rb +0 -7
  81. data/generated/google/apis/run_v1/service.rb +156 -94
  82. data/generated/google/apis/sql_v1beta4.rb +37 -0
  83. data/generated/google/apis/sql_v1beta4/classes.rb +2689 -0
  84. data/generated/google/apis/sql_v1beta4/representations.rb +1099 -0
  85. data/generated/google/apis/sql_v1beta4/service.rb +1660 -0
  86. data/generated/google/apis/testing_v1.rb +1 -1
  87. data/generated/google/apis/testing_v1/classes.rb +1 -1
  88. data/generated/google/apis/vision_v1.rb +1 -1
  89. data/generated/google/apis/vision_v1p1beta1.rb +1 -1
  90. data/generated/google/apis/vision_v1p2beta1.rb +1 -1
  91. data/lib/google/apis/version.rb +1 -1
  92. metadata +14 -6
  93. data/generated/google/apis/speech_v2beta/classes.rb +0 -355
  94. data/generated/google/apis/speech_v2beta/representations.rb +0 -152
  95. data/generated/google/apis/speech_v2beta/service.rb +0 -138
@@ -0,0 +1,1660 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SqlV1beta4
23
+ # Cloud SQL Admin API
24
+ #
25
+ # API for Cloud SQL database instance management
26
+ #
27
+ # @example
28
+ # require 'google/apis/sql_v1beta4'
29
+ #
30
+ # Sql = Google::Apis::SqlV1beta4 # Alias the module
31
+ # service = Sql::SQLAdminService.new
32
+ #
33
+ # @see https://developers.google.com/cloud-sql/
34
+ class SQLAdminService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://sqladmin.googleapis.com/', '')
47
+ @batch_path = 'batch'
48
+ end
49
+
50
+ # Deletes the backup taken by a backup run.
51
+ # @param [String] project
52
+ # Project ID of the project that contains the instance.
53
+ # @param [String] instance
54
+ # Cloud SQL instance ID. This does not include the project ID.
55
+ # @param [Fixnum] id
56
+ # The ID of the Backup Run to delete. To find a Backup Run ID, use the <a
57
+ # href="/sql/docs/db_path/admin-api/rest/v1beta4/backupRuns/list">list</a>
58
+ # method.
59
+ # @param [String] fields
60
+ # Selector specifying which fields to include in a partial response.
61
+ # @param [String] quota_user
62
+ # Available to use for quota purposes for server-side applications. Can be any
63
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
64
+ # @param [Google::Apis::RequestOptions] options
65
+ # Request-specific options
66
+ #
67
+ # @yield [result, err] Result & error if block supplied
68
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
69
+ # @yieldparam err [StandardError] error object if request failed
70
+ #
71
+ # @return [Google::Apis::SqlV1beta4::Operation]
72
+ #
73
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
76
+ def delete_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
77
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
78
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
79
+ command.response_class = Google::Apis::SqlV1beta4::Operation
80
+ command.params['project'] = project unless project.nil?
81
+ command.params['instance'] = instance unless instance.nil?
82
+ command.params['id'] = id unless id.nil?
83
+ command.query['fields'] = fields unless fields.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ execute_or_queue_command(command, &block)
86
+ end
87
+
88
+ # Retrieves a resource containing information about a backup run.
89
+ # @param [String] project
90
+ # Project ID of the project that contains the instance.
91
+ # @param [String] instance
92
+ # Cloud SQL instance ID. This does not include the project ID.
93
+ # @param [Fixnum] id
94
+ # The ID of this Backup Run.
95
+ # @param [String] fields
96
+ # Selector specifying which fields to include in a partial response.
97
+ # @param [String] quota_user
98
+ # Available to use for quota purposes for server-side applications. Can be any
99
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
100
+ # @param [Google::Apis::RequestOptions] options
101
+ # Request-specific options
102
+ #
103
+ # @yield [result, err] Result & error if block supplied
104
+ # @yieldparam result [Google::Apis::SqlV1beta4::BackupRun] parsed result object
105
+ # @yieldparam err [StandardError] error object if request failed
106
+ #
107
+ # @return [Google::Apis::SqlV1beta4::BackupRun]
108
+ #
109
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
110
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
111
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
112
+ def get_backup_run(project, instance, id, fields: nil, quota_user: nil, options: nil, &block)
113
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}', options)
114
+ command.response_representation = Google::Apis::SqlV1beta4::BackupRun::Representation
115
+ command.response_class = Google::Apis::SqlV1beta4::BackupRun
116
+ command.params['project'] = project unless project.nil?
117
+ command.params['instance'] = instance unless instance.nil?
118
+ command.params['id'] = id unless id.nil?
119
+ command.query['fields'] = fields unless fields.nil?
120
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
121
+ execute_or_queue_command(command, &block)
122
+ end
123
+
124
+ # Creates a new backup run on demand. This method is applicable only to
125
+ # Second Generation instances.
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::SqlV1beta4::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::SqlV1beta4::Operation] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::SqlV1beta4::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, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
150
+ command.request_representation = Google::Apis::SqlV1beta4::BackupRun::Representation
151
+ command.request_object = backup_run_object
152
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
153
+ command.response_class = Google::Apis::SqlV1beta4::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 a given instance and configuration in
162
+ # 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. This does not include the project ID.
167
+ # @param [Fixnum] max_results
168
+ # Maximum number of backup runs per response.
169
+ # @param [String] page_token
170
+ # A previously-returned page token representing part of the larger set of
171
+ # results to view.
172
+ # @param [String] fields
173
+ # Selector specifying which fields to include in a partial response.
174
+ # @param [String] quota_user
175
+ # Available to use for quota purposes for server-side applications. Can be any
176
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
177
+ # @param [Google::Apis::RequestOptions] options
178
+ # Request-specific options
179
+ #
180
+ # @yield [result, err] Result & error if block supplied
181
+ # @yieldparam result [Google::Apis::SqlV1beta4::BackupRunsListResponse] parsed result object
182
+ # @yieldparam err [StandardError] error object if request failed
183
+ #
184
+ # @return [Google::Apis::SqlV1beta4::BackupRunsListResponse]
185
+ #
186
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
187
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
188
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
189
+ def list_backup_runs(project, instance, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
190
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/backupRuns', options)
191
+ command.response_representation = Google::Apis::SqlV1beta4::BackupRunsListResponse::Representation
192
+ command.response_class = Google::Apis::SqlV1beta4::BackupRunsListResponse
193
+ command.params['project'] = project unless project.nil?
194
+ command.params['instance'] = instance unless instance.nil?
195
+ command.query['maxResults'] = max_results unless max_results.nil?
196
+ command.query['pageToken'] = page_token unless page_token.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Deletes a database from a Cloud SQL instance.
203
+ # @param [String] project
204
+ # Project ID of the project that contains the instance.
205
+ # @param [String] instance
206
+ # Database instance ID. This does not include the project ID.
207
+ # @param [String] database
208
+ # Name of the database to be deleted in the instance.
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::SqlV1beta4::Operation]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def delete_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
228
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
229
+ command.response_class = Google::Apis::SqlV1beta4::Operation
230
+ command.params['project'] = project unless project.nil?
231
+ command.params['instance'] = instance unless instance.nil?
232
+ command.params['database'] = database unless database.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ # Retrieves a resource containing information about a database inside a Cloud
239
+ # SQL instance.
240
+ # @param [String] project
241
+ # Project ID of the project that contains the instance.
242
+ # @param [String] instance
243
+ # Database instance ID. This does not include the project ID.
244
+ # @param [String] database
245
+ # Name of the database in the instance.
246
+ # @param [String] fields
247
+ # Selector specifying which fields to include in a partial response.
248
+ # @param [String] quota_user
249
+ # Available to use for quota purposes for server-side applications. Can be any
250
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
251
+ # @param [Google::Apis::RequestOptions] options
252
+ # Request-specific options
253
+ #
254
+ # @yield [result, err] Result & error if block supplied
255
+ # @yieldparam result [Google::Apis::SqlV1beta4::Database] parsed result object
256
+ # @yieldparam err [StandardError] error object if request failed
257
+ #
258
+ # @return [Google::Apis::SqlV1beta4::Database]
259
+ #
260
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
261
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
262
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
263
+ def get_database(project, instance, database, fields: nil, quota_user: nil, options: nil, &block)
264
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
265
+ command.response_representation = Google::Apis::SqlV1beta4::Database::Representation
266
+ command.response_class = Google::Apis::SqlV1beta4::Database
267
+ command.params['project'] = project unless project.nil?
268
+ command.params['instance'] = instance unless instance.nil?
269
+ command.params['database'] = database unless database.nil?
270
+ command.query['fields'] = fields unless fields.nil?
271
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
272
+ execute_or_queue_command(command, &block)
273
+ end
274
+
275
+ # Inserts a resource containing information about a database inside a Cloud
276
+ # SQL instance.
277
+ # @param [String] project
278
+ # Project ID of the project that contains the instance.
279
+ # @param [String] instance
280
+ # Database instance ID. This does not include the project ID.
281
+ # @param [Google::Apis::SqlV1beta4::Database] database_object
282
+ # @param [String] fields
283
+ # Selector specifying which fields to include in a partial response.
284
+ # @param [String] quota_user
285
+ # Available to use for quota purposes for server-side applications. Can be any
286
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
287
+ # @param [Google::Apis::RequestOptions] options
288
+ # Request-specific options
289
+ #
290
+ # @yield [result, err] Result & error if block supplied
291
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
292
+ # @yieldparam err [StandardError] error object if request failed
293
+ #
294
+ # @return [Google::Apis::SqlV1beta4::Operation]
295
+ #
296
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
297
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
298
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
299
+ def insert_database(project, instance, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
300
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
301
+ command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
302
+ command.request_object = database_object
303
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
304
+ command.response_class = Google::Apis::SqlV1beta4::Operation
305
+ command.params['project'] = project unless project.nil?
306
+ command.params['instance'] = instance unless instance.nil?
307
+ command.query['fields'] = fields unless fields.nil?
308
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
309
+ execute_or_queue_command(command, &block)
310
+ end
311
+
312
+ # Lists databases in the specified Cloud SQL instance.
313
+ # @param [String] project
314
+ # Project ID of the project that contains the instance.
315
+ # @param [String] instance
316
+ # Cloud SQL instance ID. This does not include the project ID.
317
+ # @param [String] fields
318
+ # Selector specifying which fields to include in a partial response.
319
+ # @param [String] quota_user
320
+ # Available to use for quota purposes for server-side applications. Can be any
321
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
322
+ # @param [Google::Apis::RequestOptions] options
323
+ # Request-specific options
324
+ #
325
+ # @yield [result, err] Result & error if block supplied
326
+ # @yieldparam result [Google::Apis::SqlV1beta4::DatabasesListResponse] parsed result object
327
+ # @yieldparam err [StandardError] error object if request failed
328
+ #
329
+ # @return [Google::Apis::SqlV1beta4::DatabasesListResponse]
330
+ #
331
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
332
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
333
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
334
+ def list_databases(project, instance, fields: nil, quota_user: nil, options: nil, &block)
335
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/databases', options)
336
+ command.response_representation = Google::Apis::SqlV1beta4::DatabasesListResponse::Representation
337
+ command.response_class = Google::Apis::SqlV1beta4::DatabasesListResponse
338
+ command.params['project'] = project unless project.nil?
339
+ command.params['instance'] = instance unless instance.nil?
340
+ command.query['fields'] = fields unless fields.nil?
341
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
342
+ execute_or_queue_command(command, &block)
343
+ end
344
+
345
+ # Partially updates a resource containing information about a database inside
346
+ # a Cloud SQL instance. This method supports patch semantics.
347
+ # @param [String] project
348
+ # Project ID of the project that contains the instance.
349
+ # @param [String] instance
350
+ # Database instance ID. This does not include the project ID.
351
+ # @param [String] database
352
+ # Name of the database to be updated in the instance.
353
+ # @param [Google::Apis::SqlV1beta4::Database] database_object
354
+ # @param [String] fields
355
+ # Selector specifying which fields to include in a partial response.
356
+ # @param [String] quota_user
357
+ # Available to use for quota purposes for server-side applications. Can be any
358
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
359
+ # @param [Google::Apis::RequestOptions] options
360
+ # Request-specific options
361
+ #
362
+ # @yield [result, err] Result & error if block supplied
363
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
364
+ # @yieldparam err [StandardError] error object if request failed
365
+ #
366
+ # @return [Google::Apis::SqlV1beta4::Operation]
367
+ #
368
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
369
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
370
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
371
+ def patch_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
372
+ command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
373
+ command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
374
+ command.request_object = database_object
375
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
376
+ command.response_class = Google::Apis::SqlV1beta4::Operation
377
+ command.params['project'] = project unless project.nil?
378
+ command.params['instance'] = instance unless instance.nil?
379
+ command.params['database'] = database unless database.nil?
380
+ command.query['fields'] = fields unless fields.nil?
381
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
382
+ execute_or_queue_command(command, &block)
383
+ end
384
+
385
+ # Updates a resource containing information about a database inside a Cloud
386
+ # SQL instance.
387
+ # @param [String] project
388
+ # Project ID of the project that contains the instance.
389
+ # @param [String] instance
390
+ # Database instance ID. This does not include the project ID.
391
+ # @param [String] database
392
+ # Name of the database to be updated in the instance.
393
+ # @param [Google::Apis::SqlV1beta4::Database] database_object
394
+ # @param [String] fields
395
+ # Selector specifying which fields to include in a partial response.
396
+ # @param [String] quota_user
397
+ # Available to use for quota purposes for server-side applications. Can be any
398
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
399
+ # @param [Google::Apis::RequestOptions] options
400
+ # Request-specific options
401
+ #
402
+ # @yield [result, err] Result & error if block supplied
403
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
404
+ # @yieldparam err [StandardError] error object if request failed
405
+ #
406
+ # @return [Google::Apis::SqlV1beta4::Operation]
407
+ #
408
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
409
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
410
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
411
+ def update_database(project, instance, database, database_object = nil, fields: nil, quota_user: nil, options: nil, &block)
412
+ command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}', options)
413
+ command.request_representation = Google::Apis::SqlV1beta4::Database::Representation
414
+ command.request_object = database_object
415
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
416
+ command.response_class = Google::Apis::SqlV1beta4::Operation
417
+ command.params['project'] = project unless project.nil?
418
+ command.params['instance'] = instance unless instance.nil?
419
+ command.params['database'] = database unless database.nil?
420
+ command.query['fields'] = fields unless fields.nil?
421
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
422
+ execute_or_queue_command(command, &block)
423
+ end
424
+
425
+ # List all available database flags for Cloud SQL instances.
426
+ # @param [String] database_version
427
+ # Database type and version you want to retrieve flags for. By default, this
428
+ # method returns flags for all database types and versions.
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::SqlV1beta4::FlagsListResponse] parsed result object
439
+ # @yieldparam err [StandardError] error object if request failed
440
+ #
441
+ # @return [Google::Apis::SqlV1beta4::FlagsListResponse]
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 list_flags(database_version: nil, fields: nil, quota_user: nil, options: nil, &block)
447
+ command = make_simple_command(:get, 'sql/v1beta4/flags', options)
448
+ command.response_representation = Google::Apis::SqlV1beta4::FlagsListResponse::Representation
449
+ command.response_class = Google::Apis::SqlV1beta4::FlagsListResponse
450
+ command.query['databaseVersion'] = database_version unless database_version.nil?
451
+ command.query['fields'] = fields unless fields.nil?
452
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
453
+ execute_or_queue_command(command, &block)
454
+ end
455
+
456
+ # Add a new trusted Certificate Authority (CA) version for the specified
457
+ # instance. Required to prepare for a certificate rotation. If a CA version
458
+ # was previously added but never used in a certificate rotation, this
459
+ # operation replaces that version. There cannot be more than one CA version
460
+ # waiting to be rotated in.
461
+ # @param [String] project
462
+ # Project ID of the project that contains the instance.
463
+ # @param [String] instance
464
+ # Cloud SQL instance ID. This does not include the project ID.
465
+ # @param [String] fields
466
+ # Selector specifying which fields to include in a partial response.
467
+ # @param [String] quota_user
468
+ # Available to use for quota purposes for server-side applications. Can be any
469
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
470
+ # @param [Google::Apis::RequestOptions] options
471
+ # Request-specific options
472
+ #
473
+ # @yield [result, err] Result & error if block supplied
474
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
475
+ # @yieldparam err [StandardError] error object if request failed
476
+ #
477
+ # @return [Google::Apis::SqlV1beta4::Operation]
478
+ #
479
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
480
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
481
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
482
+ def add_instance_server_ca(project, instance, fields: nil, quota_user: nil, options: nil, &block)
483
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/addServerCa', options)
484
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
485
+ command.response_class = Google::Apis::SqlV1beta4::Operation
486
+ command.params['project'] = project unless project.nil?
487
+ command.params['instance'] = instance unless instance.nil?
488
+ command.query['fields'] = fields unless fields.nil?
489
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
490
+ execute_or_queue_command(command, &block)
491
+ end
492
+
493
+ # Creates a Cloud SQL instance as a clone of the source instance.
494
+ # @param [String] project
495
+ # Project ID of the source as well as the clone Cloud SQL instance.
496
+ # @param [String] instance
497
+ # The ID of the Cloud SQL instance to be cloned (source). This does not
498
+ # include the project ID.
499
+ # @param [Google::Apis::SqlV1beta4::InstancesCloneRequest] instances_clone_request_object
500
+ # @param [String] fields
501
+ # Selector specifying which fields to include in a partial response.
502
+ # @param [String] quota_user
503
+ # Available to use for quota purposes for server-side applications. Can be any
504
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
505
+ # @param [Google::Apis::RequestOptions] options
506
+ # Request-specific options
507
+ #
508
+ # @yield [result, err] Result & error if block supplied
509
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
510
+ # @yieldparam err [StandardError] error object if request failed
511
+ #
512
+ # @return [Google::Apis::SqlV1beta4::Operation]
513
+ #
514
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
515
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
516
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
517
+ def clone_instance(project, instance, instances_clone_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
518
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/clone', options)
519
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesCloneRequest::Representation
520
+ command.request_object = instances_clone_request_object
521
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
522
+ command.response_class = Google::Apis::SqlV1beta4::Operation
523
+ command.params['project'] = project unless project.nil?
524
+ command.params['instance'] = instance unless instance.nil?
525
+ command.query['fields'] = fields unless fields.nil?
526
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
527
+ execute_or_queue_command(command, &block)
528
+ end
529
+
530
+ # Deletes a Cloud SQL instance.
531
+ # @param [String] project
532
+ # Project ID of the project that contains the instance to be deleted.
533
+ # @param [String] instance
534
+ # Cloud SQL instance ID. This does not include the project ID.
535
+ # @param [String] fields
536
+ # Selector specifying which fields to include in a partial response.
537
+ # @param [String] quota_user
538
+ # Available to use for quota purposes for server-side applications. Can be any
539
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
540
+ # @param [Google::Apis::RequestOptions] options
541
+ # Request-specific options
542
+ #
543
+ # @yield [result, err] Result & error if block supplied
544
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
545
+ # @yieldparam err [StandardError] error object if request failed
546
+ #
547
+ # @return [Google::Apis::SqlV1beta4::Operation]
548
+ #
549
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
550
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
551
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
552
+ def delete_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
553
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
554
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
555
+ command.response_class = Google::Apis::SqlV1beta4::Operation
556
+ command.params['project'] = project unless project.nil?
557
+ command.params['instance'] = instance unless instance.nil?
558
+ command.query['fields'] = fields unless fields.nil?
559
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
560
+ execute_or_queue_command(command, &block)
561
+ end
562
+
563
+ # Demotes the stand-alone instance to be a Cloud SQL read replica for an
564
+ # external database server.
565
+ # @param [String] project
566
+ # ID of the project that contains the instance.
567
+ # @param [String] instance
568
+ # Cloud SQL instance name.
569
+ # @param [Google::Apis::SqlV1beta4::InstancesDemoteMasterRequest] instances_demote_master_request_object
570
+ # @param [String] fields
571
+ # Selector specifying which fields to include in a partial response.
572
+ # @param [String] quota_user
573
+ # Available to use for quota purposes for server-side applications. Can be any
574
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
575
+ # @param [Google::Apis::RequestOptions] options
576
+ # Request-specific options
577
+ #
578
+ # @yield [result, err] Result & error if block supplied
579
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
580
+ # @yieldparam err [StandardError] error object if request failed
581
+ #
582
+ # @return [Google::Apis::SqlV1beta4::Operation]
583
+ #
584
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
585
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
586
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
587
+ def demote_instance_master(project, instance, instances_demote_master_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
588
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster', options)
589
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesDemoteMasterRequest::Representation
590
+ command.request_object = instances_demote_master_request_object
591
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
592
+ command.response_class = Google::Apis::SqlV1beta4::Operation
593
+ command.params['project'] = project unless project.nil?
594
+ command.params['instance'] = instance unless instance.nil?
595
+ command.query['fields'] = fields unless fields.nil?
596
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
597
+ execute_or_queue_command(command, &block)
598
+ end
599
+
600
+ # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
601
+ # dump or CSV file.
602
+ # @param [String] project
603
+ # Project ID of the project that contains the instance to be exported.
604
+ # @param [String] instance
605
+ # Cloud SQL instance ID. This does not include the project ID.
606
+ # @param [Google::Apis::SqlV1beta4::InstancesExportRequest] instances_export_request_object
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # @param [Google::Apis::RequestOptions] options
613
+ # Request-specific options
614
+ #
615
+ # @yield [result, err] Result & error if block supplied
616
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
617
+ # @yieldparam err [StandardError] error object if request failed
618
+ #
619
+ # @return [Google::Apis::SqlV1beta4::Operation]
620
+ #
621
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
622
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
623
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
624
+ def export_instance(project, instance, instances_export_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/export', options)
626
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesExportRequest::Representation
627
+ command.request_object = instances_export_request_object
628
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
629
+ command.response_class = Google::Apis::SqlV1beta4::Operation
630
+ command.params['project'] = project unless project.nil?
631
+ command.params['instance'] = instance unless instance.nil?
632
+ command.query['fields'] = fields unless fields.nil?
633
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
634
+ execute_or_queue_command(command, &block)
635
+ end
636
+
637
+ # Failover the instance to its failover replica instance.
638
+ # @param [String] project
639
+ # ID of the project that contains the read replica.
640
+ # @param [String] instance
641
+ # Cloud SQL instance ID. This does not include the project ID.
642
+ # @param [Google::Apis::SqlV1beta4::InstancesFailoverRequest] instances_failover_request_object
643
+ # @param [String] fields
644
+ # Selector specifying which fields to include in a partial response.
645
+ # @param [String] quota_user
646
+ # Available to use for quota purposes for server-side applications. Can be any
647
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
648
+ # @param [Google::Apis::RequestOptions] options
649
+ # Request-specific options
650
+ #
651
+ # @yield [result, err] Result & error if block supplied
652
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
653
+ # @yieldparam err [StandardError] error object if request failed
654
+ #
655
+ # @return [Google::Apis::SqlV1beta4::Operation]
656
+ #
657
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
658
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
659
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
660
+ def failover_instance(project, instance, instances_failover_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
661
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/failover', options)
662
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesFailoverRequest::Representation
663
+ command.request_object = instances_failover_request_object
664
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
665
+ command.response_class = Google::Apis::SqlV1beta4::Operation
666
+ command.params['project'] = project unless project.nil?
667
+ command.params['instance'] = instance unless instance.nil?
668
+ command.query['fields'] = fields unless fields.nil?
669
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
670
+ execute_or_queue_command(command, &block)
671
+ end
672
+
673
+ # Retrieves a resource containing information about a Cloud SQL instance.
674
+ # @param [String] project
675
+ # Project ID of the project that contains the instance.
676
+ # @param [String] instance
677
+ # Database instance ID. This does not include the project ID.
678
+ # @param [String] fields
679
+ # Selector specifying which fields to include in a partial response.
680
+ # @param [String] quota_user
681
+ # Available to use for quota purposes for server-side applications. Can be any
682
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
683
+ # @param [Google::Apis::RequestOptions] options
684
+ # Request-specific options
685
+ #
686
+ # @yield [result, err] Result & error if block supplied
687
+ # @yieldparam result [Google::Apis::SqlV1beta4::DatabaseInstance] parsed result object
688
+ # @yieldparam err [StandardError] error object if request failed
689
+ #
690
+ # @return [Google::Apis::SqlV1beta4::DatabaseInstance]
691
+ #
692
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
693
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
694
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
695
+ def get_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
696
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
697
+ command.response_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
698
+ command.response_class = Google::Apis::SqlV1beta4::DatabaseInstance
699
+ command.params['project'] = project unless project.nil?
700
+ command.params['instance'] = instance unless instance.nil?
701
+ command.query['fields'] = fields unless fields.nil?
702
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
703
+ execute_or_queue_command(command, &block)
704
+ end
705
+
706
+ # Imports data into a Cloud SQL instance from a SQL dump or CSV file in
707
+ # Cloud Storage.
708
+ # @param [String] project
709
+ # Project ID of the project that contains the instance.
710
+ # @param [String] instance
711
+ # Cloud SQL instance ID. This does not include the project ID.
712
+ # @param [Google::Apis::SqlV1beta4::InstancesImportRequest] instances_import_request_object
713
+ # @param [String] fields
714
+ # Selector specifying which fields to include in a partial response.
715
+ # @param [String] quota_user
716
+ # Available to use for quota purposes for server-side applications. Can be any
717
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
718
+ # @param [Google::Apis::RequestOptions] options
719
+ # Request-specific options
720
+ #
721
+ # @yield [result, err] Result & error if block supplied
722
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
723
+ # @yieldparam err [StandardError] error object if request failed
724
+ #
725
+ # @return [Google::Apis::SqlV1beta4::Operation]
726
+ #
727
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
728
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
729
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
730
+ def import_instance(project, instance, instances_import_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
731
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/import', options)
732
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesImportRequest::Representation
733
+ command.request_object = instances_import_request_object
734
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
735
+ command.response_class = Google::Apis::SqlV1beta4::Operation
736
+ command.params['project'] = project unless project.nil?
737
+ command.params['instance'] = instance unless instance.nil?
738
+ command.query['fields'] = fields unless fields.nil?
739
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
740
+ execute_or_queue_command(command, &block)
741
+ end
742
+
743
+ # Creates a new Cloud SQL instance.
744
+ # @param [String] project
745
+ # Project ID of the project to which the newly created Cloud SQL instances
746
+ # should belong.
747
+ # @param [Google::Apis::SqlV1beta4::DatabaseInstance] database_instance_object
748
+ # @param [String] fields
749
+ # Selector specifying which fields to include in a partial response.
750
+ # @param [String] quota_user
751
+ # Available to use for quota purposes for server-side applications. Can be any
752
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
753
+ # @param [Google::Apis::RequestOptions] options
754
+ # Request-specific options
755
+ #
756
+ # @yield [result, err] Result & error if block supplied
757
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
758
+ # @yieldparam err [StandardError] error object if request failed
759
+ #
760
+ # @return [Google::Apis::SqlV1beta4::Operation]
761
+ #
762
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
763
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
764
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
765
+ def insert_instance(project, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
766
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances', options)
767
+ command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
768
+ command.request_object = database_instance_object
769
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
770
+ command.response_class = Google::Apis::SqlV1beta4::Operation
771
+ command.params['project'] = project unless project.nil?
772
+ command.query['fields'] = fields unless fields.nil?
773
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
774
+ execute_or_queue_command(command, &block)
775
+ end
776
+
777
+ # Lists instances under a given project in the alphabetical order of the
778
+ # instance name.
779
+ # @param [String] project
780
+ # Project ID of the project for which to list Cloud SQL instances.
781
+ # @param [String] filter
782
+ # An expression for filtering the results of the request, such as by name or
783
+ # label.
784
+ # @param [Fixnum] max_results
785
+ # The maximum number of results to return per response.
786
+ # @param [String] page_token
787
+ # A previously-returned page token representing part of the larger set of
788
+ # results to view.
789
+ # @param [String] fields
790
+ # Selector specifying which fields to include in a partial response.
791
+ # @param [String] quota_user
792
+ # Available to use for quota purposes for server-side applications. Can be any
793
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
794
+ # @param [Google::Apis::RequestOptions] options
795
+ # Request-specific options
796
+ #
797
+ # @yield [result, err] Result & error if block supplied
798
+ # @yieldparam result [Google::Apis::SqlV1beta4::InstancesListResponse] parsed result object
799
+ # @yieldparam err [StandardError] error object if request failed
800
+ #
801
+ # @return [Google::Apis::SqlV1beta4::InstancesListResponse]
802
+ #
803
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
804
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
805
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
806
+ def list_instances(project, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
807
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances', options)
808
+ command.response_representation = Google::Apis::SqlV1beta4::InstancesListResponse::Representation
809
+ command.response_class = Google::Apis::SqlV1beta4::InstancesListResponse
810
+ command.params['project'] = project unless project.nil?
811
+ command.query['filter'] = filter unless filter.nil?
812
+ command.query['maxResults'] = max_results unless max_results.nil?
813
+ command.query['pageToken'] = page_token unless page_token.nil?
814
+ command.query['fields'] = fields unless fields.nil?
815
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
816
+ execute_or_queue_command(command, &block)
817
+ end
818
+
819
+ # Lists all of the trusted Certificate Authorities (CAs) for the specified
820
+ # instance. There can be up to three CAs listed: the CA that was used to sign
821
+ # the certificate that is currently in use, a CA that has been added but not
822
+ # yet used to sign a certificate, and a CA used to sign a certificate that
823
+ # has previously rotated out.
824
+ # @param [String] project
825
+ # Project ID of the project that contains the instance.
826
+ # @param [String] instance
827
+ # Cloud SQL instance ID. This does not include the project ID.
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::SqlV1beta4::InstancesListServerCasResponse] parsed result object
838
+ # @yieldparam err [StandardError] error object if request failed
839
+ #
840
+ # @return [Google::Apis::SqlV1beta4::InstancesListServerCasResponse]
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 list_instance_server_cas(project, instance, fields: nil, quota_user: nil, options: nil, &block)
846
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/listServerCas', options)
847
+ command.response_representation = Google::Apis::SqlV1beta4::InstancesListServerCasResponse::Representation
848
+ command.response_class = Google::Apis::SqlV1beta4::InstancesListServerCasResponse
849
+ command.params['project'] = project unless project.nil?
850
+ command.params['instance'] = instance unless instance.nil?
851
+ command.query['fields'] = fields unless fields.nil?
852
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
853
+ execute_or_queue_command(command, &block)
854
+ end
855
+
856
+ # Updates settings of a Cloud SQL instance.
857
+ # This method supports patch semantics.
858
+ # @param [String] project
859
+ # Project ID of the project that contains the instance.
860
+ # @param [String] instance
861
+ # Cloud SQL instance ID. This does not include the project ID.
862
+ # @param [Google::Apis::SqlV1beta4::DatabaseInstance] database_instance_object
863
+ # @param [String] fields
864
+ # Selector specifying which fields to include in a partial response.
865
+ # @param [String] quota_user
866
+ # Available to use for quota purposes for server-side applications. Can be any
867
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
868
+ # @param [Google::Apis::RequestOptions] options
869
+ # Request-specific options
870
+ #
871
+ # @yield [result, err] Result & error if block supplied
872
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
873
+ # @yieldparam err [StandardError] error object if request failed
874
+ #
875
+ # @return [Google::Apis::SqlV1beta4::Operation]
876
+ #
877
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
878
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
879
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
880
+ def patch_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
881
+ command = make_simple_command(:patch, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
882
+ command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
883
+ command.request_object = database_instance_object
884
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
885
+ command.response_class = Google::Apis::SqlV1beta4::Operation
886
+ command.params['project'] = project unless project.nil?
887
+ command.params['instance'] = instance unless instance.nil?
888
+ command.query['fields'] = fields unless fields.nil?
889
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
890
+ execute_or_queue_command(command, &block)
891
+ end
892
+
893
+ # Promotes the read replica instance to be a stand-alone Cloud SQL instance.
894
+ # @param [String] project
895
+ # ID of the project that contains the read replica.
896
+ # @param [String] instance
897
+ # Cloud SQL read replica instance name.
898
+ # @param [String] fields
899
+ # Selector specifying which fields to include in a partial response.
900
+ # @param [String] quota_user
901
+ # Available to use for quota purposes for server-side applications. Can be any
902
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
903
+ # @param [Google::Apis::RequestOptions] options
904
+ # Request-specific options
905
+ #
906
+ # @yield [result, err] Result & error if block supplied
907
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
908
+ # @yieldparam err [StandardError] error object if request failed
909
+ #
910
+ # @return [Google::Apis::SqlV1beta4::Operation]
911
+ #
912
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
913
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
914
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
915
+ def promote_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
916
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica', options)
917
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
918
+ command.response_class = Google::Apis::SqlV1beta4::Operation
919
+ command.params['project'] = project unless project.nil?
920
+ command.params['instance'] = instance unless instance.nil?
921
+ command.query['fields'] = fields unless fields.nil?
922
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
923
+ execute_or_queue_command(command, &block)
924
+ end
925
+
926
+ # Deletes all client certificates and generates a new server SSL certificate
927
+ # for the instance.
928
+ # @param [String] project
929
+ # Project ID of the project that contains the instance.
930
+ # @param [String] instance
931
+ # Cloud SQL instance ID. This does not include the project ID.
932
+ # @param [String] fields
933
+ # Selector specifying which fields to include in a partial response.
934
+ # @param [String] quota_user
935
+ # Available to use for quota purposes for server-side applications. Can be any
936
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
937
+ # @param [Google::Apis::RequestOptions] options
938
+ # Request-specific options
939
+ #
940
+ # @yield [result, err] Result & error if block supplied
941
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
942
+ # @yieldparam err [StandardError] error object if request failed
943
+ #
944
+ # @return [Google::Apis::SqlV1beta4::Operation]
945
+ #
946
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
947
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
948
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
949
+ def reset_instance_ssl_config(project, instance, fields: nil, quota_user: nil, options: nil, &block)
950
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig', options)
951
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
952
+ command.response_class = Google::Apis::SqlV1beta4::Operation
953
+ command.params['project'] = project unless project.nil?
954
+ command.params['instance'] = instance unless instance.nil?
955
+ command.query['fields'] = fields unless fields.nil?
956
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
957
+ execute_or_queue_command(command, &block)
958
+ end
959
+
960
+ # Restarts a Cloud SQL instance.
961
+ # @param [String] project
962
+ # Project ID of the project that contains the instance to be restarted.
963
+ # @param [String] instance
964
+ # Cloud SQL instance ID. This does not include the project ID.
965
+ # @param [String] fields
966
+ # Selector specifying which fields to include in a partial response.
967
+ # @param [String] quota_user
968
+ # Available to use for quota purposes for server-side applications. Can be any
969
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
970
+ # @param [Google::Apis::RequestOptions] options
971
+ # Request-specific options
972
+ #
973
+ # @yield [result, err] Result & error if block supplied
974
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
975
+ # @yieldparam err [StandardError] error object if request failed
976
+ #
977
+ # @return [Google::Apis::SqlV1beta4::Operation]
978
+ #
979
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
980
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
981
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
982
+ def restart_instance(project, instance, fields: nil, quota_user: nil, options: nil, &block)
983
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restart', options)
984
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
985
+ command.response_class = Google::Apis::SqlV1beta4::Operation
986
+ command.params['project'] = project unless project.nil?
987
+ command.params['instance'] = instance unless instance.nil?
988
+ command.query['fields'] = fields unless fields.nil?
989
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
990
+ execute_or_queue_command(command, &block)
991
+ end
992
+
993
+ # Restores a backup of a Cloud SQL instance.
994
+ # @param [String] project
995
+ # Project ID of the project that contains the instance.
996
+ # @param [String] instance
997
+ # Cloud SQL instance ID. This does not include the project ID.
998
+ # @param [Google::Apis::SqlV1beta4::InstancesRestoreBackupRequest] instances_restore_backup_request_object
999
+ # @param [String] fields
1000
+ # Selector specifying which fields to include in a partial response.
1001
+ # @param [String] quota_user
1002
+ # Available to use for quota purposes for server-side applications. Can be any
1003
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1004
+ # @param [Google::Apis::RequestOptions] options
1005
+ # Request-specific options
1006
+ #
1007
+ # @yield [result, err] Result & error if block supplied
1008
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1009
+ # @yieldparam err [StandardError] error object if request failed
1010
+ #
1011
+ # @return [Google::Apis::SqlV1beta4::Operation]
1012
+ #
1013
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1014
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1015
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1016
+ def restore_instance_backup(project, instance, instances_restore_backup_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1017
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup', options)
1018
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesRestoreBackupRequest::Representation
1019
+ command.request_object = instances_restore_backup_request_object
1020
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1021
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1022
+ command.params['project'] = project unless project.nil?
1023
+ command.params['instance'] = instance unless instance.nil?
1024
+ command.query['fields'] = fields unless fields.nil?
1025
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1026
+ execute_or_queue_command(command, &block)
1027
+ end
1028
+
1029
+ # Rotates the server certificate to one signed by the Certificate Authority
1030
+ # (CA) version previously added with the addServerCA method.
1031
+ # @param [String] project
1032
+ # Project ID of the project that contains the instance.
1033
+ # @param [String] instance
1034
+ # Cloud SQL instance ID. This does not include the project ID.
1035
+ # @param [Google::Apis::SqlV1beta4::InstancesRotateServerCaRequest] instances_rotate_server_ca_request_object
1036
+ # @param [String] fields
1037
+ # Selector specifying which fields to include in a partial response.
1038
+ # @param [String] quota_user
1039
+ # Available to use for quota purposes for server-side applications. Can be any
1040
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1041
+ # @param [Google::Apis::RequestOptions] options
1042
+ # Request-specific options
1043
+ #
1044
+ # @yield [result, err] Result & error if block supplied
1045
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1046
+ # @yieldparam err [StandardError] error object if request failed
1047
+ #
1048
+ # @return [Google::Apis::SqlV1beta4::Operation]
1049
+ #
1050
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1051
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1052
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1053
+ def rotate_instance_server_ca(project, instance, instances_rotate_server_ca_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1054
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa', options)
1055
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesRotateServerCaRequest::Representation
1056
+ command.request_object = instances_rotate_server_ca_request_object
1057
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1058
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1059
+ command.params['project'] = project unless project.nil?
1060
+ command.params['instance'] = instance unless instance.nil?
1061
+ command.query['fields'] = fields unless fields.nil?
1062
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1063
+ execute_or_queue_command(command, &block)
1064
+ end
1065
+
1066
+ # Starts the replication in the read replica instance.
1067
+ # @param [String] project
1068
+ # ID of the project that contains the read replica.
1069
+ # @param [String] instance
1070
+ # Cloud SQL read replica instance name.
1071
+ # @param [String] fields
1072
+ # Selector specifying which fields to include in a partial response.
1073
+ # @param [String] quota_user
1074
+ # Available to use for quota purposes for server-side applications. Can be any
1075
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1076
+ # @param [Google::Apis::RequestOptions] options
1077
+ # Request-specific options
1078
+ #
1079
+ # @yield [result, err] Result & error if block supplied
1080
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1081
+ # @yieldparam err [StandardError] error object if request failed
1082
+ #
1083
+ # @return [Google::Apis::SqlV1beta4::Operation]
1084
+ #
1085
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1086
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1087
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1088
+ def start_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1089
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/startReplica', options)
1090
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1091
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1092
+ command.params['project'] = project unless project.nil?
1093
+ command.params['instance'] = instance unless instance.nil?
1094
+ command.query['fields'] = fields unless fields.nil?
1095
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1096
+ execute_or_queue_command(command, &block)
1097
+ end
1098
+
1099
+ # Stops the replication in the read replica instance.
1100
+ # @param [String] project
1101
+ # ID of the project that contains the read replica.
1102
+ # @param [String] instance
1103
+ # Cloud SQL read replica instance name.
1104
+ # @param [String] fields
1105
+ # Selector specifying which fields to include in a partial response.
1106
+ # @param [String] quota_user
1107
+ # Available to use for quota purposes for server-side applications. Can be any
1108
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1109
+ # @param [Google::Apis::RequestOptions] options
1110
+ # Request-specific options
1111
+ #
1112
+ # @yield [result, err] Result & error if block supplied
1113
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1114
+ # @yieldparam err [StandardError] error object if request failed
1115
+ #
1116
+ # @return [Google::Apis::SqlV1beta4::Operation]
1117
+ #
1118
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1119
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1120
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1121
+ def stop_instance_replica(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1122
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/stopReplica', options)
1123
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1124
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1125
+ command.params['project'] = project unless project.nil?
1126
+ command.params['instance'] = instance unless instance.nil?
1127
+ command.query['fields'] = fields unless fields.nil?
1128
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1129
+ execute_or_queue_command(command, &block)
1130
+ end
1131
+
1132
+ # Truncate MySQL general and slow query log tables
1133
+ # @param [String] project
1134
+ # Project ID of the Cloud SQL project.
1135
+ # @param [String] instance
1136
+ # Cloud SQL instance ID. This does not include the project ID.
1137
+ # @param [Google::Apis::SqlV1beta4::InstancesTruncateLogRequest] instances_truncate_log_request_object
1138
+ # @param [String] fields
1139
+ # Selector specifying which fields to include in a partial response.
1140
+ # @param [String] quota_user
1141
+ # Available to use for quota purposes for server-side applications. Can be any
1142
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1143
+ # @param [Google::Apis::RequestOptions] options
1144
+ # Request-specific options
1145
+ #
1146
+ # @yield [result, err] Result & error if block supplied
1147
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1148
+ # @yieldparam err [StandardError] error object if request failed
1149
+ #
1150
+ # @return [Google::Apis::SqlV1beta4::Operation]
1151
+ #
1152
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1153
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1154
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1155
+ def truncate_instance_log(project, instance, instances_truncate_log_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1156
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/truncateLog', options)
1157
+ command.request_representation = Google::Apis::SqlV1beta4::InstancesTruncateLogRequest::Representation
1158
+ command.request_object = instances_truncate_log_request_object
1159
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1160
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1161
+ command.params['project'] = project unless project.nil?
1162
+ command.params['instance'] = instance unless instance.nil?
1163
+ command.query['fields'] = fields unless fields.nil?
1164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1165
+ execute_or_queue_command(command, &block)
1166
+ end
1167
+
1168
+ # Updates settings of a Cloud SQL instance. <aside
1169
+ # class="caution"><strong>Caution:</strong> This is not a partial update, so
1170
+ # you must include values for all the settings that you want to retain. For
1171
+ # partial updates, use <a
1172
+ # href="/sql/docs/db_path/admin-api/rest/v1beta4/instances/patch">patch</a>.</
1173
+ # aside>
1174
+ # @param [String] project
1175
+ # Project ID of the project that contains the instance.
1176
+ # @param [String] instance
1177
+ # Cloud SQL instance ID. This does not include the project ID.
1178
+ # @param [Google::Apis::SqlV1beta4::DatabaseInstance] database_instance_object
1179
+ # @param [String] fields
1180
+ # Selector specifying which fields to include in a partial response.
1181
+ # @param [String] quota_user
1182
+ # Available to use for quota purposes for server-side applications. Can be any
1183
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1184
+ # @param [Google::Apis::RequestOptions] options
1185
+ # Request-specific options
1186
+ #
1187
+ # @yield [result, err] Result & error if block supplied
1188
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1189
+ # @yieldparam err [StandardError] error object if request failed
1190
+ #
1191
+ # @return [Google::Apis::SqlV1beta4::Operation]
1192
+ #
1193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1196
+ def update_instance(project, instance, database_instance_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1197
+ command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}', options)
1198
+ command.request_representation = Google::Apis::SqlV1beta4::DatabaseInstance::Representation
1199
+ command.request_object = database_instance_object
1200
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1201
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1202
+ command.params['project'] = project unless project.nil?
1203
+ command.params['instance'] = instance unless instance.nil?
1204
+ command.query['fields'] = fields unless fields.nil?
1205
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1206
+ execute_or_queue_command(command, &block)
1207
+ end
1208
+
1209
+ # Retrieves an instance operation that has been performed on an instance.
1210
+ # @param [String] project
1211
+ # Project ID of the project that contains the instance.
1212
+ # @param [String] operation
1213
+ # Instance operation ID.
1214
+ # @param [String] fields
1215
+ # Selector specifying which fields to include in a partial response.
1216
+ # @param [String] quota_user
1217
+ # Available to use for quota purposes for server-side applications. Can be any
1218
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1219
+ # @param [Google::Apis::RequestOptions] options
1220
+ # Request-specific options
1221
+ #
1222
+ # @yield [result, err] Result & error if block supplied
1223
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1224
+ # @yieldparam err [StandardError] error object if request failed
1225
+ #
1226
+ # @return [Google::Apis::SqlV1beta4::Operation]
1227
+ #
1228
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1229
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1230
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1231
+ def get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
1232
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations/{operation}', options)
1233
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1234
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1235
+ command.params['project'] = project unless project.nil?
1236
+ command.params['operation'] = operation unless operation.nil?
1237
+ command.query['fields'] = fields unless fields.nil?
1238
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1239
+ execute_or_queue_command(command, &block)
1240
+ end
1241
+
1242
+ # Lists all instance operations that have been performed on the given Cloud
1243
+ # SQL instance in the reverse chronological order of the start time.
1244
+ # @param [String] project
1245
+ # Project ID of the project that contains the instance.
1246
+ # @param [String] instance
1247
+ # Cloud SQL instance ID. This does not include the project ID.
1248
+ # @param [Fixnum] max_results
1249
+ # Maximum number of operations per response.
1250
+ # @param [String] page_token
1251
+ # A previously-returned page token representing part of the larger set of
1252
+ # results to view.
1253
+ # @param [String] fields
1254
+ # Selector specifying which fields to include in a partial response.
1255
+ # @param [String] quota_user
1256
+ # Available to use for quota purposes for server-side applications. Can be any
1257
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1258
+ # @param [Google::Apis::RequestOptions] options
1259
+ # Request-specific options
1260
+ #
1261
+ # @yield [result, err] Result & error if block supplied
1262
+ # @yieldparam result [Google::Apis::SqlV1beta4::OperationsListResponse] parsed result object
1263
+ # @yieldparam err [StandardError] error object if request failed
1264
+ #
1265
+ # @return [Google::Apis::SqlV1beta4::OperationsListResponse]
1266
+ #
1267
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1268
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1269
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1270
+ def list_operations(project, instance: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1271
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/operations', options)
1272
+ command.response_representation = Google::Apis::SqlV1beta4::OperationsListResponse::Representation
1273
+ command.response_class = Google::Apis::SqlV1beta4::OperationsListResponse
1274
+ command.params['project'] = project unless project.nil?
1275
+ command.query['instance'] = instance unless instance.nil?
1276
+ command.query['maxResults'] = max_results unless max_results.nil?
1277
+ command.query['pageToken'] = page_token unless page_token.nil?
1278
+ command.query['fields'] = fields unless fields.nil?
1279
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1280
+ execute_or_queue_command(command, &block)
1281
+ end
1282
+
1283
+ # Generates a short-lived X509 certificate containing the provided public key
1284
+ # and signed by a private key specific to the target instance. Users may use
1285
+ # the certificate to authenticate as themselves when connecting to the
1286
+ # database.
1287
+ # @param [String] project
1288
+ # Project ID of the Cloud SQL project.
1289
+ # @param [String] instance
1290
+ # Cloud SQL instance ID. This does not include the project ID.
1291
+ # @param [Google::Apis::SqlV1beta4::SslCertsCreateEphemeralRequest] ssl_certs_create_ephemeral_request_object
1292
+ # @param [String] fields
1293
+ # Selector specifying which fields to include in a partial response.
1294
+ # @param [String] quota_user
1295
+ # Available to use for quota purposes for server-side applications. Can be any
1296
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1297
+ # @param [Google::Apis::RequestOptions] options
1298
+ # Request-specific options
1299
+ #
1300
+ # @yield [result, err] Result & error if block supplied
1301
+ # @yieldparam result [Google::Apis::SqlV1beta4::SslCert] parsed result object
1302
+ # @yieldparam err [StandardError] error object if request failed
1303
+ #
1304
+ # @return [Google::Apis::SqlV1beta4::SslCert]
1305
+ #
1306
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1307
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1308
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1309
+ def create_ssl_cert_ephemeral(project, instance, ssl_certs_create_ephemeral_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1310
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral', options)
1311
+ command.request_representation = Google::Apis::SqlV1beta4::SslCertsCreateEphemeralRequest::Representation
1312
+ command.request_object = ssl_certs_create_ephemeral_request_object
1313
+ command.response_representation = Google::Apis::SqlV1beta4::SslCert::Representation
1314
+ command.response_class = Google::Apis::SqlV1beta4::SslCert
1315
+ command.params['project'] = project unless project.nil?
1316
+ command.params['instance'] = instance unless instance.nil?
1317
+ command.query['fields'] = fields unless fields.nil?
1318
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1319
+ execute_or_queue_command(command, &block)
1320
+ end
1321
+
1322
+ # Deletes the SSL certificate. For First Generation instances, the
1323
+ # certificate remains valid until the instance is restarted.
1324
+ # @param [String] project
1325
+ # Project ID of the project that contains the instance.
1326
+ # @param [String] instance
1327
+ # Cloud SQL instance ID. This does not include the project ID.
1328
+ # @param [String] sha1_fingerprint
1329
+ # Sha1 FingerPrint.
1330
+ # @param [String] fields
1331
+ # Selector specifying which fields to include in a partial response.
1332
+ # @param [String] quota_user
1333
+ # Available to use for quota purposes for server-side applications. Can be any
1334
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1335
+ # @param [Google::Apis::RequestOptions] options
1336
+ # Request-specific options
1337
+ #
1338
+ # @yield [result, err] Result & error if block supplied
1339
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1340
+ # @yieldparam err [StandardError] error object if request failed
1341
+ #
1342
+ # @return [Google::Apis::SqlV1beta4::Operation]
1343
+ #
1344
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1345
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1346
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1347
+ def delete_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
1348
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
1349
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1350
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1351
+ command.params['project'] = project unless project.nil?
1352
+ command.params['instance'] = instance unless instance.nil?
1353
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1354
+ command.query['fields'] = fields unless fields.nil?
1355
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1356
+ execute_or_queue_command(command, &block)
1357
+ end
1358
+
1359
+ # Retrieves a particular SSL certificate. Does not include the private key
1360
+ # (required for usage). The private key must be saved from the response to
1361
+ # initial creation.
1362
+ # @param [String] project
1363
+ # Project ID of the project that contains the instance.
1364
+ # @param [String] instance
1365
+ # Cloud SQL instance ID. This does not include the project ID.
1366
+ # @param [String] sha1_fingerprint
1367
+ # Sha1 FingerPrint.
1368
+ # @param [String] fields
1369
+ # Selector specifying which fields to include in a partial response.
1370
+ # @param [String] quota_user
1371
+ # Available to use for quota purposes for server-side applications. Can be any
1372
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1373
+ # @param [Google::Apis::RequestOptions] options
1374
+ # Request-specific options
1375
+ #
1376
+ # @yield [result, err] Result & error if block supplied
1377
+ # @yieldparam result [Google::Apis::SqlV1beta4::SslCert] parsed result object
1378
+ # @yieldparam err [StandardError] error object if request failed
1379
+ #
1380
+ # @return [Google::Apis::SqlV1beta4::SslCert]
1381
+ #
1382
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1383
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1384
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1385
+ def get_ssl_cert(project, instance, sha1_fingerprint, fields: nil, quota_user: nil, options: nil, &block)
1386
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}', options)
1387
+ command.response_representation = Google::Apis::SqlV1beta4::SslCert::Representation
1388
+ command.response_class = Google::Apis::SqlV1beta4::SslCert
1389
+ command.params['project'] = project unless project.nil?
1390
+ command.params['instance'] = instance unless instance.nil?
1391
+ command.params['sha1Fingerprint'] = sha1_fingerprint unless sha1_fingerprint.nil?
1392
+ command.query['fields'] = fields unless fields.nil?
1393
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1394
+ execute_or_queue_command(command, &block)
1395
+ end
1396
+
1397
+ # Creates an SSL certificate and returns it along with the private key and
1398
+ # server certificate authority. The new certificate will not be usable until
1399
+ # the instance is restarted.
1400
+ # @param [String] project
1401
+ # Project ID of the project that contains the instance.
1402
+ # @param [String] instance
1403
+ # Cloud SQL instance ID. This does not include the project ID.
1404
+ # @param [Google::Apis::SqlV1beta4::SslCertsInsertRequest] ssl_certs_insert_request_object
1405
+ # @param [String] fields
1406
+ # Selector specifying which fields to include in a partial response.
1407
+ # @param [String] quota_user
1408
+ # Available to use for quota purposes for server-side applications. Can be any
1409
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1410
+ # @param [Google::Apis::RequestOptions] options
1411
+ # Request-specific options
1412
+ #
1413
+ # @yield [result, err] Result & error if block supplied
1414
+ # @yieldparam result [Google::Apis::SqlV1beta4::SslCertsInsertResponse] parsed result object
1415
+ # @yieldparam err [StandardError] error object if request failed
1416
+ #
1417
+ # @return [Google::Apis::SqlV1beta4::SslCertsInsertResponse]
1418
+ #
1419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1422
+ def insert_ssl_cert(project, instance, ssl_certs_insert_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1423
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
1424
+ command.request_representation = Google::Apis::SqlV1beta4::SslCertsInsertRequest::Representation
1425
+ command.request_object = ssl_certs_insert_request_object
1426
+ command.response_representation = Google::Apis::SqlV1beta4::SslCertsInsertResponse::Representation
1427
+ command.response_class = Google::Apis::SqlV1beta4::SslCertsInsertResponse
1428
+ command.params['project'] = project unless project.nil?
1429
+ command.params['instance'] = instance unless instance.nil?
1430
+ command.query['fields'] = fields unless fields.nil?
1431
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1432
+ execute_or_queue_command(command, &block)
1433
+ end
1434
+
1435
+ # Lists all of the current SSL certificates for the instance.
1436
+ # @param [String] project
1437
+ # Project ID of the project that contains the instance.
1438
+ # @param [String] instance
1439
+ # Cloud SQL instance ID. This does not include the project ID.
1440
+ # @param [String] fields
1441
+ # Selector specifying which fields to include in a partial response.
1442
+ # @param [String] quota_user
1443
+ # Available to use for quota purposes for server-side applications. Can be any
1444
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1445
+ # @param [Google::Apis::RequestOptions] options
1446
+ # Request-specific options
1447
+ #
1448
+ # @yield [result, err] Result & error if block supplied
1449
+ # @yieldparam result [Google::Apis::SqlV1beta4::SslCertsListResponse] parsed result object
1450
+ # @yieldparam err [StandardError] error object if request failed
1451
+ #
1452
+ # @return [Google::Apis::SqlV1beta4::SslCertsListResponse]
1453
+ #
1454
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1455
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1456
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1457
+ def list_ssl_certs(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1458
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/sslCerts', options)
1459
+ command.response_representation = Google::Apis::SqlV1beta4::SslCertsListResponse::Representation
1460
+ command.response_class = Google::Apis::SqlV1beta4::SslCertsListResponse
1461
+ command.params['project'] = project unless project.nil?
1462
+ command.params['instance'] = instance unless instance.nil?
1463
+ command.query['fields'] = fields unless fields.nil?
1464
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1465
+ execute_or_queue_command(command, &block)
1466
+ end
1467
+
1468
+ # Lists all available machine types (tiers) for Cloud SQL, for example,
1469
+ # db-n1-standard-1. For related information, see <a
1470
+ # href="/sql/pricing">Pricing</a>.
1471
+ # @param [String] project
1472
+ # Project ID of the project for which to list tiers.
1473
+ # @param [String] fields
1474
+ # Selector specifying which fields to include in a partial response.
1475
+ # @param [String] quota_user
1476
+ # Available to use for quota purposes for server-side applications. Can be any
1477
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1478
+ # @param [Google::Apis::RequestOptions] options
1479
+ # Request-specific options
1480
+ #
1481
+ # @yield [result, err] Result & error if block supplied
1482
+ # @yieldparam result [Google::Apis::SqlV1beta4::TiersListResponse] parsed result object
1483
+ # @yieldparam err [StandardError] error object if request failed
1484
+ #
1485
+ # @return [Google::Apis::SqlV1beta4::TiersListResponse]
1486
+ #
1487
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1488
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1489
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1490
+ def list_tiers(project, fields: nil, quota_user: nil, options: nil, &block)
1491
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/tiers', options)
1492
+ command.response_representation = Google::Apis::SqlV1beta4::TiersListResponse::Representation
1493
+ command.response_class = Google::Apis::SqlV1beta4::TiersListResponse
1494
+ command.params['project'] = project unless project.nil?
1495
+ command.query['fields'] = fields unless fields.nil?
1496
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1497
+ execute_or_queue_command(command, &block)
1498
+ end
1499
+
1500
+ # Deletes a user from a Cloud SQL instance.
1501
+ # @param [String] project
1502
+ # Project ID of the project that contains the instance.
1503
+ # @param [String] instance
1504
+ # Database instance ID. This does not include the project ID.
1505
+ # @param [String] host
1506
+ # Host of the user in the instance.
1507
+ # @param [String] name
1508
+ # Name of the user in the instance.
1509
+ # @param [String] fields
1510
+ # Selector specifying which fields to include in a partial response.
1511
+ # @param [String] quota_user
1512
+ # Available to use for quota purposes for server-side applications. Can be any
1513
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1514
+ # @param [Google::Apis::RequestOptions] options
1515
+ # Request-specific options
1516
+ #
1517
+ # @yield [result, err] Result & error if block supplied
1518
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1519
+ # @yieldparam err [StandardError] error object if request failed
1520
+ #
1521
+ # @return [Google::Apis::SqlV1beta4::Operation]
1522
+ #
1523
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1524
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1525
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1526
+ def delete_user(project, instance, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
1527
+ command = make_simple_command(:delete, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
1528
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1529
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1530
+ command.params['project'] = project unless project.nil?
1531
+ command.params['instance'] = instance unless instance.nil?
1532
+ command.query['host'] = host unless host.nil?
1533
+ command.query['name'] = name unless name.nil?
1534
+ command.query['fields'] = fields unless fields.nil?
1535
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1536
+ execute_or_queue_command(command, &block)
1537
+ end
1538
+
1539
+ # Creates a new user in a Cloud SQL instance.
1540
+ # @param [String] project
1541
+ # Project ID of the project that contains the instance.
1542
+ # @param [String] instance
1543
+ # Database instance ID. This does not include the project ID.
1544
+ # @param [Google::Apis::SqlV1beta4::User] user_object
1545
+ # @param [String] fields
1546
+ # Selector specifying which fields to include in a partial response.
1547
+ # @param [String] quota_user
1548
+ # Available to use for quota purposes for server-side applications. Can be any
1549
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1550
+ # @param [Google::Apis::RequestOptions] options
1551
+ # Request-specific options
1552
+ #
1553
+ # @yield [result, err] Result & error if block supplied
1554
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1555
+ # @yieldparam err [StandardError] error object if request failed
1556
+ #
1557
+ # @return [Google::Apis::SqlV1beta4::Operation]
1558
+ #
1559
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1560
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1561
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1562
+ def insert_user(project, instance, user_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1563
+ command = make_simple_command(:post, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
1564
+ command.request_representation = Google::Apis::SqlV1beta4::User::Representation
1565
+ command.request_object = user_object
1566
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1567
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1568
+ command.params['project'] = project unless project.nil?
1569
+ command.params['instance'] = instance unless instance.nil?
1570
+ command.query['fields'] = fields unless fields.nil?
1571
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1572
+ execute_or_queue_command(command, &block)
1573
+ end
1574
+
1575
+ # Lists users in the specified Cloud SQL instance.
1576
+ # @param [String] project
1577
+ # Project ID of the project that contains the instance.
1578
+ # @param [String] instance
1579
+ # Database instance ID. This does not include the project ID.
1580
+ # @param [String] fields
1581
+ # Selector specifying which fields to include in a partial response.
1582
+ # @param [String] quota_user
1583
+ # Available to use for quota purposes for server-side applications. Can be any
1584
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1585
+ # @param [Google::Apis::RequestOptions] options
1586
+ # Request-specific options
1587
+ #
1588
+ # @yield [result, err] Result & error if block supplied
1589
+ # @yieldparam result [Google::Apis::SqlV1beta4::UsersListResponse] parsed result object
1590
+ # @yieldparam err [StandardError] error object if request failed
1591
+ #
1592
+ # @return [Google::Apis::SqlV1beta4::UsersListResponse]
1593
+ #
1594
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1595
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1596
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1597
+ def list_users(project, instance, fields: nil, quota_user: nil, options: nil, &block)
1598
+ command = make_simple_command(:get, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
1599
+ command.response_representation = Google::Apis::SqlV1beta4::UsersListResponse::Representation
1600
+ command.response_class = Google::Apis::SqlV1beta4::UsersListResponse
1601
+ command.params['project'] = project unless project.nil?
1602
+ command.params['instance'] = instance unless instance.nil?
1603
+ command.query['fields'] = fields unless fields.nil?
1604
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1605
+ execute_or_queue_command(command, &block)
1606
+ end
1607
+
1608
+ # Updates an existing user in a Cloud SQL instance.
1609
+ # @param [String] project
1610
+ # Project ID of the project that contains the instance.
1611
+ # @param [String] instance
1612
+ # Database instance ID. This does not include the project ID.
1613
+ # @param [Google::Apis::SqlV1beta4::User] user_object
1614
+ # @param [String] host
1615
+ # Host of the user in the instance. For a MySQL instance, it's required; For
1616
+ # a PostgreSQL instance, it's optional.
1617
+ # @param [String] name
1618
+ # Name of the user in the instance.
1619
+ # @param [String] fields
1620
+ # Selector specifying which fields to include in a partial response.
1621
+ # @param [String] quota_user
1622
+ # Available to use for quota purposes for server-side applications. Can be any
1623
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1624
+ # @param [Google::Apis::RequestOptions] options
1625
+ # Request-specific options
1626
+ #
1627
+ # @yield [result, err] Result & error if block supplied
1628
+ # @yieldparam result [Google::Apis::SqlV1beta4::Operation] parsed result object
1629
+ # @yieldparam err [StandardError] error object if request failed
1630
+ #
1631
+ # @return [Google::Apis::SqlV1beta4::Operation]
1632
+ #
1633
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1634
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1635
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1636
+ def update_user(project, instance, user_object = nil, host: nil, name: nil, fields: nil, quota_user: nil, options: nil, &block)
1637
+ command = make_simple_command(:put, 'sql/v1beta4/projects/{project}/instances/{instance}/users', options)
1638
+ command.request_representation = Google::Apis::SqlV1beta4::User::Representation
1639
+ command.request_object = user_object
1640
+ command.response_representation = Google::Apis::SqlV1beta4::Operation::Representation
1641
+ command.response_class = Google::Apis::SqlV1beta4::Operation
1642
+ command.params['project'] = project unless project.nil?
1643
+ command.params['instance'] = instance unless instance.nil?
1644
+ command.query['host'] = host unless host.nil?
1645
+ command.query['name'] = name unless name.nil?
1646
+ command.query['fields'] = fields unless fields.nil?
1647
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1648
+ execute_or_queue_command(command, &block)
1649
+ end
1650
+
1651
+ protected
1652
+
1653
+ def apply_command_defaults(command)
1654
+ command.query['key'] = key unless key.nil?
1655
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1656
+ end
1657
+ end
1658
+ end
1659
+ end
1660
+ end