google-cloud-network_security-v1beta1 0.8.1 → 0.10.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/README.md +31 -21
- data/lib/google/cloud/network_security/v1beta1/network_security/client.rb +48 -16
- data/lib/google/cloud/network_security/v1beta1/network_security/operations.rb +19 -15
- data/lib/google/cloud/network_security/v1beta1/network_security/rest/client.rb +48 -16
- data/lib/google/cloud/network_security/v1beta1/network_security/rest/operations.rb +50 -38
- data/lib/google/cloud/network_security/v1beta1/network_security/rest/service_stub.rb +134 -92
- data/lib/google/cloud/network_security/v1beta1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/networksecurity/v1beta1/tls.rb +8 -0
- data/proto_docs/google/longrunning/operations.rb +23 -14
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a07ce928524f966875816d93f904896a850c93b8d8b55a57254bd69fbda0fb97
|
4
|
+
data.tar.gz: 0f4794f30724f696951aac90ef8ebf4a6370d2b0620d42116670f4f5b99e9686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e678380b0b97dc82f30e4655803c0646a5b389d6023611752c26b7e30d043408f5bc23a721923236bfbd049f32ec0da6d7746c259f229464bd929a9750e3a667
|
7
|
+
data.tar.gz: 1d316b20a8c7347f0d4e75628e33685fc94452ad36ccb1596291bedfa0b0c0740748aa01aa9cdc3ea3459c285e42b27738e14776ec03a779dde8dace5d4c515a
|
data/README.md
CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/traffic-director/docs/reference/network-security/rest/)
|
44
44
|
for general usage information.
|
45
45
|
|
46
|
-
##
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
You can customize logging by modifying the `logger` configuration when
|
72
|
+
constructing a client object. For example:
|
55
73
|
|
56
74
|
```ruby
|
75
|
+
require "google/cloud/network_security/v1beta1"
|
57
76
|
require "logger"
|
58
77
|
|
59
|
-
|
60
|
-
|
61
|
-
def logger
|
62
|
-
LOGGER
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
67
|
-
module GRPC
|
68
|
-
extend MyLogger
|
78
|
+
client = ::Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new do |config|
|
79
|
+
config.logger = Logger.new "my-app.log"
|
69
80
|
end
|
70
81
|
```
|
71
82
|
|
72
|
-
|
73
83
|
## Google Cloud Samples
|
74
84
|
|
75
85
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
86
|
|
77
87
|
## Supported Ruby Versions
|
78
88
|
|
79
|
-
This library is supported on Ruby
|
89
|
+
This library is supported on Ruby 3.0+.
|
80
90
|
|
81
91
|
Google provides official support for Ruby versions that are actively supported
|
82
92
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -170,14 +170,26 @@ module Google
|
|
170
170
|
universe_domain: @config.universe_domain,
|
171
171
|
channel_args: @config.channel_args,
|
172
172
|
interceptors: @config.interceptors,
|
173
|
-
channel_pool_config: @config.channel_pool
|
173
|
+
channel_pool_config: @config.channel_pool,
|
174
|
+
logger: @config.logger
|
174
175
|
)
|
175
176
|
|
177
|
+
@network_security_stub.stub_logger&.info do |entry|
|
178
|
+
entry.set_system_name
|
179
|
+
entry.set_service
|
180
|
+
entry.message = "Created client for #{entry.service}"
|
181
|
+
entry.set_credentials_fields credentials
|
182
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
183
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
184
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
185
|
+
end
|
186
|
+
|
176
187
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
177
188
|
config.credentials = credentials
|
178
189
|
config.quota_project = @quota_project_id
|
179
190
|
config.endpoint = @network_security_stub.endpoint
|
180
191
|
config.universe_domain = @network_security_stub.universe_domain
|
192
|
+
config.logger = @network_security_stub.logger if config.respond_to? :logger=
|
181
193
|
end
|
182
194
|
|
183
195
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -185,6 +197,7 @@ module Google
|
|
185
197
|
config.quota_project = @quota_project_id
|
186
198
|
config.endpoint = @network_security_stub.endpoint
|
187
199
|
config.universe_domain = @network_security_stub.universe_domain
|
200
|
+
config.logger = @network_security_stub.logger if config.respond_to? :logger=
|
188
201
|
end
|
189
202
|
end
|
190
203
|
|
@@ -209,6 +222,15 @@ module Google
|
|
209
222
|
#
|
210
223
|
attr_reader :iam_policy_client
|
211
224
|
|
225
|
+
##
|
226
|
+
# The logger used for request/response debug logging.
|
227
|
+
#
|
228
|
+
# @return [Logger]
|
229
|
+
#
|
230
|
+
def logger
|
231
|
+
@network_security_stub.logger
|
232
|
+
end
|
233
|
+
|
212
234
|
# Service calls
|
213
235
|
|
214
236
|
##
|
@@ -305,7 +327,7 @@ module Google
|
|
305
327
|
@network_security_stub.call_rpc :list_authorization_policies, request, options: options do |response, operation|
|
306
328
|
response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_authorization_policies, request, response, operation, options
|
307
329
|
yield response, operation if block_given?
|
308
|
-
|
330
|
+
throw :response, response
|
309
331
|
end
|
310
332
|
rescue ::GRPC::BadStatus => e
|
311
333
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -392,7 +414,6 @@ module Google
|
|
392
414
|
|
393
415
|
@network_security_stub.call_rpc :get_authorization_policy, request, options: options do |response, operation|
|
394
416
|
yield response, operation if block_given?
|
395
|
-
return response
|
396
417
|
end
|
397
418
|
rescue ::GRPC::BadStatus => e
|
398
419
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -494,7 +515,7 @@ module Google
|
|
494
515
|
@network_security_stub.call_rpc :create_authorization_policy, request, options: options do |response, operation|
|
495
516
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
496
517
|
yield response, operation if block_given?
|
497
|
-
|
518
|
+
throw :response, response
|
498
519
|
end
|
499
520
|
rescue ::GRPC::BadStatus => e
|
500
521
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -594,7 +615,7 @@ module Google
|
|
594
615
|
@network_security_stub.call_rpc :update_authorization_policy, request, options: options do |response, operation|
|
595
616
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
596
617
|
yield response, operation if block_given?
|
597
|
-
|
618
|
+
throw :response, response
|
598
619
|
end
|
599
620
|
rescue ::GRPC::BadStatus => e
|
600
621
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -689,7 +710,7 @@ module Google
|
|
689
710
|
@network_security_stub.call_rpc :delete_authorization_policy, request, options: options do |response, operation|
|
690
711
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
691
712
|
yield response, operation if block_given?
|
692
|
-
|
713
|
+
throw :response, response
|
693
714
|
end
|
694
715
|
rescue ::GRPC::BadStatus => e
|
695
716
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -788,7 +809,7 @@ module Google
|
|
788
809
|
@network_security_stub.call_rpc :list_server_tls_policies, request, options: options do |response, operation|
|
789
810
|
response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_server_tls_policies, request, response, operation, options
|
790
811
|
yield response, operation if block_given?
|
791
|
-
|
812
|
+
throw :response, response
|
792
813
|
end
|
793
814
|
rescue ::GRPC::BadStatus => e
|
794
815
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -875,7 +896,6 @@ module Google
|
|
875
896
|
|
876
897
|
@network_security_stub.call_rpc :get_server_tls_policy, request, options: options do |response, operation|
|
877
898
|
yield response, operation if block_given?
|
878
|
-
return response
|
879
899
|
end
|
880
900
|
rescue ::GRPC::BadStatus => e
|
881
901
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -977,7 +997,7 @@ module Google
|
|
977
997
|
@network_security_stub.call_rpc :create_server_tls_policy, request, options: options do |response, operation|
|
978
998
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
979
999
|
yield response, operation if block_given?
|
980
|
-
|
1000
|
+
throw :response, response
|
981
1001
|
end
|
982
1002
|
rescue ::GRPC::BadStatus => e
|
983
1003
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1078,7 +1098,7 @@ module Google
|
|
1078
1098
|
@network_security_stub.call_rpc :update_server_tls_policy, request, options: options do |response, operation|
|
1079
1099
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1080
1100
|
yield response, operation if block_given?
|
1081
|
-
|
1101
|
+
throw :response, response
|
1082
1102
|
end
|
1083
1103
|
rescue ::GRPC::BadStatus => e
|
1084
1104
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1173,7 +1193,7 @@ module Google
|
|
1173
1193
|
@network_security_stub.call_rpc :delete_server_tls_policy, request, options: options do |response, operation|
|
1174
1194
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1175
1195
|
yield response, operation if block_given?
|
1176
|
-
|
1196
|
+
throw :response, response
|
1177
1197
|
end
|
1178
1198
|
rescue ::GRPC::BadStatus => e
|
1179
1199
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1272,7 +1292,7 @@ module Google
|
|
1272
1292
|
@network_security_stub.call_rpc :list_client_tls_policies, request, options: options do |response, operation|
|
1273
1293
|
response = ::Gapic::PagedEnumerable.new @network_security_stub, :list_client_tls_policies, request, response, operation, options
|
1274
1294
|
yield response, operation if block_given?
|
1275
|
-
|
1295
|
+
throw :response, response
|
1276
1296
|
end
|
1277
1297
|
rescue ::GRPC::BadStatus => e
|
1278
1298
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1359,7 +1379,6 @@ module Google
|
|
1359
1379
|
|
1360
1380
|
@network_security_stub.call_rpc :get_client_tls_policy, request, options: options do |response, operation|
|
1361
1381
|
yield response, operation if block_given?
|
1362
|
-
return response
|
1363
1382
|
end
|
1364
1383
|
rescue ::GRPC::BadStatus => e
|
1365
1384
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1461,7 +1480,7 @@ module Google
|
|
1461
1480
|
@network_security_stub.call_rpc :create_client_tls_policy, request, options: options do |response, operation|
|
1462
1481
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1463
1482
|
yield response, operation if block_given?
|
1464
|
-
|
1483
|
+
throw :response, response
|
1465
1484
|
end
|
1466
1485
|
rescue ::GRPC::BadStatus => e
|
1467
1486
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1562,7 +1581,7 @@ module Google
|
|
1562
1581
|
@network_security_stub.call_rpc :update_client_tls_policy, request, options: options do |response, operation|
|
1563
1582
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1564
1583
|
yield response, operation if block_given?
|
1565
|
-
|
1584
|
+
throw :response, response
|
1566
1585
|
end
|
1567
1586
|
rescue ::GRPC::BadStatus => e
|
1568
1587
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1657,7 +1676,7 @@ module Google
|
|
1657
1676
|
@network_security_stub.call_rpc :delete_client_tls_policy, request, options: options do |response, operation|
|
1658
1677
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1659
1678
|
yield response, operation if block_given?
|
1660
|
-
|
1679
|
+
throw :response, response
|
1661
1680
|
end
|
1662
1681
|
rescue ::GRPC::BadStatus => e
|
1663
1682
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1707,6 +1726,13 @@ module Google
|
|
1707
1726
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1708
1727
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1709
1728
|
# * (`nil`) indicating no credentials
|
1729
|
+
#
|
1730
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1731
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1732
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1733
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1734
|
+
# For more information, refer to [Validate credential configurations from external
|
1735
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1710
1736
|
# @return [::Object]
|
1711
1737
|
# @!attribute [rw] scope
|
1712
1738
|
# The OAuth scopes
|
@@ -1746,6 +1772,11 @@ module Google
|
|
1746
1772
|
# default endpoint URL. The default value of nil uses the environment
|
1747
1773
|
# universe (usually the default "googleapis.com" universe).
|
1748
1774
|
# @return [::String,nil]
|
1775
|
+
# @!attribute [rw] logger
|
1776
|
+
# A custom logger to use for request/response debug logging, or the value
|
1777
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1778
|
+
# explicitly disable logging.
|
1779
|
+
# @return [::Logger,:default,nil]
|
1749
1780
|
#
|
1750
1781
|
class Configuration
|
1751
1782
|
extend ::Gapic::Config
|
@@ -1770,6 +1801,7 @@ module Google
|
|
1770
1801
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1771
1802
|
config_attr :quota_project, nil, ::String, nil
|
1772
1803
|
config_attr :universe_domain, nil, ::String, nil
|
1804
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1773
1805
|
|
1774
1806
|
# @private
|
1775
1807
|
def initialize parent_config = nil
|
@@ -124,14 +124,6 @@ module Google
|
|
124
124
|
# Lists operations that match the specified filter in the request. If the
|
125
125
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
126
126
|
#
|
127
|
-
# NOTE: the `name` binding allows API services to override the binding
|
128
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
129
|
-
# override the binding, API services can add a binding such as
|
130
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
131
|
-
# For backwards compatibility, the default name includes the operations
|
132
|
-
# collection id, however overriding users must ensure the name binding
|
133
|
-
# is the parent resource, without the operations collection id.
|
134
|
-
#
|
135
127
|
# @overload list_operations(request, options = nil)
|
136
128
|
# Pass arguments to `list_operations` via a request object, either of type
|
137
129
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -221,7 +213,7 @@ module Google
|
|
221
213
|
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
222
214
|
response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
223
215
|
yield response, operation if block_given?
|
224
|
-
|
216
|
+
throw :response, response
|
225
217
|
end
|
226
218
|
rescue ::GRPC::BadStatus => e
|
227
219
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -317,7 +309,7 @@ module Google
|
|
317
309
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
318
310
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
319
311
|
yield response, operation if block_given?
|
320
|
-
|
312
|
+
throw :response, response
|
321
313
|
end
|
322
314
|
rescue ::GRPC::BadStatus => e
|
323
315
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -406,7 +398,6 @@ module Google
|
|
406
398
|
|
407
399
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
408
400
|
yield response, operation if block_given?
|
409
|
-
return response
|
410
401
|
end
|
411
402
|
rescue ::GRPC::BadStatus => e
|
412
403
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -421,8 +412,9 @@ module Google
|
|
421
412
|
# other methods to check whether the cancellation succeeded or whether the
|
422
413
|
# operation completed despite cancellation. On successful cancellation,
|
423
414
|
# the operation is not deleted; instead, it becomes an operation with
|
424
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
425
|
-
# corresponding to
|
415
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
416
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
417
|
+
# `Code.CANCELLED`.
|
426
418
|
#
|
427
419
|
# @overload cancel_operation(request, options = nil)
|
428
420
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -501,7 +493,6 @@ module Google
|
|
501
493
|
|
502
494
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
503
495
|
yield response, operation if block_given?
|
504
|
-
return response
|
505
496
|
end
|
506
497
|
rescue ::GRPC::BadStatus => e
|
507
498
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -599,7 +590,7 @@ module Google
|
|
599
590
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
600
591
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
601
592
|
yield response, operation if block_given?
|
602
|
-
|
593
|
+
throw :response, response
|
603
594
|
end
|
604
595
|
rescue ::GRPC::BadStatus => e
|
605
596
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -649,6 +640,13 @@ module Google
|
|
649
640
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
650
641
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
651
642
|
# * (`nil`) indicating no credentials
|
643
|
+
#
|
644
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
645
|
+
# external source for authentication to Google Cloud, you must validate it before
|
646
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
647
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
648
|
+
# For more information, refer to [Validate credential configurations from external
|
649
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
652
650
|
# @return [::Object]
|
653
651
|
# @!attribute [rw] scope
|
654
652
|
# The OAuth scopes
|
@@ -688,6 +686,11 @@ module Google
|
|
688
686
|
# default endpoint URL. The default value of nil uses the environment
|
689
687
|
# universe (usually the default "googleapis.com" universe).
|
690
688
|
# @return [::String,nil]
|
689
|
+
# @!attribute [rw] logger
|
690
|
+
# A custom logger to use for request/response debug logging, or the value
|
691
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
692
|
+
# explicitly disable logging.
|
693
|
+
# @return [::Logger,:default,nil]
|
691
694
|
#
|
692
695
|
class Configuration
|
693
696
|
extend ::Gapic::Config
|
@@ -712,6 +715,7 @@ module Google
|
|
712
715
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
713
716
|
config_attr :quota_project, nil, ::String, nil
|
714
717
|
config_attr :universe_domain, nil, ::String, nil
|
718
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
715
719
|
|
716
720
|
# @private
|
717
721
|
def initialize parent_config = nil
|
@@ -163,15 +163,27 @@ module Google
|
|
163
163
|
endpoint: @config.endpoint,
|
164
164
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
165
165
|
universe_domain: @config.universe_domain,
|
166
|
-
credentials: credentials
|
166
|
+
credentials: credentials,
|
167
|
+
logger: @config.logger
|
167
168
|
)
|
168
169
|
|
170
|
+
@network_security_stub.logger(stub: true)&.info do |entry|
|
171
|
+
entry.set_system_name
|
172
|
+
entry.set_service
|
173
|
+
entry.message = "Created client for #{entry.service}"
|
174
|
+
entry.set_credentials_fields credentials
|
175
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
176
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
177
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
178
|
+
end
|
179
|
+
|
169
180
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
170
181
|
config.credentials = credentials
|
171
182
|
config.quota_project = @quota_project_id
|
172
183
|
config.endpoint = @network_security_stub.endpoint
|
173
184
|
config.universe_domain = @network_security_stub.universe_domain
|
174
185
|
config.bindings_override = @config.bindings_override
|
186
|
+
config.logger = @network_security_stub.logger if config.respond_to? :logger=
|
175
187
|
end
|
176
188
|
|
177
189
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -180,6 +192,7 @@ module Google
|
|
180
192
|
config.endpoint = @network_security_stub.endpoint
|
181
193
|
config.universe_domain = @network_security_stub.universe_domain
|
182
194
|
config.bindings_override = @config.bindings_override
|
195
|
+
config.logger = @network_security_stub.logger if config.respond_to? :logger=
|
183
196
|
end
|
184
197
|
end
|
185
198
|
|
@@ -204,6 +217,15 @@ module Google
|
|
204
217
|
#
|
205
218
|
attr_reader :iam_policy_client
|
206
219
|
|
220
|
+
##
|
221
|
+
# The logger used for request/response debug logging.
|
222
|
+
#
|
223
|
+
# @return [Logger]
|
224
|
+
#
|
225
|
+
def logger
|
226
|
+
@network_security_stub.logger
|
227
|
+
end
|
228
|
+
|
207
229
|
# Service calls
|
208
230
|
|
209
231
|
##
|
@@ -293,7 +315,7 @@ module Google
|
|
293
315
|
@network_security_stub.list_authorization_policies request, options do |result, operation|
|
294
316
|
result = ::Gapic::Rest::PagedEnumerable.new @network_security_stub, :list_authorization_policies, "authorization_policies", request, result, options
|
295
317
|
yield result, operation if block_given?
|
296
|
-
|
318
|
+
throw :response, result
|
297
319
|
end
|
298
320
|
rescue ::Gapic::Rest::Error => e
|
299
321
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -373,7 +395,6 @@ module Google
|
|
373
395
|
|
374
396
|
@network_security_stub.get_authorization_policy request, options do |result, operation|
|
375
397
|
yield result, operation if block_given?
|
376
|
-
return result
|
377
398
|
end
|
378
399
|
rescue ::Gapic::Rest::Error => e
|
379
400
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -468,7 +489,7 @@ module Google
|
|
468
489
|
@network_security_stub.create_authorization_policy request, options do |result, operation|
|
469
490
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
470
491
|
yield result, operation if block_given?
|
471
|
-
|
492
|
+
throw :response, result
|
472
493
|
end
|
473
494
|
rescue ::Gapic::Rest::Error => e
|
474
495
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -561,7 +582,7 @@ module Google
|
|
561
582
|
@network_security_stub.update_authorization_policy request, options do |result, operation|
|
562
583
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
563
584
|
yield result, operation if block_given?
|
564
|
-
|
585
|
+
throw :response, result
|
565
586
|
end
|
566
587
|
rescue ::Gapic::Rest::Error => e
|
567
588
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -649,7 +670,7 @@ module Google
|
|
649
670
|
@network_security_stub.delete_authorization_policy request, options do |result, operation|
|
650
671
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
651
672
|
yield result, operation if block_given?
|
652
|
-
|
673
|
+
throw :response, result
|
653
674
|
end
|
654
675
|
rescue ::Gapic::Rest::Error => e
|
655
676
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -741,7 +762,7 @@ module Google
|
|
741
762
|
@network_security_stub.list_server_tls_policies request, options do |result, operation|
|
742
763
|
result = ::Gapic::Rest::PagedEnumerable.new @network_security_stub, :list_server_tls_policies, "server_tls_policies", request, result, options
|
743
764
|
yield result, operation if block_given?
|
744
|
-
|
765
|
+
throw :response, result
|
745
766
|
end
|
746
767
|
rescue ::Gapic::Rest::Error => e
|
747
768
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -821,7 +842,6 @@ module Google
|
|
821
842
|
|
822
843
|
@network_security_stub.get_server_tls_policy request, options do |result, operation|
|
823
844
|
yield result, operation if block_given?
|
824
|
-
return result
|
825
845
|
end
|
826
846
|
rescue ::Gapic::Rest::Error => e
|
827
847
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -916,7 +936,7 @@ module Google
|
|
916
936
|
@network_security_stub.create_server_tls_policy request, options do |result, operation|
|
917
937
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
918
938
|
yield result, operation if block_given?
|
919
|
-
|
939
|
+
throw :response, result
|
920
940
|
end
|
921
941
|
rescue ::Gapic::Rest::Error => e
|
922
942
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1010,7 +1030,7 @@ module Google
|
|
1010
1030
|
@network_security_stub.update_server_tls_policy request, options do |result, operation|
|
1011
1031
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1012
1032
|
yield result, operation if block_given?
|
1013
|
-
|
1033
|
+
throw :response, result
|
1014
1034
|
end
|
1015
1035
|
rescue ::Gapic::Rest::Error => e
|
1016
1036
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1098,7 +1118,7 @@ module Google
|
|
1098
1118
|
@network_security_stub.delete_server_tls_policy request, options do |result, operation|
|
1099
1119
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1100
1120
|
yield result, operation if block_given?
|
1101
|
-
|
1121
|
+
throw :response, result
|
1102
1122
|
end
|
1103
1123
|
rescue ::Gapic::Rest::Error => e
|
1104
1124
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1190,7 +1210,7 @@ module Google
|
|
1190
1210
|
@network_security_stub.list_client_tls_policies request, options do |result, operation|
|
1191
1211
|
result = ::Gapic::Rest::PagedEnumerable.new @network_security_stub, :list_client_tls_policies, "client_tls_policies", request, result, options
|
1192
1212
|
yield result, operation if block_given?
|
1193
|
-
|
1213
|
+
throw :response, result
|
1194
1214
|
end
|
1195
1215
|
rescue ::Gapic::Rest::Error => e
|
1196
1216
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1270,7 +1290,6 @@ module Google
|
|
1270
1290
|
|
1271
1291
|
@network_security_stub.get_client_tls_policy request, options do |result, operation|
|
1272
1292
|
yield result, operation if block_given?
|
1273
|
-
return result
|
1274
1293
|
end
|
1275
1294
|
rescue ::Gapic::Rest::Error => e
|
1276
1295
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1365,7 +1384,7 @@ module Google
|
|
1365
1384
|
@network_security_stub.create_client_tls_policy request, options do |result, operation|
|
1366
1385
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1367
1386
|
yield result, operation if block_given?
|
1368
|
-
|
1387
|
+
throw :response, result
|
1369
1388
|
end
|
1370
1389
|
rescue ::Gapic::Rest::Error => e
|
1371
1390
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1459,7 +1478,7 @@ module Google
|
|
1459
1478
|
@network_security_stub.update_client_tls_policy request, options do |result, operation|
|
1460
1479
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1461
1480
|
yield result, operation if block_given?
|
1462
|
-
|
1481
|
+
throw :response, result
|
1463
1482
|
end
|
1464
1483
|
rescue ::Gapic::Rest::Error => e
|
1465
1484
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1547,7 +1566,7 @@ module Google
|
|
1547
1566
|
@network_security_stub.delete_client_tls_policy request, options do |result, operation|
|
1548
1567
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1549
1568
|
yield result, operation if block_given?
|
1550
|
-
|
1569
|
+
throw :response, result
|
1551
1570
|
end
|
1552
1571
|
rescue ::Gapic::Rest::Error => e
|
1553
1572
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1595,6 +1614,13 @@ module Google
|
|
1595
1614
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1596
1615
|
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1597
1616
|
# * (`nil`) indicating no credentials
|
1617
|
+
#
|
1618
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1619
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1620
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1621
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1622
|
+
# For more information, refer to [Validate credential configurations from external
|
1623
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1598
1624
|
# @return [::Object]
|
1599
1625
|
# @!attribute [rw] scope
|
1600
1626
|
# The OAuth scopes
|
@@ -1627,6 +1653,11 @@ module Google
|
|
1627
1653
|
# default endpoint URL. The default value of nil uses the environment
|
1628
1654
|
# universe (usually the default "googleapis.com" universe).
|
1629
1655
|
# @return [::String,nil]
|
1656
|
+
# @!attribute [rw] logger
|
1657
|
+
# A custom logger to use for request/response debug logging, or the value
|
1658
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1659
|
+
# explicitly disable logging.
|
1660
|
+
# @return [::Logger,:default,nil]
|
1630
1661
|
#
|
1631
1662
|
class Configuration
|
1632
1663
|
extend ::Gapic::Config
|
@@ -1655,6 +1686,7 @@ module Google
|
|
1655
1686
|
# by the host service.
|
1656
1687
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1657
1688
|
config_attr :bindings_override, {}, ::Hash, nil
|
1689
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1658
1690
|
|
1659
1691
|
# @private
|
1660
1692
|
def initialize parent_config = nil
|