google-cloud-os_config-v1 0.11.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/README.md +3 -3
  4. data/lib/google/cloud/os_config/v1/os_config_service/client.rb +18 -22
  5. data/lib/google/cloud/os_config/v1/os_config_service/rest/client.rb +1183 -0
  6. data/lib/google/cloud/os_config/v1/os_config_service/rest/service_stub.rb +762 -0
  7. data/lib/google/cloud/os_config/v1/os_config_service/rest.rb +55 -0
  8. data/lib/google/cloud/os_config/v1/os_config_service.rb +7 -1
  9. data/lib/google/cloud/os_config/v1/os_config_zonal_service/client.rb +38 -46
  10. data/lib/google/cloud/os_config/v1/os_config_zonal_service/operations.rb +17 -17
  11. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/client.rb +1284 -0
  12. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/operations.rb +795 -0
  13. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub.rb +758 -0
  14. data/lib/google/cloud/os_config/v1/os_config_zonal_service/rest.rb +56 -0
  15. data/lib/google/cloud/os_config/v1/os_config_zonal_service.rb +7 -1
  16. data/lib/google/cloud/os_config/v1/rest.rb +38 -0
  17. data/lib/google/cloud/os_config/v1/version.rb +1 -1
  18. data/lib/google/cloud/os_config/v1.rb +7 -2
  19. data/lib/google/cloud/osconfig/v1/inventory_pb.rb +26 -109
  20. data/lib/google/cloud/osconfig/v1/os_policy_assignment_reports_pb.rb +25 -61
  21. data/lib/google/cloud/osconfig/v1/os_policy_assignments_pb.rb +29 -93
  22. data/lib/google/cloud/osconfig/v1/os_policy_pb.rb +24 -158
  23. data/lib/google/cloud/osconfig/v1/osconfig_common_pb.rb +24 -7
  24. data/lib/google/cloud/osconfig/v1/osconfig_service_pb.rb +25 -2
  25. data/lib/google/cloud/osconfig/v1/osconfig_zonal_service_pb.rb +25 -2
  26. data/lib/google/cloud/osconfig/v1/patch_deployments_pb.rb +30 -88
  27. data/lib/google/cloud/osconfig/v1/patch_jobs_pb.rb +27 -209
  28. data/lib/google/cloud/osconfig/v1/vulnerability_pb.rb +25 -92
  29. data/proto_docs/google/api/client.rb +381 -0
  30. data/proto_docs/google/api/launch_stage.rb +71 -0
  31. data/proto_docs/google/protobuf/any.rb +7 -4
  32. data/proto_docs/google/protobuf/empty.rb +0 -2
  33. data/proto_docs/google/protobuf/timestamp.rb +1 -3
  34. data/proto_docs/google/rpc/status.rb +4 -2
  35. metadata +19 -8
