Reference documentation and code samples for the Network Security V1beta1 API class Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Client.
Client for the DnsThreatDetectorService service.
The Network Security API for DNS Threat Detectors.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the DnsThreatDetectorService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all DnsThreatDetectorService clients ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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::DnsThreatDetectorCreates a new DnsThreatDetector in a given project and location.
def create_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorcreate_dns_threat_detector via a request object, either of type
CreateDnsThreatDetectorRequest or an equivalent Hash.
- 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::DnsThreatDetectorcreate_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).
- 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
DnsThreatDetectorresource to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::EmptyDeletes a single DnsThreatDetector.
def delete_dns_threat_detector(request, options = nil) -> ::Google::Protobuf::Emptydelete_dns_threat_detector via a request object, either of type
Google::Cloud::NetworkSecurity::V1beta1::DeleteDnsThreatDetectorRequest or an equivalent Hash.
- 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::Emptydelete_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).
- name (::String) — Required. Name of the DnsThreatDetector resource.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::DnsThreatDetectorGets the details of a single DnsThreatDetector.
def get_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorget_dns_threat_detector via a request object, either of type
GetDnsThreatDetectorRequest or an equivalent Hash.
- 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::DnsThreatDetectorget_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).
- name (::String) — Required. Name of the DnsThreatDetector resource.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::ClientGet the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Client)
#initialize
def initialize() { |config| ... } -> ClientCreate a new DnsThreatDetectorService client object.
- (config) — Configure the DnsThreatDetectorService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Client.new do |config| config.timeout = 10.0 end
#list_dns_threat_detectors
def list_dns_threat_detectors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>
def list_dns_threat_detectors(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>Lists DnsThreatDetectors in a given project and location.
def list_dns_threat_detectors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>list_dns_threat_detectors via a request object, either of type
ListDnsThreatDetectorsRequest or an equivalent Hash.
- 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::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>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).
-
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
ListDnsThreatDetectorsRequestcall. Provide this to retrieve the subsequent page.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (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::DnsThreatDetectorUpdates a single DnsThreatDetector.
def update_dns_threat_detector(request, options = nil) -> ::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorupdate_dns_threat_detector via a request object, either of type
UpdateDnsThreatDetectorRequest or an equivalent Hash.
- 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::DnsThreatDetectorupdate_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).
- 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetector)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::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