google-apis-osconfig_v1alpha 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,615 @@
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 OsconfigV1alpha
23
+ # OS Config API
24
+ #
25
+ # OS management tools that can be used for patch management, patch compliance,
26
+ # and configuration management on VM instances.
27
+ #
28
+ # @example
29
+ # require 'google/apis/osconfig_v1alpha'
30
+ #
31
+ # Osconfig = Google::Apis::OsconfigV1alpha # Alias the module
32
+ # service = Osconfig::OSConfigService.new
33
+ #
34
+ # @see https://cloud.google.com/compute/docs/osconfig/rest
35
+ class OSConfigService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://osconfig.googleapis.com/', '',
48
+ client_name: 'google-apis-osconfig_v1alpha',
49
+ client_version: Google::Apis::OsconfigV1alpha::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Get OS policies compliance data for the specified Compute Engine VM instance.
54
+ # @param [String] name
55
+ # Required. API resource name for instance OS policies compliance resource.
56
+ # Format: `projects/`project`/locations/`location`/instanceOSPoliciesCompliances/
57
+ # `instance`` For ``project``, either Compute Engine project-number or project-
58
+ # id can be provided. For ``instance``, either Compute Engine VM instance-id or
59
+ # instance-name can be provided.
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::OsconfigV1alpha::InstanceOsPoliciesCompliance] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::OsconfigV1alpha::InstanceOsPoliciesCompliance]
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 get_project_location_instance_os_policies_compliance(name, fields: nil, quota_user: nil, options: nil, &block)
78
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
79
+ command.response_representation = Google::Apis::OsconfigV1alpha::InstanceOsPoliciesCompliance::Representation
80
+ command.response_class = Google::Apis::OsconfigV1alpha::InstanceOsPoliciesCompliance
81
+ command.params['name'] = name unless name.nil?
82
+ command.query['fields'] = fields unless fields.nil?
83
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
84
+ execute_or_queue_command(command, &block)
85
+ end
86
+
87
+ # List OS policies compliance data for all Compute Engine VM instances in the
88
+ # specified zone.
89
+ # @param [String] parent
90
+ # Required. The parent resource name. Format: `projects/`project`/locations/`
91
+ # location`` For ``project``, either Compute Engine project-number or project-id
92
+ # can be provided.
93
+ # @param [String] filter
94
+ # If provided, this field specifies the criteria that must be met by a `
95
+ # InstanceOSPoliciesCompliance` API resource to be included in the response.
96
+ # @param [Fixnum] page_size
97
+ # The maximum number of results to return.
98
+ # @param [String] page_token
99
+ # A pagination token returned from a previous call to `
100
+ # ListInstanceOSPoliciesCompliances` that indicates where this listing should
101
+ # continue from.
102
+ # @param [String] fields
103
+ # Selector specifying which fields to include in a partial response.
104
+ # @param [String] quota_user
105
+ # Available to use for quota purposes for server-side applications. Can be any
106
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
107
+ # @param [Google::Apis::RequestOptions] options
108
+ # Request-specific options
109
+ #
110
+ # @yield [result, err] Result & error if block supplied
111
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::ListInstanceOsPoliciesCompliancesResponse] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::OsconfigV1alpha::ListInstanceOsPoliciesCompliancesResponse]
115
+ #
116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
119
+ def list_project_location_instance_os_policies_compliances(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
120
+ command = make_simple_command(:get, 'v1alpha/{+parent}/instanceOSPoliciesCompliances', options)
121
+ command.response_representation = Google::Apis::OsconfigV1alpha::ListInstanceOsPoliciesCompliancesResponse::Representation
122
+ command.response_class = Google::Apis::OsconfigV1alpha::ListInstanceOsPoliciesCompliancesResponse
123
+ command.params['parent'] = parent unless parent.nil?
124
+ command.query['filter'] = filter unless filter.nil?
125
+ command.query['pageSize'] = page_size unless page_size.nil?
126
+ command.query['pageToken'] = page_token unless page_token.nil?
127
+ command.query['fields'] = fields unless fields.nil?
128
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
129
+ execute_or_queue_command(command, &block)
130
+ end
131
+
132
+ # Get inventory data for the specified VM instance. If the VM has no associated
133
+ # inventory, the message `NOT_FOUND` is returned.
134
+ # @param [String] name
135
+ # Required. API resource name for inventory resource. Format: `projects/`project`
136
+ # /locations/`location`/instances/`instance`/inventory` For ``project``, either `
137
+ # project-number` or `project-id` can be provided. For ``instance``, either
138
+ # Compute Engine `instance-id` or `instance-name` can be provided.
139
+ # @param [String] view
140
+ # Inventory view indicating what information should be included in the inventory
141
+ # resource. If unspecified, the default view is BASIC.
142
+ # @param [String] fields
143
+ # Selector specifying which fields to include in a partial response.
144
+ # @param [String] quota_user
145
+ # Available to use for quota purposes for server-side applications. Can be any
146
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
147
+ # @param [Google::Apis::RequestOptions] options
148
+ # Request-specific options
149
+ #
150
+ # @yield [result, err] Result & error if block supplied
151
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Inventory] parsed result object
152
+ # @yieldparam err [StandardError] error object if request failed
153
+ #
154
+ # @return [Google::Apis::OsconfigV1alpha::Inventory]
155
+ #
156
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
157
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
158
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
159
+ def get_project_location_instance_inventory(name, view: nil, fields: nil, quota_user: nil, options: nil, &block)
160
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
161
+ command.response_representation = Google::Apis::OsconfigV1alpha::Inventory::Representation
162
+ command.response_class = Google::Apis::OsconfigV1alpha::Inventory
163
+ command.params['name'] = name unless name.nil?
164
+ command.query['view'] = view unless view.nil?
165
+ command.query['fields'] = fields unless fields.nil?
166
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
167
+ execute_or_queue_command(command, &block)
168
+ end
169
+
170
+ # List inventory data for all VM instances in the specified zone.
171
+ # @param [String] parent
172
+ # Required. The parent resource name. Format: `projects/`project`/locations/`
173
+ # location`/instances/`instance`` For ``project``, either `project-number` or `
174
+ # project-id` can be provided. For ``instance``, only hyphen or dash character
175
+ # is supported to list inventories across VMs.
176
+ # @param [String] filter
177
+ # If provided, this field specifies the criteria that must be met by a `
178
+ # Inventory` API resource to be included in the response.
179
+ # @param [Fixnum] page_size
180
+ # The maximum number of results to return.
181
+ # @param [String] page_token
182
+ # A pagination token returned from a previous call to `ListInventories` that
183
+ # indicates where this listing should continue from.
184
+ # @param [String] view
185
+ # Inventory view indicating what information should be included in the inventory
186
+ # resource. If unspecified, the default view is BASIC.
187
+ # @param [String] fields
188
+ # Selector specifying which fields to include in a partial response.
189
+ # @param [String] quota_user
190
+ # Available to use for quota purposes for server-side applications. Can be any
191
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
192
+ # @param [Google::Apis::RequestOptions] options
193
+ # Request-specific options
194
+ #
195
+ # @yield [result, err] Result & error if block supplied
196
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::ListInventoriesResponse] parsed result object
197
+ # @yieldparam err [StandardError] error object if request failed
198
+ #
199
+ # @return [Google::Apis::OsconfigV1alpha::ListInventoriesResponse]
200
+ #
201
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
202
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
203
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
204
+ def list_project_location_instance_inventories(parent, filter: nil, page_size: nil, page_token: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
205
+ command = make_simple_command(:get, 'v1alpha/{+parent}/inventories', options)
206
+ command.response_representation = Google::Apis::OsconfigV1alpha::ListInventoriesResponse::Representation
207
+ command.response_class = Google::Apis::OsconfigV1alpha::ListInventoriesResponse
208
+ command.params['parent'] = parent unless parent.nil?
209
+ command.query['filter'] = filter unless filter.nil?
210
+ command.query['pageSize'] = page_size unless page_size.nil?
211
+ command.query['pageToken'] = page_token unless page_token.nil?
212
+ command.query['view'] = view unless view.nil?
213
+ command.query['fields'] = fields unless fields.nil?
214
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
215
+ execute_or_queue_command(command, &block)
216
+ end
217
+
218
+ # Gets the vulnerability report for the specified VM instance. Only VMs with
219
+ # inventory data have vulnerability reports associated with them.
220
+ # @param [String] name
221
+ # Required. API resource name for vulnerability resource. Format: `projects/`
222
+ # project`/locations/`location`/instances/`instance`/vulnerabilityReport` For ``
223
+ # project``, either `project-number` or `project-id` can be provided. For ``
224
+ # instance``, either Compute Engine `instance-id` or `instance-name` can be
225
+ # provided.
226
+ # @param [String] fields
227
+ # Selector specifying which fields to include in a partial response.
228
+ # @param [String] quota_user
229
+ # Available to use for quota purposes for server-side applications. Can be any
230
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
231
+ # @param [Google::Apis::RequestOptions] options
232
+ # Request-specific options
233
+ #
234
+ # @yield [result, err] Result & error if block supplied
235
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::VulnerabilityReport] parsed result object
236
+ # @yieldparam err [StandardError] error object if request failed
237
+ #
238
+ # @return [Google::Apis::OsconfigV1alpha::VulnerabilityReport]
239
+ #
240
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
241
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
242
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
243
+ def get_project_location_instance_vulnerability_report(name, fields: nil, quota_user: nil, options: nil, &block)
244
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
245
+ command.response_representation = Google::Apis::OsconfigV1alpha::VulnerabilityReport::Representation
246
+ command.response_class = Google::Apis::OsconfigV1alpha::VulnerabilityReport
247
+ command.params['name'] = name unless name.nil?
248
+ command.query['fields'] = fields unless fields.nil?
249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
250
+ execute_or_queue_command(command, &block)
251
+ end
252
+
253
+ # List vulnerability reports for all VM instances in the specified zone.
254
+ # @param [String] parent
255
+ # Required. The parent resource name. Format: `projects/`project`/locations/`
256
+ # location`/instances/`instance`` For ``project``, either `project-number` or `
257
+ # project-id` can be provided. For ``instance``, only `-` character is supported
258
+ # to list vulnerability reports across VMs.
259
+ # @param [String] filter
260
+ # If provided, this field specifies the criteria that must be met by a `
261
+ # vulnerabilityReport` API resource to be included in the response.
262
+ # @param [Fixnum] page_size
263
+ # The maximum number of results to return.
264
+ # @param [String] page_token
265
+ # A pagination token returned from a previous call to `ListVulnerabilityReports`
266
+ # that indicates where this listing should continue from.
267
+ # @param [String] fields
268
+ # Selector specifying which fields to include in a partial response.
269
+ # @param [String] quota_user
270
+ # Available to use for quota purposes for server-side applications. Can be any
271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
272
+ # @param [Google::Apis::RequestOptions] options
273
+ # Request-specific options
274
+ #
275
+ # @yield [result, err] Result & error if block supplied
276
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::ListVulnerabilityReportsResponse] parsed result object
277
+ # @yieldparam err [StandardError] error object if request failed
278
+ #
279
+ # @return [Google::Apis::OsconfigV1alpha::ListVulnerabilityReportsResponse]
280
+ #
281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
284
+ def list_project_location_instance_vulnerability_reports(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
285
+ command = make_simple_command(:get, 'v1alpha/{+parent}/vulnerabilityReports', options)
286
+ command.response_representation = Google::Apis::OsconfigV1alpha::ListVulnerabilityReportsResponse::Representation
287
+ command.response_class = Google::Apis::OsconfigV1alpha::ListVulnerabilityReportsResponse
288
+ command.params['parent'] = parent unless parent.nil?
289
+ command.query['filter'] = filter unless filter.nil?
290
+ command.query['pageSize'] = page_size unless page_size.nil?
291
+ command.query['pageToken'] = page_token unless page_token.nil?
292
+ command.query['fields'] = fields unless fields.nil?
293
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
294
+ execute_or_queue_command(command, &block)
295
+ end
296
+
297
+ # Create an OS policy assignment. This method also creates the first revision of
298
+ # the OS policy assignment. This method returns a long running operation (LRO)
299
+ # that contains the rollout details. The rollout can be cancelled by cancelling
300
+ # the LRO. For more information, see [Method: projects.locations.
301
+ # osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/
302
+ # osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel)
303
+ # .
304
+ # @param [String] parent
305
+ # Required. The parent resource name in the form: projects/`project`/locations/`
306
+ # location`
307
+ # @param [Google::Apis::OsconfigV1alpha::OsPolicyAssignment] os_policy_assignment_object
308
+ # @param [String] os_policy_assignment_id
309
+ # Required. The logical name of the OS policy assignment in the project with the
310
+ # following restrictions: * Must contain only lowercase letters, numbers, and
311
+ # hyphens. * Must start with a letter. * Must be between 1-63 characters. * Must
312
+ # end with a number or a letter. * Must be unique within the project.
313
+ # @param [String] fields
314
+ # Selector specifying which fields to include in a partial response.
315
+ # @param [String] quota_user
316
+ # Available to use for quota purposes for server-side applications. Can be any
317
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Operation] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::OsconfigV1alpha::Operation]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ def create_project_location_os_policy_assignment(parent, os_policy_assignment_object = nil, os_policy_assignment_id: nil, fields: nil, quota_user: nil, options: nil, &block)
331
+ command = make_simple_command(:post, 'v1alpha/{+parent}/osPolicyAssignments', options)
332
+ command.request_representation = Google::Apis::OsconfigV1alpha::OsPolicyAssignment::Representation
333
+ command.request_object = os_policy_assignment_object
334
+ command.response_representation = Google::Apis::OsconfigV1alpha::Operation::Representation
335
+ command.response_class = Google::Apis::OsconfigV1alpha::Operation
336
+ command.params['parent'] = parent unless parent.nil?
337
+ command.query['osPolicyAssignmentId'] = os_policy_assignment_id unless os_policy_assignment_id.nil?
338
+ command.query['fields'] = fields unless fields.nil?
339
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
340
+ execute_or_queue_command(command, &block)
341
+ end
342
+
343
+ # Delete the OS policy assignment. This method creates a new revision of the OS
344
+ # policy assignment. This method returns a long running operation (LRO) that
345
+ # contains the rollout details. The rollout can be cancelled by cancelling the
346
+ # LRO. If the LRO completes and is not cancelled, all revisions associated with
347
+ # the OS policy assignment are deleted. For more information, see [Method:
348
+ # projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.
349
+ # com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.
350
+ # operations/cancel).
351
+ # @param [String] name
352
+ # Required. The name of the OS policy assignment to be deleted
353
+ # @param [String] fields
354
+ # Selector specifying which fields to include in a partial response.
355
+ # @param [String] quota_user
356
+ # Available to use for quota purposes for server-side applications. Can be any
357
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
358
+ # @param [Google::Apis::RequestOptions] options
359
+ # Request-specific options
360
+ #
361
+ # @yield [result, err] Result & error if block supplied
362
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Operation] parsed result object
363
+ # @yieldparam err [StandardError] error object if request failed
364
+ #
365
+ # @return [Google::Apis::OsconfigV1alpha::Operation]
366
+ #
367
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
368
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
369
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
370
+ def delete_project_location_os_policy_assignment(name, fields: nil, quota_user: nil, options: nil, &block)
371
+ command = make_simple_command(:delete, 'v1alpha/{+name}', options)
372
+ command.response_representation = Google::Apis::OsconfigV1alpha::Operation::Representation
373
+ command.response_class = Google::Apis::OsconfigV1alpha::Operation
374
+ command.params['name'] = name unless name.nil?
375
+ command.query['fields'] = fields unless fields.nil?
376
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
377
+ execute_or_queue_command(command, &block)
378
+ end
379
+
380
+ # Retrieve an existing OS policy assignment. This method always returns the
381
+ # latest revision. In order to retrieve a previous revision of the assignment,
382
+ # also provide the revision ID in the `name` parameter.
383
+ # @param [String] name
384
+ # Required. The resource name of OS policy assignment. Format: `projects/`
385
+ # project`/locations/`location`/osPolicyAssignments/`os_policy_assignment`@`
386
+ # revisionId``
387
+ # @param [String] fields
388
+ # Selector specifying which fields to include in a partial response.
389
+ # @param [String] quota_user
390
+ # Available to use for quota purposes for server-side applications. Can be any
391
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
392
+ # @param [Google::Apis::RequestOptions] options
393
+ # Request-specific options
394
+ #
395
+ # @yield [result, err] Result & error if block supplied
396
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::OsPolicyAssignment] parsed result object
397
+ # @yieldparam err [StandardError] error object if request failed
398
+ #
399
+ # @return [Google::Apis::OsconfigV1alpha::OsPolicyAssignment]
400
+ #
401
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
402
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
403
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
404
+ def get_project_location_os_policy_assignment(name, fields: nil, quota_user: nil, options: nil, &block)
405
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
406
+ command.response_representation = Google::Apis::OsconfigV1alpha::OsPolicyAssignment::Representation
407
+ command.response_class = Google::Apis::OsconfigV1alpha::OsPolicyAssignment
408
+ command.params['name'] = name unless name.nil?
409
+ command.query['fields'] = fields unless fields.nil?
410
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
411
+ execute_or_queue_command(command, &block)
412
+ end
413
+
414
+ # List the OS policy assignments under the parent resource. For each OS policy
415
+ # assignment, the latest revision is returned.
416
+ # @param [String] parent
417
+ # Required. The parent resource name.
418
+ # @param [Fixnum] page_size
419
+ # The maximum number of assignments to return.
420
+ # @param [String] page_token
421
+ # A pagination token returned from a previous call to `ListOSPolicyAssignments`
422
+ # that indicates where this listing should continue from.
423
+ # @param [String] fields
424
+ # Selector specifying which fields to include in a partial response.
425
+ # @param [String] quota_user
426
+ # Available to use for quota purposes for server-side applications. Can be any
427
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
428
+ # @param [Google::Apis::RequestOptions] options
429
+ # Request-specific options
430
+ #
431
+ # @yield [result, err] Result & error if block supplied
432
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentsResponse] parsed result object
433
+ # @yieldparam err [StandardError] error object if request failed
434
+ #
435
+ # @return [Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentsResponse]
436
+ #
437
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
438
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
439
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
440
+ def list_project_location_os_policy_assignments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
441
+ command = make_simple_command(:get, 'v1alpha/{+parent}/osPolicyAssignments', options)
442
+ command.response_representation = Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentsResponse::Representation
443
+ command.response_class = Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentsResponse
444
+ command.params['parent'] = parent unless parent.nil?
445
+ command.query['pageSize'] = page_size unless page_size.nil?
446
+ command.query['pageToken'] = page_token unless page_token.nil?
447
+ command.query['fields'] = fields unless fields.nil?
448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
449
+ execute_or_queue_command(command, &block)
450
+ end
451
+
452
+ # List the OS policy assignment revisions for a given OS policy assignment.
453
+ # @param [String] name
454
+ # Required. The name of the OS policy assignment to list revisions for.
455
+ # @param [Fixnum] page_size
456
+ # The maximum number of revisions to return.
457
+ # @param [String] page_token
458
+ # A pagination token returned from a previous call to `
459
+ # ListOSPolicyAssignmentRevisions` that indicates where this listing should
460
+ # continue from.
461
+ # @param [String] fields
462
+ # Selector specifying which fields to include in a partial response.
463
+ # @param [String] quota_user
464
+ # Available to use for quota purposes for server-side applications. Can be any
465
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
466
+ # @param [Google::Apis::RequestOptions] options
467
+ # Request-specific options
468
+ #
469
+ # @yield [result, err] Result & error if block supplied
470
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentRevisionsResponse] parsed result object
471
+ # @yieldparam err [StandardError] error object if request failed
472
+ #
473
+ # @return [Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentRevisionsResponse]
474
+ #
475
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
476
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
477
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
478
+ def list_project_location_os_policy_assignment_revisions(name, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
479
+ command = make_simple_command(:get, 'v1alpha/{+name}:listRevisions', options)
480
+ command.response_representation = Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentRevisionsResponse::Representation
481
+ command.response_class = Google::Apis::OsconfigV1alpha::ListOsPolicyAssignmentRevisionsResponse
482
+ command.params['name'] = name unless name.nil?
483
+ command.query['pageSize'] = page_size unless page_size.nil?
484
+ command.query['pageToken'] = page_token unless page_token.nil?
485
+ command.query['fields'] = fields unless fields.nil?
486
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
487
+ execute_or_queue_command(command, &block)
488
+ end
489
+
490
+ # Update an existing OS policy assignment. This method creates a new revision of
491
+ # the OS policy assignment. This method returns a long running operation (LRO)
492
+ # that contains the rollout details. The rollout can be cancelled by cancelling
493
+ # the LRO. For more information, see [Method: projects.locations.
494
+ # osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/
495
+ # osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel)
496
+ # .
497
+ # @param [String] name
498
+ # Resource name. Format: `projects/`project_number`/locations/`location`/
499
+ # osPolicyAssignments/`os_policy_assignment_id`` This field is ignored when you
500
+ # create an OS policy assignment.
501
+ # @param [Google::Apis::OsconfigV1alpha::OsPolicyAssignment] os_policy_assignment_object
502
+ # @param [String] update_mask
503
+ # Optional. Field mask that controls which fields of the assignment should be
504
+ # updated.
505
+ # @param [String] fields
506
+ # Selector specifying which fields to include in a partial response.
507
+ # @param [String] quota_user
508
+ # Available to use for quota purposes for server-side applications. Can be any
509
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
510
+ # @param [Google::Apis::RequestOptions] options
511
+ # Request-specific options
512
+ #
513
+ # @yield [result, err] Result & error if block supplied
514
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Operation] parsed result object
515
+ # @yieldparam err [StandardError] error object if request failed
516
+ #
517
+ # @return [Google::Apis::OsconfigV1alpha::Operation]
518
+ #
519
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
520
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
521
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
522
+ def patch_project_location_os_policy_assignment(name, os_policy_assignment_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
523
+ command = make_simple_command(:patch, 'v1alpha/{+name}', options)
524
+ command.request_representation = Google::Apis::OsconfigV1alpha::OsPolicyAssignment::Representation
525
+ command.request_object = os_policy_assignment_object
526
+ command.response_representation = Google::Apis::OsconfigV1alpha::Operation::Representation
527
+ command.response_class = Google::Apis::OsconfigV1alpha::Operation
528
+ command.params['name'] = name unless name.nil?
529
+ command.query['updateMask'] = update_mask unless update_mask.nil?
530
+ command.query['fields'] = fields unless fields.nil?
531
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
532
+ execute_or_queue_command(command, &block)
533
+ end
534
+
535
+ # Starts asynchronous cancellation on a long-running operation. The server makes
536
+ # a best effort to cancel the operation, but success is not guaranteed. If the
537
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
538
+ # Clients can use Operations.GetOperation or other methods to check whether the
539
+ # cancellation succeeded or whether the operation completed despite cancellation.
540
+ # On successful cancellation, the operation is not deleted; instead, it becomes
541
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
542
+ # corresponding to `Code.CANCELLED`.
543
+ # @param [String] name
544
+ # The name of the operation resource to be cancelled.
545
+ # @param [Google::Apis::OsconfigV1alpha::CancelOperationRequest] cancel_operation_request_object
546
+ # @param [String] fields
547
+ # Selector specifying which fields to include in a partial response.
548
+ # @param [String] quota_user
549
+ # Available to use for quota purposes for server-side applications. Can be any
550
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
551
+ # @param [Google::Apis::RequestOptions] options
552
+ # Request-specific options
553
+ #
554
+ # @yield [result, err] Result & error if block supplied
555
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Empty] parsed result object
556
+ # @yieldparam err [StandardError] error object if request failed
557
+ #
558
+ # @return [Google::Apis::OsconfigV1alpha::Empty]
559
+ #
560
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
561
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
562
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
563
+ def cancel_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
564
+ command = make_simple_command(:post, 'v1alpha/{+name}:cancel', options)
565
+ command.request_representation = Google::Apis::OsconfigV1alpha::CancelOperationRequest::Representation
566
+ command.request_object = cancel_operation_request_object
567
+ command.response_representation = Google::Apis::OsconfigV1alpha::Empty::Representation
568
+ command.response_class = Google::Apis::OsconfigV1alpha::Empty
569
+ command.params['name'] = name unless name.nil?
570
+ command.query['fields'] = fields unless fields.nil?
571
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
572
+ execute_or_queue_command(command, &block)
573
+ end
574
+
575
+ # Gets the latest state of a long-running operation. Clients can use this method
576
+ # to poll the operation result at intervals as recommended by the API service.
577
+ # @param [String] name
578
+ # The name of the operation resource.
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # Available to use for quota purposes for server-side applications. Can be any
583
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
584
+ # @param [Google::Apis::RequestOptions] options
585
+ # Request-specific options
586
+ #
587
+ # @yield [result, err] Result & error if block supplied
588
+ # @yieldparam result [Google::Apis::OsconfigV1alpha::Operation] parsed result object
589
+ # @yieldparam err [StandardError] error object if request failed
590
+ #
591
+ # @return [Google::Apis::OsconfigV1alpha::Operation]
592
+ #
593
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
594
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
595
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
596
+ def get_project_location_os_policy_assignment_operation(name, fields: nil, quota_user: nil, options: nil, &block)
597
+ command = make_simple_command(:get, 'v1alpha/{+name}', options)
598
+ command.response_representation = Google::Apis::OsconfigV1alpha::Operation::Representation
599
+ command.response_class = Google::Apis::OsconfigV1alpha::Operation
600
+ command.params['name'] = name unless name.nil?
601
+ command.query['fields'] = fields unless fields.nil?
602
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
603
+ execute_or_queue_command(command, &block)
604
+ end
605
+
606
+ protected
607
+
608
+ def apply_command_defaults(command)
609
+ command.query['key'] = key unless key.nil?
610
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
611
+ end
612
+ end
613
+ end
614
+ end
615
+ end