google-cloud-os_config-v1 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/os_config/v1/os_config_service/client.rb +198 -27
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/client.rb +991 -16
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/operations.rb +767 -0
- data/lib/google/cloud/os_config/v1/os_config_zonal_service/paths.rb +78 -0
- data/lib/google/cloud/os_config/v1/os_config_zonal_service.rb +1 -0
- data/lib/google/cloud/os_config/v1/version.rb +1 -1
- data/lib/google/cloud/osconfig/v1/os_policy_assignment_reports_pb.rb +92 -0
- data/lib/google/cloud/osconfig/v1/os_policy_assignments_pb.rb +134 -0
- data/lib/google/cloud/osconfig/v1/os_policy_pb.rb +204 -0
- data/lib/google/cloud/osconfig/v1/osconfig_zonal_service_pb.rb +3 -1
- data/lib/google/cloud/osconfig/v1/osconfig_zonal_service_services_pb.rb +51 -0
- data/proto_docs/google/cloud/osconfig/v1/os_policy.rb +597 -0
- data/proto_docs/google/cloud/osconfig/v1/os_policy_assignment_reports.rb +293 -0
- data/proto_docs/google/cloud/osconfig/v1/os_policy_assignments.rb +392 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +13 -2
@@ -141,6 +141,11 @@ module Google
|
|
141
141
|
@quota_project_id = @config.quota_project
|
142
142
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
143
143
|
|
144
|
+
@operations_client = Operations.new do |config|
|
145
|
+
config.credentials = credentials
|
146
|
+
config.endpoint = @config.endpoint
|
147
|
+
end
|
148
|
+
|
144
149
|
@os_config_zonal_service_stub = ::Gapic::ServiceStub.new(
|
145
150
|
::Google::Cloud::OsConfig::V1::OsConfigZonalService::Stub,
|
146
151
|
credentials: credentials,
|
@@ -150,7 +155,841 @@ module Google
|
|
150
155
|
)
|
151
156
|
end
|
152
157
|
|
153
|
-
|
158
|
+
##
|
159
|
+
# Get the associated client for long-running operations.
|
160
|
+
#
|
161
|
+
# @return [::Google::Cloud::OsConfig::V1::OsConfigZonalService::Operations]
|
162
|
+
#
|
163
|
+
attr_reader :operations_client
|
164
|
+
|
165
|
+
# Service calls
|
166
|
+
|
167
|
+
##
|
168
|
+
# Create an OS policy assignment.
|
169
|
+
#
|
170
|
+
# This method also creates the first revision of the OS policy assignment.
|
171
|
+
#
|
172
|
+
# This method returns a long running operation (LRO) that contains the
|
173
|
+
# rollout details. The rollout can be cancelled by cancelling the LRO.
|
174
|
+
#
|
175
|
+
# For more information, see [Method:
|
176
|
+
# projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
|
177
|
+
#
|
178
|
+
# @overload create_os_policy_assignment(request, options = nil)
|
179
|
+
# Pass arguments to `create_os_policy_assignment` via a request object, either of type
|
180
|
+
# {::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest} or an equivalent Hash.
|
181
|
+
#
|
182
|
+
# @param request [::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest, ::Hash]
|
183
|
+
# A request object representing the call parameters. Required. To specify no
|
184
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
185
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
186
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
187
|
+
#
|
188
|
+
# @overload create_os_policy_assignment(parent: nil, os_policy_assignment: nil, os_policy_assignment_id: nil)
|
189
|
+
# Pass arguments to `create_os_policy_assignment` via keyword arguments. Note that at
|
190
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
191
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
192
|
+
#
|
193
|
+
# @param parent [::String]
|
194
|
+
# Required. The parent resource name in the form:
|
195
|
+
# projects/\\{project}/locations/\\{location}
|
196
|
+
# @param os_policy_assignment [::Google::Cloud::OsConfig::V1::OSPolicyAssignment, ::Hash]
|
197
|
+
# Required. The OS policy assignment to be created.
|
198
|
+
# @param os_policy_assignment_id [::String]
|
199
|
+
# Required. The logical name of the OS policy assignment in the project
|
200
|
+
# with the following restrictions:
|
201
|
+
#
|
202
|
+
# * Must contain only lowercase letters, numbers, and hyphens.
|
203
|
+
# * Must start with a letter.
|
204
|
+
# * Must be between 1-63 characters.
|
205
|
+
# * Must end with a number or a letter.
|
206
|
+
# * Must be unique within the project.
|
207
|
+
#
|
208
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
209
|
+
# @yieldparam response [::Gapic::Operation]
|
210
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
211
|
+
#
|
212
|
+
# @return [::Gapic::Operation]
|
213
|
+
#
|
214
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
215
|
+
#
|
216
|
+
# @example Basic example
|
217
|
+
# require "google/cloud/os_config/v1"
|
218
|
+
#
|
219
|
+
# # Create a client object. The client can be reused for multiple calls.
|
220
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
221
|
+
#
|
222
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
223
|
+
# request = Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest.new
|
224
|
+
#
|
225
|
+
# # Call the create_os_policy_assignment method.
|
226
|
+
# result = client.create_os_policy_assignment request
|
227
|
+
#
|
228
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
229
|
+
# # object to check the status of an operation, cancel it, or wait
|
230
|
+
# # for results. Here is how to block until completion:
|
231
|
+
# result.wait_until_done! timeout: 60
|
232
|
+
# if result.response?
|
233
|
+
# p result.response
|
234
|
+
# else
|
235
|
+
# puts "Error!"
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
def create_os_policy_assignment request, options = nil
|
239
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
240
|
+
|
241
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest
|
242
|
+
|
243
|
+
# Converts hash and nil to an options object
|
244
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
245
|
+
|
246
|
+
# Customize the options with defaults
|
247
|
+
metadata = @config.rpcs.create_os_policy_assignment.metadata.to_h
|
248
|
+
|
249
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
250
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
251
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
252
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
253
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
254
|
+
|
255
|
+
header_params = {}
|
256
|
+
if request.parent
|
257
|
+
header_params["parent"] = request.parent
|
258
|
+
end
|
259
|
+
|
260
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
261
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
262
|
+
|
263
|
+
options.apply_defaults timeout: @config.rpcs.create_os_policy_assignment.timeout,
|
264
|
+
metadata: metadata,
|
265
|
+
retry_policy: @config.rpcs.create_os_policy_assignment.retry_policy
|
266
|
+
|
267
|
+
options.apply_defaults timeout: @config.timeout,
|
268
|
+
metadata: @config.metadata,
|
269
|
+
retry_policy: @config.retry_policy
|
270
|
+
|
271
|
+
@os_config_zonal_service_stub.call_rpc :create_os_policy_assignment, request, options: options do |response, operation|
|
272
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
273
|
+
yield response, operation if block_given?
|
274
|
+
return response
|
275
|
+
end
|
276
|
+
rescue ::GRPC::BadStatus => e
|
277
|
+
raise ::Google::Cloud::Error.from_error(e)
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Update an existing OS policy assignment.
|
282
|
+
#
|
283
|
+
# This method creates a new revision of the OS policy assignment.
|
284
|
+
#
|
285
|
+
# This method returns a long running operation (LRO) that contains the
|
286
|
+
# rollout details. The rollout can be cancelled by cancelling the LRO.
|
287
|
+
#
|
288
|
+
# For more information, see [Method:
|
289
|
+
# projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
|
290
|
+
#
|
291
|
+
# @overload update_os_policy_assignment(request, options = nil)
|
292
|
+
# Pass arguments to `update_os_policy_assignment` via a request object, either of type
|
293
|
+
# {::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest} or an equivalent Hash.
|
294
|
+
#
|
295
|
+
# @param request [::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest, ::Hash]
|
296
|
+
# A request object representing the call parameters. Required. To specify no
|
297
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
298
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
299
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
300
|
+
#
|
301
|
+
# @overload update_os_policy_assignment(os_policy_assignment: nil, update_mask: nil)
|
302
|
+
# Pass arguments to `update_os_policy_assignment` via keyword arguments. Note that at
|
303
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
304
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
305
|
+
#
|
306
|
+
# @param os_policy_assignment [::Google::Cloud::OsConfig::V1::OSPolicyAssignment, ::Hash]
|
307
|
+
# Required. The updated OS policy assignment.
|
308
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
309
|
+
# Optional. Field mask that controls which fields of the assignment should be
|
310
|
+
# updated.
|
311
|
+
#
|
312
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
313
|
+
# @yieldparam response [::Gapic::Operation]
|
314
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
315
|
+
#
|
316
|
+
# @return [::Gapic::Operation]
|
317
|
+
#
|
318
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
319
|
+
#
|
320
|
+
# @example Basic example
|
321
|
+
# require "google/cloud/os_config/v1"
|
322
|
+
#
|
323
|
+
# # Create a client object. The client can be reused for multiple calls.
|
324
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
325
|
+
#
|
326
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
327
|
+
# request = Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest.new
|
328
|
+
#
|
329
|
+
# # Call the update_os_policy_assignment method.
|
330
|
+
# result = client.update_os_policy_assignment request
|
331
|
+
#
|
332
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
333
|
+
# # object to check the status of an operation, cancel it, or wait
|
334
|
+
# # for results. Here is how to block until completion:
|
335
|
+
# result.wait_until_done! timeout: 60
|
336
|
+
# if result.response?
|
337
|
+
# p result.response
|
338
|
+
# else
|
339
|
+
# puts "Error!"
|
340
|
+
# end
|
341
|
+
#
|
342
|
+
def update_os_policy_assignment request, options = nil
|
343
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
344
|
+
|
345
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest
|
346
|
+
|
347
|
+
# Converts hash and nil to an options object
|
348
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
349
|
+
|
350
|
+
# Customize the options with defaults
|
351
|
+
metadata = @config.rpcs.update_os_policy_assignment.metadata.to_h
|
352
|
+
|
353
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
354
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
355
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
356
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
357
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
358
|
+
|
359
|
+
header_params = {}
|
360
|
+
if request.os_policy_assignment&.name
|
361
|
+
header_params["os_policy_assignment.name"] = request.os_policy_assignment.name
|
362
|
+
end
|
363
|
+
|
364
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
365
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
366
|
+
|
367
|
+
options.apply_defaults timeout: @config.rpcs.update_os_policy_assignment.timeout,
|
368
|
+
metadata: metadata,
|
369
|
+
retry_policy: @config.rpcs.update_os_policy_assignment.retry_policy
|
370
|
+
|
371
|
+
options.apply_defaults timeout: @config.timeout,
|
372
|
+
metadata: @config.metadata,
|
373
|
+
retry_policy: @config.retry_policy
|
374
|
+
|
375
|
+
@os_config_zonal_service_stub.call_rpc :update_os_policy_assignment, request, options: options do |response, operation|
|
376
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
377
|
+
yield response, operation if block_given?
|
378
|
+
return response
|
379
|
+
end
|
380
|
+
rescue ::GRPC::BadStatus => e
|
381
|
+
raise ::Google::Cloud::Error.from_error(e)
|
382
|
+
end
|
383
|
+
|
384
|
+
##
|
385
|
+
# Retrieve an existing OS policy assignment.
|
386
|
+
#
|
387
|
+
# This method always returns the latest revision. In order to retrieve a
|
388
|
+
# previous revision of the assignment, also provide the revision ID in the
|
389
|
+
# `name` parameter.
|
390
|
+
#
|
391
|
+
# @overload get_os_policy_assignment(request, options = nil)
|
392
|
+
# Pass arguments to `get_os_policy_assignment` via a request object, either of type
|
393
|
+
# {::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest} or an equivalent Hash.
|
394
|
+
#
|
395
|
+
# @param request [::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest, ::Hash]
|
396
|
+
# A request object representing the call parameters. Required. To specify no
|
397
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
398
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
399
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
400
|
+
#
|
401
|
+
# @overload get_os_policy_assignment(name: nil)
|
402
|
+
# Pass arguments to `get_os_policy_assignment` via keyword arguments. Note that at
|
403
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
404
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
405
|
+
#
|
406
|
+
# @param name [::String]
|
407
|
+
# Required. The resource name of OS policy assignment.
|
408
|
+
#
|
409
|
+
# Format:
|
410
|
+
# `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}`
|
411
|
+
#
|
412
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
413
|
+
# @yieldparam response [::Google::Cloud::OsConfig::V1::OSPolicyAssignment]
|
414
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
415
|
+
#
|
416
|
+
# @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignment]
|
417
|
+
#
|
418
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
419
|
+
#
|
420
|
+
# @example Basic example
|
421
|
+
# require "google/cloud/os_config/v1"
|
422
|
+
#
|
423
|
+
# # Create a client object. The client can be reused for multiple calls.
|
424
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
425
|
+
#
|
426
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
427
|
+
# request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest.new
|
428
|
+
#
|
429
|
+
# # Call the get_os_policy_assignment method.
|
430
|
+
# result = client.get_os_policy_assignment request
|
431
|
+
#
|
432
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
433
|
+
# p result
|
434
|
+
#
|
435
|
+
def get_os_policy_assignment request, options = nil
|
436
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
437
|
+
|
438
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest
|
439
|
+
|
440
|
+
# Converts hash and nil to an options object
|
441
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
442
|
+
|
443
|
+
# Customize the options with defaults
|
444
|
+
metadata = @config.rpcs.get_os_policy_assignment.metadata.to_h
|
445
|
+
|
446
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
447
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
448
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
449
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
450
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
451
|
+
|
452
|
+
header_params = {}
|
453
|
+
if request.name
|
454
|
+
header_params["name"] = request.name
|
455
|
+
end
|
456
|
+
|
457
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
458
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
459
|
+
|
460
|
+
options.apply_defaults timeout: @config.rpcs.get_os_policy_assignment.timeout,
|
461
|
+
metadata: metadata,
|
462
|
+
retry_policy: @config.rpcs.get_os_policy_assignment.retry_policy
|
463
|
+
|
464
|
+
options.apply_defaults timeout: @config.timeout,
|
465
|
+
metadata: @config.metadata,
|
466
|
+
retry_policy: @config.retry_policy
|
467
|
+
|
468
|
+
@os_config_zonal_service_stub.call_rpc :get_os_policy_assignment, request, options: options do |response, operation|
|
469
|
+
yield response, operation if block_given?
|
470
|
+
return response
|
471
|
+
end
|
472
|
+
rescue ::GRPC::BadStatus => e
|
473
|
+
raise ::Google::Cloud::Error.from_error(e)
|
474
|
+
end
|
475
|
+
|
476
|
+
##
|
477
|
+
# List the OS policy assignments under the parent resource.
|
478
|
+
#
|
479
|
+
# For each OS policy assignment, the latest revision is returned.
|
480
|
+
#
|
481
|
+
# @overload list_os_policy_assignments(request, options = nil)
|
482
|
+
# Pass arguments to `list_os_policy_assignments` via a request object, either of type
|
483
|
+
# {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest} or an equivalent Hash.
|
484
|
+
#
|
485
|
+
# @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest, ::Hash]
|
486
|
+
# A request object representing the call parameters. Required. To specify no
|
487
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
488
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
489
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
490
|
+
#
|
491
|
+
# @overload list_os_policy_assignments(parent: nil, page_size: nil, page_token: nil)
|
492
|
+
# Pass arguments to `list_os_policy_assignments` via keyword arguments. Note that at
|
493
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
494
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
495
|
+
#
|
496
|
+
# @param parent [::String]
|
497
|
+
# Required. The parent resource name.
|
498
|
+
# @param page_size [::Integer]
|
499
|
+
# The maximum number of assignments to return.
|
500
|
+
# @param page_token [::String]
|
501
|
+
# A pagination token returned from a previous call to
|
502
|
+
# `ListOSPolicyAssignments` that indicates where this listing should continue
|
503
|
+
# from.
|
504
|
+
#
|
505
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
506
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
507
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
508
|
+
#
|
509
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
510
|
+
#
|
511
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
512
|
+
#
|
513
|
+
# @example Basic example
|
514
|
+
# require "google/cloud/os_config/v1"
|
515
|
+
#
|
516
|
+
# # Create a client object. The client can be reused for multiple calls.
|
517
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
518
|
+
#
|
519
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
520
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest.new
|
521
|
+
#
|
522
|
+
# # Call the list_os_policy_assignments method.
|
523
|
+
# result = client.list_os_policy_assignments request
|
524
|
+
#
|
525
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
526
|
+
# # iterate over all elements by calling #each, and the enumerable
|
527
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
528
|
+
# # methods are also available for managing paging directly.
|
529
|
+
# result.each do |response|
|
530
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
531
|
+
# p response
|
532
|
+
# end
|
533
|
+
#
|
534
|
+
def list_os_policy_assignments request, options = nil
|
535
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
536
|
+
|
537
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest
|
538
|
+
|
539
|
+
# Converts hash and nil to an options object
|
540
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
541
|
+
|
542
|
+
# Customize the options with defaults
|
543
|
+
metadata = @config.rpcs.list_os_policy_assignments.metadata.to_h
|
544
|
+
|
545
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
546
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
547
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
548
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
549
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
550
|
+
|
551
|
+
header_params = {}
|
552
|
+
if request.parent
|
553
|
+
header_params["parent"] = request.parent
|
554
|
+
end
|
555
|
+
|
556
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
557
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
558
|
+
|
559
|
+
options.apply_defaults timeout: @config.rpcs.list_os_policy_assignments.timeout,
|
560
|
+
metadata: metadata,
|
561
|
+
retry_policy: @config.rpcs.list_os_policy_assignments.retry_policy
|
562
|
+
|
563
|
+
options.apply_defaults timeout: @config.timeout,
|
564
|
+
metadata: @config.metadata,
|
565
|
+
retry_policy: @config.retry_policy
|
566
|
+
|
567
|
+
@os_config_zonal_service_stub.call_rpc :list_os_policy_assignments, request, options: options do |response, operation|
|
568
|
+
response = ::Gapic::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignments, request, response, operation, options
|
569
|
+
yield response, operation if block_given?
|
570
|
+
return response
|
571
|
+
end
|
572
|
+
rescue ::GRPC::BadStatus => e
|
573
|
+
raise ::Google::Cloud::Error.from_error(e)
|
574
|
+
end
|
575
|
+
|
576
|
+
##
|
577
|
+
# List the OS policy assignment revisions for a given OS policy assignment.
|
578
|
+
#
|
579
|
+
# @overload list_os_policy_assignment_revisions(request, options = nil)
|
580
|
+
# Pass arguments to `list_os_policy_assignment_revisions` via a request object, either of type
|
581
|
+
# {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest} or an equivalent Hash.
|
582
|
+
#
|
583
|
+
# @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest, ::Hash]
|
584
|
+
# A request object representing the call parameters. Required. To specify no
|
585
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
586
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
587
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
588
|
+
#
|
589
|
+
# @overload list_os_policy_assignment_revisions(name: nil, page_size: nil, page_token: nil)
|
590
|
+
# Pass arguments to `list_os_policy_assignment_revisions` via keyword arguments. Note that at
|
591
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
592
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
593
|
+
#
|
594
|
+
# @param name [::String]
|
595
|
+
# Required. The name of the OS policy assignment to list revisions for.
|
596
|
+
# @param page_size [::Integer]
|
597
|
+
# The maximum number of revisions to return.
|
598
|
+
# @param page_token [::String]
|
599
|
+
# A pagination token returned from a previous call to
|
600
|
+
# `ListOSPolicyAssignmentRevisions` that indicates where this listing should
|
601
|
+
# continue from.
|
602
|
+
#
|
603
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
604
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
605
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
606
|
+
#
|
607
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignment>]
|
608
|
+
#
|
609
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
610
|
+
#
|
611
|
+
# @example Basic example
|
612
|
+
# require "google/cloud/os_config/v1"
|
613
|
+
#
|
614
|
+
# # Create a client object. The client can be reused for multiple calls.
|
615
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
616
|
+
#
|
617
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
618
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest.new
|
619
|
+
#
|
620
|
+
# # Call the list_os_policy_assignment_revisions method.
|
621
|
+
# result = client.list_os_policy_assignment_revisions request
|
622
|
+
#
|
623
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
624
|
+
# # iterate over all elements by calling #each, and the enumerable
|
625
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
626
|
+
# # methods are also available for managing paging directly.
|
627
|
+
# result.each do |response|
|
628
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment.
|
629
|
+
# p response
|
630
|
+
# end
|
631
|
+
#
|
632
|
+
def list_os_policy_assignment_revisions request, options = nil
|
633
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
634
|
+
|
635
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest
|
636
|
+
|
637
|
+
# Converts hash and nil to an options object
|
638
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
639
|
+
|
640
|
+
# Customize the options with defaults
|
641
|
+
metadata = @config.rpcs.list_os_policy_assignment_revisions.metadata.to_h
|
642
|
+
|
643
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
644
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
645
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
646
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
647
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
648
|
+
|
649
|
+
header_params = {}
|
650
|
+
if request.name
|
651
|
+
header_params["name"] = request.name
|
652
|
+
end
|
653
|
+
|
654
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
655
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
656
|
+
|
657
|
+
options.apply_defaults timeout: @config.rpcs.list_os_policy_assignment_revisions.timeout,
|
658
|
+
metadata: metadata,
|
659
|
+
retry_policy: @config.rpcs.list_os_policy_assignment_revisions.retry_policy
|
660
|
+
|
661
|
+
options.apply_defaults timeout: @config.timeout,
|
662
|
+
metadata: @config.metadata,
|
663
|
+
retry_policy: @config.retry_policy
|
664
|
+
|
665
|
+
@os_config_zonal_service_stub.call_rpc :list_os_policy_assignment_revisions, request, options: options do |response, operation|
|
666
|
+
response = ::Gapic::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignment_revisions, request, response, operation, options
|
667
|
+
yield response, operation if block_given?
|
668
|
+
return response
|
669
|
+
end
|
670
|
+
rescue ::GRPC::BadStatus => e
|
671
|
+
raise ::Google::Cloud::Error.from_error(e)
|
672
|
+
end
|
673
|
+
|
674
|
+
##
|
675
|
+
# Delete the OS policy assignment.
|
676
|
+
#
|
677
|
+
# This method creates a new revision of the OS policy assignment.
|
678
|
+
#
|
679
|
+
# This method returns a long running operation (LRO) that contains the
|
680
|
+
# rollout details. The rollout can be cancelled by cancelling the LRO.
|
681
|
+
#
|
682
|
+
# If the LRO completes and is not cancelled, all revisions associated with
|
683
|
+
# the OS policy assignment are deleted.
|
684
|
+
#
|
685
|
+
# For more information, see [Method:
|
686
|
+
# projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).
|
687
|
+
#
|
688
|
+
# @overload delete_os_policy_assignment(request, options = nil)
|
689
|
+
# Pass arguments to `delete_os_policy_assignment` via a request object, either of type
|
690
|
+
# {::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest} or an equivalent Hash.
|
691
|
+
#
|
692
|
+
# @param request [::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest, ::Hash]
|
693
|
+
# A request object representing the call parameters. Required. To specify no
|
694
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
695
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
696
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
697
|
+
#
|
698
|
+
# @overload delete_os_policy_assignment(name: nil)
|
699
|
+
# Pass arguments to `delete_os_policy_assignment` via keyword arguments. Note that at
|
700
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
701
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
702
|
+
#
|
703
|
+
# @param name [::String]
|
704
|
+
# Required. The name of the OS policy assignment to be deleted
|
705
|
+
#
|
706
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
707
|
+
# @yieldparam response [::Gapic::Operation]
|
708
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
709
|
+
#
|
710
|
+
# @return [::Gapic::Operation]
|
711
|
+
#
|
712
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
713
|
+
#
|
714
|
+
# @example Basic example
|
715
|
+
# require "google/cloud/os_config/v1"
|
716
|
+
#
|
717
|
+
# # Create a client object. The client can be reused for multiple calls.
|
718
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
719
|
+
#
|
720
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
721
|
+
# request = Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest.new
|
722
|
+
#
|
723
|
+
# # Call the delete_os_policy_assignment method.
|
724
|
+
# result = client.delete_os_policy_assignment request
|
725
|
+
#
|
726
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
727
|
+
# # object to check the status of an operation, cancel it, or wait
|
728
|
+
# # for results. Here is how to block until completion:
|
729
|
+
# result.wait_until_done! timeout: 60
|
730
|
+
# if result.response?
|
731
|
+
# p result.response
|
732
|
+
# else
|
733
|
+
# puts "Error!"
|
734
|
+
# end
|
735
|
+
#
|
736
|
+
def delete_os_policy_assignment request, options = nil
|
737
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
738
|
+
|
739
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest
|
740
|
+
|
741
|
+
# Converts hash and nil to an options object
|
742
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
743
|
+
|
744
|
+
# Customize the options with defaults
|
745
|
+
metadata = @config.rpcs.delete_os_policy_assignment.metadata.to_h
|
746
|
+
|
747
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
748
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
749
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
750
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
751
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
752
|
+
|
753
|
+
header_params = {}
|
754
|
+
if request.name
|
755
|
+
header_params["name"] = request.name
|
756
|
+
end
|
757
|
+
|
758
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
759
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
760
|
+
|
761
|
+
options.apply_defaults timeout: @config.rpcs.delete_os_policy_assignment.timeout,
|
762
|
+
metadata: metadata,
|
763
|
+
retry_policy: @config.rpcs.delete_os_policy_assignment.retry_policy
|
764
|
+
|
765
|
+
options.apply_defaults timeout: @config.timeout,
|
766
|
+
metadata: @config.metadata,
|
767
|
+
retry_policy: @config.retry_policy
|
768
|
+
|
769
|
+
@os_config_zonal_service_stub.call_rpc :delete_os_policy_assignment, request, options: options do |response, operation|
|
770
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
771
|
+
yield response, operation if block_given?
|
772
|
+
return response
|
773
|
+
end
|
774
|
+
rescue ::GRPC::BadStatus => e
|
775
|
+
raise ::Google::Cloud::Error.from_error(e)
|
776
|
+
end
|
777
|
+
|
778
|
+
##
|
779
|
+
# Get the OS policy asssignment report for the specified Compute Engine VM
|
780
|
+
# instance.
|
781
|
+
#
|
782
|
+
# @overload get_os_policy_assignment_report(request, options = nil)
|
783
|
+
# Pass arguments to `get_os_policy_assignment_report` via a request object, either of type
|
784
|
+
# {::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest} or an equivalent Hash.
|
785
|
+
#
|
786
|
+
# @param request [::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest, ::Hash]
|
787
|
+
# A request object representing the call parameters. Required. To specify no
|
788
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
789
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
790
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
791
|
+
#
|
792
|
+
# @overload get_os_policy_assignment_report(name: nil)
|
793
|
+
# Pass arguments to `get_os_policy_assignment_report` via keyword arguments. Note that at
|
794
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
795
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
796
|
+
#
|
797
|
+
# @param name [::String]
|
798
|
+
# Required. API resource name for OS policy assignment report.
|
799
|
+
#
|
800
|
+
# Format:
|
801
|
+
# `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report`
|
802
|
+
#
|
803
|
+
# For `{project}`, either `project-number` or `project-id` can be provided.
|
804
|
+
# For `{instance_id}`, either Compute Engine `instance-id` or `instance-name`
|
805
|
+
# can be provided.
|
806
|
+
# For `{assignment_id}`, the OSPolicyAssignment id must be provided.
|
807
|
+
#
|
808
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
809
|
+
# @yieldparam response [::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport]
|
810
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
811
|
+
#
|
812
|
+
# @return [::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport]
|
813
|
+
#
|
814
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
815
|
+
#
|
816
|
+
# @example Basic example
|
817
|
+
# require "google/cloud/os_config/v1"
|
818
|
+
#
|
819
|
+
# # Create a client object. The client can be reused for multiple calls.
|
820
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
821
|
+
#
|
822
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
823
|
+
# request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest.new
|
824
|
+
#
|
825
|
+
# # Call the get_os_policy_assignment_report method.
|
826
|
+
# result = client.get_os_policy_assignment_report request
|
827
|
+
#
|
828
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport.
|
829
|
+
# p result
|
830
|
+
#
|
831
|
+
def get_os_policy_assignment_report request, options = nil
|
832
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
833
|
+
|
834
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest
|
835
|
+
|
836
|
+
# Converts hash and nil to an options object
|
837
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
838
|
+
|
839
|
+
# Customize the options with defaults
|
840
|
+
metadata = @config.rpcs.get_os_policy_assignment_report.metadata.to_h
|
841
|
+
|
842
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
843
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
844
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
845
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
846
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
847
|
+
|
848
|
+
header_params = {}
|
849
|
+
if request.name
|
850
|
+
header_params["name"] = request.name
|
851
|
+
end
|
852
|
+
|
853
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
854
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
855
|
+
|
856
|
+
options.apply_defaults timeout: @config.rpcs.get_os_policy_assignment_report.timeout,
|
857
|
+
metadata: metadata,
|
858
|
+
retry_policy: @config.rpcs.get_os_policy_assignment_report.retry_policy
|
859
|
+
|
860
|
+
options.apply_defaults timeout: @config.timeout,
|
861
|
+
metadata: @config.metadata,
|
862
|
+
retry_policy: @config.retry_policy
|
863
|
+
|
864
|
+
@os_config_zonal_service_stub.call_rpc :get_os_policy_assignment_report, request, options: options do |response, operation|
|
865
|
+
yield response, operation if block_given?
|
866
|
+
return response
|
867
|
+
end
|
868
|
+
rescue ::GRPC::BadStatus => e
|
869
|
+
raise ::Google::Cloud::Error.from_error(e)
|
870
|
+
end
|
871
|
+
|
872
|
+
##
|
873
|
+
# List OS policy asssignment reports for all Compute Engine VM instances in
|
874
|
+
# the specified zone.
|
875
|
+
#
|
876
|
+
# @overload list_os_policy_assignment_reports(request, options = nil)
|
877
|
+
# Pass arguments to `list_os_policy_assignment_reports` via a request object, either of type
|
878
|
+
# {::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest} or an equivalent Hash.
|
879
|
+
#
|
880
|
+
# @param request [::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest, ::Hash]
|
881
|
+
# A request object representing the call parameters. Required. To specify no
|
882
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
883
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
884
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
885
|
+
#
|
886
|
+
# @overload list_os_policy_assignment_reports(parent: nil, page_size: nil, filter: nil, page_token: nil)
|
887
|
+
# Pass arguments to `list_os_policy_assignment_reports` via keyword arguments. Note that at
|
888
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
889
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
890
|
+
#
|
891
|
+
# @param parent [::String]
|
892
|
+
# Required. The parent resource name.
|
893
|
+
#
|
894
|
+
# Format:
|
895
|
+
# `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports`
|
896
|
+
#
|
897
|
+
# For `{project}`, either `project-number` or `project-id` can be provided.
|
898
|
+
# For `{instance}`, either `instance-name`, `instance-id`, or `-` can be
|
899
|
+
# provided. If '-' is provided, the response will include
|
900
|
+
# OSPolicyAssignmentReports for all instances in the project/location.
|
901
|
+
# For `{assignment}`, either `assignment-id` or `-` can be provided. If '-'
|
902
|
+
# is provided, the response will include OSPolicyAssignmentReports for all
|
903
|
+
# OSPolicyAssignments in the project/location.
|
904
|
+
# Either \\{instance} or \\{assignment} must be `-`.
|
905
|
+
#
|
906
|
+
# For example:
|
907
|
+
# `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports`
|
908
|
+
# returns all reports for the instance
|
909
|
+
# `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports`
|
910
|
+
# returns all the reports for the given assignment across all instances.
|
911
|
+
# `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports`
|
912
|
+
# returns all the reports for all assignments across all instances.
|
913
|
+
# @param page_size [::Integer]
|
914
|
+
# The maximum number of results to return.
|
915
|
+
# @param filter [::String]
|
916
|
+
# If provided, this field specifies the criteria that must be met by the
|
917
|
+
# `OSPolicyAssignmentReport` API resource that is included in the response.
|
918
|
+
# @param page_token [::String]
|
919
|
+
# A pagination token returned from a previous call to the
|
920
|
+
# `ListOSPolicyAssignmentReports` method that indicates where this listing
|
921
|
+
# should continue from.
|
922
|
+
#
|
923
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
924
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport>]
|
925
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
926
|
+
#
|
927
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport>]
|
928
|
+
#
|
929
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
930
|
+
#
|
931
|
+
# @example Basic example
|
932
|
+
# require "google/cloud/os_config/v1"
|
933
|
+
#
|
934
|
+
# # Create a client object. The client can be reused for multiple calls.
|
935
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
936
|
+
#
|
937
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
938
|
+
# request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest.new
|
939
|
+
#
|
940
|
+
# # Call the list_os_policy_assignment_reports method.
|
941
|
+
# result = client.list_os_policy_assignment_reports request
|
942
|
+
#
|
943
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
944
|
+
# # iterate over all elements by calling #each, and the enumerable
|
945
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
946
|
+
# # methods are also available for managing paging directly.
|
947
|
+
# result.each do |response|
|
948
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport.
|
949
|
+
# p response
|
950
|
+
# end
|
951
|
+
#
|
952
|
+
def list_os_policy_assignment_reports request, options = nil
|
953
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
954
|
+
|
955
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest
|
956
|
+
|
957
|
+
# Converts hash and nil to an options object
|
958
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
959
|
+
|
960
|
+
# Customize the options with defaults
|
961
|
+
metadata = @config.rpcs.list_os_policy_assignment_reports.metadata.to_h
|
962
|
+
|
963
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
964
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
965
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
966
|
+
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
967
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
968
|
+
|
969
|
+
header_params = {}
|
970
|
+
if request.parent
|
971
|
+
header_params["parent"] = request.parent
|
972
|
+
end
|
973
|
+
|
974
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
975
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
976
|
+
|
977
|
+
options.apply_defaults timeout: @config.rpcs.list_os_policy_assignment_reports.timeout,
|
978
|
+
metadata: metadata,
|
979
|
+
retry_policy: @config.rpcs.list_os_policy_assignment_reports.retry_policy
|
980
|
+
|
981
|
+
options.apply_defaults timeout: @config.timeout,
|
982
|
+
metadata: @config.metadata,
|
983
|
+
retry_policy: @config.retry_policy
|
984
|
+
|
985
|
+
@os_config_zonal_service_stub.call_rpc :list_os_policy_assignment_reports, request, options: options do |response, operation|
|
986
|
+
response = ::Gapic::PagedEnumerable.new @os_config_zonal_service_stub, :list_os_policy_assignment_reports, request, response, operation, options
|
987
|
+
yield response, operation if block_given?
|
988
|
+
return response
|
989
|
+
end
|
990
|
+
rescue ::GRPC::BadStatus => e
|
991
|
+
raise ::Google::Cloud::Error.from_error(e)
|
992
|
+
end
|
154
993
|
|
155
994
|
##
|
156
995
|
# Get inventory data for the specified VM instance. If the VM has no
|
@@ -192,6 +1031,21 @@ module Google
|
|
192
1031
|
#
|
193
1032
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
194
1033
|
#
|
1034
|
+
# @example Basic example
|
1035
|
+
# require "google/cloud/os_config/v1"
|
1036
|
+
#
|
1037
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1038
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
1039
|
+
#
|
1040
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1041
|
+
# request = Google::Cloud::OsConfig::V1::GetInventoryRequest.new
|
1042
|
+
#
|
1043
|
+
# # Call the get_inventory method.
|
1044
|
+
# result = client.get_inventory request
|
1045
|
+
#
|
1046
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::Inventory.
|
1047
|
+
# p result
|
1048
|
+
#
|
195
1049
|
def get_inventory request, options = nil
|
196
1050
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
197
1051
|
|
@@ -209,9 +1063,11 @@ module Google
|
|
209
1063
|
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
210
1064
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
211
1065
|
|
212
|
-
header_params = {
|
213
|
-
|
214
|
-
|
1066
|
+
header_params = {}
|
1067
|
+
if request.name
|
1068
|
+
header_params["name"] = request.name
|
1069
|
+
end
|
1070
|
+
|
215
1071
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
216
1072
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
217
1073
|
|
@@ -276,6 +1132,27 @@ module Google
|
|
276
1132
|
#
|
277
1133
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
278
1134
|
#
|
1135
|
+
# @example Basic example
|
1136
|
+
# require "google/cloud/os_config/v1"
|
1137
|
+
#
|
1138
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1139
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
1140
|
+
#
|
1141
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1142
|
+
# request = Google::Cloud::OsConfig::V1::ListInventoriesRequest.new
|
1143
|
+
#
|
1144
|
+
# # Call the list_inventories method.
|
1145
|
+
# result = client.list_inventories request
|
1146
|
+
#
|
1147
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1148
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1149
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1150
|
+
# # methods are also available for managing paging directly.
|
1151
|
+
# result.each do |response|
|
1152
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::Inventory.
|
1153
|
+
# p response
|
1154
|
+
# end
|
1155
|
+
#
|
279
1156
|
def list_inventories request, options = nil
|
280
1157
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
281
1158
|
|
@@ -293,9 +1170,11 @@ module Google
|
|
293
1170
|
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
294
1171
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
295
1172
|
|
296
|
-
header_params = {
|
297
|
-
|
298
|
-
|
1173
|
+
header_params = {}
|
1174
|
+
if request.parent
|
1175
|
+
header_params["parent"] = request.parent
|
1176
|
+
end
|
1177
|
+
|
299
1178
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
300
1179
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
301
1180
|
|
@@ -353,6 +1232,21 @@ module Google
|
|
353
1232
|
#
|
354
1233
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
355
1234
|
#
|
1235
|
+
# @example Basic example
|
1236
|
+
# require "google/cloud/os_config/v1"
|
1237
|
+
#
|
1238
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1239
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
1240
|
+
#
|
1241
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1242
|
+
# request = Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest.new
|
1243
|
+
#
|
1244
|
+
# # Call the get_vulnerability_report method.
|
1245
|
+
# result = client.get_vulnerability_report request
|
1246
|
+
#
|
1247
|
+
# # The returned object is of type Google::Cloud::OsConfig::V1::VulnerabilityReport.
|
1248
|
+
# p result
|
1249
|
+
#
|
356
1250
|
def get_vulnerability_report request, options = nil
|
357
1251
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
358
1252
|
|
@@ -370,9 +1264,11 @@ module Google
|
|
370
1264
|
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
371
1265
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
372
1266
|
|
373
|
-
header_params = {
|
374
|
-
|
375
|
-
|
1267
|
+
header_params = {}
|
1268
|
+
if request.name
|
1269
|
+
header_params["name"] = request.name
|
1270
|
+
end
|
1271
|
+
|
376
1272
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
377
1273
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
378
1274
|
|
@@ -434,6 +1330,27 @@ module Google
|
|
434
1330
|
#
|
435
1331
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
436
1332
|
#
|
1333
|
+
# @example Basic example
|
1334
|
+
# require "google/cloud/os_config/v1"
|
1335
|
+
#
|
1336
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1337
|
+
# client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new
|
1338
|
+
#
|
1339
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1340
|
+
# request = Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest.new
|
1341
|
+
#
|
1342
|
+
# # Call the list_vulnerability_reports method.
|
1343
|
+
# result = client.list_vulnerability_reports request
|
1344
|
+
#
|
1345
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1346
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1347
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1348
|
+
# # methods are also available for managing paging directly.
|
1349
|
+
# result.each do |response|
|
1350
|
+
# # Each element is of type ::Google::Cloud::OsConfig::V1::VulnerabilityReport.
|
1351
|
+
# p response
|
1352
|
+
# end
|
1353
|
+
#
|
437
1354
|
def list_vulnerability_reports request, options = nil
|
438
1355
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
439
1356
|
|
@@ -451,9 +1368,11 @@ module Google
|
|
451
1368
|
gapic_version: ::Google::Cloud::OsConfig::V1::VERSION
|
452
1369
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
453
1370
|
|
454
|
-
header_params = {
|
455
|
-
|
456
|
-
|
1371
|
+
header_params = {}
|
1372
|
+
if request.parent
|
1373
|
+
header_params["parent"] = request.parent
|
1374
|
+
end
|
1375
|
+
|
457
1376
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
458
1377
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
459
1378
|
|
@@ -490,17 +1409,17 @@ module Google
|
|
490
1409
|
# @example
|
491
1410
|
#
|
492
1411
|
# # Modify the global config, setting the timeout for
|
493
|
-
# #
|
1412
|
+
# # create_os_policy_assignment to 20 seconds,
|
494
1413
|
# # and all remaining timeouts to 10 seconds.
|
495
1414
|
# ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.configure do |config|
|
496
1415
|
# config.timeout = 10.0
|
497
|
-
# config.rpcs.
|
1416
|
+
# config.rpcs.create_os_policy_assignment.timeout = 20.0
|
498
1417
|
# end
|
499
1418
|
#
|
500
1419
|
# # Apply the above configuration only to a new client.
|
501
1420
|
# client = ::Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new do |config|
|
502
1421
|
# config.timeout = 10.0
|
503
|
-
# config.rpcs.
|
1422
|
+
# config.rpcs.create_os_policy_assignment.timeout = 20.0
|
504
1423
|
# end
|
505
1424
|
#
|
506
1425
|
# @!attribute [rw] endpoint
|
@@ -609,6 +1528,46 @@ module Google
|
|
609
1528
|
# trigger a retry.
|
610
1529
|
#
|
611
1530
|
class Rpcs
|
1531
|
+
##
|
1532
|
+
# RPC-specific configuration for `create_os_policy_assignment`
|
1533
|
+
# @return [::Gapic::Config::Method]
|
1534
|
+
#
|
1535
|
+
attr_reader :create_os_policy_assignment
|
1536
|
+
##
|
1537
|
+
# RPC-specific configuration for `update_os_policy_assignment`
|
1538
|
+
# @return [::Gapic::Config::Method]
|
1539
|
+
#
|
1540
|
+
attr_reader :update_os_policy_assignment
|
1541
|
+
##
|
1542
|
+
# RPC-specific configuration for `get_os_policy_assignment`
|
1543
|
+
# @return [::Gapic::Config::Method]
|
1544
|
+
#
|
1545
|
+
attr_reader :get_os_policy_assignment
|
1546
|
+
##
|
1547
|
+
# RPC-specific configuration for `list_os_policy_assignments`
|
1548
|
+
# @return [::Gapic::Config::Method]
|
1549
|
+
#
|
1550
|
+
attr_reader :list_os_policy_assignments
|
1551
|
+
##
|
1552
|
+
# RPC-specific configuration for `list_os_policy_assignment_revisions`
|
1553
|
+
# @return [::Gapic::Config::Method]
|
1554
|
+
#
|
1555
|
+
attr_reader :list_os_policy_assignment_revisions
|
1556
|
+
##
|
1557
|
+
# RPC-specific configuration for `delete_os_policy_assignment`
|
1558
|
+
# @return [::Gapic::Config::Method]
|
1559
|
+
#
|
1560
|
+
attr_reader :delete_os_policy_assignment
|
1561
|
+
##
|
1562
|
+
# RPC-specific configuration for `get_os_policy_assignment_report`
|
1563
|
+
# @return [::Gapic::Config::Method]
|
1564
|
+
#
|
1565
|
+
attr_reader :get_os_policy_assignment_report
|
1566
|
+
##
|
1567
|
+
# RPC-specific configuration for `list_os_policy_assignment_reports`
|
1568
|
+
# @return [::Gapic::Config::Method]
|
1569
|
+
#
|
1570
|
+
attr_reader :list_os_policy_assignment_reports
|
612
1571
|
##
|
613
1572
|
# RPC-specific configuration for `get_inventory`
|
614
1573
|
# @return [::Gapic::Config::Method]
|
@@ -632,6 +1591,22 @@ module Google
|
|
632
1591
|
|
633
1592
|
# @private
|
634
1593
|
def initialize parent_rpcs = nil
|
1594
|
+
create_os_policy_assignment_config = parent_rpcs.create_os_policy_assignment if parent_rpcs.respond_to? :create_os_policy_assignment
|
1595
|
+
@create_os_policy_assignment = ::Gapic::Config::Method.new create_os_policy_assignment_config
|
1596
|
+
update_os_policy_assignment_config = parent_rpcs.update_os_policy_assignment if parent_rpcs.respond_to? :update_os_policy_assignment
|
1597
|
+
@update_os_policy_assignment = ::Gapic::Config::Method.new update_os_policy_assignment_config
|
1598
|
+
get_os_policy_assignment_config = parent_rpcs.get_os_policy_assignment if parent_rpcs.respond_to? :get_os_policy_assignment
|
1599
|
+
@get_os_policy_assignment = ::Gapic::Config::Method.new get_os_policy_assignment_config
|
1600
|
+
list_os_policy_assignments_config = parent_rpcs.list_os_policy_assignments if parent_rpcs.respond_to? :list_os_policy_assignments
|
1601
|
+
@list_os_policy_assignments = ::Gapic::Config::Method.new list_os_policy_assignments_config
|
1602
|
+
list_os_policy_assignment_revisions_config = parent_rpcs.list_os_policy_assignment_revisions if parent_rpcs.respond_to? :list_os_policy_assignment_revisions
|
1603
|
+
@list_os_policy_assignment_revisions = ::Gapic::Config::Method.new list_os_policy_assignment_revisions_config
|
1604
|
+
delete_os_policy_assignment_config = parent_rpcs.delete_os_policy_assignment if parent_rpcs.respond_to? :delete_os_policy_assignment
|
1605
|
+
@delete_os_policy_assignment = ::Gapic::Config::Method.new delete_os_policy_assignment_config
|
1606
|
+
get_os_policy_assignment_report_config = parent_rpcs.get_os_policy_assignment_report if parent_rpcs.respond_to? :get_os_policy_assignment_report
|
1607
|
+
@get_os_policy_assignment_report = ::Gapic::Config::Method.new get_os_policy_assignment_report_config
|
1608
|
+
list_os_policy_assignment_reports_config = parent_rpcs.list_os_policy_assignment_reports if parent_rpcs.respond_to? :list_os_policy_assignment_reports
|
1609
|
+
@list_os_policy_assignment_reports = ::Gapic::Config::Method.new list_os_policy_assignment_reports_config
|
635
1610
|
get_inventory_config = parent_rpcs.get_inventory if parent_rpcs.respond_to? :get_inventory
|
636
1611
|
@get_inventory = ::Gapic::Config::Method.new get_inventory_config
|
637
1612
|
list_inventories_config = parent_rpcs.list_inventories if parent_rpcs.respond_to? :list_inventories
|