google-cloud-security_center-v1 0.8.0 → 0.10.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/security_center/v1/security_center/client.rb +602 -128
- data/lib/google/cloud/security_center/v1/security_center/operations.rb +145 -33
- data/lib/google/cloud/security_center/v1/version.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/asset_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/finding_pb.rb +4 -2
- data/lib/google/cloud/securitycenter/v1/folder_pb.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/indicator_pb.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/notification_config_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/notification_message_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/organization_settings_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/resource_pb.rb +4 -2
- data/lib/google/cloud/securitycenter/v1/run_asset_discovery_response_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/security_marks_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/securitycenter_service_pb.rb +4 -2
- data/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/source_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb +86 -0
- data/proto_docs/google/cloud/securitycenter/v1/finding.rb +5 -0
- data/proto_docs/google/cloud/securitycenter/v1/resource.rb +6 -0
- data/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb +7 -0
- data/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb +226 -0
- metadata +6 -4
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all SecurityCenter clients
|
47
|
+
# ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -173,19 +172,15 @@ module Google
|
|
173
172
|
##
|
174
173
|
# Create a new SecurityCenter client object.
|
175
174
|
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
# To create a new SecurityCenter client with the default
|
179
|
-
# configuration:
|
180
|
-
#
|
181
|
-
# client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
175
|
+
# @example
|
182
176
|
#
|
183
|
-
#
|
184
|
-
#
|
177
|
+
# # Create a client using the default configuration
|
178
|
+
# client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
185
179
|
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
180
|
+
# # Create a client using a custom configuration
|
181
|
+
# client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config|
|
182
|
+
# config.timeout = 10.0
|
183
|
+
# end
|
189
184
|
#
|
190
185
|
# @yield [config] Configure the SecurityCenter client.
|
191
186
|
# @yieldparam config [Client::Configuration]
|
@@ -205,10 +200,9 @@ module Google
|
|
205
200
|
|
206
201
|
# Create credentials
|
207
202
|
credentials = @config.credentials
|
208
|
-
# Use self-signed JWT if the
|
203
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
209
204
|
# but only if the default endpoint does not have a region prefix.
|
210
|
-
enable_self_signed_jwt = @config.
|
211
|
-
@config.endpoint == Client.configure.endpoint &&
|
205
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
212
206
|
!@config.endpoint.split(".").first.include?("-")
|
213
207
|
credentials ||= Credentials.default scope: @config.scope,
|
214
208
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -274,6 +268,21 @@ module Google
|
|
274
268
|
#
|
275
269
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
276
270
|
#
|
271
|
+
# @example Basic example
|
272
|
+
# require "google/cloud/security_center/v1"
|
273
|
+
#
|
274
|
+
# # Create a client object. The client can be reused for multiple calls.
|
275
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
276
|
+
#
|
277
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
278
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new
|
279
|
+
#
|
280
|
+
# # Call the create_source method.
|
281
|
+
# result = client.create_source request
|
282
|
+
#
|
283
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
284
|
+
# p result
|
285
|
+
#
|
277
286
|
def create_source request, options = nil
|
278
287
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
279
288
|
|
@@ -291,16 +300,20 @@ module Google
|
|
291
300
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
292
301
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
293
302
|
|
294
|
-
header_params = {
|
295
|
-
|
296
|
-
|
303
|
+
header_params = {}
|
304
|
+
if request.parent
|
305
|
+
header_params["parent"] = request.parent
|
306
|
+
end
|
307
|
+
|
297
308
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
298
309
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
299
310
|
|
300
311
|
options.apply_defaults timeout: @config.rpcs.create_source.timeout,
|
301
312
|
metadata: metadata,
|
302
313
|
retry_policy: @config.rpcs.create_source.retry_policy
|
303
|
-
|
314
|
+
|
315
|
+
options.apply_defaults timeout: @config.timeout,
|
316
|
+
metadata: @config.metadata,
|
304
317
|
retry_policy: @config.retry_policy
|
305
318
|
|
306
319
|
@security_center_stub.call_rpc :create_source, request, options: options do |response, operation|
|
@@ -349,6 +362,21 @@ module Google
|
|
349
362
|
#
|
350
363
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
351
364
|
#
|
365
|
+
# @example Basic example
|
366
|
+
# require "google/cloud/security_center/v1"
|
367
|
+
#
|
368
|
+
# # Create a client object. The client can be reused for multiple calls.
|
369
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
370
|
+
#
|
371
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
372
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new
|
373
|
+
#
|
374
|
+
# # Call the create_finding method.
|
375
|
+
# result = client.create_finding request
|
376
|
+
#
|
377
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
378
|
+
# p result
|
379
|
+
#
|
352
380
|
def create_finding request, options = nil
|
353
381
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
354
382
|
|
@@ -366,16 +394,20 @@ module Google
|
|
366
394
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
367
395
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
368
396
|
|
369
|
-
header_params = {
|
370
|
-
|
371
|
-
|
397
|
+
header_params = {}
|
398
|
+
if request.parent
|
399
|
+
header_params["parent"] = request.parent
|
400
|
+
end
|
401
|
+
|
372
402
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
373
403
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
374
404
|
|
375
405
|
options.apply_defaults timeout: @config.rpcs.create_finding.timeout,
|
376
406
|
metadata: metadata,
|
377
407
|
retry_policy: @config.rpcs.create_finding.retry_policy
|
378
|
-
|
408
|
+
|
409
|
+
options.apply_defaults timeout: @config.timeout,
|
410
|
+
metadata: @config.metadata,
|
379
411
|
retry_policy: @config.retry_policy
|
380
412
|
|
381
413
|
@security_center_stub.call_rpc :create_finding, request, options: options do |response, operation|
|
@@ -424,6 +456,21 @@ module Google
|
|
424
456
|
#
|
425
457
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
426
458
|
#
|
459
|
+
# @example Basic example
|
460
|
+
# require "google/cloud/security_center/v1"
|
461
|
+
#
|
462
|
+
# # Create a client object. The client can be reused for multiple calls.
|
463
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
464
|
+
#
|
465
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
466
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new
|
467
|
+
#
|
468
|
+
# # Call the create_notification_config method.
|
469
|
+
# result = client.create_notification_config request
|
470
|
+
#
|
471
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
472
|
+
# p result
|
473
|
+
#
|
427
474
|
def create_notification_config request, options = nil
|
428
475
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
429
476
|
|
@@ -441,16 +488,20 @@ module Google
|
|
441
488
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
442
489
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
443
490
|
|
444
|
-
header_params = {
|
445
|
-
|
446
|
-
|
491
|
+
header_params = {}
|
492
|
+
if request.parent
|
493
|
+
header_params["parent"] = request.parent
|
494
|
+
end
|
495
|
+
|
447
496
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
448
497
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
449
498
|
|
450
499
|
options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout,
|
451
500
|
metadata: metadata,
|
452
501
|
retry_policy: @config.rpcs.create_notification_config.retry_policy
|
453
|
-
|
502
|
+
|
503
|
+
options.apply_defaults timeout: @config.timeout,
|
504
|
+
metadata: @config.metadata,
|
454
505
|
retry_policy: @config.retry_policy
|
455
506
|
|
456
507
|
@security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation|
|
@@ -491,6 +542,21 @@ module Google
|
|
491
542
|
#
|
492
543
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
493
544
|
#
|
545
|
+
# @example Basic example
|
546
|
+
# require "google/cloud/security_center/v1"
|
547
|
+
#
|
548
|
+
# # Create a client object. The client can be reused for multiple calls.
|
549
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
550
|
+
#
|
551
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
552
|
+
# request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new
|
553
|
+
#
|
554
|
+
# # Call the delete_notification_config method.
|
555
|
+
# result = client.delete_notification_config request
|
556
|
+
#
|
557
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
558
|
+
# p result
|
559
|
+
#
|
494
560
|
def delete_notification_config request, options = nil
|
495
561
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
496
562
|
|
@@ -508,16 +574,20 @@ module Google
|
|
508
574
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
509
575
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
510
576
|
|
511
|
-
header_params = {
|
512
|
-
|
513
|
-
|
577
|
+
header_params = {}
|
578
|
+
if request.name
|
579
|
+
header_params["name"] = request.name
|
580
|
+
end
|
581
|
+
|
514
582
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
515
583
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
516
584
|
|
517
585
|
options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout,
|
518
586
|
metadata: metadata,
|
519
587
|
retry_policy: @config.rpcs.delete_notification_config.retry_policy
|
520
|
-
|
588
|
+
|
589
|
+
options.apply_defaults timeout: @config.timeout,
|
590
|
+
metadata: @config.metadata,
|
521
591
|
retry_policy: @config.retry_policy
|
522
592
|
|
523
593
|
@security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation|
|
@@ -561,6 +631,21 @@ module Google
|
|
561
631
|
#
|
562
632
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
563
633
|
#
|
634
|
+
# @example Basic example
|
635
|
+
# require "google/cloud/security_center/v1"
|
636
|
+
#
|
637
|
+
# # Create a client object. The client can be reused for multiple calls.
|
638
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
639
|
+
#
|
640
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
641
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
642
|
+
#
|
643
|
+
# # Call the get_iam_policy method.
|
644
|
+
# result = client.get_iam_policy request
|
645
|
+
#
|
646
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
647
|
+
# p result
|
648
|
+
#
|
564
649
|
def get_iam_policy request, options = nil
|
565
650
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
566
651
|
|
@@ -578,16 +663,20 @@ module Google
|
|
578
663
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
579
664
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
580
665
|
|
581
|
-
header_params = {
|
582
|
-
|
583
|
-
|
666
|
+
header_params = {}
|
667
|
+
if request.resource
|
668
|
+
header_params["resource"] = request.resource
|
669
|
+
end
|
670
|
+
|
584
671
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
585
672
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
586
673
|
|
587
674
|
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
588
675
|
metadata: metadata,
|
589
676
|
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
590
|
-
|
677
|
+
|
678
|
+
options.apply_defaults timeout: @config.timeout,
|
679
|
+
metadata: @config.metadata,
|
591
680
|
retry_policy: @config.retry_policy
|
592
681
|
|
593
682
|
@security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
@@ -628,6 +717,21 @@ module Google
|
|
628
717
|
#
|
629
718
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
630
719
|
#
|
720
|
+
# @example Basic example
|
721
|
+
# require "google/cloud/security_center/v1"
|
722
|
+
#
|
723
|
+
# # Create a client object. The client can be reused for multiple calls.
|
724
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
725
|
+
#
|
726
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
727
|
+
# request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new
|
728
|
+
#
|
729
|
+
# # Call the get_notification_config method.
|
730
|
+
# result = client.get_notification_config request
|
731
|
+
#
|
732
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
733
|
+
# p result
|
734
|
+
#
|
631
735
|
def get_notification_config request, options = nil
|
632
736
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
633
737
|
|
@@ -645,16 +749,20 @@ module Google
|
|
645
749
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
646
750
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
647
751
|
|
648
|
-
header_params = {
|
649
|
-
|
650
|
-
|
752
|
+
header_params = {}
|
753
|
+
if request.name
|
754
|
+
header_params["name"] = request.name
|
755
|
+
end
|
756
|
+
|
651
757
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
652
758
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
653
759
|
|
654
760
|
options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout,
|
655
761
|
metadata: metadata,
|
656
762
|
retry_policy: @config.rpcs.get_notification_config.retry_policy
|
657
|
-
|
763
|
+
|
764
|
+
options.apply_defaults timeout: @config.timeout,
|
765
|
+
metadata: @config.metadata,
|
658
766
|
retry_policy: @config.retry_policy
|
659
767
|
|
660
768
|
@security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation|
|
@@ -695,6 +803,21 @@ module Google
|
|
695
803
|
#
|
696
804
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
697
805
|
#
|
806
|
+
# @example Basic example
|
807
|
+
# require "google/cloud/security_center/v1"
|
808
|
+
#
|
809
|
+
# # Create a client object. The client can be reused for multiple calls.
|
810
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
811
|
+
#
|
812
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
813
|
+
# request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new
|
814
|
+
#
|
815
|
+
# # Call the get_organization_settings method.
|
816
|
+
# result = client.get_organization_settings request
|
817
|
+
#
|
818
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings.
|
819
|
+
# p result
|
820
|
+
#
|
698
821
|
def get_organization_settings request, options = nil
|
699
822
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
700
823
|
|
@@ -712,16 +835,20 @@ module Google
|
|
712
835
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
713
836
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
714
837
|
|
715
|
-
header_params = {
|
716
|
-
|
717
|
-
|
838
|
+
header_params = {}
|
839
|
+
if request.name
|
840
|
+
header_params["name"] = request.name
|
841
|
+
end
|
842
|
+
|
718
843
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
719
844
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
720
845
|
|
721
846
|
options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout,
|
722
847
|
metadata: metadata,
|
723
848
|
retry_policy: @config.rpcs.get_organization_settings.retry_policy
|
724
|
-
|
849
|
+
|
850
|
+
options.apply_defaults timeout: @config.timeout,
|
851
|
+
metadata: @config.metadata,
|
725
852
|
retry_policy: @config.retry_policy
|
726
853
|
|
727
854
|
@security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation|
|
@@ -762,6 +889,21 @@ module Google
|
|
762
889
|
#
|
763
890
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
764
891
|
#
|
892
|
+
# @example Basic example
|
893
|
+
# require "google/cloud/security_center/v1"
|
894
|
+
#
|
895
|
+
# # Create a client object. The client can be reused for multiple calls.
|
896
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
897
|
+
#
|
898
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
899
|
+
# request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new
|
900
|
+
#
|
901
|
+
# # Call the get_source method.
|
902
|
+
# result = client.get_source request
|
903
|
+
#
|
904
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
905
|
+
# p result
|
906
|
+
#
|
765
907
|
def get_source request, options = nil
|
766
908
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
767
909
|
|
@@ -779,16 +921,20 @@ module Google
|
|
779
921
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
780
922
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
781
923
|
|
782
|
-
header_params = {
|
783
|
-
|
784
|
-
|
924
|
+
header_params = {}
|
925
|
+
if request.name
|
926
|
+
header_params["name"] = request.name
|
927
|
+
end
|
928
|
+
|
785
929
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
786
930
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
787
931
|
|
788
932
|
options.apply_defaults timeout: @config.rpcs.get_source.timeout,
|
789
933
|
metadata: metadata,
|
790
934
|
retry_policy: @config.rpcs.get_source.retry_policy
|
791
|
-
|
935
|
+
|
936
|
+
options.apply_defaults timeout: @config.timeout,
|
937
|
+
metadata: @config.metadata,
|
792
938
|
retry_policy: @config.retry_policy
|
793
939
|
|
794
940
|
@security_center_stub.call_rpc :get_source, request, options: options do |response, operation|
|
@@ -953,6 +1099,27 @@ module Google
|
|
953
1099
|
#
|
954
1100
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
955
1101
|
#
|
1102
|
+
# @example Basic example
|
1103
|
+
# require "google/cloud/security_center/v1"
|
1104
|
+
#
|
1105
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1106
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1107
|
+
#
|
1108
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1109
|
+
# request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new
|
1110
|
+
#
|
1111
|
+
# # Call the group_assets method.
|
1112
|
+
# result = client.group_assets request
|
1113
|
+
#
|
1114
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1115
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1116
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1117
|
+
# # methods are also available for managing paging directly.
|
1118
|
+
# result.each do |response|
|
1119
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
|
1120
|
+
# p response
|
1121
|
+
# end
|
1122
|
+
#
|
956
1123
|
def group_assets request, options = nil
|
957
1124
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
958
1125
|
|
@@ -970,16 +1137,20 @@ module Google
|
|
970
1137
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
971
1138
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
972
1139
|
|
973
|
-
header_params = {
|
974
|
-
|
975
|
-
|
1140
|
+
header_params = {}
|
1141
|
+
if request.parent
|
1142
|
+
header_params["parent"] = request.parent
|
1143
|
+
end
|
1144
|
+
|
976
1145
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
977
1146
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
978
1147
|
|
979
1148
|
options.apply_defaults timeout: @config.rpcs.group_assets.timeout,
|
980
1149
|
metadata: metadata,
|
981
1150
|
retry_policy: @config.rpcs.group_assets.retry_policy
|
982
|
-
|
1151
|
+
|
1152
|
+
options.apply_defaults timeout: @config.timeout,
|
1153
|
+
metadata: @config.metadata,
|
983
1154
|
retry_policy: @config.retry_policy
|
984
1155
|
|
985
1156
|
@security_center_stub.call_rpc :group_assets, request, options: options do |response, operation|
|
@@ -1153,6 +1324,27 @@ module Google
|
|
1153
1324
|
#
|
1154
1325
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1155
1326
|
#
|
1327
|
+
# @example Basic example
|
1328
|
+
# require "google/cloud/security_center/v1"
|
1329
|
+
#
|
1330
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1331
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1332
|
+
#
|
1333
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1334
|
+
# request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new
|
1335
|
+
#
|
1336
|
+
# # Call the group_findings method.
|
1337
|
+
# result = client.group_findings request
|
1338
|
+
#
|
1339
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1340
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1341
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1342
|
+
# # methods are also available for managing paging directly.
|
1343
|
+
# result.each do |response|
|
1344
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
|
1345
|
+
# p response
|
1346
|
+
# end
|
1347
|
+
#
|
1156
1348
|
def group_findings request, options = nil
|
1157
1349
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1158
1350
|
|
@@ -1170,16 +1362,20 @@ module Google
|
|
1170
1362
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1171
1363
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1172
1364
|
|
1173
|
-
header_params = {
|
1174
|
-
|
1175
|
-
|
1365
|
+
header_params = {}
|
1366
|
+
if request.parent
|
1367
|
+
header_params["parent"] = request.parent
|
1368
|
+
end
|
1369
|
+
|
1176
1370
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1177
1371
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1178
1372
|
|
1179
1373
|
options.apply_defaults timeout: @config.rpcs.group_findings.timeout,
|
1180
1374
|
metadata: metadata,
|
1181
1375
|
retry_policy: @config.rpcs.group_findings.retry_policy
|
1182
|
-
|
1376
|
+
|
1377
|
+
options.apply_defaults timeout: @config.timeout,
|
1378
|
+
metadata: @config.metadata,
|
1183
1379
|
retry_policy: @config.retry_policy
|
1184
1380
|
|
1185
1381
|
@security_center_stub.call_rpc :group_findings, request, options: options do |response, operation|
|
@@ -1348,6 +1544,27 @@ module Google
|
|
1348
1544
|
#
|
1349
1545
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1350
1546
|
#
|
1547
|
+
# @example Basic example
|
1548
|
+
# require "google/cloud/security_center/v1"
|
1549
|
+
#
|
1550
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1551
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1552
|
+
#
|
1553
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1554
|
+
# request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new
|
1555
|
+
#
|
1556
|
+
# # Call the list_assets method.
|
1557
|
+
# result = client.list_assets request
|
1558
|
+
#
|
1559
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1560
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1561
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1562
|
+
# # methods are also available for managing paging directly.
|
1563
|
+
# result.each do |response|
|
1564
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult.
|
1565
|
+
# p response
|
1566
|
+
# end
|
1567
|
+
#
|
1351
1568
|
def list_assets request, options = nil
|
1352
1569
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1353
1570
|
|
@@ -1365,16 +1582,20 @@ module Google
|
|
1365
1582
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1366
1583
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1367
1584
|
|
1368
|
-
header_params = {
|
1369
|
-
|
1370
|
-
|
1585
|
+
header_params = {}
|
1586
|
+
if request.parent
|
1587
|
+
header_params["parent"] = request.parent
|
1588
|
+
end
|
1589
|
+
|
1371
1590
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1372
1591
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1373
1592
|
|
1374
1593
|
options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
|
1375
1594
|
metadata: metadata,
|
1376
1595
|
retry_policy: @config.rpcs.list_assets.retry_policy
|
1377
|
-
|
1596
|
+
|
1597
|
+
options.apply_defaults timeout: @config.timeout,
|
1598
|
+
metadata: @config.metadata,
|
1378
1599
|
retry_policy: @config.retry_policy
|
1379
1600
|
|
1380
1601
|
@security_center_stub.call_rpc :list_assets, request, options: options do |response, operation|
|
@@ -1476,6 +1697,7 @@ module Google
|
|
1476
1697
|
# * resource.project_display_name: `=`, `:`
|
1477
1698
|
# * resource.type: `=`, `:`
|
1478
1699
|
# * resource.folders.resource_folder: `=`, `:`
|
1700
|
+
# * resource.display_name: `=`, `:`
|
1479
1701
|
# @param order_by [::String]
|
1480
1702
|
# Expression that defines what fields and order to use for sorting. The
|
1481
1703
|
# string value should follow SQL syntax: comma separated list of fields. For
|
@@ -1550,6 +1772,27 @@ module Google
|
|
1550
1772
|
#
|
1551
1773
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1552
1774
|
#
|
1775
|
+
# @example Basic example
|
1776
|
+
# require "google/cloud/security_center/v1"
|
1777
|
+
#
|
1778
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1779
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1780
|
+
#
|
1781
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1782
|
+
# request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new
|
1783
|
+
#
|
1784
|
+
# # Call the list_findings method.
|
1785
|
+
# result = client.list_findings request
|
1786
|
+
#
|
1787
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1788
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1789
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1790
|
+
# # methods are also available for managing paging directly.
|
1791
|
+
# result.each do |response|
|
1792
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult.
|
1793
|
+
# p response
|
1794
|
+
# end
|
1795
|
+
#
|
1553
1796
|
def list_findings request, options = nil
|
1554
1797
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1555
1798
|
|
@@ -1567,16 +1810,20 @@ module Google
|
|
1567
1810
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1568
1811
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1569
1812
|
|
1570
|
-
header_params = {
|
1571
|
-
|
1572
|
-
|
1813
|
+
header_params = {}
|
1814
|
+
if request.parent
|
1815
|
+
header_params["parent"] = request.parent
|
1816
|
+
end
|
1817
|
+
|
1573
1818
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1574
1819
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1575
1820
|
|
1576
1821
|
options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
|
1577
1822
|
metadata: metadata,
|
1578
1823
|
retry_policy: @config.rpcs.list_findings.retry_policy
|
1579
|
-
|
1824
|
+
|
1825
|
+
options.apply_defaults timeout: @config.timeout,
|
1826
|
+
metadata: @config.metadata,
|
1580
1827
|
retry_policy: @config.retry_policy
|
1581
1828
|
|
1582
1829
|
@security_center_stub.call_rpc :list_findings, request, options: options do |response, operation|
|
@@ -1625,6 +1872,27 @@ module Google
|
|
1625
1872
|
#
|
1626
1873
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1627
1874
|
#
|
1875
|
+
# @example Basic example
|
1876
|
+
# require "google/cloud/security_center/v1"
|
1877
|
+
#
|
1878
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1879
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1880
|
+
#
|
1881
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1882
|
+
# request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new
|
1883
|
+
#
|
1884
|
+
# # Call the list_notification_configs method.
|
1885
|
+
# result = client.list_notification_configs request
|
1886
|
+
#
|
1887
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1888
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1889
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1890
|
+
# # methods are also available for managing paging directly.
|
1891
|
+
# result.each do |response|
|
1892
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
1893
|
+
# p response
|
1894
|
+
# end
|
1895
|
+
#
|
1628
1896
|
def list_notification_configs request, options = nil
|
1629
1897
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1630
1898
|
|
@@ -1642,16 +1910,20 @@ module Google
|
|
1642
1910
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1643
1911
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1644
1912
|
|
1645
|
-
header_params = {
|
1646
|
-
|
1647
|
-
|
1913
|
+
header_params = {}
|
1914
|
+
if request.parent
|
1915
|
+
header_params["parent"] = request.parent
|
1916
|
+
end
|
1917
|
+
|
1648
1918
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1649
1919
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1650
1920
|
|
1651
1921
|
options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout,
|
1652
1922
|
metadata: metadata,
|
1653
1923
|
retry_policy: @config.rpcs.list_notification_configs.retry_policy
|
1654
|
-
|
1924
|
+
|
1925
|
+
options.apply_defaults timeout: @config.timeout,
|
1926
|
+
metadata: @config.metadata,
|
1655
1927
|
retry_policy: @config.retry_policy
|
1656
1928
|
|
1657
1929
|
@security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation|
|
@@ -1701,6 +1973,27 @@ module Google
|
|
1701
1973
|
#
|
1702
1974
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1703
1975
|
#
|
1976
|
+
# @example Basic example
|
1977
|
+
# require "google/cloud/security_center/v1"
|
1978
|
+
#
|
1979
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1980
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1981
|
+
#
|
1982
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1983
|
+
# request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new
|
1984
|
+
#
|
1985
|
+
# # Call the list_sources method.
|
1986
|
+
# result = client.list_sources request
|
1987
|
+
#
|
1988
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1989
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1990
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1991
|
+
# # methods are also available for managing paging directly.
|
1992
|
+
# result.each do |response|
|
1993
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source.
|
1994
|
+
# p response
|
1995
|
+
# end
|
1996
|
+
#
|
1704
1997
|
def list_sources request, options = nil
|
1705
1998
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1706
1999
|
|
@@ -1718,16 +2011,20 @@ module Google
|
|
1718
2011
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1719
2012
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1720
2013
|
|
1721
|
-
header_params = {
|
1722
|
-
|
1723
|
-
|
2014
|
+
header_params = {}
|
2015
|
+
if request.parent
|
2016
|
+
header_params["parent"] = request.parent
|
2017
|
+
end
|
2018
|
+
|
1724
2019
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1725
2020
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1726
2021
|
|
1727
2022
|
options.apply_defaults timeout: @config.rpcs.list_sources.timeout,
|
1728
2023
|
metadata: metadata,
|
1729
2024
|
retry_policy: @config.rpcs.list_sources.retry_policy
|
1730
|
-
|
2025
|
+
|
2026
|
+
options.apply_defaults timeout: @config.timeout,
|
2027
|
+
metadata: @config.metadata,
|
1731
2028
|
retry_policy: @config.retry_policy
|
1732
2029
|
|
1733
2030
|
@security_center_stub.call_rpc :list_sources, request, options: options do |response, operation|
|
@@ -1774,6 +2071,28 @@ module Google
|
|
1774
2071
|
#
|
1775
2072
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1776
2073
|
#
|
2074
|
+
# @example Basic example
|
2075
|
+
# require "google/cloud/security_center/v1"
|
2076
|
+
#
|
2077
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2078
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2079
|
+
#
|
2080
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2081
|
+
# request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new
|
2082
|
+
#
|
2083
|
+
# # Call the run_asset_discovery method.
|
2084
|
+
# result = client.run_asset_discovery request
|
2085
|
+
#
|
2086
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2087
|
+
# # object to check the status of an operation, cancel it, or wait
|
2088
|
+
# # for results. Here is how to block until completion:
|
2089
|
+
# result.wait_until_done! timeout: 60
|
2090
|
+
# if result.response?
|
2091
|
+
# p result.response
|
2092
|
+
# else
|
2093
|
+
# puts "Error!"
|
2094
|
+
# end
|
2095
|
+
#
|
1777
2096
|
def run_asset_discovery request, options = nil
|
1778
2097
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1779
2098
|
|
@@ -1791,16 +2110,20 @@ module Google
|
|
1791
2110
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1792
2111
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1793
2112
|
|
1794
|
-
header_params = {
|
1795
|
-
|
1796
|
-
|
2113
|
+
header_params = {}
|
2114
|
+
if request.parent
|
2115
|
+
header_params["parent"] = request.parent
|
2116
|
+
end
|
2117
|
+
|
1797
2118
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1798
2119
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1799
2120
|
|
1800
2121
|
options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout,
|
1801
2122
|
metadata: metadata,
|
1802
2123
|
retry_policy: @config.rpcs.run_asset_discovery.retry_policy
|
1803
|
-
|
2124
|
+
|
2125
|
+
options.apply_defaults timeout: @config.timeout,
|
2126
|
+
metadata: @config.metadata,
|
1804
2127
|
retry_policy: @config.retry_policy
|
1805
2128
|
|
1806
2129
|
@security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation|
|
@@ -1848,6 +2171,21 @@ module Google
|
|
1848
2171
|
#
|
1849
2172
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1850
2173
|
#
|
2174
|
+
# @example Basic example
|
2175
|
+
# require "google/cloud/security_center/v1"
|
2176
|
+
#
|
2177
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2178
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2179
|
+
#
|
2180
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2181
|
+
# request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new
|
2182
|
+
#
|
2183
|
+
# # Call the set_finding_state method.
|
2184
|
+
# result = client.set_finding_state request
|
2185
|
+
#
|
2186
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
2187
|
+
# p result
|
2188
|
+
#
|
1851
2189
|
def set_finding_state request, options = nil
|
1852
2190
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1853
2191
|
|
@@ -1865,16 +2203,20 @@ module Google
|
|
1865
2203
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1866
2204
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1867
2205
|
|
1868
|
-
header_params = {
|
1869
|
-
|
1870
|
-
|
2206
|
+
header_params = {}
|
2207
|
+
if request.name
|
2208
|
+
header_params["name"] = request.name
|
2209
|
+
end
|
2210
|
+
|
1871
2211
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1872
2212
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1873
2213
|
|
1874
2214
|
options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
|
1875
2215
|
metadata: metadata,
|
1876
2216
|
retry_policy: @config.rpcs.set_finding_state.retry_policy
|
1877
|
-
|
2217
|
+
|
2218
|
+
options.apply_defaults timeout: @config.timeout,
|
2219
|
+
metadata: @config.metadata,
|
1878
2220
|
retry_policy: @config.retry_policy
|
1879
2221
|
|
1880
2222
|
@security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation|
|
@@ -1920,6 +2262,21 @@ module Google
|
|
1920
2262
|
#
|
1921
2263
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1922
2264
|
#
|
2265
|
+
# @example Basic example
|
2266
|
+
# require "google/cloud/security_center/v1"
|
2267
|
+
#
|
2268
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2269
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2270
|
+
#
|
2271
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2272
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
2273
|
+
#
|
2274
|
+
# # Call the set_iam_policy method.
|
2275
|
+
# result = client.set_iam_policy request
|
2276
|
+
#
|
2277
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
2278
|
+
# p result
|
2279
|
+
#
|
1923
2280
|
def set_iam_policy request, options = nil
|
1924
2281
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1925
2282
|
|
@@ -1937,16 +2294,20 @@ module Google
|
|
1937
2294
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1938
2295
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1939
2296
|
|
1940
|
-
header_params = {
|
1941
|
-
|
1942
|
-
|
2297
|
+
header_params = {}
|
2298
|
+
if request.resource
|
2299
|
+
header_params["resource"] = request.resource
|
2300
|
+
end
|
2301
|
+
|
1943
2302
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1944
2303
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1945
2304
|
|
1946
2305
|
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
1947
2306
|
metadata: metadata,
|
1948
2307
|
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
1949
|
-
|
2308
|
+
|
2309
|
+
options.apply_defaults timeout: @config.timeout,
|
2310
|
+
metadata: @config.metadata,
|
1950
2311
|
retry_policy: @config.retry_policy
|
1951
2312
|
|
1952
2313
|
@security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
@@ -1992,6 +2353,21 @@ module Google
|
|
1992
2353
|
#
|
1993
2354
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1994
2355
|
#
|
2356
|
+
# @example Basic example
|
2357
|
+
# require "google/cloud/security_center/v1"
|
2358
|
+
#
|
2359
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2360
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2361
|
+
#
|
2362
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2363
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
2364
|
+
#
|
2365
|
+
# # Call the test_iam_permissions method.
|
2366
|
+
# result = client.test_iam_permissions request
|
2367
|
+
#
|
2368
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
2369
|
+
# p result
|
2370
|
+
#
|
1995
2371
|
def test_iam_permissions request, options = nil
|
1996
2372
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1997
2373
|
|
@@ -2009,16 +2385,20 @@ module Google
|
|
2009
2385
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2010
2386
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2011
2387
|
|
2012
|
-
header_params = {
|
2013
|
-
|
2014
|
-
|
2388
|
+
header_params = {}
|
2389
|
+
if request.resource
|
2390
|
+
header_params["resource"] = request.resource
|
2391
|
+
end
|
2392
|
+
|
2015
2393
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2016
2394
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2017
2395
|
|
2018
2396
|
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
2019
2397
|
metadata: metadata,
|
2020
2398
|
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
2021
|
-
|
2399
|
+
|
2400
|
+
options.apply_defaults timeout: @config.timeout,
|
2401
|
+
metadata: @config.metadata,
|
2022
2402
|
retry_policy: @config.retry_policy
|
2023
2403
|
|
2024
2404
|
@security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
@@ -2072,6 +2452,21 @@ module Google
|
|
2072
2452
|
#
|
2073
2453
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2074
2454
|
#
|
2455
|
+
# @example Basic example
|
2456
|
+
# require "google/cloud/security_center/v1"
|
2457
|
+
#
|
2458
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2459
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2460
|
+
#
|
2461
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2462
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new
|
2463
|
+
#
|
2464
|
+
# # Call the update_finding method.
|
2465
|
+
# result = client.update_finding request
|
2466
|
+
#
|
2467
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
2468
|
+
# p result
|
2469
|
+
#
|
2075
2470
|
def update_finding request, options = nil
|
2076
2471
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2077
2472
|
|
@@ -2089,16 +2484,20 @@ module Google
|
|
2089
2484
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2090
2485
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2091
2486
|
|
2092
|
-
header_params = {
|
2093
|
-
|
2094
|
-
|
2487
|
+
header_params = {}
|
2488
|
+
if request.finding&.name
|
2489
|
+
header_params["finding.name"] = request.finding.name
|
2490
|
+
end
|
2491
|
+
|
2095
2492
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2096
2493
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2097
2494
|
|
2098
2495
|
options.apply_defaults timeout: @config.rpcs.update_finding.timeout,
|
2099
2496
|
metadata: metadata,
|
2100
2497
|
retry_policy: @config.rpcs.update_finding.retry_policy
|
2101
|
-
|
2498
|
+
|
2499
|
+
options.apply_defaults timeout: @config.timeout,
|
2500
|
+
metadata: @config.metadata,
|
2102
2501
|
retry_policy: @config.retry_policy
|
2103
2502
|
|
2104
2503
|
@security_center_stub.call_rpc :update_finding, request, options: options do |response, operation|
|
@@ -2143,6 +2542,21 @@ module Google
|
|
2143
2542
|
#
|
2144
2543
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2145
2544
|
#
|
2545
|
+
# @example Basic example
|
2546
|
+
# require "google/cloud/security_center/v1"
|
2547
|
+
#
|
2548
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2549
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2550
|
+
#
|
2551
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2552
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new
|
2553
|
+
#
|
2554
|
+
# # Call the update_notification_config method.
|
2555
|
+
# result = client.update_notification_config request
|
2556
|
+
#
|
2557
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
2558
|
+
# p result
|
2559
|
+
#
|
2146
2560
|
def update_notification_config request, options = nil
|
2147
2561
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2148
2562
|
|
@@ -2160,16 +2574,20 @@ module Google
|
|
2160
2574
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2161
2575
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2162
2576
|
|
2163
|
-
header_params = {
|
2164
|
-
|
2165
|
-
|
2577
|
+
header_params = {}
|
2578
|
+
if request.notification_config&.name
|
2579
|
+
header_params["notification_config.name"] = request.notification_config.name
|
2580
|
+
end
|
2581
|
+
|
2166
2582
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2167
2583
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2168
2584
|
|
2169
2585
|
options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout,
|
2170
2586
|
metadata: metadata,
|
2171
2587
|
retry_policy: @config.rpcs.update_notification_config.retry_policy
|
2172
|
-
|
2588
|
+
|
2589
|
+
options.apply_defaults timeout: @config.timeout,
|
2590
|
+
metadata: @config.metadata,
|
2173
2591
|
retry_policy: @config.retry_policy
|
2174
2592
|
|
2175
2593
|
@security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation|
|
@@ -2213,6 +2631,21 @@ module Google
|
|
2213
2631
|
#
|
2214
2632
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2215
2633
|
#
|
2634
|
+
# @example Basic example
|
2635
|
+
# require "google/cloud/security_center/v1"
|
2636
|
+
#
|
2637
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2638
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2639
|
+
#
|
2640
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2641
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new
|
2642
|
+
#
|
2643
|
+
# # Call the update_organization_settings method.
|
2644
|
+
# result = client.update_organization_settings request
|
2645
|
+
#
|
2646
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings.
|
2647
|
+
# p result
|
2648
|
+
#
|
2216
2649
|
def update_organization_settings request, options = nil
|
2217
2650
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2218
2651
|
|
@@ -2230,16 +2663,20 @@ module Google
|
|
2230
2663
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2231
2664
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2232
2665
|
|
2233
|
-
header_params = {
|
2234
|
-
|
2235
|
-
|
2666
|
+
header_params = {}
|
2667
|
+
if request.organization_settings&.name
|
2668
|
+
header_params["organization_settings.name"] = request.organization_settings.name
|
2669
|
+
end
|
2670
|
+
|
2236
2671
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2237
2672
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2238
2673
|
|
2239
2674
|
options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout,
|
2240
2675
|
metadata: metadata,
|
2241
2676
|
retry_policy: @config.rpcs.update_organization_settings.retry_policy
|
2242
|
-
|
2677
|
+
|
2678
|
+
options.apply_defaults timeout: @config.timeout,
|
2679
|
+
metadata: @config.metadata,
|
2243
2680
|
retry_policy: @config.retry_policy
|
2244
2681
|
|
2245
2682
|
@security_center_stub.call_rpc :update_organization_settings, request, options: options do |response, operation|
|
@@ -2283,6 +2720,21 @@ module Google
|
|
2283
2720
|
#
|
2284
2721
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2285
2722
|
#
|
2723
|
+
# @example Basic example
|
2724
|
+
# require "google/cloud/security_center/v1"
|
2725
|
+
#
|
2726
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2727
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2728
|
+
#
|
2729
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2730
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new
|
2731
|
+
#
|
2732
|
+
# # Call the update_source method.
|
2733
|
+
# result = client.update_source request
|
2734
|
+
#
|
2735
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
2736
|
+
# p result
|
2737
|
+
#
|
2286
2738
|
def update_source request, options = nil
|
2287
2739
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2288
2740
|
|
@@ -2300,16 +2752,20 @@ module Google
|
|
2300
2752
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2301
2753
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2302
2754
|
|
2303
|
-
header_params = {
|
2304
|
-
|
2305
|
-
|
2755
|
+
header_params = {}
|
2756
|
+
if request.source&.name
|
2757
|
+
header_params["source.name"] = request.source.name
|
2758
|
+
end
|
2759
|
+
|
2306
2760
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2307
2761
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2308
2762
|
|
2309
2763
|
options.apply_defaults timeout: @config.rpcs.update_source.timeout,
|
2310
2764
|
metadata: metadata,
|
2311
2765
|
retry_policy: @config.rpcs.update_source.retry_policy
|
2312
|
-
|
2766
|
+
|
2767
|
+
options.apply_defaults timeout: @config.timeout,
|
2768
|
+
metadata: @config.metadata,
|
2313
2769
|
retry_policy: @config.retry_policy
|
2314
2770
|
|
2315
2771
|
@security_center_stub.call_rpc :update_source, request, options: options do |response, operation|
|
@@ -2359,6 +2815,21 @@ module Google
|
|
2359
2815
|
#
|
2360
2816
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2361
2817
|
#
|
2818
|
+
# @example Basic example
|
2819
|
+
# require "google/cloud/security_center/v1"
|
2820
|
+
#
|
2821
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2822
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2823
|
+
#
|
2824
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2825
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new
|
2826
|
+
#
|
2827
|
+
# # Call the update_security_marks method.
|
2828
|
+
# result = client.update_security_marks request
|
2829
|
+
#
|
2830
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks.
|
2831
|
+
# p result
|
2832
|
+
#
|
2362
2833
|
def update_security_marks request, options = nil
|
2363
2834
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2364
2835
|
|
@@ -2376,16 +2847,20 @@ module Google
|
|
2376
2847
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2377
2848
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2378
2849
|
|
2379
|
-
header_params = {
|
2380
|
-
|
2381
|
-
|
2850
|
+
header_params = {}
|
2851
|
+
if request.security_marks&.name
|
2852
|
+
header_params["security_marks.name"] = request.security_marks.name
|
2853
|
+
end
|
2854
|
+
|
2382
2855
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2383
2856
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2384
2857
|
|
2385
2858
|
options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout,
|
2386
2859
|
metadata: metadata,
|
2387
2860
|
retry_policy: @config.rpcs.update_security_marks.retry_policy
|
2388
|
-
|
2861
|
+
|
2862
|
+
options.apply_defaults timeout: @config.timeout,
|
2863
|
+
metadata: @config.metadata,
|
2389
2864
|
retry_policy: @config.retry_policy
|
2390
2865
|
|
2391
2866
|
@security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation|
|
@@ -2409,22 +2884,21 @@ module Google
|
|
2409
2884
|
# Configuration can be applied globally to all clients, or to a single client
|
2410
2885
|
# on construction.
|
2411
2886
|
#
|
2412
|
-
#
|
2413
|
-
#
|
2414
|
-
#
|
2415
|
-
# to 20 seconds,
|
2416
|
-
#
|
2417
|
-
#
|
2418
|
-
#
|
2419
|
-
#
|
2420
|
-
#
|
2421
|
-
#
|
2422
|
-
#
|
2423
|
-
#
|
2424
|
-
#
|
2425
|
-
#
|
2426
|
-
#
|
2427
|
-
# end
|
2887
|
+
# @example
|
2888
|
+
#
|
2889
|
+
# # Modify the global config, setting the timeout for
|
2890
|
+
# # create_source to 20 seconds,
|
2891
|
+
# # and all remaining timeouts to 10 seconds.
|
2892
|
+
# ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config|
|
2893
|
+
# config.timeout = 10.0
|
2894
|
+
# config.rpcs.create_source.timeout = 20.0
|
2895
|
+
# end
|
2896
|
+
#
|
2897
|
+
# # Apply the above configuration only to a new client.
|
2898
|
+
# client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config|
|
2899
|
+
# config.timeout = 10.0
|
2900
|
+
# config.rpcs.create_source.timeout = 20.0
|
2901
|
+
# end
|
2428
2902
|
#
|
2429
2903
|
# @!attribute [rw] endpoint
|
2430
2904
|
# The hostname or hostname:port of the service endpoint.
|