Class: Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client

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

Overview

Client for the SecurityCenterManagement service.

Service describing handlers for resources

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#effective_event_threat_detection_custom_module_path, #effective_security_health_analytics_custom_module_path, #event_threat_detection_custom_module_path, #folder_location_path, #location_path, #organization_location_path, #security_center_service_path, #security_health_analytics_custom_module_path

Constructor Details

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

Create a new SecurityCenterManagement client object.

Examples:


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

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

Yields:

  • (config)

    Configure the SecurityCenterManagement client.

Yield Parameters:



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 197

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/securitycentermanagement/v1/security_center_management_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

  @security_center_management_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::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
  )

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @security_center_management_stub.endpoint
    config.universe_domain = @security_center_management_stub.universe_domain
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Client)


249
250
251
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 249

def location_client
  @location_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the SecurityCenterManagement Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 63

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "SecurityCenterManagement", "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.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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

    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: [14, 4]
    }

    default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0

    default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0

    default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0

    default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0
    default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0
    default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0
    default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0
    default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0
    default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0
    default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0

    default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0

    default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0

    default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0
    default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the SecurityCenterManagement 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:



167
168
169
170
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 167

def configure
  yield @config if block_given?
  @config
end

#create_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule #create_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

Creates a resident Event Threat Detection custom module at the scope of the given organization, folder, or project, and creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
p result

Overloads:

  • #create_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

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

    Parameters:

  • #create_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

    Pass arguments to create_event_threat_detection_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. Name of parent for the module, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • event_threat_detection_custom_module (::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash) (defaults to: nil)

      Required. The module to create. The EventThreatDetectionCustomModule.name field is ignored; Security Command Center generates the name.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be created. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to create the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during creation of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1772

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy

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

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

Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given organization, folder, or project, and also creates inherited SecurityHealthAnalyticsCustomModule resources for all folders and projects that are descendants of the given parent. These modules are enabled by default.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
p result

Overloads:

  • #create_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::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, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::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. Name of the parent organization, folder, or project of the module, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • security_health_analytics_custom_module (::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash) (defaults to: nil)

      Required. The resource being created.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be created. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to create the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during creation of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 829

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_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

#delete_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_event_threat_detection_custom_module(name: nil, validate_only: nil) ⇒ ::Google::Protobuf::Empty

Deletes the specified Event Threat Detection custom module and all of its descendants in the resource hierarchy. This method is only supported for resident custom modules.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

  • #delete_event_threat_detection_custom_module(name: nil, validate_only: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_event_threat_detection_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. The resource name of the Event Threat Detection custom module, in one of the following formats:

      • organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}
      • folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}
      • projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}
    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be deleted. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to delete the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during creation of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1986

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy

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

  @security_center_management_stub.call_rpc :delete_event_threat_detection_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

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

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

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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, validate_only: 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. The resource name of the SHA custom module, in one of the following formats:

      • organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}
      • folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}
      • projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}
    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be deleted. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to delete the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during deletion of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1051

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_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_effective_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule #get_effective_event_threat_detection_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule

Gets the effective Event Threat Detection custom module at the given level.

The difference between an EffectiveEventThreatDetectionCustomModule and an EventThreatDetectionCustomModule is that the fields for an EffectiveEventThreatDetectionCustomModule are computed from ancestors if needed. For example, the enablement state for an EventThreatDetectionCustomModule can be ENABLED, DISABLED, or INHERITED. In contrast, the enablement state for an EffectiveEventThreatDetectionCustomModule is always computed as ENABLED or DISABLED.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.
p result

Overloads:

  • #get_effective_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule

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

    Parameters:

  • #get_effective_event_threat_detection_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule

    Pass arguments to get_effective_event_threat_detection_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. The resource name of the Event Threat Detection custom module, in one of the following formats:

      • organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}
      • folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}
      • projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1355

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy

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

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

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.
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.



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 412

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_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_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule #get_event_threat_detection_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

Gets an Event Threat Detection custom module.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
p result

