Class: Google::Cloud::SecurityCenter::V1::SecurityCenter::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/security_center/v1/security_center/client.rb

Overview

Client for the SecurityCenter service.

V1 APIs for Security Center service.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#big_query_export_path, #dlp_job_path, #effective_security_health_analytics_custom_module_path, #external_system_path, #finding_path, #folder_path, #mute_config_path, #notification_config_path, #organization_path, #organization_settings_path, #policy_path, #project_path, #security_health_analytics_custom_module_path, #security_health_analytics_settings_path, #security_marks_path, #source_path, #table_data_profile_path, #topic_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new SecurityCenter client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the SecurityCenter client.

Yield Parameters:



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 234

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/v1/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.nil? ||
                           (@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
    config.universe_domain = @config.universe_domain
  end

  @security_center_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::SecurityCenter::V1::SecurityCenter::Operations (readonly)

Get the associated client for long-running operations.



286
287
288
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 286

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.

Examples:


# Modify the configuration for all SecurityCenter clients
::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 62

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "SecurityCenter", "V1"]
    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_security_health_analytics_custom_module.timeout = 60.0

    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.delete_security_health_analytics_custom_module.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_effective_security_health_analytics_custom_module.timeout = 60.0
    default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0
    default_config.rpcs.get_security_health_analytics_custom_module.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_descendant_security_health_analytics_custom_modules.timeout = 60.0
    default_config.rpcs.list_descendant_security_health_analytics_custom_modules.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_effective_security_health_analytics_custom_modules.timeout = 60.0
    default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0
    default_config.rpcs.list_security_health_analytics_custom_modules.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.test_iam_permissions.timeout = 60.0
    default_config.rpcs.test_iam_permissions.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_security_health_analytics_custom_module.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

#bulk_mute_findings(request, options = nil) ⇒ ::Gapic::Operation #bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil) ⇒ ::Gapic::Operation

Kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new

# Call the bulk_mute_findings method.
result = client.bulk_mute_findings request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #bulk_mute_findings(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to bulk_mute_findings via a request object, either of type BulkMuteFindingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil) ⇒ ::Gapic::Operation

    Pass arguments to bulk_mute_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent, at which bulk action needs to be applied. Its format is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".

    • filter (::String) (defaults to: nil)

      Expression that identifies findings that should be updated. The expression is a list of zero or more restrictions combined via logical operators AND and OR. Parentheses are supported, and OR has higher precedence than AND.

      Restrictions have the form <field> <operator> <value> and may have a - character in front of them to indicate negation. The fields map to those defined in the corresponding resource.

      The supported operators are:

      • = for all value types.
      • >, <, >=, <= for integer values.
      • :, meaning substring matching, for strings.

      The supported value types are:

      • string literals in quotes.
      • integer literals without quotes.
      • boolean literals true and false without quotes.
    • mute_annotation (::String) (defaults to: nil)

      This can be a mute configuration name or any identifier for mute/unmute of findings based on the filter.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



369
370
371
372
373
374
375
376
377
378
379
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
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 369

def bulk_mute_findings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.bulk_mute_findings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.bulk_mute_findings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.bulk_mute_findings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :bulk_mute_findings, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#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.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



204
205
206
207
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 204

def configure
  yield @config if block_given?
  @config
end

#create_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport #create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

Creates a BigQuery export.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new

# Call the create_big_query_export method.
result = client.create_big_query_export request

# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport.
p result

Overloads:

  • #create_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

    Pass arguments to create_big_query_export via a request object, either of type CreateBigQueryExportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

    Pass arguments to create_big_query_export via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource of the new BigQuery export. Its format is "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • big_query_export (::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash) (defaults to: nil)

      Required. The BigQuery export being created.

    • big_query_export_id (::String) (defaults to: nil)

      Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 4730

def create_big_query_export request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_big_query_export..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_big_query_export.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_big_query_export.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_big_query_export, request, options: 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_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding #create_finding(parent: nil, finding_id: nil, finding: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

Creates a finding. The corresponding source must exist for finding creation to succeed.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new

# Call the create_finding method.
result = client.create_finding request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
p result

Overloads:

  • #create_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to create_finding via a request object, either of type CreateFindingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_finding(parent: nil, finding_id: nil, finding: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to create_finding via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]".

    • finding_id (::String) (defaults to: nil)

      Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.

    • finding (::Google::Cloud::SecurityCenter::V1::Finding, ::Hash) (defaults to: nil)

      Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



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
688
689
690
691
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 651

def create_finding request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_finding..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_finding.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_finding.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_finding, request, options: 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_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig #create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

Creates a mute config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new

# Call the create_mute_config method.
result = client.create_mute_config request

# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
p result

