Class: Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client
- Inherits:
-
Object
- Object
- Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/security_center/v1p1beta1/security_center/client.rb
Overview
Client for the SecurityCenter service.
V1p1Beta1 APIs for Security Center service.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client instance.
-
#create_finding(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Creates a finding.
-
#create_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Creates a notification config.
-
#create_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Creates a source.
-
#delete_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a notification config.
-
#get_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the access control policy on the specified Source.
-
#get_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Gets a notification config.
-
#get_organization_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings
Gets the settings for an organization.
-
#get_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Gets a source.
-
#group_assets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>
Filters an organization's assets and groups them by their specified properties.
-
#group_findings(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>
Filters an organization or source's findings and groups them by their specified properties.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new SecurityCenter client object.
-
#list_assets(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>
Lists an organization's assets.
-
#list_findings(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>
Lists an organization or source's findings.
-
#list_notification_configs(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>
Lists notification configs.
-
#list_sources(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>
Lists all sources belonging to an organization.
-
#run_asset_discovery(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Runs asset discovery.
-
#set_finding_state(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Updates the state of a finding.
-
#set_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on the specified Source.
-
#test_iam_permissions(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns the permissions that a caller has on the specified source.
-
#update_finding(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Creates or updates a finding.
-
#update_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Updates a notification config.
-
#update_organization_settings(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings
Updates an organization's settings.
-
#update_security_marks(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks
Updates security marks.
-
#update_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Updates a source.
Methods included from Paths
#finding_path, #folder_path, #notification_config_path, #organization_path, #organization_settings_path, #project_path, #security_marks_path, #source_path, #topic_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new SecurityCenter client object.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 188 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint end @security_center_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Operations (readonly)
Get the associated client for long-running operations.
236 237 238 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 236 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client class.
See Configuration for a description of the configuration fields.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 56 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "SecurityCenter", "V1p1beta1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.create_source.timeout = 60.0 default_config.rpcs.create_finding.timeout = 60.0 default_config.rpcs.create_notification_config.timeout = 60.0 default_config.rpcs.delete_notification_config.timeout = 60.0 default_config.rpcs.get_iam_policy.timeout = 60.0 default_config.rpcs.get_iam_policy.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_notification_config.timeout = 60.0 default_config.rpcs.get_notification_config.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_organization_settings.timeout = 60.0 default_config.rpcs.get_organization_settings.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_source.timeout = 60.0 default_config.rpcs.get_source.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.group_assets.timeout = 480.0 default_config.rpcs.group_assets.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.group_findings.timeout = 480.0 default_config.rpcs.group_findings.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_assets.timeout = 480.0 default_config.rpcs.list_assets.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_findings.timeout = 480.0 default_config.rpcs.list_findings.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_notification_configs.timeout = 60.0 default_config.rpcs.list_notification_configs.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_sources.timeout = 60.0 default_config.rpcs.list_sources.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.run_asset_discovery.timeout = 60.0 default_config.rpcs.set_finding_state.timeout = 60.0 default_config.rpcs.set_iam_policy.timeout = 60.0 default_config.rpcs..timeout = 60.0 default_config.rpcs..retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.update_finding.timeout = 60.0 default_config.rpcs.update_notification_config.timeout = 60.0 default_config.rpcs.update_organization_settings.timeout = 60.0 default_config.rpcs.update_source.timeout = 60.0 default_config.rpcs.update_security_marks.timeout = 480.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
167 168 169 170 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 167 def configure yield @config if block_given? @config end |
#create_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding #create_finding(parent: nil, finding_id: nil, finding: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Creates a finding. The corresponding source must exist for finding creation to succeed.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 380 def create_finding request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_finding..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_finding.timeout, metadata: , retry_policy: @config.rpcs.create_finding.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_finding, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig #create_notification_config(parent: nil, config_id: nil, notification_config: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Creates a notification config.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 473 def create_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_notification_config.timeout, metadata: , retry_policy: @config.rpcs.create_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source #create_source(parent: nil, source: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Creates a source.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 288 def create_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_source.timeout, metadata: , retry_policy: @config.rpcs.create_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_notification_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_notification_config(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a notification config.
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 559 def delete_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, metadata: , retry_policy: @config.rpcs.delete_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :delete_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy
Gets the access control policy on the specified Source.
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 648 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_iam_policy, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig #get_notification_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Gets a notification config.
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 734 def get_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_notification_config.timeout, metadata: , retry_policy: @config.rpcs.get_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_organization_settings(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings #get_organization_settings(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings
Gets the settings for an organization.
820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 820 def get_organization_settings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_organization_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_organization_settings.timeout, metadata: , retry_policy: @config.rpcs.get_organization_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_organization_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source #get_source(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Gets a source.
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 906 def get_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_source.timeout, metadata: , retry_policy: @config.rpcs.get_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#group_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult> #group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>
Filters an organization's assets and groups them by their specified properties.
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1120 def group_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.group_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.group_assets.timeout, metadata: , retry_policy: @config.rpcs.group_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :group_assets, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#group_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult> #group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>
Filters an organization or source's findings and groups them by their specified properties.
To group across all sources provide a -
as the source id.
Example: /v1/organizations/{organization_id}/sources/-/findings,
/v1/folders/{folder_id}/sources/-/findings,
/v1/projects/{project_id}/sources/-/findings
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1334 def group_findings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.group_findings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.group_findings.timeout, metadata: , retry_policy: @config.rpcs.group_findings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :group_findings, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult> #list_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>
Lists an organization's assets.
1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1552 def list_assets request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_assets..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_assets.timeout, metadata: , retry_policy: @config.rpcs.list_assets.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_assets, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult> #list_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>
Lists an organization or source's findings.
To list across all sources provide a -
as the source id.
Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1767 def list_findings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_findings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_findings.timeout, metadata: , retry_policy: @config.rpcs.list_findings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_findings, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_notification_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig> #list_notification_configs(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>
Lists notification configs.
1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1865 def list_notification_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_notification_configs..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, metadata: , retry_policy: @config.rpcs.list_notification_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_notification_configs, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_sources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source> #list_sources(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>
Lists all sources belonging to an organization.
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 1964 def list_sources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_sources..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_sources.timeout, metadata: , retry_policy: @config.rpcs.list_sources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_sources, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#run_asset_discovery(request, options = nil) ⇒ ::Gapic::Operation #run_asset_discovery(parent: nil) ⇒ ::Gapic::Operation
Runs asset discovery. The discovery is tracked with a long-running operation.
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2063 def run_asset_discovery request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.run_asset_discovery..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout, metadata: , retry_policy: @config.rpcs.run_asset_discovery.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :run_asset_discovery, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_finding_state(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding #set_finding_state(name: nil, state: nil, start_time: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Updates the state of a finding.
2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2156 def set_finding_state request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_finding_state..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_finding_state.timeout, metadata: , retry_policy: @config.rpcs.set_finding_state.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :set_finding_state, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on the specified Source.
2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2253 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :set_iam_policy, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns the permissions that a caller has on the specified source.
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2344 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :test_iam_permissions, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding #update_finding(finding: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Finding
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2443 def update_finding request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_finding..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.finding&.name header_params["finding.name"] = request.finding.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_finding.timeout, metadata: , retry_policy: @config.rpcs.update_finding.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_finding, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig #update_notification_config(notification_config: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig
Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter
2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2533 def update_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.notification_config&.name header_params["notification_config.name"] = request.notification_config.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_notification_config.timeout, metadata: , retry_policy: @config.rpcs.update_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_organization_settings(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings #update_organization_settings(organization_settings: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings
Updates an organization's settings.
2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2622 def update_organization_settings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_organization_settings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.organization_settings&.name header_params["organization_settings.name"] = request.organization_settings.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_organization_settings.timeout, metadata: , retry_policy: @config.rpcs.update_organization_settings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_organization_settings, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_security_marks(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks #update_security_marks(security_marks: nil, update_mask: nil, start_time: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks
Updates security marks.
2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2806 def update_security_marks request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_security_marks..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.security_marks&.name header_params["security_marks.name"] = request.security_marks.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_security_marks.timeout, metadata: , retry_policy: @config.rpcs.update_security_marks.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_security_marks, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source #update_source(source: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1p1beta1::Source
Updates a source.
2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 |
# File 'lib/google/cloud/security_center/v1p1beta1/security_center/client.rb', line 2711 def update_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.source&.name header_params["source.name"] = request.source.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_source.timeout, metadata: , retry_policy: @config.rpcs.update_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |