google-cloud-network_security 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +3 -3
- data/README.md +3 -3
- data/lib/google/cloud/network_security/version.rb +1 -1
- data/lib/google/cloud/network_security.rb +70 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b445a09a8fa47936ddfba4af33e958a85cc02898be087b26ba669c13f17ecb9e
|
|
4
|
+
data.tar.gz: ebfce621013318ee249411a73b44259e0ec02c1f6a8130d90fc6d83084a3cad8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bd74910e541dd01abfb211f13543fd95f6540434d3d00d2eb456fb3dd4f86f4f92985e97414d5b878308967adad0aba9a9b30cd85b5acfe2e8b258beeacb68e7
|
|
7
|
+
data.tar.gz: e43119a9d7d3d936edca9fcb7f0f761e165d920f95c4060ffec9050494f3402ee9f78bb7d69a621c76365bae05f20cfb3865d5e06c303865cc3f37525ace6e16
|
data/AUTHENTICATION.md
CHANGED
|
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
|
56
56
|
```ruby
|
|
57
57
|
require "google/cloud/network_security"
|
|
58
58
|
|
|
59
|
-
client = Google::Cloud::NetworkSecurity.
|
|
59
|
+
client = Google::Cloud::NetworkSecurity.dns_threat_detector_service do |config|
|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
|
61
61
|
end
|
|
62
62
|
```
|
|
@@ -70,7 +70,7 @@ Google::Cloud::NetworkSecurity.configure do |config|
|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
client = Google::Cloud::NetworkSecurity.
|
|
73
|
+
client = Google::Cloud::NetworkSecurity.dns_threat_detector_service
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
### Environment Variables
|
|
@@ -100,7 +100,7 @@ require "google/cloud/network_security"
|
|
|
100
100
|
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
|
102
102
|
|
|
103
|
-
client = Google::Cloud::NetworkSecurity.
|
|
103
|
+
client = Google::Cloud::NetworkSecurity.dns_threat_detector_service
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
|
@@ -37,9 +37,9 @@ In order to use this library, you first need to go through the following steps:
|
|
|
37
37
|
```ruby
|
|
38
38
|
require "google/cloud/network_security"
|
|
39
39
|
|
|
40
|
-
client = Google::Cloud::NetworkSecurity.
|
|
41
|
-
request = ::Google::Cloud::NetworkSecurity::V1beta1::
|
|
42
|
-
response = client.
|
|
40
|
+
client = Google::Cloud::NetworkSecurity.dns_threat_detector_service
|
|
41
|
+
request = ::Google::Cloud::NetworkSecurity::V1beta1::ListDnsThreatDetectorsRequest.new # (request fields as keyword arguments...)
|
|
42
|
+
response = client.list_dns_threat_detectors request
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## Debug Logging
|
|
@@ -45,6 +45,76 @@ end
|
|
|
45
45
|
module Google
|
|
46
46
|
module Cloud
|
|
47
47
|
module NetworkSecurity
|
|
48
|
+
##
|
|
49
|
+
# Create a new client object for DnsThreatDetectorService.
|
|
50
|
+
#
|
|
51
|
+
# By default, this returns an instance of
|
|
52
|
+
# [Google::Cloud::NetworkSecurity::V1beta1::DnsThreatDetectorService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-network_security-v1beta1/latest/Google-Cloud-NetworkSecurity-V1beta1-DnsThreatDetectorService-Client)
|
|
53
|
+
# for a gRPC client for version V1beta1 of the API.
|
|
54
|
+
# However, you can specify a different API version by passing it in the
|
|
55
|
+
# `version` parameter. If the DnsThreatDetectorService service is
|
|
56
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
57
|
+
# appropriate versioned client will be returned.
|
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
|
59
|
+
# the `transport` parameter.
|
|
60
|
+
#
|
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
|
62
|
+
# given API version does not support the given transport of the DnsThreatDetectorService service.
|
|
63
|
+
# You can determine whether the method will succeed by calling
|
|
64
|
+
# {Google::Cloud::NetworkSecurity.dns_threat_detector_service_available?}.
|
|
65
|
+
#
|
|
66
|
+
# ## About DnsThreatDetectorService
|
|
67
|
+
#
|
|
68
|
+
# The Network Security API for DNS Threat Detectors.
|
|
69
|
+
#
|
|
70
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
71
|
+
# Defaults to `:v1beta1`.
|
|
72
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
73
|
+
# @return [::Object] A client object for the specified version.
|
|
74
|
+
#
|
|
75
|
+
def self.dns_threat_detector_service version: :v1beta1, transport: :grpc, &block
|
|
76
|
+
require "google/cloud/network_security/#{version.to_s.downcase}"
|
|
77
|
+
|
|
78
|
+
package_name = Google::Cloud::NetworkSecurity
|
|
79
|
+
.constants
|
|
80
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
81
|
+
.first
|
|
82
|
+
service_module = Google::Cloud::NetworkSecurity.const_get(package_name).const_get(:DnsThreatDetectorService)
|
|
83
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
|
84
|
+
service_module.const_get(:Client).new(&block)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
##
|
|
88
|
+
# Determines whether the DnsThreatDetectorService service is supported by the current client.
|
|
89
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::NetworkSecurity.dns_threat_detector_service}.
|
|
90
|
+
# If false, that method will raise an exception. This could happen if the given
|
|
91
|
+
# API version does not exist or does not support the DnsThreatDetectorService service,
|
|
92
|
+
# or if the versioned client gem needs an update to support the DnsThreatDetectorService service.
|
|
93
|
+
#
|
|
94
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
95
|
+
# Defaults to `:v1beta1`.
|
|
96
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
|
97
|
+
# @return [boolean] Whether the service is available.
|
|
98
|
+
#
|
|
99
|
+
def self.dns_threat_detector_service_available? version: :v1beta1, transport: :grpc
|
|
100
|
+
require "google/cloud/network_security/#{version.to_s.downcase}"
|
|
101
|
+
package_name = Google::Cloud::NetworkSecurity
|
|
102
|
+
.constants
|
|
103
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
104
|
+
.first
|
|
105
|
+
return false unless package_name
|
|
106
|
+
service_module = Google::Cloud::NetworkSecurity.const_get package_name
|
|
107
|
+
return false unless service_module.const_defined? :DnsThreatDetectorService
|
|
108
|
+
service_module = service_module.const_get :DnsThreatDetectorService
|
|
109
|
+
if transport == :rest
|
|
110
|
+
return false unless service_module.const_defined? :Rest
|
|
111
|
+
service_module = service_module.const_get :Rest
|
|
112
|
+
end
|
|
113
|
+
service_module.const_defined? :Client
|
|
114
|
+
rescue ::LoadError
|
|
115
|
+
false
|
|
116
|
+
end
|
|
117
|
+
|
|
48
118
|
##
|
|
49
119
|
# Create a new client object for NetworkSecurity.
|
|
50
120
|
#
|