Overloads:

  • #create_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

    Pass arguments to create_mute_config via a request object, either of type CreateMuteConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

    Pass arguments to create_mute_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the new mute configs's parent. Its format is "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • mute_config (::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash) (defaults to: nil)

      Required. The mute config being created.

    • mute_config_id (::String) (defaults to: nil)

      Required. Unique identifier provided by the client within the parent scope. It must consist of only lowercase letters, numbers, and hyphens, must start with a letter, must end with either a letter or a number, and must be 63 characters or less.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



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
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 746

def create_mute_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_mute_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_mute_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_mute_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_mute_config, request, options: 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::V1::NotificationConfig #create_notification_config(parent: nil, config_id: nil, notification_config: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

Creates a notification config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new

# Call the create_notification_config method.
result = client.create_notification_config request

# The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
p result

Overloads:

  • #create_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

    Pass arguments to create_notification_config via a request object, either of type CreateNotificationConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_notification_config(parent: nil, config_id: nil, notification_config: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

    Pass arguments to create_notification_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the new notification config's parent. Its format is "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • config_id (::String) (defaults to: nil)

      Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters and contain alphanumeric characters, underscores, or hyphens only.

    • notification_config (::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash) (defaults to: nil)

      Required. The notification config being created. The name and the service account will be ignored as they are both output only fields on this resource.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 843

def create_notification_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_notification_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_notification_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_notification_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_notification_config, request, options: 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_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule #create_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new

# Call the create_security_health_analytics_custom_module method.
result = client.create_security_health_analytics_custom_module request

# The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.
p result

Overloads:

  • #create_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

    Pass arguments to create_security_health_analytics_custom_module via a request object, either of type CreateSecurityHealthAnalyticsCustomModuleRequest or an equivalent Hash.

    Parameters:

  • #create_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

    Pass arguments to create_security_health_analytics_custom_module via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the new custom module's parent. Its format is "organizations/{organization}/securityHealthAnalyticsSettings", "folders/{folder}/securityHealthAnalyticsSettings", or "projects/{project}/securityHealthAnalyticsSettings"

    • security_health_analytics_custom_module (::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule, ::Hash) (defaults to: nil)

      Required. SecurityHealthAnalytics custom module to create. The provided name is ignored and reset with provided parent information and server-generated ID.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



466
467
468
469
470
471
472
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
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 466

def create_security_health_analytics_custom_module request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSecurityHealthAnalyticsCustomModuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_security_health_analytics_custom_module..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_security_health_analytics_custom_module, request, options: 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::V1::Source #create_source(parent: nil, source: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

Creates a source.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new

# Call the create_source method.
result = client.create_source request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
p result

Overloads:

  • #create_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

    Pass arguments to create_source via a request object, either of type CreateSourceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_source(parent: nil, source: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

    Pass arguments to create_source via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]".

    • source (::Google::Cloud::SecurityCenter::V1::Source, ::Hash) (defaults to: nil)

      Required. The Source being created, only the display_name and description will be used. All other fields will be ignored.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



556
557
558
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
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 556

def create_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_source..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.create_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_source.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :create_source, request, options: 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_big_query_export(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_big_query_export(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an existing BigQuery export.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new

# Call the delete_big_query_export method.
result = client.delete_big_query_export request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_big_query_export(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_big_query_export via a request object, either of type DeleteBigQueryExportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_big_query_export(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_big_query_export via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 4819

def delete_big_query_export request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_big_query_export..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.delete_big_query_export.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_big_query_export.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :delete_big_query_export, request, options: 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_mute_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_mute_config(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes an existing mute config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new

# Call the delete_mute_config method.
result = client.delete_mute_config request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_mute_config(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_mute_config via a request object, either of type DeleteMuteConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_mute_config(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_mute_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the mute config to delete. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 932

def delete_mute_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_mute_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.delete_mute_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_mute_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :delete_mute_config, request, options: 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.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new

# Call the delete_notification_config method.
result = client.delete_notification_config request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_notification_config(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_notification_config via a request object, either of type DeleteNotificationConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_notification_config(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_notification_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the notification config to delete. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]", "folders/[folder_id]/notificationConfigs/[config_id]", or "projects/[project_id]/notificationConfigs/[config_id]".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1021

def delete_notification_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_notification_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.delete_notification_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_notification_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :delete_notification_config, request, options: 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_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new

# Call the delete_security_health_analytics_custom_module method.
result = client.delete_security_health_analytics_custom_module request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_security_health_analytics_custom_module via a request object, either of type DeleteSecurityHealthAnalyticsCustomModuleRequest or an equivalent Hash.

    Parameters:

  • #delete_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_security_health_analytics_custom_module via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the custom module to delete. Its format is "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}", "folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}", or "projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1113
1114
1115
1116
1117
1118
1119
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
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1113

def delete_security_health_analytics_custom_module request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_security_health_analytics_custom_module..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.delete_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :delete_security_health_analytics_custom_module, request, options: 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_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport #get_big_query_export(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

Gets a BigQuery export.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new

# Call the get_big_query_export method.
result = client.get_big_query_export request

# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport.
p result

Overloads:

  • #get_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

    Pass arguments to get_big_query_export via a request object, either of type GetBigQueryExportRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_big_query_export(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

    Pass arguments to get_big_query_export via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1202

def get_big_query_export request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_big_query_export..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_big_query_export.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_big_query_export.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_big_query_export, request, options: 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_effective_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule #get_effective_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule

Retrieves an EffectiveSecurityHealthAnalyticsCustomModule.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new

# Call the get_effective_security_health_analytics_custom_module method.
result = client.get_effective_security_health_analytics_custom_module request

# The returned object is of type Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.
p result

Overloads:

  • #get_effective_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule

    Pass arguments to get_effective_security_health_analytics_custom_module via a request object, either of type GetEffectiveSecurityHealthAnalyticsCustomModuleRequest or an equivalent Hash.

    Parameters:

  • #get_effective_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule

    Pass arguments to get_effective_security_health_analytics_custom_module via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the effective custom module to get. Its format is "organizations/{organization}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", "folders/{folder}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}", or "projects/{project}/securityHealthAnalyticsSettings/effectiveCustomModules/{customModule}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1647

def get_effective_security_health_analytics_custom_module request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_effective_security_health_analytics_custom_module..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_effective_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: 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.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1292

def get_iam_policy request, options = 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
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_iam_policy, request, options: 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_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig #get_mute_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

Gets a mute config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new

# Call the get_mute_config method.
result = client.get_mute_config request

# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
p result

Overloads:

  • #get_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

    Pass arguments to get_mute_config via a request object, either of type GetMuteConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_mute_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

    Pass arguments to get_mute_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the mute config to retrieve. Its format is organizations/{organization}/muteConfigs/{config_id}, folders/{folder}/muteConfigs/{config_id}, or projects/{project}/muteConfigs/{config_id}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1381

def get_mute_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_mute_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_mute_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_mute_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_mute_config, request, options: 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::V1::NotificationConfig #get_notification_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

Gets a notification config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new

# Call the get_notification_config method.
result = client.get_notification_config request

# The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
p result

Overloads:

  • #get_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

    Pass arguments to get_notification_config via a request object, either of type GetNotificationConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_notification_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::NotificationConfig

    Pass arguments to get_notification_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the notification config to get. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]", "folders/[folder_id]/notificationConfigs/[config_id]", or "projects/[project_id]/notificationConfigs/[config_id]".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1470

def get_notification_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_notification_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_notification_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_notification_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_notification_config, request, options: 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::V1::OrganizationSettings #get_organization_settings(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::OrganizationSettings

Gets the settings for an organization.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new

# Call the get_organization_settings method.
result = client.get_organization_settings request

# The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings.
p result

Overloads:

  • #get_organization_settings(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::OrganizationSettings

    Pass arguments to get_organization_settings via a request object, either of type GetOrganizationSettingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_organization_settings(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::OrganizationSettings

    Pass arguments to get_organization_settings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



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
1593
1594
1595
1596
1597
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1557

def get_organization_settings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_organization_settings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_organization_settings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_organization_settings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_organization_settings, request, options: 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_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule #get_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

Retrieves a SecurityHealthAnalyticsCustomModule.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new

# Call the get_security_health_analytics_custom_module method.
result = client.get_security_health_analytics_custom_module request

# The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.
p result

Overloads:

  • #get_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

    Pass arguments to get_security_health_analytics_custom_module via a request object, either of type GetSecurityHealthAnalyticsCustomModuleRequest or an equivalent Hash.

    Parameters:

  • #get_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule

    Pass arguments to get_security_health_analytics_custom_module via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the custom module to get. Its format is "organizations/{organization}/securityHealthAnalyticsSettings/customModules/{customModule}", "folders/{folder}/securityHealthAnalyticsSettings/customModules/{customModule}", or "projects/{project}/securityHealthAnalyticsSettings/customModules/{customModule}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1737

def get_security_health_analytics_custom_module request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSecurityHealthAnalyticsCustomModuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_security_health_analytics_custom_module..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_security_health_analytics_custom_module, request, options: 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::V1::Source #get_source(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

Gets a source.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new

# Call the get_source method.
result = client.get_source request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
p result

Overloads:

  • #get_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

    Pass arguments to get_source via a request object, either of type GetSourceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_source(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Source

    Pass arguments to get_source via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 1824

def get_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_source..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.get_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_source.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :get_source, request, options: 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::V1::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::V1::GroupResult>

Deprecated.

This method is deprecated and may be removed in the next major version update.

Filters an organization's assets and groups them by their specified properties.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new

# Call the group_assets method.
result = client.group_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
  p item
end

Overloads:

  • #group_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>

    Pass arguments to group_assets via a request object, either of type GroupAssetsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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::V1::GroupResult>

    Pass arguments to group_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent to group the assets by. Its format is "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • filter (::String) (defaults to: nil)

      Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators AND and OR. Parentheses are supported, and OR has higher precedence than AND.

      Restrictions have the form <field> <operator> <value> and may have a - character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include:

      • name
      • security_center_properties.resource_name
      • resource_properties.a_property
      • security_marks.marks.marka

      The supported operators are:

      • = for all value types.
      • >, <, >=, <= for integer values.
      • :, meaning substring matching, for strings.

      The supported value types are:

      • string literals in quotes.
      • integer literals without quotes.
      • boolean literals true and false without quotes.

      The following field and operator combinations are supported:

      • name: =
      • update_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: update_time = "2019-06-10T16:07:18-07:00" update_time = 1560208038000

      • create_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: create_time = "2019-06-10T16:07:18-07:00" create_time = 1560208038000

      • iam_policy.policy_blob: =, :
      • resource_properties: =, :, >, <, >=, <=
      • security_marks.marks: =, :
      • security_center_properties.resource_name: =, :
      • security_center_properties.resource_display_name: =, :
      • security_center_properties.resource_type: =, :
      • security_center_properties.resource_parent: =, :
      • security_center_properties.resource_parent_display_name: =, :
      • security_center_properties.resource_project: =, :
      • security_center_properties.resource_project_display_name: =, :
      • security_center_properties.resource_owners: =, :

      For example, resource_properties.size = 100 is a valid filter string.

      Use a partial match on the empty string to filter based on a property existing: resource_properties.my_property : ""

      Use a negated partial match on the empty string to filter based on a property not existing: -resource_properties.my_property : ""

    • group_by (::String) (defaults to: nil)

      Required. Expression that defines what assets fields to use for grouping. The string value should follow SQL syntax: comma separated list of fields. For example: "security_center_properties.resource_project,security_center_properties.project".

      The following fields are supported when compare_duration is not set:

      • security_center_properties.resource_project
      • security_center_properties.resource_project_display_name
      • security_center_properties.resource_type
      • security_center_properties.resource_parent
      • security_center_properties.resource_parent_display_name

      The following fields are supported when compare_duration is set:

      • security_center_properties.resource_type
      • security_center_properties.resource_project_display_name
      • security_center_properties.resource_parent_display_name
    • compare_duration (::Google::Protobuf::Duration, ::Hash) (defaults to: nil)

      When compare_duration is set, the GroupResult's "state_change" property is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time.

      The state change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again.

      Possible "state_change" values when compare_duration is specified:

      • "ADDED": indicates that the asset was not present at the start of compare_duration, but present at reference_time.
      • "REMOVED": indicates that the asset was present at the start of compare_duration, but not present at reference_time.
      • "ACTIVE": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and reference_time.

      If compare_duration is not specified, then the only possible state_change is "UNUSED", which will be the state_change set for all assets present at read_time.

      If this field is set then state_change must be a specified field in group_by.

    • read_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.

    • page_token (::String) (defaults to: nil)

      The value returned by the last GroupAssetsResponse; indicates that this is a continuation of a prior GroupAssets call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2041

def group_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.group_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.group_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.group_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :group_assets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, request, response, operation, options
    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::V1::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::V1::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

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new

# Call the group_findings method.
result = client.group_findings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
  p item
end

Overloads:

  • #group_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>

    Pass arguments to group_findings via a request object, either of type GroupFindingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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::V1::GroupResult>

    Pass arguments to group_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of the source to groupBy. Its format is "organizations/[organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of -. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-

    • filter (::String) (defaults to: nil)

      Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators AND and OR. Parentheses are supported, and OR has higher precedence than AND.

      Restrictions have the form <field> <operator> <value> and may have a - character in front of them to indicate negation. Examples include:

      • name
      • source_properties.a_property
      • security_marks.marks.marka

      The supported operators are:

      • = for all value types.
      • >, <, >=, <= for integer values.
      • :, meaning substring matching, for strings.

      The supported value types are:

      • string literals in quotes.
      • integer literals without quotes.
      • boolean literals true and false without quotes.

      The following field and operator combinations are supported:

      • name: =
      • parent: =, :
      • resource_name: =, :
      • state: =, :
      • category: =, :
      • external_uri: =, :
      • event_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: event_time = "2019-06-10T16:07:18-07:00" event_time = 1560208038000

      • severity: =, :
      • workflow_state: =, :
      • security_marks.marks: =, :
      • source_properties: =, :, >, <, >=, <=

      For example, source_properties.size = 100 is a valid filter string.

      Use a partial match on the empty string to filter based on a property existing: source_properties.my_property : ""

      Use a negated partial match on the empty string to filter based on a property not existing: -source_properties.my_property : ""

      • resource:
        • resource.name: =, :
        • resource.parent_name: =, :
        • resource.parent_display_name: =, :
        • resource.project_name: =, :
        • resource.project_display_name: =, :
        • resource.type: =, :
    • group_by (::String) (defaults to: nil)

      Required. Expression that defines what assets fields to use for grouping (including state_change). The string value should follow SQL syntax: comma separated list of fields. For example: "parent,resource_name".

      The following fields are supported:

      • resource_name
      • category
      • state
      • parent
      • severity

      The following fields are supported when compare_duration is set:

      • state_change
    • read_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.

    • compare_duration (::Google::Protobuf::Duration, ::Hash) (defaults to: nil)

      When compare_duration is set, the GroupResult's "state_change" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time.

      The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again.

      Possible "state_change" values when compare_duration is specified:

      • "CHANGED": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time.
      • "UNCHANGED": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time.
      • "ADDED": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time.
      • "REMOVED": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time.

      If compare_duration is not specified, then the only possible state_change is "UNUSED", which will be the state_change set for all findings present at read_time.

      If this field is set then state_change must be a specified field in group_by.

    • page_token (::String) (defaults to: nil)

      The value returned by the last GroupFindingsResponse; indicates that this is a continuation of a prior GroupFindings call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



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
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2265

def group_findings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.group_findings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.group_findings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.group_findings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, options
    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::V1::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::V1::ListAssetsResponse::ListAssetsResult>

Deprecated.

This method is deprecated and may be removed in the next major version update.

Lists an organization's assets.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new

# Call the list_assets method.
result = client.list_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult.
  p item
end

Overloads:

  • #list_assets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>

    Pass arguments to list_assets via a request object, either of type ListAssetsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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::V1::ListAssetsResponse::ListAssetsResult>

    Pass arguments to list_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent resource that contains the assets. The value that you can specify on parent depends on the method in which you specify parent. You can specify one of the following values: "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • filter (::String) (defaults to: nil)

      Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions combined via logical operators AND and OR. Parentheses are supported, and OR has higher precedence than AND.

      Restrictions have the form <field> <operator> <value> and may have a - character in front of them to indicate negation. The fields map to those defined in the Asset resource. Examples include:

      • name
      • security_center_properties.resource_name
      • resource_properties.a_property
      • security_marks.marks.marka

      The supported operators are:

      • = for all value types.
      • >, <, >=, <= for integer values.
      • :, meaning substring matching, for strings.

      The supported value types are:

      • string literals in quotes.
      • integer literals without quotes.
      • boolean literals true and false without quotes.

      The following are the allowed field and operator combinations:

      • name: =
      • update_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: update_time = "2019-06-10T16:07:18-07:00" update_time = 1560208038000

      • create_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: create_time = "2019-06-10T16:07:18-07:00" create_time = 1560208038000

      • iam_policy.policy_blob: =, :
      • resource_properties: =, :, >, <, >=, <=
      • security_marks.marks: =, :
      • security_center_properties.resource_name: =, :
      • security_center_properties.resource_display_name: =, :
      • security_center_properties.resource_type: =, :
      • security_center_properties.resource_parent: =, :
      • security_center_properties.resource_parent_display_name: =, :
      • security_center_properties.resource_project: =, :
      • security_center_properties.resource_project_display_name: =, :
      • security_center_properties.resource_owners: =, :

      For example, resource_properties.size = 100 is a valid filter string.

      Use a partial match on the empty string to filter based on a property existing: resource_properties.my_property : ""

      Use a negated partial match on the empty string to filter based on a property not existing: -resource_properties.my_property : ""

    • order_by (::String) (defaults to: nil)

      Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: "name,resource_properties.a_property". The default sorting order is ascending. To specify descending order for a field, a suffix " desc" should be appended to the field name. For example: "name desc,resource_properties.a_property". Redundant space characters in the syntax are insignificant. "name desc,resource_properties.a_property" and " name desc , resource_properties.a_property " are equivalent.

      The following fields are supported: name update_time resource_properties security_marks.marks security_center_properties.resource_name security_center_properties.resource_display_name security_center_properties.resource_parent security_center_properties.resource_parent_display_name security_center_properties.resource_project security_center_properties.resource_project_display_name security_center_properties.resource_type

    • read_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      Time used as a reference point when filtering assets. The filter is limited to assets existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.

    • compare_duration (::Google::Protobuf::Duration, ::Hash) (defaults to: nil)

      When compare_duration is set, the ListAssetsResult's "state_change" attribute is updated to indicate whether the asset was added, removed, or remained present during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time.

      The state_change value is derived based on the presence of the asset at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the asset is removed and re-created again.

      Possible "state_change" values when compare_duration is specified:

      • "ADDED": indicates that the asset was not present at the start of compare_duration, but present at read_time.
      • "REMOVED": indicates that the asset was present at the start of compare_duration, but not present at read_time.
      • "ACTIVE": indicates that the asset was present at both the start and the end of the time period defined by compare_duration and read_time.

      If compare_duration is not specified, then the only possible state_change is "UNUSED", which will be the state_change set for all assets present at read_time.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      A field mask to specify the ListAssetsResult fields to be listed in the response. An empty field mask will list all fields.

    • page_token (::String) (defaults to: nil)

      The value returned by the last ListAssetsResponse; indicates that this is a continuation of a prior ListAssets call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2488

def list_assets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_assets..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_assets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_assets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_assets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_big_query_exports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport> #list_big_query_exports(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>

Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new

# Call the list_big_query_exports method.
result = client.list_big_query_exports request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport.
  p item
end

Overloads:

  • #list_big_query_exports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>

    Pass arguments to list_big_query_exports via a request object, either of type ListBigQueryExportsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_big_query_exports(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>

    Pass arguments to list_big_query_exports via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent, which owns the collection of BigQuery exports. Its format is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".

    • page_size (::Integer) (defaults to: nil)

      The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      A page token, received from a previous ListBigQueryExports call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListBigQueryExports must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 5014

def list_big_query_exports request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_big_query_exports..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_big_query_exports.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_big_query_exports.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_descendant_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule> #list_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new

# Call the list_descendant_security_health_analytics_custom_modules method.
result = client.list_descendant_security_health_analytics_custom_modules request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_descendant_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

    Pass arguments to list_descendant_security_health_analytics_custom_modules via a request object, either of type ListDescendantSecurityHealthAnalyticsCustomModulesRequest or an equivalent Hash.

    Parameters:

  • #list_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

    Pass arguments to list_descendant_security_health_analytics_custom_modules via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of parent to list descendant custom modules. Its format is "organizations/{organization}/securityHealthAnalyticsSettings", "folders/{folder}/securityHealthAnalyticsSettings", or "projects/{project}/securityHealthAnalyticsSettings"

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

    • page_token (::String) (defaults to: nil)

      The value returned by the last call indicating a continuation

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2588

def list_descendant_security_health_analytics_custom_modules request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_descendant_security_health_analytics_custom_modules..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_descendant_security_health_analytics_custom_modules, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_effective_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule> #list_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>

Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new

# Call the list_effective_security_health_analytics_custom_modules method.
result = client.list_effective_security_health_analytics_custom_modules request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_effective_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>

    Pass arguments to list_effective_security_health_analytics_custom_modules via a request object, either of type ListEffectiveSecurityHealthAnalyticsCustomModulesRequest or an equivalent Hash.

    Parameters:

  • #list_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::EffectiveSecurityHealthAnalyticsCustomModule>

    Pass arguments to list_effective_security_health_analytics_custom_modules via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of parent to list effective custom modules. Its format is "organizations/{organization}/securityHealthAnalyticsSettings", "folders/{folder}/securityHealthAnalyticsSettings", or "projects/{project}/securityHealthAnalyticsSettings"

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

    • page_token (::String) (defaults to: nil)

      The value returned by the last call indicating a continuation

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3120

def list_effective_security_health_analytics_custom_modules request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_effective_security_health_analytics_custom_modules..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_effective_security_health_analytics_custom_modules, request, response, operation, options
    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::V1::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::V1::ListFindingsResponse::ListFindingsResult>

Lists an organization or source's findings.

To list across all sources provide a - as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new

# Call the list_findings method.
result = client.list_findings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult.
  p item
end

Overloads:

  • #list_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>

    Pass arguments to list_findings via a request object, either of type ListFindingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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::V1::ListFindingsResponse::ListFindingsResult>

    Pass arguments to list_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of the source the findings belong to. Its format is "organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]". To list across all sources provide a source_id of -. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-

    • filter (::String) (defaults to: nil)

      Expression that defines the filter to apply across findings. The expression is a list of one or more restrictions combined via logical operators AND and OR. Parentheses are supported, and OR has higher precedence than AND.

      Restrictions have the form <field> <operator> <value> and may have a - character in front of them to indicate negation. Examples include:

      • name
      • source_properties.a_property
      • security_marks.marks.marka

      The supported operators are:

      • = for all value types.
      • >, <, >=, <= for integer values.
      • :, meaning substring matching, for strings.

      The supported value types are:

      • string literals in quotes.
      • integer literals without quotes.
      • boolean literals true and false without quotes.

      The following field and operator combinations are supported:

      • name: =
      • parent: =, :
      • resource_name: =, :
      • state: =, :
      • category: =, :
      • external_uri: =, :
      • event_time: =, >, <, >=, <=

      Usage: This should be milliseconds since epoch or an RFC3339 string. Examples: event_time = "2019-06-10T16:07:18-07:00" event_time = 1560208038000

      • severity: =, :
      • workflow_state: =, :
      • security_marks.marks: =, :
      • source_properties: =, :, >, <, >=, <=

      For example, source_properties.size = 100 is a valid filter string.

      Use a partial match on the empty string to filter based on a property existing: source_properties.my_property : ""

      Use a negated partial match on the empty string to filter based on a property not existing: -source_properties.my_property : ""

      • resource:
        • resource.name: =, :
        • resource.parent_name: =, :
        • resource.parent_display_name: =, :
        • resource.project_name: =, :
        • resource.project_display_name: =, :
        • resource.type: =, :
        • resource.folders.resource_folder: =, :
        • resource.display_name: =, :
    • order_by (::String) (defaults to: nil)

      Expression that defines what fields and order to use for sorting. The string value should follow SQL syntax: comma separated list of fields. For example: "name,resource_properties.a_property". The default sorting order is ascending. To specify descending order for a field, a suffix " desc" should be appended to the field name. For example: "name desc,source_properties.a_property". Redundant space characters in the syntax are insignificant. "name desc,source_properties.a_property" and " name desc , source_properties.a_property " are equivalent.

      The following fields are supported: name parent state category resource_name event_time source_properties security_marks.marks

    • read_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      Time used as a reference point when filtering findings. The filter is limited to findings existing at the supplied time and their values are those at that specific time. Absence of this field will default to the API's version of NOW.

    • compare_duration (::Google::Protobuf::Duration, ::Hash) (defaults to: nil)

      When compare_duration is set, the ListFindingsResult's "state_change" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time.

      The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again.

      Possible "state_change" values when compare_duration is specified:

      • "CHANGED": indicates that the finding was present and matched the given filter at the start of compare_duration, but changed its state at read_time.
      • "UNCHANGED": indicates that the finding was present and matched the given filter at the start of compare_duration and did not change state at read_time.
      • "ADDED": indicates that the finding did not match the given filter or was not present at the start of compare_duration, but was present at read_time.
      • "REMOVED": indicates that the finding was present and matched the filter at the start of compare_duration, but did not match the filter at read_time.

      If compare_duration is not specified, then the only possible state_change is "UNUSED", which will be the state_change set for all findings present at read_time.

    • field_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all fields.

    • page_token (::String) (defaults to: nil)

      The value returned by the last ListFindingsResponse; indicates that this is a continuation of a prior ListFindings call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



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
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2815

def list_findings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_findings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_findings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_findings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_mute_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig> #list_mute_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>

Lists mute configs.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new

# Call the list_mute_configs method.
result = client.list_mute_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig.
  p item
end

Overloads:

  • #list_mute_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>

    Pass arguments to list_mute_configs via a request object, either of type ListMuteConfigsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_mute_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>

    Pass arguments to list_mute_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent, which owns the collection of mute configs. Its format is "organizations/[organization_id]", "folders/[folder_id]", "projects/[project_id]".

    • page_size (::Integer) (defaults to: nil)

      The maximum number of configs to return. The service may return fewer than this value. If unspecified, at most 10 configs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      A page token, received from a previous ListMuteConfigs call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListMuteConfigs must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 2919

def list_mute_configs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_mute_configs..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_mute_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_mute_configs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, request, response, operation, options
    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::V1::NotificationConfig> #list_notification_configs(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>

Lists notification configs.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new

# Call the list_notification_configs method.
result = client.list_notification_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig.
  p item
end

Overloads:

  • #list_notification_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>

    Pass arguments to list_notification_configs via a request object, either of type ListNotificationConfigsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_notification_configs(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>

    Pass arguments to list_notification_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The name of the parent in which to list the notification configurations. Its format is "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • page_token (::String) (defaults to: nil)

      The value returned by the last ListNotificationConfigsResponse; indicates that this is a continuation of a prior ListNotificationConfigs call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3019

def list_notification_configs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_notification_configs..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_notification_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_notification_configs.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule> #list_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new

# Call the list_security_health_analytics_custom_modules method.
result = client.list_security_health_analytics_custom_modules request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

    Pass arguments to list_security_health_analytics_custom_modules via a request object, either of type ListSecurityHealthAnalyticsCustomModulesRequest or an equivalent Hash.

    Parameters:

  • #list_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::SecurityHealthAnalyticsCustomModule>

    Pass arguments to list_security_health_analytics_custom_modules via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of parent to list custom modules. Its format is "organizations/{organization}/securityHealthAnalyticsSettings", "folders/{folder}/securityHealthAnalyticsSettings", or "projects/{project}/securityHealthAnalyticsSettings"

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

    • page_token (::String) (defaults to: nil)

      The value returned by the last call indicating a continuation

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3221

def list_security_health_analytics_custom_modules request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSecurityHealthAnalyticsCustomModulesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_security_health_analytics_custom_modules..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_security_health_analytics_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_security_health_analytics_custom_modules, request, response, operation, options
    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::V1::Source> #list_sources(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>

Lists all sources belonging to an organization.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new

# Call the list_sources method.
result = client.list_sources request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source.
  p item
end

Overloads:

  • #list_sources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>

    Pass arguments to list_sources via a request object, either of type ListSourcesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_sources(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>

    Pass arguments to list_sources via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]".

    • page_token (::String) (defaults to: nil)

      The value returned by the last ListSourcesResponse; indicates that this is a continuation of a prior ListSources call, and that the system should return the next page of data.

    • page_size (::Integer) (defaults to: nil)

      The maximum number of results to return in a single response. Default is 10, minimum is 1, maximum is 1000.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3321

def list_sources request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_sources..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.list_sources.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sources.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, options
    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

Deprecated.

This method is deprecated and may be removed in the next major version update.

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.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new

# Call the run_asset_discovery method.
result = client.run_asset_discovery request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #run_asset_discovery(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to run_asset_discovery via a request object, either of type RunAssetDiscoveryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #run_asset_discovery(parent: nil) ⇒ ::Gapic::Operation

    Pass arguments to run_asset_discovery via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]".

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3423

def run_asset_discovery request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.run_asset_discovery..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.run_asset_discovery.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.run_asset_discovery.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: 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::V1::Finding #set_finding_state(name: nil, state: nil, start_time: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

Updates the state of a finding.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new

# Call the set_finding_state method.
result = client.set_finding_state request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
p result

Overloads:

  • #set_finding_state(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to set_finding_state via a request object, either of type Google::Cloud::SecurityCenter::V1::SetFindingStateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_finding_state(name: nil, state: nil, start_time: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to set_finding_state via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the finding. Example: "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", "projects/{project_id}/sources/{source_id}/findings/{finding_id}".

    • state (::Google::Cloud::SecurityCenter::V1::Finding::State) (defaults to: nil)

      Required. The desired State of the finding.

    • start_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      Required. The time at which the updated state takes effect.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3519

def set_finding_state request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_finding_state..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.set_finding_state.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_finding_state.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :set_finding_state, request, options: 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.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

      REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3710

def set_iam_policy request, options = 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
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :set_iam_policy, request, options: 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_mute(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding #set_mute(name: nil, mute: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

Updates the mute state of a finding.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new

# Call the set_mute method.
result = client.set_mute request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
p result

Overloads:

  • #set_mute(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to set_mute via a request object, either of type Google::Cloud::SecurityCenter::V1::SetMuteRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_mute(name: nil, mute: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to set_mute via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The relative resource name of the finding. Example: "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", "projects/{project_id}/sources/{source_id}/findings/{finding_id}".

    • mute (::Google::Cloud::SecurityCenter::V1::Finding::Mute) (defaults to: nil)

      Required. The desired state of the Mute.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3612

def set_mute request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_mute..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.set_mute.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_mute.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :set_mute, request, options: 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

#simulate_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse #simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse

Simulates a given SecurityHealthAnalyticsCustomModule and Resource.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new

# Call the simulate_security_health_analytics_custom_module method.
result = client.simulate_security_health_analytics_custom_module request

# The returned object is of type Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3896

def simulate_security_health_analytics_custom_module request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.simulate_security_health_analytics_custom_module..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.simulate_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :simulate_security_health_analytics_custom_module, request, options: 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.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

    • permissions (::Array<::String>) (defaults to: nil)

      The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3802

def test_iam_permissions request, options = 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
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :test_iam_permissions, request, options: 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

#universe_domainString

The effective universe domain

Returns:

  • (String)


214
215
216
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 214

def universe_domain
  @security_center_stub.universe_domain
end

#update_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport #update_big_query_export(big_query_export: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::BigQueryExport

Updates a BigQuery export.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new

# Call the update_big_query_export method.
result = client.update_big_query_export request

# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 4908

def update_big_query_export request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_big_query_export..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.big_query_export&.name
    header_params["big_query_export.name"] = request.big_query_export.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_big_query_export.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_big_query_export.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :update_big_query_export, request, options: 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_external_system(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::ExternalSystem #update_external_system(external_system: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::ExternalSystem

Updates external system. This is for a given finding.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new

# Call the update_external_system method.
result = client.update_external_system request

# The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 3986

def update_external_system request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_external_system..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.external_system&.name
    header_params["external_system.name"] = request.external_system.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_external_system.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_external_system.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :update_external_system, request, options: 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::V1::Finding #update_finding(finding: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new

# Call the update_finding method.
result = client.update_finding request

# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
p result

Overloads:

  • #update_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to update_finding via a request object, either of type UpdateFindingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_finding(finding: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::Finding

    Pass arguments to update_finding via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • finding (::Google::Cloud::SecurityCenter::V1::Finding, ::Hash) (defaults to: nil)

      Required. The finding resource to update or create if it does not already exist. parent, security_marks, and update_time will be ignored.

      In the case of creation, the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding.

      When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using "source_properties." in the field mask.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 4086

def update_finding request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_finding..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"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

  options.apply_defaults timeout:      @config.rpcs.update_finding.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_finding.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @security_center_stub.call_rpc :update_finding, request, options: 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_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig #update_mute_config(mute_config: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V1::MuteConfig

Updates a mute config.

Examples:

Basic example

require "google/cloud/security_center/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new

# Call the update_mute_config method.
result = client.update_mute_config request

# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
# File 'lib/google/cloud/security_center/v1/security_center/client.rb', line 4175

def update_mute_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_mute_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.mute_config&.name
    header_params["mute_config.name"] = request.mute_config.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_mute_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_mute_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:</