@@ -0,0 +1,1284 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/osconfig/v1/osconfig_zonal_service_pb"
21
+ require "google/cloud/os_config/v1/os_config_zonal_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module OsConfig
26
+ module V1
27
+ module OsConfigZonalService
28
+ module Rest
29
+ ##
30
+ # REST client for the OsConfigZonalService service.
31
+ #
32
+ # Zonal OS Config API
33
+ #
34
+ # The OS Config service is the server-side component that allows users to
35
+ # manage package installations and patch jobs for Compute Engine VM instances.
36
+ #
37
+ class Client
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :os_config_zonal_service_stub
42
+
43
+ ##
44
+ # Configure the OsConfigZonalService Client class.
45
+ #
46
+ # See {::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all OsConfigZonalService clients
52
+ # ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "OsConfig", "V1"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config.timeout = 60.0
73
+ default_config.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config
78
+ end
79
+ yield @configure if block_given?
80
+ @configure
81
+ end
82
+
83
+ ##
84
+ # Configure the OsConfigZonalService Client instance.
85
+ #
86
+ # The configuration is set to the derived mode, meaning that values can be changed,
87
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
88
+ # should be made on {Client.configure}.
89
+ #
90
+ # See {::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client::Configuration}
91
+ # for a description of the configuration fields.
92
+ #
93
+ # @yield [config] Configure the Client client.
94
+ # @yieldparam config [Client::Configuration]
95
+ #
96
+ # @return [Client::Configuration]
97
+ #
98
+ def configure
99
+ yield @config if block_given?
100
+ @config
101
+ end
102
+
103
+ ##
104
+ # Create a new OsConfigZonalService REST client object.
105
+ #
106
+ # @example
107
+ #
108
+ # # Create a client using the default configuration
109
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new
110
+ #
111
+ # # Create a client using a custom configuration
112
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new do |config|
113
+ # config.timeout = 10.0
114
+ # end
115
+ #
116
+ # @yield [config] Configure the OsConfigZonalService client.
117
+ # @yieldparam config [Client::Configuration]
118
+ #
119
+ def initialize
120
+ # Create the configuration object
121
+ @config = Configuration.new Client.configure
122
+
123
+ # Yield the configuration if needed
124
+ yield @config if block_given?
125
+
126
+ # Create credentials
127
+ credentials = @config.credentials
128
+ # Use self-signed JWT if the endpoint is unchanged from default,
129
+ # but only if the default endpoint does not have a region prefix.
130
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
131
+ !@config.endpoint.split(".").first.include?("-")
132
+ credentials ||= Credentials.default scope: @config.scope,
133
+ enable_self_signed_jwt: enable_self_signed_jwt
134
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
135
+ credentials = Credentials.new credentials, scope: @config.scope
136
+ end
137
+
138
+ @quota_project_id = @config.quota_project
139
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
+
141
+ @operations_client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Operations.new do |config|
142
+ config.credentials = credentials
143
+ config.quota_project = @quota_project_id
144
+ config.endpoint = @config.endpoint
145
+ end
146
+
147
+ @os_config_zonal_service_stub = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ end
149
+
150
+ ##
151
+ # Get the associated client for long-running operations.
152
+ #
153
+ # @return [::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Operations]
154
+ #
155
+ attr_reader :operations_client
156
+
157
+ # Service calls
158
+
159
+ ##
160
+ # Create an OS policy assignment.
161
+ #
162
+ # This method also creates the first revision of the OS policy assignment.
163
+ #
164
+ # This method returns a long running operation (LRO) that contains the
165
+ # rollout details. The rollout can be cancelled by cancelling the LRO.
166
+ #
167
+ # For more information, see [Method:
168
+ # projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
169
+ #
170
+ # @overload create_os_policy_assignment(request, options = nil)
171
+ # Pass arguments to `create_os_policy_assignment` via a request object, either of type
172
+ # {::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest} or an equivalent Hash.
173
+ #
174
+ # @param request [::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest, ::Hash]
175
+ # A request object representing the call parameters. Required. To specify no
176
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
177
+ # @param options [::Gapic::CallOptions, ::Hash]
178
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
179
+ #
180
+ # @overload create_os_policy_assignment(parent: nil, os_policy_assignment: nil, os_policy_assignment_id: nil)
181
+ # Pass arguments to `create_os_policy_assignment` via keyword arguments. Note that at
182
+ # least one keyword argument is required. To specify no parameters, or to keep all
183
+ # the default parameter values, pass an empty Hash as a request object (see above).
184
+ #
185
+ # @param parent [::String]
186
+ # Required. The parent resource name in the form:
187
+ # projects/\\{project}/locations/\\{location}
188
+ # @param os_policy_assignment [::Google::Cloud::OsConfig::V1::OSPolicyAssignment, ::Hash]
189
+ # Required. The OS policy assignment to be created.
190
+ # @param os_policy_assignment_id [::String]
191
+ # Required. The logical name of the OS policy assignment in the project
192
+ # with the following restrictions:
193
+ #
194
+ # * Must contain only lowercase letters, numbers, and hyphens.
195
+ # * Must start with a letter.
196
+ # * Must be between 1-63 characters.
197
+ # * Must end with a number or a letter.
198
+ # * Must be unique within the project.
199
+ # @yield [result, operation] Access the result along with the TransportOperation object
200
+ # @yieldparam result [::Gapic::Operation]
201
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
202
+ #
203
+ # @return [::Gapic::Operation]
204
+ #
205
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
206
+ def create_os_policy_assignment request, options = nil
207
+ raise ::ArgumentError, "request must be provided" if request.nil?
208
+
209
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest
210
+
211
+ # Converts hash and nil to an options object
212
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
213
+
214
+ # Customize the options with defaults
215
+ call_metadata = @config.rpcs.create_os_policy_assignment.metadata.to_h
216
+
217
+ # Set x-goog-api-client and x-goog-user-project headers
218
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
219
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
220
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
221
+ transports_version_send: [:rest]
222
+
223
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
224
+
225
+ options.apply_defaults timeout: @config.rpcs.create_os_policy_assignment.timeout,
226
+ metadata: call_metadata,
227
+ retry_policy: @config.rpcs.create_os_policy_assignment.retry_policy
228
+
229
+ options.apply_defaults timeout: @config.timeout,
230
+ metadata: @config.metadata,
231
+ retry_policy: @config.retry_policy
232
+
233
+ @os_config_zonal_service_stub.create_os_policy_assignment request, options do |result, operation|
234
+ result = ::Gapic::Operation.new result, @operations_client, options: options
235
+ yield result, operation if block_given?
236
+ return result
237
+ end
238
+ rescue ::Gapic::Rest::Error => e
239
+ raise ::Google::Cloud::Error.from_error(e)
240
+ end
241
+
242
+ ##
243
+ # Update an existing OS policy assignment.
244
+ #
245
+ # This method creates a new revision of the OS policy assignment.
246
+ #
247
+ # This method returns a long running operation (LRO) that contains the
248
+ # rollout details. The rollout can be cancelled by cancelling the LRO.
249
+ #
250
+ # For more information, see [Method:
251
+ # projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
252
+ #
253
+ # @overload update_os_policy_assignment(request, options = nil)
254
+ # Pass arguments to `update_os_policy_assignment` via a request object, either of type
255
+ # {::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest} or an equivalent Hash.
256
+ #
257
+ # @param request [::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest, ::Hash]
258
+ # A request object representing the call parameters. Required. To specify no
259
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
260
+ # @param options [::Gapic::CallOptions, ::Hash]
261
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
262
+ #
263
+ # @overload update_os_policy_assignment(os_policy_assignment: nil, update_mask: nil)
264
+ # Pass arguments to `update_os_policy_assignment` via keyword arguments. Note that at
265
+ # least one keyword argument is required. To specify no parameters, or to keep all
266
+ # the default parameter values, pass an empty Hash as a request object (see above).
267
+ #
268
+ # @param os_policy_assignment [::Google::Cloud::OsConfig::V1::OSPolicyAssignment, ::Hash]
269
+ # Required. The updated OS policy assignment.
270
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
271
+ # Optional. Field mask that controls which fields of the assignment should be
272
+ # updated.
273
+ # @yield [result, operation] Access the result along with the TransportOperation object
274
+ # @yieldparam result [::Gapic::Operation]
275
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
276
+ #
277
+ # @return [::Gapic::Operation]
278
+ #
279
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
280
+ def update_os_policy_assignment request, options = nil
281
+ raise ::ArgumentError, "request must be provided" if request.nil?
282
+
283
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest
284
+
285
+ # Converts hash and nil to an options object
286
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
287
+
288
+ # Customize the options with defaults
289
+ call_metadata = @config.rpcs.update_os_policy_assignment.metadata.to_h
290
+
291
+ # Set x-goog-api-client and x-goog-user-project headers
292
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
293
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
294
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
295
+ transports_version_send: [:rest]
296
+
297
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
298
+
299
+ options.apply_defaults timeout: @config.rpcs.update_os_policy_assignment.timeout,
300
+ metadata: call_metadata,
301
+ retry_policy: @config.rpcs.update_os_policy_assignment.retry_policy
302
+
303
+ options.apply_defaults timeout: @config.timeout,
304
+ metadata: @config.metadata,
305
+ retry_policy: @config.retry_policy
306
+
307
+ @os_config_zonal_service_stub.update_os_policy_assignment request, options do |result, operation|
308
+ result = ::Gapic::Operation.new result, @operations_client, options: options
309
+ yield result, operation if block_given?
310
+ return result
311
+ end
312
+ rescue ::Gapic::Rest::Error => e
313
+ raise ::Google::Cloud::Error.from_error(e)
314
+ end
315
+
316
+ ##
317
+ # Retrieve an existing OS policy assignment.
318
+ #
319
+ # This method always returns the latest revision. In order to retrieve a
320
+ # previous revision of the assignment, also provide the revision ID in the
321
+ # `name` parameter.
322
+ #
323
+ # @overload get_os_policy_assignment(request, options = nil)
324
+ # Pass arguments to `get_os_policy_assignment` via a request object, either of type
325
+ # {::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
332
+ #
333
+ # @overload get_os_policy_assignment(name: nil)
334
+ # Pass arguments to `get_os_policy_assignment` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param name [::String]
339
+ # Required. The resource name of OS policy assignment.
340
+ #
341
+ # Format:
342
+ # `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}`
343
+ # @yield [result, operation] Access the result along with the TransportOperation object
344
+ # @yieldparam result [::Google::Cloud::OsConfig::V1::OSPolicyAssignment]
345
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
346
+ #
347
+ # @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignment]
348
+ #
349
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
350
+ def get_os_policy_assignment request, options = nil
351
+ raise ::ArgumentError, "request must be provided" if request.nil?
352
+
353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest
354
+
355
+ # Converts hash and nil to an options object
356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
357
+
358
+ # Customize the options with defaults
359
+ call_metadata = @config.rpcs.get_os_policy_assignment.metadata.to_h
360
+
361
+ # Set x-goog-api-client and x-goog-user-project headers
362
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
364
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
365
+ transports_version_send: [:rest]
366
+
367
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
368
+
369
+ options.apply_defaults timeout: @config.rpcs.get_os_policy_assignment.timeout,
370
+ metadata: call_metadata,
371
+ retry_policy: @config.rpcs.get_os_policy_assignment.retry_policy
372
+
373
+ options.apply_defaults timeout: @config.timeout,
374
+ metadata: @config.metadata,
375
+ retry_policy: @config.retry_policy
376
+
377
+ @os_config_zonal_service_stub.get_os_policy_assignment request, options do |result, operation|
378
+ yield result, operation if block_given?
379
+ return result
380
+ end
381
+ rescue ::Gapic::Rest::Error => e
382
+ raise ::Google::Cloud::Error.from_error(e)
383
+ end
384
+
385
+ ##
386
+ # List the OS policy assignments under the parent resource.
387
+ #
388
+ # For each OS policy assignment, the latest revision is returned.
389
+ #
390
+ # @overload list_os_policy_assignments(request, options = nil)
391
+ # Pass arguments to `list_os_policy_assignments` via a request object, either of type
392
+ # {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest} or an equivalent Hash.
393
+ #
394
+ # @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest, ::Hash]
395
+ # A request object representing the call parameters. Required. To specify no
396
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
397
+ # @param options [::Gapic::CallOptions, ::Hash]
398
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
399
+ #
400
+ # @overload list_os_policy_assignments(parent: nil, page_size: nil, page_token: nil)
401
+ # Pass arguments to `list_os_policy_assignments` via keyword arguments. Note that at
402
+ # least one keyword argument is required. To specify no parameters, or to keep all
403
+ # the default parameter values, pass an empty Hash as a request object (see above).
404
+ #
405
+ # @param parent [::String]
406
+ # Required. The parent resource name.
407
+ # @param page_size [::Integer]
408
+ # The maximum number of assignments to return.
409
+ # @param page_token [::String]
410
+ # A pagination token returned from a previous call to
411
+ # `ListOSPolicyAssignments` that indicates where this listing should continue
412
+ # from.
413
+ # @yield [result, operation] Access the result along with the TransportOperation object
414
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
415
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
416
+ #
417
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
418
+ #
419
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
420
+ def list_os_policy_assignments request, options = nil
421
+ raise ::ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ call_metadata = @config.rpcs.list_os_policy_assignments.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
435
+ transports_version_send: [:rest]
436
+
437
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
438
+
439
+ options.apply_defaults timeout: @config.rpcs.list_os_policy_assignments.timeout,
440
+ metadata: call_metadata,
441
+ retry_policy: @config.rpcs.list_os_policy_assignments.retry_policy
442
+
443
+ options.apply_defaults timeout: @config.timeout,
444
+ metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @os_config_zonal_service_stub.list_os_policy_assignments request, options do |result, operation|
448
+ result = ::Gapic::Rest::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignments, "os_policy_assignments", request, result, options
449
+ yield result, operation if block_given?
450
+ return result
451
+ end
452
+ rescue ::Gapic::Rest::Error => e
453
+ raise ::Google::Cloud::Error.from_error(e)
454
+ end
455
+
456
+ ##
457
+ # List the OS policy assignment revisions for a given OS policy assignment.
458
+ #
459
+ # @overload list_os_policy_assignment_revisions(request, options = nil)
460
+ # Pass arguments to `list_os_policy_assignment_revisions` via a request object, either of type
461
+ # {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest} or an equivalent Hash.
462
+ #
463
+ # @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest, ::Hash]
464
+ # A request object representing the call parameters. Required. To specify no
465
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
466
+ # @param options [::Gapic::CallOptions, ::Hash]
467
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
468
+ #
469
+ # @overload list_os_policy_assignment_revisions(name: nil, page_size: nil, page_token: nil)
470
+ # Pass arguments to `list_os_policy_assignment_revisions` via keyword arguments. Note that at
471
+ # least one keyword argument is required. To specify no parameters, or to keep all
472
+ # the default parameter values, pass an empty Hash as a request object (see above).
473
+ #
474
+ # @param name [::String]
475
+ # Required. The name of the OS policy assignment to list revisions for.
476
+ # @param page_size [::Integer]
477
+ # The maximum number of revisions to return.
478
+ # @param page_token [::String]
479
+ # A pagination token returned from a previous call to
480
+ # `ListOSPolicyAssignmentRevisions` that indicates where this listing should
481
+ # continue from.
482
+ # @yield [result, operation] Access the result along with the TransportOperation object
483
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
484
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
485
+ #
486
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
487
+ #
488
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
489
+ def list_os_policy_assignment_revisions request, options = nil
490
+ raise ::ArgumentError, "request must be provided" if request.nil?
491
+
492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest
493
+
494
+ # Converts hash and nil to an options object
495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
496
+
497
+ # Customize the options with defaults
498
+ call_metadata = @config.rpcs.list_os_policy_assignment_revisions.metadata.to_h
499
+
500
+ # Set x-goog-api-client and x-goog-user-project headers
501
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
503
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
504
+ transports_version_send: [:rest]
505
+
506
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
+
508
+ options.apply_defaults timeout: @config.rpcs.list_os_policy_assignment_revisions.timeout,
509
+ metadata: call_metadata,
510
+ retry_policy: @config.rpcs.list_os_policy_assignment_revisions.retry_policy
511
+
512
+ options.apply_defaults timeout: @config.timeout,
513
+ metadata: @config.metadata,
514
+ retry_policy: @config.retry_policy
515
+
516
+ @os_config_zonal_service_stub.list_os_policy_assignment_revisions request, options do |result, operation|
517
+ result = ::Gapic::Rest::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignment_revisions, "os_policy_assignments", request, result, options
518
+ yield result, operation if block_given?
519
+ return result
520
+ end
521
+ rescue ::Gapic::Rest::Error => e
522
+ raise ::Google::Cloud::Error.from_error(e)
523
+ end
524
+
525
+ ##
526
+ # Delete the OS policy assignment.
527
+ #
528
+ # This method creates a new revision of the OS policy assignment.
529
+ #
530
+ # This method returns a long running operation (LRO) that contains the
531
+ # rollout details. The rollout can be cancelled by cancelling the LRO.
532
+ #
533
+ # If the LRO completes and is not cancelled, all revisions associated with
534
+ # the OS policy assignment are deleted.
535
+ #
536
+ # For more information, see [Method:
537
+ # projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
538
+ #
539
+ # @overload delete_os_policy_assignment(request, options = nil)
540
+ # Pass arguments to `delete_os_policy_assignment` via a request object, either of type
541
+ # {::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest} or an equivalent Hash.
542
+ #
543
+ # @param request [::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest, ::Hash]
544
+ # A request object representing the call parameters. Required. To specify no
545
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
546
+ # @param options [::Gapic::CallOptions, ::Hash]
547
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
548
+ #
549
+ # @overload delete_os_policy_assignment(name: nil)
550
+ # Pass arguments to `delete_os_policy_assignment` via keyword arguments. Note that at
551
+ # least one keyword argument is required. To specify no parameters, or to keep all
552
+ # the default parameter values, pass an empty Hash as a request object (see above).
553
+ #
554
+ # @param name [::String]
555
+ # Required. The name of the OS policy assignment to be deleted
556
+ # @yield [result, operation] Access the result along with the TransportOperation object
557
+ # @yieldparam result [::Gapic::Operation]
558
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
559
+ #
560
+ # @return [::Gapic::Operation]
561
+ #
562
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
563
+ def delete_os_policy_assignment request, options = nil
564
+ raise ::ArgumentError, "request must be provided" if request.nil?
565
+
566
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest
567
+
568
+ # Converts hash and nil to an options object
569
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
570
+
571
+ # Customize the options with defaults
572
+ call_metadata = @config.rpcs.delete_os_policy_assignment.metadata.to_h
573
+
574
+ # Set x-goog-api-client and x-goog-user-project headers
575
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
576
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
577
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
578
+ transports_version_send: [:rest]
579
+
580
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
581
+
582
+ options.apply_defaults timeout: @config.rpcs.delete_os_policy_assignment.timeout,
583
+ metadata: call_metadata,
584
+ retry_policy: @config.rpcs.delete_os_policy_assignment.retry_policy
585
+
586
+ options.apply_defaults timeout: @config.timeout,
587
+ metadata: @config.metadata,
588
+ retry_policy: @config.retry_policy
589
+
590
+ @os_config_zonal_service_stub.delete_os_policy_assignment request, options do |result, operation|
591
+ result = ::Gapic::Operation.new result, @operations_client, options: options
592
+ yield result, operation if block_given?
593
+ return result
594
+ end
595
+ rescue ::Gapic::Rest::Error => e
596
+ raise ::Google::Cloud::Error.from_error(e)
597
+ end
598
+
599
+ ##
600
+ # Get the OS policy asssignment report for the specified Compute Engine VM
601
+ # instance.
602
+ #
603
+ # @overload get_os_policy_assignment_report(request, options = nil)
604
+ # Pass arguments to `get_os_policy_assignment_report` via a request object, either of type
605
+ # {::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest} or an equivalent Hash.
606
+ #
607
+ # @param request [::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest, ::Hash]
608
+ # A request object representing the call parameters. Required. To specify no
609
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
610
+ # @param options [::Gapic::CallOptions, ::Hash]
611
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
612
+ #
613
+ # @overload get_os_policy_assignment_report(name: nil)
614
+ # Pass arguments to `get_os_policy_assignment_report` via keyword arguments. Note that at
615
+ # least one keyword argument is required. To specify no parameters, or to keep all
616
+ # the default parameter values, pass an empty Hash as a request object (see above).
617
+ #
618
+ # @param name [::String]
619
+ # Required. API resource name for OS policy assignment report.
620
+ #
621
+ # Format:
622
+ # `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report`
623
+ #
624
+ # For `{project}`, either `project-number` or `project-id` can be provided.
625
+ # For `{instance_id}`, either Compute Engine `instance-id` or `instance-name`
626
+ # can be provided.
627
+ # For `{assignment_id}`, the OSPolicyAssignment id must be provided.
628
+ # @yield [result, operation] Access the result along with the TransportOperation object
629
+ # @yieldparam result [::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport]
630
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
631
+ #
632
+ # @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport]
633
+ #
634
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
635
+ def get_os_policy_assignment_report request, options = nil
636
+ raise ::ArgumentError, "request must be provided" if request.nil?
637
+
638
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest
639
+
640
+ # Converts hash and nil to an options object
641
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
642
+
643
+ # Customize the options with defaults
644
+ call_metadata = @config.rpcs.get_os_policy_assignment_report.metadata.to_h
645
+
646
+ # Set x-goog-api-client and x-goog-user-project headers
647
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
648
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
649
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
650
+ transports_version_send: [:rest]
651
+
652
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
653
+
654
+ options.apply_defaults timeout: @config.rpcs.get_os_policy_assignment_report.timeout,
655
+ metadata: call_metadata,
656
+ retry_policy: @config.rpcs.get_os_policy_assignment_report.retry_policy
657
+
658
+ options.apply_defaults timeout: @config.timeout,
659
+ metadata: @config.metadata,
660
+ retry_policy: @config.retry_policy
661
+
662
+ @os_config_zonal_service_stub.get_os_policy_assignment_report request, options do |result, operation|
663
+ yield result, operation if block_given?
664
+ return result
665
+ end
666
+ rescue ::Gapic::Rest::Error => e
667
+ raise ::Google::Cloud::Error.from_error(e)
668
+ end
669
+
670
+ ##
671
+ # List OS policy asssignment reports for all Compute Engine VM instances in
672
+ # the specified zone.
673
+ #
674
+ # @overload list_os_policy_assignment_reports(request, options = nil)
675
+ # Pass arguments to `list_os_policy_assignment_reports` via a request object, either of type
676
+ # {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest} or an equivalent Hash.
677
+ #
678
+ # @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest, ::Hash]
679
+ # A request object representing the call parameters. Required. To specify no
680
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
681
+ # @param options [::Gapic::CallOptions, ::Hash]
682
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
683
+ #
684
+ # @overload list_os_policy_assignment_reports(parent: nil, page_size: nil, filter: nil, page_token: nil)
685
+ # Pass arguments to `list_os_policy_assignment_reports` via keyword arguments. Note that at
686
+ # least one keyword argument is required. To specify no parameters, or to keep all
687
+ # the default parameter values, pass an empty Hash as a request object (see above).
688
+ #
689
+ # @param parent [::String]
690
+ # Required. The parent resource name.
691
+ #
692
+ # Format:
693
+ # `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports`
694
+ #
695
+ # For `{project}`, either `project-number` or `project-id` can be provided.
696
+ # For `{instance}`, either `instance-name`, `instance-id`, or `-` can be
697
+ # provided. If '-' is provided, the response will include
698
+ # OSPolicyAssignmentReports for all instances in the project/location.
699
+ # For `{assignment}`, either `assignment-id` or `-` can be provided. If '-'
700
+ # is provided, the response will include OSPolicyAssignmentReports for all
701
+ # OSPolicyAssignments in the project/location.
702
+ # Either \\{instance} or \\{assignment} must be `-`.
703
+ #
704
+ # For example:
705
+ # `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports`
706
+ # returns all reports for the instance
707
+ # `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports`
708
+ # returns all the reports for the given assignment across all instances.
709
+ # `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports`
710
+ # returns all the reports for all assignments across all instances.
711
+ # @param page_size [::Integer]
712
+ # The maximum number of results to return.
713
+ # @param filter [::String]
714
+ # If provided, this field specifies the criteria that must be met by the
715
+ # `OSPolicyAssignmentReport` API resource that is included in the response.
716
+ # @param page_token [::String]
717
+ # A pagination token returned from a previous call to the
718
+ # `ListOSPolicyAssignmentReports` method that indicates where this listing
719
+ # should continue from.
720
+ # @yield [result, operation] Access the result along with the TransportOperation object
721
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport>]
722
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
723
+ #
724
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport>]
725
+ #
726
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
727
+ def list_os_policy_assignment_reports request, options = nil
728
+ raise ::ArgumentError, "request must be provided" if request.nil?
729
+
730
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest
731
+
732
+ # Converts hash and nil to an options object
733
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
734
+
735
+ # Customize the options with defaults
736
+ call_metadata = @config.rpcs.list_os_policy_assignment_reports.metadata.to_h
737
+
738
+ # Set x-goog-api-client and x-goog-user-project headers
739
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
740
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
741
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
742
+ transports_version_send: [:rest]
743
+
744
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
745
+
746
+ options.apply_defaults timeout: @config.rpcs.list_os_policy_assignment_reports.timeout,
747
+ metadata: call_metadata,
748
+ retry_policy: @config.rpcs.list_os_policy_assignment_reports.retry_policy
749
+
750
+ options.apply_defaults timeout: @config.timeout,
751
+ metadata: @config.metadata,
752
+ retry_policy: @config.retry_policy
753
+
754
+ @os_config_zonal_service_stub.list_os_policy_assignment_reports request, options do |result, operation|
755
+ result = ::Gapic::Rest::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignment_reports, "os_policy_assignment_reports", request, result, options
756
+ yield result, operation if block_given?
757
+ return result
758
+ end
759
+ rescue ::Gapic::Rest::Error => e
760
+ raise ::Google::Cloud::Error.from_error(e)
761
+ end
762
+
763
+ ##
764
+ # Get inventory data for the specified VM instance. If the VM has no
765
+ # associated inventory, the message `NOT_FOUND` is returned.
766
+ #
767
+ # @overload get_inventory(request, options = nil)
768
+ # Pass arguments to `get_inventory` via a request object, either of type
769
+ # {::Google::Cloud::OsConfig::V1::GetInventoryRequest} or an equivalent Hash.
770
+ #
771
+ # @param request [::Google::Cloud::OsConfig::V1::GetInventoryRequest, ::Hash]
772
+ # A request object representing the call parameters. Required. To specify no
773
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
774
+ # @param options [::Gapic::CallOptions, ::Hash]
775
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
776
+ #
777
+ # @overload get_inventory(name: nil, view: nil)
778
+ # Pass arguments to `get_inventory` via keyword arguments. Note that at
779
+ # least one keyword argument is required. To specify no parameters, or to keep all
780
+ # the default parameter values, pass an empty Hash as a request object (see above).
781
+ #
782
+ # @param name [::String]
783
+ # Required. API resource name for inventory resource.
784
+ #
785
+ # Format:
786
+ # `projects/{project}/locations/{location}/instances/{instance}/inventory`
787
+ #
788
+ # For `{project}`, either `project-number` or `project-id` can be provided.
789
+ # For `{instance}`, either Compute Engine `instance-id` or `instance-name`
790
+ # can be provided.
791
+ # @param view [::Google::Cloud::OsConfig::V1::InventoryView]
792
+ # Inventory view indicating what information should be included in the
793
+ # inventory resource. If unspecified, the default view is BASIC.
794
+ # @yield [result, operation] Access the result along with the TransportOperation object
795
+ # @yieldparam result [::Google::Cloud::OsConfig::V1::Inventory]
796
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
797
+ #
798
+ # @return [::Google::Cloud::OsConfig::V1::Inventory]
799
+ #
800
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
801
+ def get_inventory request, options = nil
802
+ raise ::ArgumentError, "request must be provided" if request.nil?
803
+
804
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetInventoryRequest
805
+
806
+ # Converts hash and nil to an options object
807
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
808
+
809
+ # Customize the options with defaults
810
+ call_metadata = @config.rpcs.get_inventory.metadata.to_h
811
+
812
+ # Set x-goog-api-client and x-goog-user-project headers
813
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
814
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
815
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
816
+ transports_version_send: [:rest]
817
+
818
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
819
+
820
+ options.apply_defaults timeout: @config.rpcs.get_inventory.timeout,
821
+ metadata: call_metadata,
822
+ retry_policy: @config.rpcs.get_inventory.retry_policy
823
+
824
+ options.apply_defaults timeout: @config.timeout,
825
+ metadata: @config.metadata,
826
+ retry_policy: @config.retry_policy
827
+
828
+ @os_config_zonal_service_stub.get_inventory request, options do |result, operation|
829
+ yield result, operation if block_given?
830
+ return result
831
+ end
832
+ rescue ::Gapic::Rest::Error => e
833
+ raise ::Google::Cloud::Error.from_error(e)
834
+ end
835
+
836
+ ##
837
+ # List inventory data for all VM instances in the specified zone.
838
+ #
839
+ # @overload list_inventories(request, options = nil)
840
+ # Pass arguments to `list_inventories` via a request object, either of type
841
+ # {::Google::Cloud::OsConfig::V1::ListInventoriesRequest} or an equivalent Hash.
842
+ #
843
+ # @param request [::Google::Cloud::OsConfig::V1::ListInventoriesRequest, ::Hash]
844
+ # A request object representing the call parameters. Required. To specify no
845
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
846
+ # @param options [::Gapic::CallOptions, ::Hash]
847
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
848
+ #
849
+ # @overload list_inventories(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil)
850
+ # Pass arguments to `list_inventories` via keyword arguments. Note that at
851
+ # least one keyword argument is required. To specify no parameters, or to keep all
852
+ # the default parameter values, pass an empty Hash as a request object (see above).
853
+ #
854
+ # @param parent [::String]
855
+ # Required. The parent resource name.
856
+ #
857
+ # Format: `projects/{project}/locations/{location}/instances/-`
858
+ #
859
+ # For `{project}`, either `project-number` or `project-id` can be provided.
860
+ # @param view [::Google::Cloud::OsConfig::V1::InventoryView]
861
+ # Inventory view indicating what information should be included in the
862
+ # inventory resource. If unspecified, the default view is BASIC.
863
+ # @param page_size [::Integer]
864
+ # The maximum number of results to return.
865
+ # @param page_token [::String]
866
+ # A pagination token returned from a previous call to
867
+ # `ListInventories` that indicates where this listing
868
+ # should continue from.
869
+ # @param filter [::String]
870
+ # If provided, this field specifies the criteria that must be met by a
871
+ # `Inventory` API resource to be included in the response.
872
+ # @yield [result, operation] Access the result along with the TransportOperation object
873
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::Inventory>]
874
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
875
+ #
876
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::Inventory>]
877
+ #
878
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
879
+ def list_inventories request, options = nil
880
+ raise ::ArgumentError, "request must be provided" if request.nil?
881
+
882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListInventoriesRequest
883
+
884
+ # Converts hash and nil to an options object
885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
886
+
887
+ # Customize the options with defaults
888
+ call_metadata = @config.rpcs.list_inventories.metadata.to_h
889
+
890
+ # Set x-goog-api-client and x-goog-user-project headers
891
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
893
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
894
+ transports_version_send: [:rest]
895
+
896
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
897
+
898
+ options.apply_defaults timeout: @config.rpcs.list_inventories.timeout,
899
+ metadata: call_metadata,
900
+ retry_policy: @config.rpcs.list_inventories.retry_policy
901
+
902
+ options.apply_defaults timeout: @config.timeout,
903
+ metadata: @config.metadata,
904
+ retry_policy: @config.retry_policy
905
+
906
+ @os_config_zonal_service_stub.list_inventories request, options do |result, operation|
907
+ result = ::Gapic::Rest::PagedEnumerable.new @os_config_zonal_service_stub, :list_inventories, "inventories", request, result, options
908
+ yield result, operation if block_given?
909
+ return result
910
+ end
911
+ rescue ::Gapic::Rest::Error => e
912
+ raise ::Google::Cloud::Error.from_error(e)
913
+ end
914
+
915
+ ##
916
+ # Gets the vulnerability report for the specified VM instance. Only VMs with
917
+ # inventory data have vulnerability reports associated with them.
918
+ #
919
+ # @overload get_vulnerability_report(request, options = nil)
920
+ # Pass arguments to `get_vulnerability_report` via a request object, either of type
921
+ # {::Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest} or an equivalent Hash.
922
+ #
923
+ # @param request [::Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest, ::Hash]
924
+ # A request object representing the call parameters. Required. To specify no
925
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
926
+ # @param options [::Gapic::CallOptions, ::Hash]
927
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
928
+ #
929
+ # @overload get_vulnerability_report(name: nil)
930
+ # Pass arguments to `get_vulnerability_report` via keyword arguments. Note that at
931
+ # least one keyword argument is required. To specify no parameters, or to keep all
932
+ # the default parameter values, pass an empty Hash as a request object (see above).
933
+ #
934
+ # @param name [::String]
935
+ # Required. API resource name for vulnerability resource.
936
+ #
937
+ # Format:
938
+ # `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
939
+ #
940
+ # For `{project}`, either `project-number` or `project-id` can be provided.
941
+ # For `{instance}`, either Compute Engine `instance-id` or `instance-name`
942
+ # can be provided.
943
+ # @yield [result, operation] Access the result along with the TransportOperation object
944
+ # @yieldparam result [::Google::Cloud::OsConfig::V1::VulnerabilityReport]
945
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
946
+ #
947
+ # @return [::Google::Cloud::OsConfig::V1::VulnerabilityReport]
948
+ #
949
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
950
+ def get_vulnerability_report request, options = nil
951
+ raise ::ArgumentError, "request must be provided" if request.nil?
952
+
953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest
954
+
955
+ # Converts hash and nil to an options object
956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
957
+
958
+ # Customize the options with defaults
959
+ call_metadata = @config.rpcs.get_vulnerability_report.metadata.to_h
960
+
961
+ # Set x-goog-api-client and x-goog-user-project headers
962
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
964
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
965
+ transports_version_send: [:rest]
966
+
967
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
968
+
969
+ options.apply_defaults timeout: @config.rpcs.get_vulnerability_report.timeout,
970
+ metadata: call_metadata,
971
+ retry_policy: @config.rpcs.get_vulnerability_report.retry_policy
972
+
973
+ options.apply_defaults timeout: @config.timeout,
974
+ metadata: @config.metadata,
975
+ retry_policy: @config.retry_policy
976
+
977
+ @os_config_zonal_service_stub.get_vulnerability_report request, options do |result, operation|
978
+ yield result, operation if block_given?
979
+ return result
980
+ end
981
+ rescue ::Gapic::Rest::Error => e
982
+ raise ::Google::Cloud::Error.from_error(e)
983
+ end
984
+
985
+ ##
986
+ # List vulnerability reports for all VM instances in the specified zone.
987
+ #
988
+ # @overload list_vulnerability_reports(request, options = nil)
989
+ # Pass arguments to `list_vulnerability_reports` via a request object, either of type
990
+ # {::Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest} or an equivalent Hash.
991
+ #
992
+ # @param request [::Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest, ::Hash]
993
+ # A request object representing the call parameters. Required. To specify no
994
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
995
+ # @param options [::Gapic::CallOptions, ::Hash]
996
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
997
+ #
998
+ # @overload list_vulnerability_reports(parent: nil, page_size: nil, page_token: nil, filter: nil)
999
+ # Pass arguments to `list_vulnerability_reports` via keyword arguments. Note that at
1000
+ # least one keyword argument is required. To specify no parameters, or to keep all
1001
+ # the default parameter values, pass an empty Hash as a request object (see above).
1002
+ #
1003
+ # @param parent [::String]
1004
+ # Required. The parent resource name.
1005
+ #
1006
+ # Format: `projects/{project}/locations/{location}/instances/-`
1007
+ #
1008
+ # For `{project}`, either `project-number` or `project-id` can be provided.
1009
+ # @param page_size [::Integer]
1010
+ # The maximum number of results to return.
1011
+ # @param page_token [::String]
1012
+ # A pagination token returned from a previous call to
1013
+ # `ListVulnerabilityReports` that indicates where this listing
1014
+ # should continue from.
1015
+ # @param filter [::String]
1016
+ # If provided, this field specifies the criteria that must be met by a
1017
+ # `vulnerabilityReport` API resource to be included in the response.
1018
+ # @yield [result, operation] Access the result along with the TransportOperation object
1019
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::VulnerabilityReport>]
1020
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1021
+ #
1022
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::OsConfig::V1::VulnerabilityReport>]
1023
+ #
1024
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1025
+ def list_vulnerability_reports request, options = nil
1026
+ raise ::ArgumentError, "request must be provided" if request.nil?
1027
+
1028
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest
1029
+
1030
+ # Converts hash and nil to an options object
1031
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1032
+
1033
+ # Customize the options with defaults
1034
+ call_metadata = @config.rpcs.list_vulnerability_reports.metadata.to_h
1035
+
1036
+ # Set x-goog-api-client and x-goog-user-project headers
1037
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1038
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1039
+ gapic_version: ::Google::Cloud::OsConfig::V1::VERSION,
1040
+ transports_version_send: [:rest]
1041
+
1042
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1043
+
1044
+ options.apply_defaults timeout: @config.rpcs.list_vulnerability_reports.timeout,
1045
+ metadata: call_metadata,
1046
+ retry_policy: @config.rpcs.list_vulnerability_reports.retry_policy
1047
+
1048
+ options.apply_defaults timeout: @config.timeout,
1049
+ metadata: @config.metadata,
1050
+ retry_policy: @config.retry_policy
1051
+
1052
+ @os_config_zonal_service_stub.list_vulnerability_reports request, options do |result, operation|
1053
+ result = ::Gapic::Rest::PagedEnumerable.new @os_config_zonal_service_stub, :list_vulnerability_reports, "vulnerability_reports", request, result, options
1054
+ yield result, operation if block_given?
1055
+ return result
1056
+ end
1057
+ rescue ::Gapic::Rest::Error => e
1058
+ raise ::Google::Cloud::Error.from_error(e)
1059
+ end
1060
+
1061
+ ##
1062
+ # Configuration class for the OsConfigZonalService REST API.
1063
+ #
1064
+ # This class represents the configuration for OsConfigZonalService REST,
1065
+ # providing control over timeouts, retry behavior, logging, transport
1066
+ # parameters, and other low-level controls. Certain parameters can also be
1067
+ # applied individually to specific RPCs. See
1068
+ # {::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client::Configuration::Rpcs}
1069
+ # for a list of RPCs that can be configured independently.
1070
+ #
1071
+ # Configuration can be applied globally to all clients, or to a single client
1072
+ # on construction.
1073
+ #
1074
+ # @example
1075
+ #
1076
+ # # Modify the global config, setting the timeout for
1077
+ # # create_os_policy_assignment to 20 seconds,
1078
+ # # and all remaining timeouts to 10 seconds.
1079
+ # ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.configure do |config|
1080
+ # config.timeout = 10.0
1081
+ # config.rpcs.create_os_policy_assignment.timeout = 20.0
1082
+ # end
1083
+ #
1084
+ # # Apply the above configuration only to a new client.
1085
+ # client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Rest::Client.new do |config|
1086
+ # config.timeout = 10.0
1087
+ # config.rpcs.create_os_policy_assignment.timeout = 20.0
1088
+ # end
1089
+ #
1090
+ # @!attribute [rw] endpoint
1091
+ # The hostname or hostname:port of the service endpoint.
1092
+ # Defaults to `"osconfig.googleapis.com"`.
1093
+ # @return [::String]
1094
+ # @!attribute [rw] credentials
1095
+ # Credentials to send with calls. You may provide any of the following types:
1096
+ # * (`String`) The path to a service account key file in JSON format
1097
+ # * (`Hash`) A service account key as a Hash
1098
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1099
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1100
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1101
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1102
+ # * (`nil`) indicating no credentials
1103
+ # @return [::Object]
1104
+ # @!attribute [rw] scope
1105
+ # The OAuth scopes
1106
+ # @return [::Array<::String>]
1107
+ # @!attribute [rw] lib_name
1108
+ # The library name as recorded in instrumentation and logging
1109
+ # @return [::String]
1110
+ # @!attribute [rw] lib_version
1111
+ # The library version as recorded in instrumentation and logging
1112
+ # @return [::String]
1113
+ # @!attribute [rw] timeout
1114
+ # The call timeout in seconds.
1115
+ # @return [::Numeric]
1116
+ # @!attribute [rw] metadata
1117
+ # Additional headers to be sent with the call.
1118
+ # @return [::Hash{::Symbol=>::String}]
1119
+ # @!attribute [rw] retry_policy
1120
+ # The retry policy. The value is a hash with the following keys:
1121
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1122
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1123
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1124
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1125
+ # trigger a retry.
1126
+ # @return [::Hash]
1127
+ # @!attribute [rw] quota_project
1128
+ # A separate project against which to charge quota.
1129
+ # @return [::String]
1130
+ #
1131
+ class Configuration
1132
+ extend ::Gapic::Config
1133
+
1134
+ DEFAULT_ENDPOINT = "osconfig.googleapis.com"
1135
+
1136
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1137
+ config_attr :credentials, nil do |value|
1138
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1139
+ allowed.any? { |klass| klass === value }
1140
+ end
1141
+ config_attr :scope, nil, ::String, ::Array, nil
1142
+ config_attr :lib_name, nil, ::String, nil
1143
+ config_attr :lib_version, nil, ::String, nil
1144
+ config_attr :timeout, nil, ::Numeric, nil
1145
+ config_attr :metadata, nil, ::Hash, nil
1146
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1147
+ config_attr :quota_project, nil, ::String, nil
1148
+
1149
+ # @private
1150
+ def initialize parent_config = nil
1151
+ @parent_config = parent_config unless parent_config.nil?
1152
+
1153
+ yield self if block_given?
1154
+ end
1155
+
1156
+ ##
1157
+ # Configurations for individual RPCs
1158
+ # @return [Rpcs]
1159
+ #
1160
+ def rpcs
1161
+ @rpcs ||= begin
1162
+ parent_rpcs = nil
1163
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1164
+ Rpcs.new parent_rpcs
1165
+ end
1166
+ end
1167
+
1168
+ ##
1169
+ # Configuration RPC class for the OsConfigZonalService API.
1170
+ #
1171
+ # Includes fields providing the configuration for each RPC in this service.
1172
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1173
+ # the following configuration fields:
1174
+ #
1175
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1176
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1177
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1178
+ # include the following keys:
1179
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1180
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1181
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1182
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1183
+ # trigger a retry.
1184
+ #
1185
+ class Rpcs
1186
+ ##
1187
+ # RPC-specific configuration for `create_os_policy_assignment`
1188
+ # @return [::Gapic::Config::Method]
1189
+ #
1190
+ attr_reader :create_os_policy_assignment
1191
+ ##
1192
+ # RPC-specific configuration for `update_os_policy_assignment`
1193
+ # @return [::Gapic::Config::Method]
1194
+ #
1195
+ attr_reader :update_os_policy_assignment
1196
+ ##
1197
+ # RPC-specific configuration for `get_os_policy_assignment`
1198
+ # @return [::Gapic::Config::Method]
1199
+ #
1200
+ attr_reader :get_os_policy_assignment
1201
+ ##
1202
+ # RPC-specific configuration for `list_os_policy_assignments`
1203
+ # @return [::Gapic::Config::Method]
1204
+ #
1205
+ attr_reader :list_os_policy_assignments
1206
+ ##
1207
+ # RPC-specific configuration for `list_os_policy_assignment_revisions`
1208
+ # @return [::Gapic::Config::Method]
1209
+ #
1210
+ attr_reader :list_os_policy_assignment_revisions
1211
+ ##
1212
+ # RPC-specific configuration for `delete_os_policy_assignment`
1213
+ # @return [::Gapic::Config::Method]
1214
+ #
1215
+ attr_reader :delete_os_policy_assignment
1216
+ ##
1217
+ # RPC-specific configuration for `get_os_policy_assignment_report`
1218
+ # @return [::Gapic::Config::Method]
1219
+ #
1220
+ attr_reader :get_os_policy_assignment_report
1221
+ ##
1222
+ # RPC-specific configuration for `list_os_policy_assignment_reports`
1223
+ # @return [::Gapic::Config::Method]
1224
+ #
1225
+ attr_reader :list_os_policy_assignment_reports
1226
+ ##
1227
+ # RPC-specific configuration for `get_inventory`
1228
+ # @return [::Gapic::Config::Method]
1229
+ #
1230
+ attr_reader :get_inventory
1231
+ ##
1232
+ # RPC-specific configuration for `list_inventories`
1233
+ # @return [::Gapic::Config::Method]
1234
+ #
1235
+ attr_reader :list_inventories
1236
+ ##
1237
+ # RPC-specific configuration for `get_vulnerability_report`
1238
+ # @return [::Gapic::Config::Method]
1239
+ #
1240
+ attr_reader :get_vulnerability_report
1241
+ ##
1242
+ # RPC-specific configuration for `list_vulnerability_reports`
1243
+ # @return [::Gapic::Config::Method]
1244
+ #
1245
+ attr_reader :list_vulnerability_reports
1246
+
1247
+ # @private
1248
+ def initialize parent_rpcs = nil
1249
+ create_os_policy_assignment_config = parent_rpcs.create_os_policy_assignment if parent_rpcs.respond_to? :create_os_policy_assignment
1250
+ @create_os_policy_assignment = ::Gapic::Config::Method.new create_os_policy_assignment_config
1251
+ update_os_policy_assignment_config = parent_rpcs.update_os_policy_assignment if parent_rpcs.respond_to? :update_os_policy_assignment
1252
+ @update_os_policy_assignment = ::Gapic::Config::Method.new update_os_policy_assignment_config
1253
+ get_os_policy_assignment_config = parent_rpcs.get_os_policy_assignment if parent_rpcs.respond_to? :get_os_policy_assignment
1254
+ @get_os_policy_assignment = ::Gapic::Config::Method.new get_os_policy_assignment_config
1255
+ list_os_policy_assignments_config = parent_rpcs.list_os_policy_assignments if parent_rpcs.respond_to? :list_os_policy_assignments
1256
+ @list_os_policy_assignments = ::Gapic::Config::Method.new list_os_policy_assignments_config
1257
+ list_os_policy_assignment_revisions_config = parent_rpcs.list_os_policy_assignment_revisions if parent_rpcs.respond_to? :list_os_policy_assignment_revisions
1258
+ @list_os_policy_assignment_revisions = ::Gapic::Config::Method.new list_os_policy_assignment_revisions_config
1259
+ delete_os_policy_assignment_config = parent_rpcs.delete_os_policy_assignment if parent_rpcs.respond_to? :delete_os_policy_assignment
1260
+ @delete_os_policy_assignment = ::Gapic::Config::Method.new delete_os_policy_assignment_config
1261
+ get_os_policy_assignment_report_config = parent_rpcs.get_os_policy_assignment_report if parent_rpcs.respond_to? :get_os_policy_assignment_report
1262
+ @get_os_policy_assignment_report = ::Gapic::Config::Method.new get_os_policy_assignment_report_config
1263
+ list_os_policy_assignment_reports_config = parent_rpcs.list_os_policy_assignment_reports if parent_rpcs.respond_to? :list_os_policy_assignment_reports
1264
+ @list_os_policy_assignment_reports = ::Gapic::Config::Method.new list_os_policy_assignment_reports_config
1265
+ get_inventory_config = parent_rpcs.get_inventory if parent_rpcs.respond_to? :get_inventory
1266
+ @get_inventory = ::Gapic::Config::Method.new get_inventory_config
1267
+ list_inventories_config = parent_rpcs.list_inventories if parent_rpcs.respond_to? :list_inventories
1268
+ @list_inventories = ::Gapic::Config::Method.new list_inventories_config
1269
+ get_vulnerability_report_config = parent_rpcs.get_vulnerability_report if parent_rpcs.respond_to? :get_vulnerability_report
1270
+ @get_vulnerability_report = ::Gapic::Config::Method.new get_vulnerability_report_config
1271
+ list_vulnerability_reports_config = parent_rpcs.list_vulnerability_reports if parent_rpcs.respond_to? :list_vulnerability_reports
1272
+ @list_vulnerability_reports = ::Gapic::Config::Method.new list_vulnerability_reports_config
1273
+
1274
+ yield self if block_given?
1275
+ end
1276
+ end
1277
+ end
1278
+ end
1279
+ end
1280
+ end
1281
+ end
1282
+ end
1283
+ end
1284
+ end