Network Security V1beta1 API - Class Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client (v0.14.0)

Reference documentation and code samples for the Network Security V1beta1 API class Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.

REST client for the DnsThreatDetectorService service.

The Network Security API for DNS Threat Detectors.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the DnsThreatDetectorService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DnsThreatDetectorService clients
::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the DnsThreatDetectorService 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 Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_dns_threat_detector

def create_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
def create_dns_threat_detector(parent: nil, dns_threat_detector_id: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Creates a new DnsThreatDetector in a given project and location.

Overloads
def create_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to create_dns_threat_detector via a request object, either of type CreateDnsThreatDetectorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::CreateDnsThreatDetectorRequest, ::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) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_dns_threat_detector(parent: nil, dns_threat_detector_id: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to create_dns_threat_detector 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) — Required. The value for the parent of the DnsThreatDetector resource.
  • dns_threat_detector_id (::String) — Optional. The ID of the requesting DnsThreatDetector object. If this field is not supplied, the service generates an identifier.
  • dns_threat_detector (::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector, ::Hash) — Required. The DnsThreatDetector resource to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::CreateDnsThreatDetectorRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result

#delete_dns_threat_detector

def delete_dns_threat_detector(request, options = nil) -> ::Google::Protobuf::Empty
def delete_dns_threat_detector(name: nil) -> ::Google::Protobuf::Empty

Deletes a single DnsThreatDetector.

Overloads
def delete_dns_threat_detector(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_dns_threat_detector via a request object, either of type Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest, ::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) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_dns_threat_detector(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_dns_threat_detector 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).
Parameter
  • name (::String) — Required. Name of the DnsThreatDetector resource.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest.new

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

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

#get_dns_threat_detector

def get_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
def get_dns_threat_detector(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Gets the details of a single DnsThreatDetector.

Overloads
def get_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to get_dns_threat_detector via a request object, either of type GetDnsThreatDetectorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::GetDnsThreatDetectorRequest, ::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) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_dns_threat_detector(name: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to get_dns_threat_detector 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).
Parameter
  • name (::String) — Required. Name of the DnsThreatDetector resource.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::GetDnsThreatDetectorRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Rest::Client

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

Returns
  • (Google::Iam::V1::IAMPolicy::Rest::Client)

#initialize

def initialize() { |config| ... } -> Client

Create a new DnsThreatDetectorService REST client object.

Yields
  • (config) — Configure the DnsThreatDetectorService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_dns_threat_detectors

def list_dns_threat_detectors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>
def list_dns_threat_detectors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>

Lists DnsThreatDetectors in a given project and location.

Overloads
def list_dns_threat_detectors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>
Pass arguments to list_dns_threat_detectors via a request object, either of type ListDnsThreatDetectorsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest, ::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) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_dns_threat_detectors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>
Pass arguments to list_dns_threat_detectors 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) — Required. The parent value for ListDnsThreatDetectorsRequest.
  • page_size (::Integer) — Optional. The requested page size. The server may return fewer items than requested. If unspecified, the server picks an appropriate default.
  • page_token (::String) — Optional. A page token received from a previous ListDnsThreatDetectorsRequest call. Provide this to retrieve the subsequent page.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest.new

# Call the list_dns_threat_detectors method.
result = client.list_dns_threat_detectors 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::NetworkSecurity::V1beta1::DnsThreatDetector.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

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

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

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_dns_threat_detector

def update_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
def update_dns_threat_detector(update_mask: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector

Updates a single DnsThreatDetector.

Overloads
def update_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to update_dns_threat_detector via a request object, either of type UpdateDnsThreatDetectorRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkSecurity::V1beta1::UpdateDnsThreatDetectorRequest, ::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) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_dns_threat_detector(update_mask: nil, dns_threat_detector: nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector
Pass arguments to update_dns_threat_detector 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) — Optional. The field mask is used to specify the fields to be overwritten in the DnsThreatDetector resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the mask is not provided then all fields present in the request will be overwritten.
  • dns_threat_detector (::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector, ::Hash) — Required. The DnsThreatDetector resource being updated.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/network_security/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1beta1::UpdateDnsThreatDetectorRequest.new

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

# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector.
p result