google-apis-deploymentmanager_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,912 @@
1
+ # Copyright 2020 Google LLC
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 DeploymentmanagerV2
23
+ # Cloud Deployment Manager V2 API
24
+ #
25
+ # The Google Cloud Deployment Manager v2 API provides services for configuring,
26
+ # deploying, and viewing Google Cloud services and APIs via templates which
27
+ # specify deployments of Cloud resources.
28
+ #
29
+ # @example
30
+ # require 'google/apis/deploymentmanager_v2'
31
+ #
32
+ # Deploymentmanager = Google::Apis::DeploymentmanagerV2 # Alias the module
33
+ # service = Deploymentmanager::DeploymentManagerService.new
34
+ #
35
+ # @see https://cloud.google.com/deployment-manager
36
+ class DeploymentManagerService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://deploymentmanager.googleapis.com/', '',
49
+ client_name: 'google-apis-deploymentmanager_v2',
50
+ client_version: Google::Apis::DeploymentmanagerV2::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Cancels and removes the preview currently associated with the deployment.
55
+ # @param [String] project
56
+ # The project ID for this request.
57
+ # @param [String] deployment
58
+ # The name of the deployment for this request.
59
+ # @param [Google::Apis::DeploymentmanagerV2::DeploymentsCancelPreviewRequest] deployments_cancel_preview_request_object
60
+ # @param [String] fields
61
+ # Selector specifying which fields to include in a partial response.
62
+ # @param [String] quota_user
63
+ # Available to use for quota purposes for server-side applications. Can be any
64
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def cancel_deployment_preview(project, deployment, deployments_cancel_preview_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
78
+ command = make_simple_command(:post, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview', options)
79
+ command.request_representation = Google::Apis::DeploymentmanagerV2::DeploymentsCancelPreviewRequest::Representation
80
+ command.request_object = deployments_cancel_preview_request_object
81
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
82
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
83
+ command.params['project'] = project unless project.nil?
84
+ command.params['deployment'] = deployment unless deployment.nil?
85
+ command.query['fields'] = fields unless fields.nil?
86
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
87
+ execute_or_queue_command(command, &block)
88
+ end
89
+
90
+ # Deletes a deployment and all of the resources in the deployment.
91
+ # @param [String] project
92
+ # The project ID for this request.
93
+ # @param [String] deployment
94
+ # The name of the deployment for this request.
95
+ # @param [String] delete_policy
96
+ # Sets the policy to use for deleting resources.
97
+ # @param [String] fields
98
+ # Selector specifying which fields to include in a partial response.
99
+ # @param [String] quota_user
100
+ # Available to use for quota purposes for server-side applications. Can be any
101
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
102
+ # @param [Google::Apis::RequestOptions] options
103
+ # Request-specific options
104
+ #
105
+ # @yield [result, err] Result & error if block supplied
106
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
107
+ # @yieldparam err [StandardError] error object if request failed
108
+ #
109
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
110
+ #
111
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
112
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
113
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
114
+ def delete_deployment(project, deployment, delete_policy: nil, fields: nil, quota_user: nil, options: nil, &block)
115
+ command = make_simple_command(:delete, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}', options)
116
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
117
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
118
+ command.params['project'] = project unless project.nil?
119
+ command.params['deployment'] = deployment unless deployment.nil?
120
+ command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
121
+ command.query['fields'] = fields unless fields.nil?
122
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
123
+ execute_or_queue_command(command, &block)
124
+ end
125
+
126
+ # Gets information about a specific deployment.
127
+ # @param [String] project
128
+ # The project ID for this request.
129
+ # @param [String] deployment
130
+ # The name of the deployment for this request.
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::DeploymentmanagerV2::Deployment] parsed result object
141
+ # @yieldparam err [StandardError] error object if request failed
142
+ #
143
+ # @return [Google::Apis::DeploymentmanagerV2::Deployment]
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 get_deployment(project, deployment, fields: nil, quota_user: nil, options: nil, &block)
149
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}', options)
150
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
151
+ command.response_class = Google::Apis::DeploymentmanagerV2::Deployment
152
+ command.params['project'] = project unless project.nil?
153
+ command.params['deployment'] = deployment unless deployment.nil?
154
+ command.query['fields'] = fields unless fields.nil?
155
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ execute_or_queue_command(command, &block)
157
+ end
158
+
159
+ # Gets the access control policy for a resource. May be empty if no such policy
160
+ # or resource exists.
161
+ # @param [String] project
162
+ # Project ID for this request.
163
+ # @param [String] resource
164
+ # Name or id of the resource for this request.
165
+ # @param [Fixnum] options_requested_policy_version
166
+ # Requested IAM Policy version.
167
+ # @param [String] fields
168
+ # Selector specifying which fields to include in a partial response.
169
+ # @param [String] quota_user
170
+ # Available to use for quota purposes for server-side applications. Can be any
171
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
172
+ # @param [Google::Apis::RequestOptions] options
173
+ # Request-specific options
174
+ #
175
+ # @yield [result, err] Result & error if block supplied
176
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Policy] parsed result object
177
+ # @yieldparam err [StandardError] error object if request failed
178
+ #
179
+ # @return [Google::Apis::DeploymentmanagerV2::Policy]
180
+ #
181
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
182
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
183
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
184
+ def get_deployment_iam_policy(project, resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
185
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy', options)
186
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Policy::Representation
187
+ command.response_class = Google::Apis::DeploymentmanagerV2::Policy
188
+ command.params['project'] = project unless project.nil?
189
+ command.params['resource'] = resource unless resource.nil?
190
+ command.query['optionsRequestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
191
+ command.query['fields'] = fields unless fields.nil?
192
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
193
+ execute_or_queue_command(command, &block)
194
+ end
195
+
196
+ # Creates a deployment and all of the resources described by the deployment
197
+ # manifest.
198
+ # @param [String] project
199
+ # The project ID for this request.
200
+ # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
201
+ # @param [String] create_policy
202
+ # Sets the policy to use for creating new resources.
203
+ # @param [Boolean] preview
204
+ # If set to true, creates a deployment and creates "shell" resources but does
205
+ # not actually instantiate these resources. This allows you to preview what your
206
+ # deployment looks like. After previewing a deployment, you can deploy your
207
+ # resources by making a request with the `update()` method or you can use the `
208
+ # cancelPreview()` method to cancel the preview altogether. Note that the
209
+ # deployment will still exist after you cancel the preview and you must
210
+ # separately delete this deployment if you want to remove it.
211
+ # @param [String] fields
212
+ # Selector specifying which fields to include in a partial response.
213
+ # @param [String] quota_user
214
+ # Available to use for quota purposes for server-side applications. Can be any
215
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
216
+ # @param [Google::Apis::RequestOptions] options
217
+ # Request-specific options
218
+ #
219
+ # @yield [result, err] Result & error if block supplied
220
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
221
+ # @yieldparam err [StandardError] error object if request failed
222
+ #
223
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
224
+ #
225
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
226
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
227
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
228
+ def insert_deployment(project, deployment_object = nil, create_policy: nil, preview: nil, fields: nil, quota_user: nil, options: nil, &block)
229
+ command = make_simple_command(:post, 'deploymentmanager/v2/projects/{project}/global/deployments', options)
230
+ command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
231
+ command.request_object = deployment_object
232
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
233
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
234
+ command.params['project'] = project unless project.nil?
235
+ command.query['createPolicy'] = create_policy unless create_policy.nil?
236
+ command.query['preview'] = preview unless preview.nil?
237
+ command.query['fields'] = fields unless fields.nil?
238
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
239
+ execute_or_queue_command(command, &block)
240
+ end
241
+
242
+ # Lists all deployments for a given project.
243
+ # @param [String] project
244
+ # The project ID for this request.
245
+ # @param [String] filter
246
+ # A filter expression that filters resources listed in the response. The
247
+ # expression must specify the field name, a comparison operator, and the value
248
+ # that you want to use for filtering. The value must be a string, a number, or a
249
+ # boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For
250
+ # example, if you are filtering Compute Engine instances, you can exclude
251
+ # instances named `example-instance` by specifying `name != example-instance`.
252
+ # You can also filter nested fields. For example, you could specify `scheduling.
253
+ # automaticRestart = false` to include instances only if they are not scheduled
254
+ # for automatic restarts. You can use filtering on nested fields to filter based
255
+ # on resource labels. To filter on multiple expressions, provide each separate
256
+ # expression within parentheses. For example: ``` (scheduling.automaticRestart =
257
+ # true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `
258
+ # AND` expression. However, you can include `AND` and `OR` expressions
259
+ # explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform =
260
+ # "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
261
+ # @param [Fixnum] max_results
262
+ # The maximum number of results per page that should be returned. If the number
263
+ # of available results is larger than `maxResults`, Compute Engine returns a `
264
+ # nextPageToken` that can be used to get the next page of results in subsequent
265
+ # list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
266
+ # @param [String] order_by
267
+ # Sorts list results by a certain order. By default, results are returned in
268
+ # alphanumerical order based on the resource name. You can also sort results in
269
+ # descending order based on the creation timestamp using `orderBy="
270
+ # creationTimestamp desc"`. This sorts results based on the `creationTimestamp`
271
+ # field in reverse chronological order (newest result first). Use this to sort
272
+ # resources like operations so that the newest operation is returned first.
273
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
274
+ # @param [String] page_token
275
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned
276
+ # by a previous list request to get the next page of results.
277
+ # @param [String] fields
278
+ # Selector specifying which fields to include in a partial response.
279
+ # @param [String] quota_user
280
+ # Available to use for quota purposes for server-side applications. Can be any
281
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
282
+ # @param [Google::Apis::RequestOptions] options
283
+ # Request-specific options
284
+ #
285
+ # @yield [result, err] Result & error if block supplied
286
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse] parsed result object
287
+ # @yieldparam err [StandardError] error object if request failed
288
+ #
289
+ # @return [Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse]
290
+ #
291
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
292
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
293
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
294
+ def list_deployments(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
295
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments', options)
296
+ command.response_representation = Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse::Representation
297
+ command.response_class = Google::Apis::DeploymentmanagerV2::ListDeploymentsResponse
298
+ command.params['project'] = project unless project.nil?
299
+ command.query['filter'] = filter unless filter.nil?
300
+ command.query['maxResults'] = max_results unless max_results.nil?
301
+ command.query['orderBy'] = order_by unless order_by.nil?
302
+ command.query['pageToken'] = page_token unless page_token.nil?
303
+ command.query['fields'] = fields unless fields.nil?
304
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
305
+ execute_or_queue_command(command, &block)
306
+ end
307
+
308
+ # Patches a deployment and all of the resources described by the deployment
309
+ # manifest.
310
+ # @param [String] project
311
+ # The project ID for this request.
312
+ # @param [String] deployment
313
+ # The name of the deployment for this request.
314
+ # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
315
+ # @param [String] create_policy
316
+ # Sets the policy to use for creating new resources.
317
+ # @param [String] delete_policy
318
+ # Sets the policy to use for deleting resources.
319
+ # @param [Boolean] preview
320
+ # If set to true, updates the deployment and creates and updates the "shell"
321
+ # resources but does not actually alter or instantiate these resources. This
322
+ # allows you to preview what your deployment will look like. You can use this
323
+ # intent to preview how an update would affect your deployment. You must provide
324
+ # a `target.config` with a configuration if this is set to true. After
325
+ # previewing a deployment, you can deploy your resources by making a request
326
+ # with the `update()` or you can `cancelPreview()` to remove the preview
327
+ # altogether. Note that the deployment will still exist after you cancel the
328
+ # preview and you must separately delete this deployment if you want to remove
329
+ # it.
330
+ # @param [String] fields
331
+ # Selector specifying which fields to include in a partial response.
332
+ # @param [String] quota_user
333
+ # Available to use for quota purposes for server-side applications. Can be any
334
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
335
+ # @param [Google::Apis::RequestOptions] options
336
+ # Request-specific options
337
+ #
338
+ # @yield [result, err] Result & error if block supplied
339
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
340
+ # @yieldparam err [StandardError] error object if request failed
341
+ #
342
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
343
+ #
344
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
345
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
346
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
347
+ def patch_deployment(project, deployment, deployment_object = nil, create_policy: nil, delete_policy: nil, preview: nil, fields: nil, quota_user: nil, options: nil, &block)
348
+ command = make_simple_command(:patch, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}', options)
349
+ command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
350
+ command.request_object = deployment_object
351
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
352
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
353
+ command.params['project'] = project unless project.nil?
354
+ command.params['deployment'] = deployment unless deployment.nil?
355
+ command.query['createPolicy'] = create_policy unless create_policy.nil?
356
+ command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
357
+ command.query['preview'] = preview unless preview.nil?
358
+ command.query['fields'] = fields unless fields.nil?
359
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
360
+ execute_or_queue_command(command, &block)
361
+ end
362
+
363
+ # Sets the access control policy on the specified resource. Replaces any
364
+ # existing policy.
365
+ # @param [String] project
366
+ # Project ID for this request.
367
+ # @param [String] resource
368
+ # Name or id of the resource for this request.
369
+ # @param [Google::Apis::DeploymentmanagerV2::GlobalSetPolicyRequest] global_set_policy_request_object
370
+ # @param [String] fields
371
+ # Selector specifying which fields to include in a partial response.
372
+ # @param [String] quota_user
373
+ # Available to use for quota purposes for server-side applications. Can be any
374
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
375
+ # @param [Google::Apis::RequestOptions] options
376
+ # Request-specific options
377
+ #
378
+ # @yield [result, err] Result & error if block supplied
379
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Policy] parsed result object
380
+ # @yieldparam err [StandardError] error object if request failed
381
+ #
382
+ # @return [Google::Apis::DeploymentmanagerV2::Policy]
383
+ #
384
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
385
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
386
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
387
+ def set_deployment_iam_policy(project, resource, global_set_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
388
+ command = make_simple_command(:post, 'deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy', options)
389
+ command.request_representation = Google::Apis::DeploymentmanagerV2::GlobalSetPolicyRequest::Representation
390
+ command.request_object = global_set_policy_request_object
391
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Policy::Representation
392
+ command.response_class = Google::Apis::DeploymentmanagerV2::Policy
393
+ command.params['project'] = project unless project.nil?
394
+ command.params['resource'] = resource unless resource.nil?
395
+ command.query['fields'] = fields unless fields.nil?
396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
397
+ execute_or_queue_command(command, &block)
398
+ end
399
+
400
+ # Stops an ongoing operation. This does not roll back any work that has already
401
+ # been completed, but prevents any new work from being started.
402
+ # @param [String] project
403
+ # The project ID for this request.
404
+ # @param [String] deployment
405
+ # The name of the deployment for this request.
406
+ # @param [Google::Apis::DeploymentmanagerV2::DeploymentsStopRequest] deployments_stop_request_object
407
+ # @param [String] fields
408
+ # Selector specifying which fields to include in a partial response.
409
+ # @param [String] quota_user
410
+ # Available to use for quota purposes for server-side applications. Can be any
411
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
412
+ # @param [Google::Apis::RequestOptions] options
413
+ # Request-specific options
414
+ #
415
+ # @yield [result, err] Result & error if block supplied
416
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
417
+ # @yieldparam err [StandardError] error object if request failed
418
+ #
419
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
420
+ #
421
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
422
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
423
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
424
+ def stop_deployment(project, deployment, deployments_stop_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
425
+ command = make_simple_command(:post, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop', options)
426
+ command.request_representation = Google::Apis::DeploymentmanagerV2::DeploymentsStopRequest::Representation
427
+ command.request_object = deployments_stop_request_object
428
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
429
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
430
+ command.params['project'] = project unless project.nil?
431
+ command.params['deployment'] = deployment unless deployment.nil?
432
+ command.query['fields'] = fields unless fields.nil?
433
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
434
+ execute_or_queue_command(command, &block)
435
+ end
436
+
437
+ # Returns permissions that a caller has on the specified resource.
438
+ # @param [String] project
439
+ # Project ID for this request.
440
+ # @param [String] resource
441
+ # Name or id of the resource for this request.
442
+ # @param [Google::Apis::DeploymentmanagerV2::TestPermissionsRequest] test_permissions_request_object
443
+ # @param [String] fields
444
+ # Selector specifying which fields to include in a partial response.
445
+ # @param [String] quota_user
446
+ # Available to use for quota purposes for server-side applications. Can be any
447
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
448
+ # @param [Google::Apis::RequestOptions] options
449
+ # Request-specific options
450
+ #
451
+ # @yield [result, err] Result & error if block supplied
452
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::TestPermissionsResponse] parsed result object
453
+ # @yieldparam err [StandardError] error object if request failed
454
+ #
455
+ # @return [Google::Apis::DeploymentmanagerV2::TestPermissionsResponse]
456
+ #
457
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
458
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
459
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
460
+ def test_deployment_iam_permissions(project, resource, test_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
461
+ command = make_simple_command(:post, 'deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions', options)
462
+ command.request_representation = Google::Apis::DeploymentmanagerV2::TestPermissionsRequest::Representation
463
+ command.request_object = test_permissions_request_object
464
+ command.response_representation = Google::Apis::DeploymentmanagerV2::TestPermissionsResponse::Representation
465
+ command.response_class = Google::Apis::DeploymentmanagerV2::TestPermissionsResponse
466
+ command.params['project'] = project unless project.nil?
467
+ command.params['resource'] = resource unless resource.nil?
468
+ command.query['fields'] = fields unless fields.nil?
469
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
470
+ execute_or_queue_command(command, &block)
471
+ end
472
+
473
+ # Updates a deployment and all of the resources described by the deployment
474
+ # manifest.
475
+ # @param [String] project
476
+ # The project ID for this request.
477
+ # @param [String] deployment
478
+ # The name of the deployment for this request.
479
+ # @param [Google::Apis::DeploymentmanagerV2::Deployment] deployment_object
480
+ # @param [String] create_policy
481
+ # Sets the policy to use for creating new resources.
482
+ # @param [String] delete_policy
483
+ # Sets the policy to use for deleting resources.
484
+ # @param [Boolean] preview
485
+ # If set to true, updates the deployment and creates and updates the "shell"
486
+ # resources but does not actually alter or instantiate these resources. This
487
+ # allows you to preview what your deployment will look like. You can use this
488
+ # intent to preview how an update would affect your deployment. You must provide
489
+ # a `target.config` with a configuration if this is set to true. After
490
+ # previewing a deployment, you can deploy your resources by making a request
491
+ # with the `update()` or you can `cancelPreview()` to remove the preview
492
+ # altogether. Note that the deployment will still exist after you cancel the
493
+ # preview and you must separately delete this deployment if you want to remove
494
+ # it.
495
+ # @param [String] fields
496
+ # Selector specifying which fields to include in a partial response.
497
+ # @param [String] quota_user
498
+ # Available to use for quota purposes for server-side applications. Can be any
499
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
500
+ # @param [Google::Apis::RequestOptions] options
501
+ # Request-specific options
502
+ #
503
+ # @yield [result, err] Result & error if block supplied
504
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
505
+ # @yieldparam err [StandardError] error object if request failed
506
+ #
507
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
508
+ #
509
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
510
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
511
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
512
+ def update_deployment(project, deployment, deployment_object = nil, create_policy: nil, delete_policy: nil, preview: nil, fields: nil, quota_user: nil, options: nil, &block)
513
+ command = make_simple_command(:put, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}', options)
514
+ command.request_representation = Google::Apis::DeploymentmanagerV2::Deployment::Representation
515
+ command.request_object = deployment_object
516
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
517
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
518
+ command.params['project'] = project unless project.nil?
519
+ command.params['deployment'] = deployment unless deployment.nil?
520
+ command.query['createPolicy'] = create_policy unless create_policy.nil?
521
+ command.query['deletePolicy'] = delete_policy unless delete_policy.nil?
522
+ command.query['preview'] = preview unless preview.nil?
523
+ command.query['fields'] = fields unless fields.nil?
524
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
525
+ execute_or_queue_command(command, &block)
526
+ end
527
+
528
+ # Gets information about a specific manifest.
529
+ # @param [String] project
530
+ # The project ID for this request.
531
+ # @param [String] deployment
532
+ # The name of the deployment for this request.
533
+ # @param [String] manifest
534
+ # The name of the manifest for this request.
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::DeploymentmanagerV2::Manifest] parsed result object
545
+ # @yieldparam err [StandardError] error object if request failed
546
+ #
547
+ # @return [Google::Apis::DeploymentmanagerV2::Manifest]
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 get_manifest(project, deployment, manifest, fields: nil, quota_user: nil, options: nil, &block)
553
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}', options)
554
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Manifest::Representation
555
+ command.response_class = Google::Apis::DeploymentmanagerV2::Manifest
556
+ command.params['project'] = project unless project.nil?
557
+ command.params['deployment'] = deployment unless deployment.nil?
558
+ command.params['manifest'] = manifest unless manifest.nil?
559
+ command.query['fields'] = fields unless fields.nil?
560
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
561
+ execute_or_queue_command(command, &block)
562
+ end
563
+
564
+ # Lists all manifests for a given deployment.
565
+ # @param [String] project
566
+ # The project ID for this request.
567
+ # @param [String] deployment
568
+ # The name of the deployment for this request.
569
+ # @param [String] filter
570
+ # A filter expression that filters resources listed in the response. The
571
+ # expression must specify the field name, a comparison operator, and the value
572
+ # that you want to use for filtering. The value must be a string, a number, or a
573
+ # boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For
574
+ # example, if you are filtering Compute Engine instances, you can exclude
575
+ # instances named `example-instance` by specifying `name != example-instance`.
576
+ # You can also filter nested fields. For example, you could specify `scheduling.
577
+ # automaticRestart = false` to include instances only if they are not scheduled
578
+ # for automatic restarts. You can use filtering on nested fields to filter based
579
+ # on resource labels. To filter on multiple expressions, provide each separate
580
+ # expression within parentheses. For example: ``` (scheduling.automaticRestart =
581
+ # true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `
582
+ # AND` expression. However, you can include `AND` and `OR` expressions
583
+ # explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform =
584
+ # "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
585
+ # @param [Fixnum] max_results
586
+ # The maximum number of results per page that should be returned. If the number
587
+ # of available results is larger than `maxResults`, Compute Engine returns a `
588
+ # nextPageToken` that can be used to get the next page of results in subsequent
589
+ # list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
590
+ # @param [String] order_by
591
+ # Sorts list results by a certain order. By default, results are returned in
592
+ # alphanumerical order based on the resource name. You can also sort results in
593
+ # descending order based on the creation timestamp using `orderBy="
594
+ # creationTimestamp desc"`. This sorts results based on the `creationTimestamp`
595
+ # field in reverse chronological order (newest result first). Use this to sort
596
+ # resources like operations so that the newest operation is returned first.
597
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
598
+ # @param [String] page_token
599
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned
600
+ # by a previous list request to get the next page of results.
601
+ # @param [String] fields
602
+ # Selector specifying which fields to include in a partial response.
603
+ # @param [String] quota_user
604
+ # Available to use for quota purposes for server-side applications. Can be any
605
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
606
+ # @param [Google::Apis::RequestOptions] options
607
+ # Request-specific options
608
+ #
609
+ # @yield [result, err] Result & error if block supplied
610
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListManifestsResponse] parsed result object
611
+ # @yieldparam err [StandardError] error object if request failed
612
+ #
613
+ # @return [Google::Apis::DeploymentmanagerV2::ListManifestsResponse]
614
+ #
615
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
616
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
617
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
618
+ def list_manifests(project, deployment, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
619
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests', options)
620
+ command.response_representation = Google::Apis::DeploymentmanagerV2::ListManifestsResponse::Representation
621
+ command.response_class = Google::Apis::DeploymentmanagerV2::ListManifestsResponse
622
+ command.params['project'] = project unless project.nil?
623
+ command.params['deployment'] = deployment unless deployment.nil?
624
+ command.query['filter'] = filter unless filter.nil?
625
+ command.query['maxResults'] = max_results unless max_results.nil?
626
+ command.query['orderBy'] = order_by unless order_by.nil?
627
+ command.query['pageToken'] = page_token unless page_token.nil?
628
+ command.query['fields'] = fields unless fields.nil?
629
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
630
+ execute_or_queue_command(command, &block)
631
+ end
632
+
633
+ # Gets information about a specific operation.
634
+ # @param [String] project
635
+ # The project ID for this request.
636
+ # @param [String] operation
637
+ # The name of the operation for this request.
638
+ # @param [String] fields
639
+ # Selector specifying which fields to include in a partial response.
640
+ # @param [String] quota_user
641
+ # Available to use for quota purposes for server-side applications. Can be any
642
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
643
+ # @param [Google::Apis::RequestOptions] options
644
+ # Request-specific options
645
+ #
646
+ # @yield [result, err] Result & error if block supplied
647
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Operation] parsed result object
648
+ # @yieldparam err [StandardError] error object if request failed
649
+ #
650
+ # @return [Google::Apis::DeploymentmanagerV2::Operation]
651
+ #
652
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
653
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
654
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
655
+ def get_operation(project, operation, fields: nil, quota_user: nil, options: nil, &block)
656
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/operations/{operation}', options)
657
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Operation::Representation
658
+ command.response_class = Google::Apis::DeploymentmanagerV2::Operation
659
+ command.params['project'] = project unless project.nil?
660
+ command.params['operation'] = operation unless operation.nil?
661
+ command.query['fields'] = fields unless fields.nil?
662
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
663
+ execute_or_queue_command(command, &block)
664
+ end
665
+
666
+ # Lists all operations for a project.
667
+ # @param [String] project
668
+ # The project ID for this request.
669
+ # @param [String] filter
670
+ # A filter expression that filters resources listed in the response. The
671
+ # expression must specify the field name, a comparison operator, and the value
672
+ # that you want to use for filtering. The value must be a string, a number, or a
673
+ # boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For
674
+ # example, if you are filtering Compute Engine instances, you can exclude
675
+ # instances named `example-instance` by specifying `name != example-instance`.
676
+ # You can also filter nested fields. For example, you could specify `scheduling.
677
+ # automaticRestart = false` to include instances only if they are not scheduled
678
+ # for automatic restarts. You can use filtering on nested fields to filter based
679
+ # on resource labels. To filter on multiple expressions, provide each separate
680
+ # expression within parentheses. For example: ``` (scheduling.automaticRestart =
681
+ # true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `
682
+ # AND` expression. However, you can include `AND` and `OR` expressions
683
+ # explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform =
684
+ # "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
685
+ # @param [Fixnum] max_results
686
+ # The maximum number of results per page that should be returned. If the number
687
+ # of available results is larger than `maxResults`, Compute Engine returns a `
688
+ # nextPageToken` that can be used to get the next page of results in subsequent
689
+ # list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
690
+ # @param [String] order_by
691
+ # Sorts list results by a certain order. By default, results are returned in
692
+ # alphanumerical order based on the resource name. You can also sort results in
693
+ # descending order based on the creation timestamp using `orderBy="
694
+ # creationTimestamp desc"`. This sorts results based on the `creationTimestamp`
695
+ # field in reverse chronological order (newest result first). Use this to sort
696
+ # resources like operations so that the newest operation is returned first.
697
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
698
+ # @param [String] page_token
699
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned
700
+ # by a previous list request to get the next page of results.
701
+ # @param [String] fields
702
+ # Selector specifying which fields to include in a partial response.
703
+ # @param [String] quota_user
704
+ # Available to use for quota purposes for server-side applications. Can be any
705
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
706
+ # @param [Google::Apis::RequestOptions] options
707
+ # Request-specific options
708
+ #
709
+ # @yield [result, err] Result & error if block supplied
710
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListOperationsResponse] parsed result object
711
+ # @yieldparam err [StandardError] error object if request failed
712
+ #
713
+ # @return [Google::Apis::DeploymentmanagerV2::ListOperationsResponse]
714
+ #
715
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
716
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
717
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
718
+ def list_operations(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
719
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/operations', options)
720
+ command.response_representation = Google::Apis::DeploymentmanagerV2::ListOperationsResponse::Representation
721
+ command.response_class = Google::Apis::DeploymentmanagerV2::ListOperationsResponse
722
+ command.params['project'] = project unless project.nil?
723
+ command.query['filter'] = filter unless filter.nil?
724
+ command.query['maxResults'] = max_results unless max_results.nil?
725
+ command.query['orderBy'] = order_by unless order_by.nil?
726
+ command.query['pageToken'] = page_token unless page_token.nil?
727
+ command.query['fields'] = fields unless fields.nil?
728
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
729
+ execute_or_queue_command(command, &block)
730
+ end
731
+
732
+ # Gets information about a single resource.
733
+ # @param [String] project
734
+ # The project ID for this request.
735
+ # @param [String] deployment
736
+ # The name of the deployment for this request.
737
+ # @param [String] resource
738
+ # The name of the resource for this request.
739
+ # @param [String] fields
740
+ # Selector specifying which fields to include in a partial response.
741
+ # @param [String] quota_user
742
+ # Available to use for quota purposes for server-side applications. Can be any
743
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
744
+ # @param [Google::Apis::RequestOptions] options
745
+ # Request-specific options
746
+ #
747
+ # @yield [result, err] Result & error if block supplied
748
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::Resource] parsed result object
749
+ # @yieldparam err [StandardError] error object if request failed
750
+ #
751
+ # @return [Google::Apis::DeploymentmanagerV2::Resource]
752
+ #
753
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
754
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
755
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
756
+ def get_resource(project, deployment, resource, fields: nil, quota_user: nil, options: nil, &block)
757
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}', options)
758
+ command.response_representation = Google::Apis::DeploymentmanagerV2::Resource::Representation
759
+ command.response_class = Google::Apis::DeploymentmanagerV2::Resource
760
+ command.params['project'] = project unless project.nil?
761
+ command.params['deployment'] = deployment unless deployment.nil?
762
+ command.params['resource'] = resource unless resource.nil?
763
+ command.query['fields'] = fields unless fields.nil?
764
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
765
+ execute_or_queue_command(command, &block)
766
+ end
767
+
768
+ # Lists all resources in a given deployment.
769
+ # @param [String] project
770
+ # The project ID for this request.
771
+ # @param [String] deployment
772
+ # The name of the deployment for this request.
773
+ # @param [String] filter
774
+ # A filter expression that filters resources listed in the response. The
775
+ # expression must specify the field name, a comparison operator, and the value
776
+ # that you want to use for filtering. The value must be a string, a number, or a
777
+ # boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For
778
+ # example, if you are filtering Compute Engine instances, you can exclude
779
+ # instances named `example-instance` by specifying `name != example-instance`.
780
+ # You can also filter nested fields. For example, you could specify `scheduling.
781
+ # automaticRestart = false` to include instances only if they are not scheduled
782
+ # for automatic restarts. You can use filtering on nested fields to filter based
783
+ # on resource labels. To filter on multiple expressions, provide each separate
784
+ # expression within parentheses. For example: ``` (scheduling.automaticRestart =
785
+ # true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `
786
+ # AND` expression. However, you can include `AND` and `OR` expressions
787
+ # explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform =
788
+ # "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
789
+ # @param [Fixnum] max_results
790
+ # The maximum number of results per page that should be returned. If the number
791
+ # of available results is larger than `maxResults`, Compute Engine returns a `
792
+ # nextPageToken` that can be used to get the next page of results in subsequent
793
+ # list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
794
+ # @param [String] order_by
795
+ # Sorts list results by a certain order. By default, results are returned in
796
+ # alphanumerical order based on the resource name. You can also sort results in
797
+ # descending order based on the creation timestamp using `orderBy="
798
+ # creationTimestamp desc"`. This sorts results based on the `creationTimestamp`
799
+ # field in reverse chronological order (newest result first). Use this to sort
800
+ # resources like operations so that the newest operation is returned first.
801
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
802
+ # @param [String] page_token
803
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned
804
+ # by a previous list request to get the next page of results.
805
+ # @param [String] fields
806
+ # Selector specifying which fields to include in a partial response.
807
+ # @param [String] quota_user
808
+ # Available to use for quota purposes for server-side applications. Can be any
809
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
810
+ # @param [Google::Apis::RequestOptions] options
811
+ # Request-specific options
812
+ #
813
+ # @yield [result, err] Result & error if block supplied
814
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListResourcesResponse] parsed result object
815
+ # @yieldparam err [StandardError] error object if request failed
816
+ #
817
+ # @return [Google::Apis::DeploymentmanagerV2::ListResourcesResponse]
818
+ #
819
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
820
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
821
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
822
+ def list_resources(project, deployment, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
823
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources', options)
824
+ command.response_representation = Google::Apis::DeploymentmanagerV2::ListResourcesResponse::Representation
825
+ command.response_class = Google::Apis::DeploymentmanagerV2::ListResourcesResponse
826
+ command.params['project'] = project unless project.nil?
827
+ command.params['deployment'] = deployment unless deployment.nil?
828
+ command.query['filter'] = filter unless filter.nil?
829
+ command.query['maxResults'] = max_results unless max_results.nil?
830
+ command.query['orderBy'] = order_by unless order_by.nil?
831
+ command.query['pageToken'] = page_token unless page_token.nil?
832
+ command.query['fields'] = fields unless fields.nil?
833
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
834
+ execute_or_queue_command(command, &block)
835
+ end
836
+
837
+ # Lists all resource types for Deployment Manager.
838
+ # @param [String] project
839
+ # The project ID for this request.
840
+ # @param [String] filter
841
+ # A filter expression that filters resources listed in the response. The
842
+ # expression must specify the field name, a comparison operator, and the value
843
+ # that you want to use for filtering. The value must be a string, a number, or a
844
+ # boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. For
845
+ # example, if you are filtering Compute Engine instances, you can exclude
846
+ # instances named `example-instance` by specifying `name != example-instance`.
847
+ # You can also filter nested fields. For example, you could specify `scheduling.
848
+ # automaticRestart = false` to include instances only if they are not scheduled
849
+ # for automatic restarts. You can use filtering on nested fields to filter based
850
+ # on resource labels. To filter on multiple expressions, provide each separate
851
+ # expression within parentheses. For example: ``` (scheduling.automaticRestart =
852
+ # true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `
853
+ # AND` expression. However, you can include `AND` and `OR` expressions
854
+ # explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform =
855
+ # "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
856
+ # @param [Fixnum] max_results
857
+ # The maximum number of results per page that should be returned. If the number
858
+ # of available results is larger than `maxResults`, Compute Engine returns a `
859
+ # nextPageToken` that can be used to get the next page of results in subsequent
860
+ # list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
861
+ # @param [String] order_by
862
+ # Sorts list results by a certain order. By default, results are returned in
863
+ # alphanumerical order based on the resource name. You can also sort results in
864
+ # descending order based on the creation timestamp using `orderBy="
865
+ # creationTimestamp desc"`. This sorts results based on the `creationTimestamp`
866
+ # field in reverse chronological order (newest result first). Use this to sort
867
+ # resources like operations so that the newest operation is returned first.
868
+ # Currently, only sorting by `name` or `creationTimestamp desc` is supported.
869
+ # @param [String] page_token
870
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned
871
+ # by a previous list request to get the next page of results.
872
+ # @param [String] fields
873
+ # Selector specifying which fields to include in a partial response.
874
+ # @param [String] quota_user
875
+ # Available to use for quota purposes for server-side applications. Can be any
876
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
877
+ # @param [Google::Apis::RequestOptions] options
878
+ # Request-specific options
879
+ #
880
+ # @yield [result, err] Result & error if block supplied
881
+ # @yieldparam result [Google::Apis::DeploymentmanagerV2::ListTypesResponse] parsed result object
882
+ # @yieldparam err [StandardError] error object if request failed
883
+ #
884
+ # @return [Google::Apis::DeploymentmanagerV2::ListTypesResponse]
885
+ #
886
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
887
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
888
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
889
+ def list_types(project, filter: nil, max_results: nil, order_by: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
890
+ command = make_simple_command(:get, 'deploymentmanager/v2/projects/{project}/global/types', options)
891
+ command.response_representation = Google::Apis::DeploymentmanagerV2::ListTypesResponse::Representation
892
+ command.response_class = Google::Apis::DeploymentmanagerV2::ListTypesResponse
893
+ command.params['project'] = project unless project.nil?
894
+ command.query['filter'] = filter unless filter.nil?
895
+ command.query['maxResults'] = max_results unless max_results.nil?
896
+ command.query['orderBy'] = order_by unless order_by.nil?
897
+ command.query['pageToken'] = page_token unless page_token.nil?
898
+ command.query['fields'] = fields unless fields.nil?
899
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
900
+ execute_or_queue_command(command, &block)
901
+ end
902
+
903
+ protected
904
+
905
+ def apply_command_defaults(command)
906
+ command.query['key'] = key unless key.nil?
907
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
908
+ end
909
+ end
910
+ end
911
+ end
912
+ end