google-cloud-security_center-v1p1beta1 0.14.2 → 0.15.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 +30 -20
- data/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb +34 -24
- data/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb +12 -15
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb +34 -24
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb +43 -38
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb +198 -140
- data/lib/google/cloud/security_center/v1p1beta1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2455f828dff12fed0d8ae9f93c556eceb3ade531df92fe3051b475205b3e90a6
|
|
4
|
+
data.tar.gz: 50625547b601709a7ec691908b0801a395f461d2f042bf45a57b6570074790b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21d7ea372455996e4e04a974fc3ed999fe79e03298c0e0f96b694588ca9ba2f4ef686eecafd528720947fccec7a612862dcfc61b5d801b7e90484498c45118d9
|
|
7
|
+
data.tar.gz: 7d0b30b10388d3ce7476670c54cbfda0a4a3e19e489842d2b7d61db687d97a9ee92068c1c4a83a74d22b3507fe597a40c11692b274305f8eb69bd5c7e8d4513c
|
data/README.md
CHANGED
|
@@ -42,33 +42,43 @@ for class and method documentation.
|
|
|
42
42
|
See also the [Product Documentation](https://cloud.google.com/security-command-center)
|
|
43
43
|
for general usage information.
|
|
44
44
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
## Debug Logging
|
|
46
|
+
|
|
47
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
|
48
|
+
your application's integration with the API. When logging is activated, key
|
|
49
|
+
events such as requests and responses, along with data payloads and metadata
|
|
50
|
+
such as headers and client configuration, are logged to the standard error
|
|
51
|
+
stream.
|
|
52
|
+
|
|
53
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
|
54
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
|
55
|
+
customers, private keys, or other security data that could be compromising if
|
|
56
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
|
57
|
+
the principle of least access. Google also recommends that Client Library Debug
|
|
58
|
+
Logging be enabled only temporarily during active debugging, and not used
|
|
59
|
+
permanently in production.
|
|
60
|
+
|
|
61
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
|
62
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
|
63
|
+
list of client library gem names. This will select the default logging behavior,
|
|
64
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
|
65
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
|
66
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
|
67
|
+
results in logs appearing alongside your application logs in the
|
|
68
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
|
69
|
+
|
|
70
|
+
You can customize logging by modifying the `logger` configuration when
|
|
71
|
+
constructing a client object. For example:
|
|
54
72
|
|
|
55
73
|
```ruby
|
|
74
|
+
require "google/cloud/security_center/v1p1beta1"
|
|
56
75
|
require "logger"
|
|
57
76
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def logger
|
|
61
|
-
LOGGER
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
|
66
|
-
module GRPC
|
|
67
|
-
extend MyLogger
|
|
77
|
+
client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new do |config|
|
|
78
|
+
config.logger = Logger.new "my-app.log"
|
|
68
79
|
end
|
|
69
80
|
```
|
|
70
81
|
|
|
71
|
-
|
|
72
82
|
## Google Cloud Samples
|
|
73
83
|
|
|
74
84
|
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
|
@@ -243,8 +243,19 @@ module Google
|
|
|
243
243
|
universe_domain: @config.universe_domain,
|
|
244
244
|
channel_args: @config.channel_args,
|
|
245
245
|
interceptors: @config.interceptors,
|
|
246
|
-
channel_pool_config: @config.channel_pool
|
|
246
|
+
channel_pool_config: @config.channel_pool,
|
|
247
|
+
logger: @config.logger
|
|
247
248
|
)
|
|
249
|
+
|
|
250
|
+
@security_center_stub.stub_logger&.info do |entry|
|
|
251
|
+
entry.set_system_name
|
|
252
|
+
entry.set_service
|
|
253
|
+
entry.message = "Created client for #{entry.service}"
|
|
254
|
+
entry.set_credentials_fields credentials
|
|
255
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
256
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
257
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
258
|
+
end
|
|
248
259
|
end
|
|
249
260
|
|
|
250
261
|
##
|
|
@@ -254,6 +265,15 @@ module Google
|
|
|
254
265
|
#
|
|
255
266
|
attr_reader :operations_client
|
|
256
267
|
|
|
268
|
+
##
|
|
269
|
+
# The logger used for request/response debug logging.
|
|
270
|
+
#
|
|
271
|
+
# @return [Logger]
|
|
272
|
+
#
|
|
273
|
+
def logger
|
|
274
|
+
@security_center_stub.logger
|
|
275
|
+
end
|
|
276
|
+
|
|
257
277
|
# Service calls
|
|
258
278
|
|
|
259
279
|
##
|
|
@@ -340,7 +360,6 @@ module Google
|
|
|
340
360
|
|
|
341
361
|
@security_center_stub.call_rpc :create_source, request, options: options do |response, operation|
|
|
342
362
|
yield response, operation if block_given?
|
|
343
|
-
return response
|
|
344
363
|
end
|
|
345
364
|
rescue ::GRPC::BadStatus => e
|
|
346
365
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -433,7 +452,6 @@ module Google
|
|
|
433
452
|
|
|
434
453
|
@security_center_stub.call_rpc :create_finding, request, options: options do |response, operation|
|
|
435
454
|
yield response, operation if block_given?
|
|
436
|
-
return response
|
|
437
455
|
end
|
|
438
456
|
rescue ::GRPC::BadStatus => e
|
|
439
457
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -527,7 +545,6 @@ module Google
|
|
|
527
545
|
|
|
528
546
|
@security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation|
|
|
529
547
|
yield response, operation if block_given?
|
|
530
|
-
return response
|
|
531
548
|
end
|
|
532
549
|
rescue ::GRPC::BadStatus => e
|
|
533
550
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -614,7 +631,6 @@ module Google
|
|
|
614
631
|
|
|
615
632
|
@security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation|
|
|
616
633
|
yield response, operation if block_given?
|
|
617
|
-
return response
|
|
618
634
|
end
|
|
619
635
|
rescue ::GRPC::BadStatus => e
|
|
620
636
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -704,7 +720,6 @@ module Google
|
|
|
704
720
|
|
|
705
721
|
@security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
|
706
722
|
yield response, operation if block_given?
|
|
707
|
-
return response
|
|
708
723
|
end
|
|
709
724
|
rescue ::GRPC::BadStatus => e
|
|
710
725
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -791,7 +806,6 @@ module Google
|
|
|
791
806
|
|
|
792
807
|
@security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation|
|
|
793
808
|
yield response, operation if block_given?
|
|
794
|
-
return response
|
|
795
809
|
end
|
|
796
810
|
rescue ::GRPC::BadStatus => e
|
|
797
811
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -878,7 +892,6 @@ module Google
|
|
|
878
892
|
|
|
879
893
|
@security_center_stub.call_rpc :get_organization_settings, request, options: options do |response, operation|
|
|
880
894
|
yield response, operation if block_given?
|
|
881
|
-
return response
|
|
882
895
|
end
|
|
883
896
|
rescue ::GRPC::BadStatus => e
|
|
884
897
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -965,7 +978,6 @@ module Google
|
|
|
965
978
|
|
|
966
979
|
@security_center_stub.call_rpc :get_source, request, options: options do |response, operation|
|
|
967
980
|
yield response, operation if block_given?
|
|
968
|
-
return response
|
|
969
981
|
end
|
|
970
982
|
rescue ::GRPC::BadStatus => e
|
|
971
983
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1181,7 +1193,7 @@ module Google
|
|
|
1181
1193
|
@security_center_stub.call_rpc :group_assets, request, options: options do |response, operation|
|
|
1182
1194
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_assets, request, response, operation, options
|
|
1183
1195
|
yield response, operation if block_given?
|
|
1184
|
-
|
|
1196
|
+
throw :response, response
|
|
1185
1197
|
end
|
|
1186
1198
|
rescue ::GRPC::BadStatus => e
|
|
1187
1199
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1396,7 +1408,7 @@ module Google
|
|
|
1396
1408
|
@security_center_stub.call_rpc :group_findings, request, options: options do |response, operation|
|
|
1397
1409
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, options
|
|
1398
1410
|
yield response, operation if block_given?
|
|
1399
|
-
|
|
1411
|
+
throw :response, response
|
|
1400
1412
|
end
|
|
1401
1413
|
rescue ::GRPC::BadStatus => e
|
|
1402
1414
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1615,7 +1627,7 @@ module Google
|
|
|
1615
1627
|
@security_center_stub.call_rpc :list_assets, request, options: options do |response, operation|
|
|
1616
1628
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_assets, request, response, operation, options
|
|
1617
1629
|
yield response, operation if block_given?
|
|
1618
|
-
|
|
1630
|
+
throw :response, response
|
|
1619
1631
|
end
|
|
1620
1632
|
rescue ::GRPC::BadStatus => e
|
|
1621
1633
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1831,7 +1843,7 @@ module Google
|
|
|
1831
1843
|
@security_center_stub.call_rpc :list_findings, request, options: options do |response, operation|
|
|
1832
1844
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, options
|
|
1833
1845
|
yield response, operation if block_given?
|
|
1834
|
-
|
|
1846
|
+
throw :response, response
|
|
1835
1847
|
end
|
|
1836
1848
|
rescue ::GRPC::BadStatus => e
|
|
1837
1849
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1930,7 +1942,7 @@ module Google
|
|
|
1930
1942
|
@security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation|
|
|
1931
1943
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, options
|
|
1932
1944
|
yield response, operation if block_given?
|
|
1933
|
-
|
|
1945
|
+
throw :response, response
|
|
1934
1946
|
end
|
|
1935
1947
|
rescue ::GRPC::BadStatus => e
|
|
1936
1948
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2030,7 +2042,7 @@ module Google
|
|
|
2030
2042
|
@security_center_stub.call_rpc :list_sources, request, options: options do |response, operation|
|
|
2031
2043
|
response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, options
|
|
2032
2044
|
yield response, operation if block_given?
|
|
2033
|
-
|
|
2045
|
+
throw :response, response
|
|
2034
2046
|
end
|
|
2035
2047
|
rescue ::GRPC::BadStatus => e
|
|
2036
2048
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2130,7 +2142,7 @@ module Google
|
|
|
2130
2142
|
@security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation|
|
|
2131
2143
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
2132
2144
|
yield response, operation if block_given?
|
|
2133
|
-
|
|
2145
|
+
throw :response, response
|
|
2134
2146
|
end
|
|
2135
2147
|
rescue ::GRPC::BadStatus => e
|
|
2136
2148
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2223,7 +2235,6 @@ module Google
|
|
|
2223
2235
|
|
|
2224
2236
|
@security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation|
|
|
2225
2237
|
yield response, operation if block_given?
|
|
2226
|
-
return response
|
|
2227
2238
|
end
|
|
2228
2239
|
rescue ::GRPC::BadStatus => e
|
|
2229
2240
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2321,7 +2332,6 @@ module Google
|
|
|
2321
2332
|
|
|
2322
2333
|
@security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
|
2323
2334
|
yield response, operation if block_given?
|
|
2324
|
-
return response
|
|
2325
2335
|
end
|
|
2326
2336
|
rescue ::GRPC::BadStatus => e
|
|
2327
2337
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2413,7 +2423,6 @@ module Google
|
|
|
2413
2423
|
|
|
2414
2424
|
@security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
|
2415
2425
|
yield response, operation if block_given?
|
|
2416
|
-
return response
|
|
2417
2426
|
end
|
|
2418
2427
|
rescue ::GRPC::BadStatus => e
|
|
2419
2428
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2513,7 +2522,6 @@ module Google
|
|
|
2513
2522
|
|
|
2514
2523
|
@security_center_stub.call_rpc :update_finding, request, options: options do |response, operation|
|
|
2515
2524
|
yield response, operation if block_given?
|
|
2516
|
-
return response
|
|
2517
2525
|
end
|
|
2518
2526
|
rescue ::GRPC::BadStatus => e
|
|
2519
2527
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2604,7 +2612,6 @@ module Google
|
|
|
2604
2612
|
|
|
2605
2613
|
@security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation|
|
|
2606
2614
|
yield response, operation if block_given?
|
|
2607
|
-
return response
|
|
2608
2615
|
end
|
|
2609
2616
|
rescue ::GRPC::BadStatus => e
|
|
2610
2617
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2694,7 +2701,6 @@ module Google
|
|
|
2694
2701
|
|
|
2695
2702
|
@security_center_stub.call_rpc :update_organization_settings, request, options: options do |response, operation|
|
|
2696
2703
|
yield response, operation if block_given?
|
|
2697
|
-
return response
|
|
2698
2704
|
end
|
|
2699
2705
|
rescue ::GRPC::BadStatus => e
|
|
2700
2706
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2784,7 +2790,6 @@ module Google
|
|
|
2784
2790
|
|
|
2785
2791
|
@security_center_stub.call_rpc :update_source, request, options: options do |response, operation|
|
|
2786
2792
|
yield response, operation if block_given?
|
|
2787
|
-
return response
|
|
2788
2793
|
end
|
|
2789
2794
|
rescue ::GRPC::BadStatus => e
|
|
2790
2795
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2880,7 +2885,6 @@ module Google
|
|
|
2880
2885
|
|
|
2881
2886
|
@security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation|
|
|
2882
2887
|
yield response, operation if block_given?
|
|
2883
|
-
return response
|
|
2884
2888
|
end
|
|
2885
2889
|
rescue ::GRPC::BadStatus => e
|
|
2886
2890
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2969,6 +2973,11 @@ module Google
|
|
|
2969
2973
|
# default endpoint URL. The default value of nil uses the environment
|
|
2970
2974
|
# universe (usually the default "googleapis.com" universe).
|
|
2971
2975
|
# @return [::String,nil]
|
|
2976
|
+
# @!attribute [rw] logger
|
|
2977
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
2978
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
2979
|
+
# explicitly disable logging.
|
|
2980
|
+
# @return [::Logger,:default,nil]
|
|
2972
2981
|
#
|
|
2973
2982
|
class Configuration
|
|
2974
2983
|
extend ::Gapic::Config
|
|
@@ -2993,6 +3002,7 @@ module Google
|
|
|
2993
3002
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
2994
3003
|
config_attr :quota_project, nil, ::String, nil
|
|
2995
3004
|
config_attr :universe_domain, nil, ::String, nil
|
|
3005
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
2996
3006
|
|
|
2997
3007
|
# @private
|
|
2998
3008
|
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)
|
|
@@ -688,6 +679,11 @@ module Google
|
|
|
688
679
|
# default endpoint URL. The default value of nil uses the environment
|
|
689
680
|
# universe (usually the default "googleapis.com" universe).
|
|
690
681
|
# @return [::String,nil]
|
|
682
|
+
# @!attribute [rw] logger
|
|
683
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
684
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
685
|
+
# explicitly disable logging.
|
|
686
|
+
# @return [::Logger,:default,nil]
|
|
691
687
|
#
|
|
692
688
|
class Configuration
|
|
693
689
|
extend ::Gapic::Config
|
|
@@ -712,6 +708,7 @@ module Google
|
|
|
712
708
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
713
709
|
config_attr :quota_project, nil, ::String, nil
|
|
714
710
|
config_attr :universe_domain, nil, ::String, nil
|
|
711
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
715
712
|
|
|
716
713
|
# @private
|
|
717
714
|
def initialize parent_config = nil
|
|
@@ -236,8 +236,19 @@ module Google
|
|
|
236
236
|
endpoint: @config.endpoint,
|
|
237
237
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
238
238
|
universe_domain: @config.universe_domain,
|
|
239
|
-
credentials: credentials
|
|
239
|
+
credentials: credentials,
|
|
240
|
+
logger: @config.logger
|
|
240
241
|
)
|
|
242
|
+
|
|
243
|
+
@security_center_stub.logger(stub: true)&.info do |entry|
|
|
244
|
+
entry.set_system_name
|
|
245
|
+
entry.set_service
|
|
246
|
+
entry.message = "Created client for #{entry.service}"
|
|
247
|
+
entry.set_credentials_fields credentials
|
|
248
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
249
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
250
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
251
|
+
end
|
|
241
252
|
end
|
|
242
253
|
|
|
243
254
|
##
|
|
@@ -247,6 +258,15 @@ module Google
|
|
|
247
258
|
#
|
|
248
259
|
attr_reader :operations_client
|
|
249
260
|
|
|
261
|
+
##
|
|
262
|
+
# The logger used for request/response debug logging.
|
|
263
|
+
#
|
|
264
|
+
# @return [Logger]
|
|
265
|
+
#
|
|
266
|
+
def logger
|
|
267
|
+
@security_center_stub.logger
|
|
268
|
+
end
|
|
269
|
+
|
|
250
270
|
# Service calls
|
|
251
271
|
|
|
252
272
|
##
|
|
@@ -326,7 +346,6 @@ module Google
|
|
|
326
346
|
|
|
327
347
|
@security_center_stub.create_source request, options do |result, operation|
|
|
328
348
|
yield result, operation if block_given?
|
|
329
|
-
return result
|
|
330
349
|
end
|
|
331
350
|
rescue ::Gapic::Rest::Error => e
|
|
332
351
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -412,7 +431,6 @@ module Google
|
|
|
412
431
|
|
|
413
432
|
@security_center_stub.create_finding request, options do |result, operation|
|
|
414
433
|
yield result, operation if block_given?
|
|
415
|
-
return result
|
|
416
434
|
end
|
|
417
435
|
rescue ::Gapic::Rest::Error => e
|
|
418
436
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -499,7 +517,6 @@ module Google
|
|
|
499
517
|
|
|
500
518
|
@security_center_stub.create_notification_config request, options do |result, operation|
|
|
501
519
|
yield result, operation if block_given?
|
|
502
|
-
return result
|
|
503
520
|
end
|
|
504
521
|
rescue ::Gapic::Rest::Error => e
|
|
505
522
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -579,7 +596,6 @@ module Google
|
|
|
579
596
|
|
|
580
597
|
@security_center_stub.delete_notification_config request, options do |result, operation|
|
|
581
598
|
yield result, operation if block_given?
|
|
582
|
-
return result
|
|
583
599
|
end
|
|
584
600
|
rescue ::Gapic::Rest::Error => e
|
|
585
601
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -662,7 +678,6 @@ module Google
|
|
|
662
678
|
|
|
663
679
|
@security_center_stub.get_iam_policy request, options do |result, operation|
|
|
664
680
|
yield result, operation if block_given?
|
|
665
|
-
return result
|
|
666
681
|
end
|
|
667
682
|
rescue ::Gapic::Rest::Error => e
|
|
668
683
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -742,7 +757,6 @@ module Google
|
|
|
742
757
|
|
|
743
758
|
@security_center_stub.get_notification_config request, options do |result, operation|
|
|
744
759
|
yield result, operation if block_given?
|
|
745
|
-
return result
|
|
746
760
|
end
|
|
747
761
|
rescue ::Gapic::Rest::Error => e
|
|
748
762
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -822,7 +836,6 @@ module Google
|
|
|
822
836
|
|
|
823
837
|
@security_center_stub.get_organization_settings request, options do |result, operation|
|
|
824
838
|
yield result, operation if block_given?
|
|
825
|
-
return result
|
|
826
839
|
end
|
|
827
840
|
rescue ::Gapic::Rest::Error => e
|
|
828
841
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -902,7 +915,6 @@ module Google
|
|
|
902
915
|
|
|
903
916
|
@security_center_stub.get_source request, options do |result, operation|
|
|
904
917
|
yield result, operation if block_given?
|
|
905
|
-
return result
|
|
906
918
|
end
|
|
907
919
|
rescue ::Gapic::Rest::Error => e
|
|
908
920
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1111,7 +1123,7 @@ module Google
|
|
|
1111
1123
|
@security_center_stub.group_assets request, options do |result, operation|
|
|
1112
1124
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", request, result, options
|
|
1113
1125
|
yield result, operation if block_given?
|
|
1114
|
-
|
|
1126
|
+
throw :response, result
|
|
1115
1127
|
end
|
|
1116
1128
|
rescue ::Gapic::Rest::Error => e
|
|
1117
1129
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1319,7 +1331,7 @@ module Google
|
|
|
1319
1331
|
@security_center_stub.group_findings request, options do |result, operation|
|
|
1320
1332
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", request, result, options
|
|
1321
1333
|
yield result, operation if block_given?
|
|
1322
|
-
|
|
1334
|
+
throw :response, result
|
|
1323
1335
|
end
|
|
1324
1336
|
rescue ::Gapic::Rest::Error => e
|
|
1325
1337
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1531,7 +1543,7 @@ module Google
|
|
|
1531
1543
|
@security_center_stub.list_assets request, options do |result, operation|
|
|
1532
1544
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", request, result, options
|
|
1533
1545
|
yield result, operation if block_given?
|
|
1534
|
-
|
|
1546
|
+
throw :response, result
|
|
1535
1547
|
end
|
|
1536
1548
|
rescue ::Gapic::Rest::Error => e
|
|
1537
1549
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1740,7 +1752,7 @@ module Google
|
|
|
1740
1752
|
@security_center_stub.list_findings request, options do |result, operation|
|
|
1741
1753
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", request, result, options
|
|
1742
1754
|
yield result, operation if block_given?
|
|
1743
|
-
|
|
1755
|
+
throw :response, result
|
|
1744
1756
|
end
|
|
1745
1757
|
rescue ::Gapic::Rest::Error => e
|
|
1746
1758
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1832,7 +1844,7 @@ module Google
|
|
|
1832
1844
|
@security_center_stub.list_notification_configs request, options do |result, operation|
|
|
1833
1845
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", request, result, options
|
|
1834
1846
|
yield result, operation if block_given?
|
|
1835
|
-
|
|
1847
|
+
throw :response, result
|
|
1836
1848
|
end
|
|
1837
1849
|
rescue ::Gapic::Rest::Error => e
|
|
1838
1850
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -1925,7 +1937,7 @@ module Google
|
|
|
1925
1937
|
@security_center_stub.list_sources request, options do |result, operation|
|
|
1926
1938
|
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", request, result, options
|
|
1927
1939
|
yield result, operation if block_given?
|
|
1928
|
-
|
|
1940
|
+
throw :response, result
|
|
1929
1941
|
end
|
|
1930
1942
|
rescue ::Gapic::Rest::Error => e
|
|
1931
1943
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2018,7 +2030,7 @@ module Google
|
|
|
2018
2030
|
@security_center_stub.run_asset_discovery request, options do |result, operation|
|
|
2019
2031
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
2020
2032
|
yield result, operation if block_given?
|
|
2021
|
-
|
|
2033
|
+
throw :response, result
|
|
2022
2034
|
end
|
|
2023
2035
|
rescue ::Gapic::Rest::Error => e
|
|
2024
2036
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2104,7 +2116,6 @@ module Google
|
|
|
2104
2116
|
|
|
2105
2117
|
@security_center_stub.set_finding_state request, options do |result, operation|
|
|
2106
2118
|
yield result, operation if block_given?
|
|
2107
|
-
return result
|
|
2108
2119
|
end
|
|
2109
2120
|
rescue ::Gapic::Rest::Error => e
|
|
2110
2121
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2195,7 +2206,6 @@ module Google
|
|
|
2195
2206
|
|
|
2196
2207
|
@security_center_stub.set_iam_policy request, options do |result, operation|
|
|
2197
2208
|
yield result, operation if block_given?
|
|
2198
|
-
return result
|
|
2199
2209
|
end
|
|
2200
2210
|
rescue ::Gapic::Rest::Error => e
|
|
2201
2211
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2280,7 +2290,6 @@ module Google
|
|
|
2280
2290
|
|
|
2281
2291
|
@security_center_stub.test_iam_permissions request, options do |result, operation|
|
|
2282
2292
|
yield result, operation if block_given?
|
|
2283
|
-
return result
|
|
2284
2293
|
end
|
|
2285
2294
|
rescue ::Gapic::Rest::Error => e
|
|
2286
2295
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2373,7 +2382,6 @@ module Google
|
|
|
2373
2382
|
|
|
2374
2383
|
@security_center_stub.update_finding request, options do |result, operation|
|
|
2375
2384
|
yield result, operation if block_given?
|
|
2376
|
-
return result
|
|
2377
2385
|
end
|
|
2378
2386
|
rescue ::Gapic::Rest::Error => e
|
|
2379
2387
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2457,7 +2465,6 @@ module Google
|
|
|
2457
2465
|
|
|
2458
2466
|
@security_center_stub.update_notification_config request, options do |result, operation|
|
|
2459
2467
|
yield result, operation if block_given?
|
|
2460
|
-
return result
|
|
2461
2468
|
end
|
|
2462
2469
|
rescue ::Gapic::Rest::Error => e
|
|
2463
2470
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2540,7 +2547,6 @@ module Google
|
|
|
2540
2547
|
|
|
2541
2548
|
@security_center_stub.update_organization_settings request, options do |result, operation|
|
|
2542
2549
|
yield result, operation if block_given?
|
|
2543
|
-
return result
|
|
2544
2550
|
end
|
|
2545
2551
|
rescue ::Gapic::Rest::Error => e
|
|
2546
2552
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2623,7 +2629,6 @@ module Google
|
|
|
2623
2629
|
|
|
2624
2630
|
@security_center_stub.update_source request, options do |result, operation|
|
|
2625
2631
|
yield result, operation if block_given?
|
|
2626
|
-
return result
|
|
2627
2632
|
end
|
|
2628
2633
|
rescue ::Gapic::Rest::Error => e
|
|
2629
2634
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2712,7 +2717,6 @@ module Google
|
|
|
2712
2717
|
|
|
2713
2718
|
@security_center_stub.update_security_marks request, options do |result, operation|
|
|
2714
2719
|
yield result, operation if block_given?
|
|
2715
|
-
return result
|
|
2716
2720
|
end
|
|
2717
2721
|
rescue ::Gapic::Rest::Error => e
|
|
2718
2722
|
raise ::Google::Cloud::Error.from_error(e)
|
|
@@ -2792,6 +2796,11 @@ module Google
|
|
|
2792
2796
|
# default endpoint URL. The default value of nil uses the environment
|
|
2793
2797
|
# universe (usually the default "googleapis.com" universe).
|
|
2794
2798
|
# @return [::String,nil]
|
|
2799
|
+
# @!attribute [rw] logger
|
|
2800
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
2801
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
2802
|
+
# explicitly disable logging.
|
|
2803
|
+
# @return [::Logger,:default,nil]
|
|
2795
2804
|
#
|
|
2796
2805
|
class Configuration
|
|
2797
2806
|
extend ::Gapic::Config
|
|
@@ -2813,6 +2822,7 @@ module Google
|
|
|
2813
2822
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
2814
2823
|
config_attr :quota_project, nil, ::String, nil
|
|
2815
2824
|
config_attr :universe_domain, nil, ::String, nil
|
|
2825
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
2816
2826
|
|
|
2817
2827
|
# @private
|
|
2818
2828
|
def initialize parent_config = nil
|