Overloads:

  • #get_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

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

    Parameters:

  • #get_event_threat_detection_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

    Pass arguments to get_event_threat_detection_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. The resource name of the Event Threat Detection custom module, in one of the following formats:

      • organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}
      • folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}
      • projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1661

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy

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

  @security_center_management_stub.call_rpc :get_event_threat_detection_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_security_center_service(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService #get_security_center_service(name: nil, show_eligible_modules_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

Gets service settings for the specified Security Command Center service.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.
p result

Overloads:

  • #get_security_center_service(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

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

    Parameters:

    • request (::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest, ::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_security_center_service(name: nil, show_eligible_modules_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

    Pass arguments to get_security_center_service 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 Security Command Center service to retrieve, in one of the following formats:

      • organizations/{organization}/locations/{location}/securityCenterServices/{service}
      • folders/{folder}/locations/{location}/securityCenterServices/{service}
      • projects/{project}/locations/{location}/securityCenterServices/{service}

      The following values are valid for {service}:

      • container-threat-detection
      • event-threat-detection
      • security-health-analytics
      • vm-threat-detection
      • web-security-scanner
    • show_eligible_modules_only (::Boolean) (defaults to: nil)

      Set to true to show only modules that are in scope. By default, all modules are shown.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 2182

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityCenterServiceRequest

  # 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_center_service..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::SecurityCenterManagement::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_center_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_security_center_service.retry_policy

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

  @security_center_management_stub.call_rpc :get_security_center_service, 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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule #get_security_health_analytics_custom_module(name: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
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.



717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 717

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_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

#list_descendant_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule> #list_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

Lists all resident Event Threat Detection custom modules for the given organization, folder, or project and its descendants.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

# Call the list_descendant_event_threat_detection_custom_modules method.
result = client.list_descendant_event_threat_detection_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::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
  p item
end

Overloads:

  • #list_descendant_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

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

    Parameters:

  • #list_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

    Pass arguments to list_descendant_event_threat_detection_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, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of modules 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



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
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1569

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy

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

  @security_center_management_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_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_descendant_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule> #list_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>

Returns a list of all resident SecurityHealthAnalyticsCustomModule resources under the given organization, folder, or project and all of its descendants.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_descendant_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::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 the parent organization, folder, or project in which to list custom modules, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 628

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_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_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule> #list_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>

Lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

# Call the list_effective_event_threat_detection_custom_modules method.
result = client.list_effective_event_threat_detection_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::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.
  p item
end

Overloads:

  • #list_effective_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>

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

    Parameters:

  • #list_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>

    Pass arguments to list_effective_event_threat_detection_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, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1252

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy

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

  @security_center_management_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_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::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule> #list_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>

Returns a list of all EffectiveSecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_effective_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::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, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 319

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_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_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule> #list_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

Lists all Event Threat Detection custom modules for the given organization, folder, or project. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

# Call the list_event_threat_detection_custom_modules method.
result = client.list_event_threat_detection_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::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
  p item
end

Overloads:

  • #list_event_threat_detection_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

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

    Parameters:

  • #list_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>

    Pass arguments to list_event_threat_detection_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, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

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

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

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



1462
1463
1464
1465
1466
1467
1468
1469
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
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1462

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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_event_threat_detection_custom_modules.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy

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

  @security_center_management_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_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_security_center_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService> #list_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>

Returns a list of all Security Command Center services for the given parent.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

# Call the list_security_center_services method.
result = client.list_security_center_services 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::SecurityCenterManagement::V1::SecurityCenterService.
  p item
end

Overloads:

  • #list_security_center_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>

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

    Parameters:

    • request (::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest, ::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_security_center_services(parent: nil, page_size: nil, page_token: nil, show_eligible_modules_only: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService>

    Pass arguments to list_security_center_services 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 list Security Command Center services, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated the page token.

    • show_eligible_modules_only (::Boolean) (defaults to: nil)

      Flag that, when set, is used to filter the module settings that are shown. The default setting is that all modules are shown.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 2290

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityCenterServicesRequest

  # 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_center_services..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::SecurityCenterManagement::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_center_services.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_security_center_services.retry_policy

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

  @security_center_management_stub.call_rpc :list_security_center_services, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_center_services, 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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule> #list_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>

Returns a list of all SecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
  p item
end

Overloads:

  • #list_security_health_analytics_custom_modules(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::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 the parent organization, folder, or project in which to list custom modules, in one of the following formats:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • page_size (::Integer) (defaults to: nil)

      Optional. 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)

      Optional. A pagination token returned from a previous request. Provide this token to retrieve the next page of results.

      When paginating, the rest of the request must match the request that generated 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.



520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 520

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @security_center_management_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

#simulate_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse #simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse

Simulates the result of using a SecurityHealthAnalyticsCustomModule to check a resource.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::SecurityCenterManagement::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::SecurityCenterManagement::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.



1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1146

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::SecurityCenterManagement::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::SecurityCenterManagement::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_management_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

#universe_domainString

The effective universe domain

Returns:

  • (String)


177
178
179
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 177

def universe_domain
  @security_center_management_stub.universe_domain
end

#update_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule #update_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

Updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of "inherited"). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
p result

Overloads:

  • #update_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

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

    Parameters:

  • #update_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule

    Pass arguments to update_event_threat_detection_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:

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

      Required. The fields to update. If omitted, then all fields are updated.

    • event_threat_detection_custom_module (::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash) (defaults to: nil)

      Required. The module being updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be updated. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to update the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during creation of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 1879

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest

  # 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_event_threat_detection_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::SecurityCenterManagement::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.event_threat_detection_custom_module&.name
    header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.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_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy

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

  @security_center_management_stub.call_rpc :update_event_threat_detection_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

#update_security_center_service(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService #update_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

Updates a Security Command Center service using the given update mask.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService.
p result

Overloads:

  • #update_security_center_service(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

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

    Parameters:

  • #update_security_center_service(security_center_service: nil, update_mask: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService

    Pass arguments to update_security_center_service 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:

    • security_center_service (::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterService, ::Hash) (defaults to: nil)

      Required. The updated service.

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

      Required. The fields to update. Accepts the following values:

      • intended_enablement_state
      • modules

      If omitted, then all eligible fields are updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no service will be updated. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to update the service could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during update of the service

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 2398

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityCenterServiceRequest

  # 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_security_center_service..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::SecurityCenterManagement::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.security_center_service&.name
    header_params["security_center_service.name"] = request.security_center_service.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_security_center_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_security_center_service.retry_policy

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

  @security_center_management_stub.call_rpc :update_security_center_service, 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_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule #update_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule

Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of "inherited"). Updating the display name and custom configuration of a module is supported on resident modules only.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

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

Overloads:

  • #update_security_health_analytics_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule

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

    Parameters:

  • #update_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule

    Pass arguments to update_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:

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

      Required. The fields to update. The following values are valid:

      • custom_config
      • enablement_state

      If you omit this field or set it to the wildcard value *, then all eligible fields are updated.

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

      Required. The resource being updated.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When set to true, the request will be validated (including IAM checks), but no module will be updated. An OK response indicates that the request is valid, while an error response indicates that the request is invalid.

      If the request is valid, a subsequent request to update the module could still fail for one of the following reasons:

      • The state of your cloud resources changed; for example, you lost a required IAM permission
      • An error occurred during creation of the module

      Defaults to false.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
973
974
975
976
977
978
979
980
981
982
983
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 943

def update_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::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest

  # 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_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::SecurityCenterManagement::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.security_health_analytics_custom_module&.name
    header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.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_security_health_analytics_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy

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

  @security_center_management_stub.call_rpc :update_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

#validate_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse #validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse

Validates the given Event Threat Detection custom module.

Examples:

Basic example

require "google/cloud/security_center_management/v1"

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

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

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

# The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.
p result

Overloads:

  • #validate_event_threat_detection_custom_module(request, options = nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse

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

    Parameters:

  • #validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil) ⇒ ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse

    Pass arguments to validate_event_threat_detection_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 parent to validate the custom modules under, in one of the following formats:

      • organizations/{organization}/locations/{location}
    • raw_text (::String) (defaults to: nil)

      Required. The raw text of the module's contents. Used to generate error messages.

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

      Required. The type of the module. For example, CONFIGURABLE_BAD_IP.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
# File 'lib/google/cloud/security_center_management/v1/security_center_management/client.rb', line 2080

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest

  # 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.validate_event_threat_detection_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::SecurityCenterManagement::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.validate_event_threat_detection_custom_module.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy

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

  @security_center_management_stub.call_rpc :validate_event_threat_detection_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