google-cloud-network_connectivity-v1 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/network_connectivity/v1/hub_service/client.rb +300 -22
- data/lib/google/cloud/network_connectivity/v1/hub_service/operations.rb +12 -15
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb +32 -5
- data/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb +12 -15
- data/lib/google/cloud/network_connectivity/v1/version.rb +1 -1
- data/lib/google/cloud/networkconnectivity/v1/hub_pb.rb +15 -1
- data/lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb +7 -2
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/api/field_info.rb +88 -0
- data/proto_docs/google/cloud/networkconnectivity/v1/hub.rb +378 -1
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e71fb4a3f178f5272e034eadba2b9f2b27f17f2a06552330e3ece9c39a8fc5b
|
4
|
+
data.tar.gz: 8be086c55e4c6ea22ed1f517691f32c570a3179b283a5d20b627fac817ef98dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d25c476d3e2d4ba80e94ee653a95eba888d715046146ea5dc508d0c7916dc2752f78946736675334e5d6f27ef11d511bb961e2c16794a6d7066f9a1bcca5305
|
7
|
+
data.tar.gz: 32e39ea17475c3d4dc98d126551243b3f8949e139ca1ebc84cde66cfdcfb9f281d43fec3a839c81a2ccd19d2f74368edccc793cf1981e9fe4465ca4968655206
|
data/README.md
CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/network-connectivity/docs)
|
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_connectivity/v1"
|
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::NetworkConnectivity::V1::HubService::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).
|
@@ -185,14 +185,26 @@ module Google
|
|
185
185
|
universe_domain: @config.universe_domain,
|
186
186
|
channel_args: @config.channel_args,
|
187
187
|
interceptors: @config.interceptors,
|
188
|
-
channel_pool_config: @config.channel_pool
|
188
|
+
channel_pool_config: @config.channel_pool,
|
189
|
+
logger: @config.logger
|
189
190
|
)
|
190
191
|
|
192
|
+
@hub_service_stub.stub_logger&.info do |entry|
|
193
|
+
entry.set_system_name
|
194
|
+
entry.set_service
|
195
|
+
entry.message = "Created client for #{entry.service}"
|
196
|
+
entry.set_credentials_fields credentials
|
197
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
198
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
199
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
200
|
+
end
|
201
|
+
|
191
202
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
192
203
|
config.credentials = credentials
|
193
204
|
config.quota_project = @quota_project_id
|
194
205
|
config.endpoint = @hub_service_stub.endpoint
|
195
206
|
config.universe_domain = @hub_service_stub.universe_domain
|
207
|
+
config.logger = @hub_service_stub.logger if config.respond_to? :logger=
|
196
208
|
end
|
197
209
|
|
198
210
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
@@ -200,6 +212,7 @@ module Google
|
|
200
212
|
config.quota_project = @quota_project_id
|
201
213
|
config.endpoint = @hub_service_stub.endpoint
|
202
214
|
config.universe_domain = @hub_service_stub.universe_domain
|
215
|
+
config.logger = @hub_service_stub.logger if config.respond_to? :logger=
|
203
216
|
end
|
204
217
|
end
|
205
218
|
|
@@ -224,6 +237,15 @@ module Google
|
|
224
237
|
#
|
225
238
|
attr_reader :iam_policy_client
|
226
239
|
|
240
|
+
##
|
241
|
+
# The logger used for request/response debug logging.
|
242
|
+
#
|
243
|
+
# @return [Logger]
|
244
|
+
#
|
245
|
+
def logger
|
246
|
+
@hub_service_stub.logger
|
247
|
+
end
|
248
|
+
|
227
249
|
# Service calls
|
228
250
|
|
229
251
|
##
|
@@ -319,7 +341,7 @@ module Google
|
|
319
341
|
@hub_service_stub.call_rpc :list_hubs, request, options: options do |response, operation|
|
320
342
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hubs, request, response, operation, options
|
321
343
|
yield response, operation if block_given?
|
322
|
-
|
344
|
+
throw :response, response
|
323
345
|
end
|
324
346
|
rescue ::GRPC::BadStatus => e
|
325
347
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -405,7 +427,6 @@ module Google
|
|
405
427
|
|
406
428
|
@hub_service_stub.call_rpc :get_hub, request, options: options do |response, operation|
|
407
429
|
yield response, operation if block_given?
|
408
|
-
return response
|
409
430
|
end
|
410
431
|
rescue ::GRPC::BadStatus => e
|
411
432
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -518,7 +539,7 @@ module Google
|
|
518
539
|
@hub_service_stub.call_rpc :create_hub, request, options: options do |response, operation|
|
519
540
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
520
541
|
yield response, operation if block_given?
|
521
|
-
|
542
|
+
throw :response, response
|
522
543
|
end
|
523
544
|
rescue ::GRPC::BadStatus => e
|
524
545
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -634,7 +655,7 @@ module Google
|
|
634
655
|
@hub_service_stub.call_rpc :update_hub, request, options: options do |response, operation|
|
635
656
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
636
657
|
yield response, operation if block_given?
|
637
|
-
|
658
|
+
throw :response, response
|
638
659
|
end
|
639
660
|
rescue ::GRPC::BadStatus => e
|
640
661
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -743,7 +764,7 @@ module Google
|
|
743
764
|
@hub_service_stub.call_rpc :delete_hub, request, options: options do |response, operation|
|
744
765
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
745
766
|
yield response, operation if block_given?
|
746
|
-
|
767
|
+
throw :response, response
|
747
768
|
end
|
748
769
|
rescue ::GRPC::BadStatus => e
|
749
770
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -857,7 +878,133 @@ module Google
|
|
857
878
|
@hub_service_stub.call_rpc :list_hub_spokes, request, options: options do |response, operation|
|
858
879
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_hub_spokes, request, response, operation, options
|
859
880
|
yield response, operation if block_given?
|
860
|
-
|
881
|
+
throw :response, response
|
882
|
+
end
|
883
|
+
rescue ::GRPC::BadStatus => e
|
884
|
+
raise ::Google::Cloud::Error.from_error(e)
|
885
|
+
end
|
886
|
+
|
887
|
+
##
|
888
|
+
# Query the Private Service Connect propagation status of a Network
|
889
|
+
# Connectivity Center hub.
|
890
|
+
#
|
891
|
+
# @overload query_hub_status(request, options = nil)
|
892
|
+
# Pass arguments to `query_hub_status` via a request object, either of type
|
893
|
+
# {::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest} or an equivalent Hash.
|
894
|
+
#
|
895
|
+
# @param request [::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest, ::Hash]
|
896
|
+
# A request object representing the call parameters. Required. To specify no
|
897
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
898
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
899
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
900
|
+
#
|
901
|
+
# @overload query_hub_status(name: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, group_by: nil)
|
902
|
+
# Pass arguments to `query_hub_status` via keyword arguments. Note that at
|
903
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
904
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
905
|
+
#
|
906
|
+
# @param name [::String]
|
907
|
+
# Required. The name of the hub.
|
908
|
+
# @param page_size [::Integer]
|
909
|
+
# Optional. The maximum number of results to return per page.
|
910
|
+
# @param page_token [::String]
|
911
|
+
# Optional. The page token.
|
912
|
+
# @param filter [::String]
|
913
|
+
# Optional. An expression that filters the list of results.
|
914
|
+
# The filter can be used to filter the results by the following fields:
|
915
|
+
# * `psc_propagation_status.source_spoke`
|
916
|
+
# * `psc_propagation_status.source_group`
|
917
|
+
# * `psc_propagation_status.source_forwarding_rule`
|
918
|
+
# * `psc_propagation_status.target_spoke`
|
919
|
+
# * `psc_propagation_status.target_group`
|
920
|
+
# * `psc_propagation_status.code`
|
921
|
+
# * `psc_propagation_status.message`
|
922
|
+
# @param order_by [::String]
|
923
|
+
# Optional. Sort the results in ascending order by the specified fields.
|
924
|
+
# A comma-separated list of any of these fields:
|
925
|
+
# * `psc_propagation_status.source_spoke`
|
926
|
+
# * `psc_propagation_status.source_group`
|
927
|
+
# * `psc_propagation_status.source_forwarding_rule`
|
928
|
+
# * `psc_propagation_status.target_spoke`
|
929
|
+
# * `psc_propagation_status.target_group`
|
930
|
+
# * `psc_propagation_status.code`
|
931
|
+
# If `group_by` is set, the value of the `order_by` field must be the
|
932
|
+
# same as or a subset of the `group_by` field.
|
933
|
+
# @param group_by [::String]
|
934
|
+
# Optional. Aggregate the results by the specified fields.
|
935
|
+
# A comma-separated list of any of these fields:
|
936
|
+
# * `psc_propagation_status.source_spoke`
|
937
|
+
# * `psc_propagation_status.source_group`
|
938
|
+
# * `psc_propagation_status.source_forwarding_rule`
|
939
|
+
# * `psc_propagation_status.target_spoke`
|
940
|
+
# * `psc_propagation_status.target_group`
|
941
|
+
# * `psc_propagation_status.code`
|
942
|
+
#
|
943
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
944
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry>]
|
945
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
946
|
+
#
|
947
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry>]
|
948
|
+
#
|
949
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
950
|
+
#
|
951
|
+
# @example Basic example
|
952
|
+
# require "google/cloud/network_connectivity/v1"
|
953
|
+
#
|
954
|
+
# # Create a client object. The client can be reused for multiple calls.
|
955
|
+
# client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
|
956
|
+
#
|
957
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
958
|
+
# request = Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest.new
|
959
|
+
#
|
960
|
+
# # Call the query_hub_status method.
|
961
|
+
# result = client.query_hub_status request
|
962
|
+
#
|
963
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
964
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
965
|
+
# result.each do |item|
|
966
|
+
# # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::HubStatusEntry.
|
967
|
+
# p item
|
968
|
+
# end
|
969
|
+
#
|
970
|
+
def query_hub_status request, options = nil
|
971
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
972
|
+
|
973
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::QueryHubStatusRequest
|
974
|
+
|
975
|
+
# Converts hash and nil to an options object
|
976
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
977
|
+
|
978
|
+
# Customize the options with defaults
|
979
|
+
metadata = @config.rpcs.query_hub_status.metadata.to_h
|
980
|
+
|
981
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
982
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
983
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
984
|
+
gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
|
985
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
986
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
987
|
+
|
988
|
+
header_params = {}
|
989
|
+
if request.name
|
990
|
+
header_params["name"] = request.name
|
991
|
+
end
|
992
|
+
|
993
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
994
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
995
|
+
|
996
|
+
options.apply_defaults timeout: @config.rpcs.query_hub_status.timeout,
|
997
|
+
metadata: metadata,
|
998
|
+
retry_policy: @config.rpcs.query_hub_status.retry_policy
|
999
|
+
|
1000
|
+
options.apply_defaults timeout: @config.timeout,
|
1001
|
+
metadata: @config.metadata,
|
1002
|
+
retry_policy: @config.retry_policy
|
1003
|
+
|
1004
|
+
@hub_service_stub.call_rpc :query_hub_status, request, options: options do |response, operation|
|
1005
|
+
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :query_hub_status, request, response, operation, options
|
1006
|
+
yield response, operation if block_given?
|
1007
|
+
throw :response, response
|
861
1008
|
end
|
862
1009
|
rescue ::GRPC::BadStatus => e
|
863
1010
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -957,7 +1104,7 @@ module Google
|
|
957
1104
|
@hub_service_stub.call_rpc :list_spokes, request, options: options do |response, operation|
|
958
1105
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_spokes, request, response, operation, options
|
959
1106
|
yield response, operation if block_given?
|
960
|
-
|
1107
|
+
throw :response, response
|
961
1108
|
end
|
962
1109
|
rescue ::GRPC::BadStatus => e
|
963
1110
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1043,7 +1190,6 @@ module Google
|
|
1043
1190
|
|
1044
1191
|
@hub_service_stub.call_rpc :get_spoke, request, options: options do |response, operation|
|
1045
1192
|
yield response, operation if block_given?
|
1046
|
-
return response
|
1047
1193
|
end
|
1048
1194
|
rescue ::GRPC::BadStatus => e
|
1049
1195
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1156,7 +1302,7 @@ module Google
|
|
1156
1302
|
@hub_service_stub.call_rpc :create_spoke, request, options: options do |response, operation|
|
1157
1303
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1158
1304
|
yield response, operation if block_given?
|
1159
|
-
|
1305
|
+
throw :response, response
|
1160
1306
|
end
|
1161
1307
|
rescue ::GRPC::BadStatus => e
|
1162
1308
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1271,7 +1417,7 @@ module Google
|
|
1271
1417
|
@hub_service_stub.call_rpc :update_spoke, request, options: options do |response, operation|
|
1272
1418
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1273
1419
|
yield response, operation if block_given?
|
1274
|
-
|
1420
|
+
throw :response, response
|
1275
1421
|
end
|
1276
1422
|
rescue ::GRPC::BadStatus => e
|
1277
1423
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1387,7 +1533,7 @@ module Google
|
|
1387
1533
|
@hub_service_stub.call_rpc :reject_hub_spoke, request, options: options do |response, operation|
|
1388
1534
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1389
1535
|
yield response, operation if block_given?
|
1390
|
-
|
1536
|
+
throw :response, response
|
1391
1537
|
end
|
1392
1538
|
rescue ::GRPC::BadStatus => e
|
1393
1539
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1499,7 +1645,7 @@ module Google
|
|
1499
1645
|
@hub_service_stub.call_rpc :accept_hub_spoke, request, options: options do |response, operation|
|
1500
1646
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1501
1647
|
yield response, operation if block_given?
|
1502
|
-
|
1648
|
+
throw :response, response
|
1503
1649
|
end
|
1504
1650
|
rescue ::GRPC::BadStatus => e
|
1505
1651
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1608,7 +1754,7 @@ module Google
|
|
1608
1754
|
@hub_service_stub.call_rpc :delete_spoke, request, options: options do |response, operation|
|
1609
1755
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1610
1756
|
yield response, operation if block_given?
|
1611
|
-
|
1757
|
+
throw :response, response
|
1612
1758
|
end
|
1613
1759
|
rescue ::GRPC::BadStatus => e
|
1614
1760
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1694,7 +1840,6 @@ module Google
|
|
1694
1840
|
|
1695
1841
|
@hub_service_stub.call_rpc :get_route_table, request, options: options do |response, operation|
|
1696
1842
|
yield response, operation if block_given?
|
1697
|
-
return response
|
1698
1843
|
end
|
1699
1844
|
rescue ::GRPC::BadStatus => e
|
1700
1845
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1780,14 +1925,13 @@ module Google
|
|
1780
1925
|
|
1781
1926
|
@hub_service_stub.call_rpc :get_route, request, options: options do |response, operation|
|
1782
1927
|
yield response, operation if block_given?
|
1783
|
-
return response
|
1784
1928
|
end
|
1785
1929
|
rescue ::GRPC::BadStatus => e
|
1786
1930
|
raise ::Google::Cloud::Error.from_error(e)
|
1787
1931
|
end
|
1788
1932
|
|
1789
1933
|
##
|
1790
|
-
# Lists routes in a given
|
1934
|
+
# Lists routes in a given route table.
|
1791
1935
|
#
|
1792
1936
|
# @overload list_routes(request, options = nil)
|
1793
1937
|
# Pass arguments to `list_routes` via a request object, either of type
|
@@ -1879,14 +2023,14 @@ module Google
|
|
1879
2023
|
@hub_service_stub.call_rpc :list_routes, request, options: options do |response, operation|
|
1880
2024
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_routes, request, response, operation, options
|
1881
2025
|
yield response, operation if block_given?
|
1882
|
-
|
2026
|
+
throw :response, response
|
1883
2027
|
end
|
1884
2028
|
rescue ::GRPC::BadStatus => e
|
1885
2029
|
raise ::Google::Cloud::Error.from_error(e)
|
1886
2030
|
end
|
1887
2031
|
|
1888
2032
|
##
|
1889
|
-
# Lists route tables in a given
|
2033
|
+
# Lists route tables in a given hub.
|
1890
2034
|
#
|
1891
2035
|
# @overload list_route_tables(request, options = nil)
|
1892
2036
|
# Pass arguments to `list_route_tables` via a request object, either of type
|
@@ -1978,7 +2122,7 @@ module Google
|
|
1978
2122
|
@hub_service_stub.call_rpc :list_route_tables, request, options: options do |response, operation|
|
1979
2123
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_route_tables, request, response, operation, options
|
1980
2124
|
yield response, operation if block_given?
|
1981
|
-
|
2125
|
+
throw :response, response
|
1982
2126
|
end
|
1983
2127
|
rescue ::GRPC::BadStatus => e
|
1984
2128
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2064,7 +2208,6 @@ module Google
|
|
2064
2208
|
|
2065
2209
|
@hub_service_stub.call_rpc :get_group, request, options: options do |response, operation|
|
2066
2210
|
yield response, operation if block_given?
|
2067
|
-
return response
|
2068
2211
|
end
|
2069
2212
|
rescue ::GRPC::BadStatus => e
|
2070
2213
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2163,7 +2306,122 @@ module Google
|
|
2163
2306
|
@hub_service_stub.call_rpc :list_groups, request, options: options do |response, operation|
|
2164
2307
|
response = ::Gapic::PagedEnumerable.new @hub_service_stub, :list_groups, request, response, operation, options
|
2165
2308
|
yield response, operation if block_given?
|
2166
|
-
|
2309
|
+
throw :response, response
|
2310
|
+
end
|
2311
|
+
rescue ::GRPC::BadStatus => e
|
2312
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2313
|
+
end
|
2314
|
+
|
2315
|
+
##
|
2316
|
+
# Updates the parameters of a Network Connectivity Center group.
|
2317
|
+
#
|
2318
|
+
# @overload update_group(request, options = nil)
|
2319
|
+
# Pass arguments to `update_group` via a request object, either of type
|
2320
|
+
# {::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest} or an equivalent Hash.
|
2321
|
+
#
|
2322
|
+
# @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest, ::Hash]
|
2323
|
+
# A request object representing the call parameters. Required. To specify no
|
2324
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2325
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2326
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2327
|
+
#
|
2328
|
+
# @overload update_group(update_mask: nil, group: nil, request_id: nil)
|
2329
|
+
# Pass arguments to `update_group` via keyword arguments. Note that at
|
2330
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2331
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2332
|
+
#
|
2333
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2334
|
+
# Optional. In the case of an update to an existing group, field mask is used
|
2335
|
+
# to specify the fields to be overwritten. The fields specified in the
|
2336
|
+
# update_mask are relative to the resource, not the full request. A field is
|
2337
|
+
# overwritten if it is in the mask. If the user does not provide a mask, then
|
2338
|
+
# all fields are overwritten.
|
2339
|
+
# @param group [::Google::Cloud::NetworkConnectivity::V1::Group, ::Hash]
|
2340
|
+
# Required. The state that the group should be in after the update.
|
2341
|
+
# @param request_id [::String]
|
2342
|
+
# Optional. A request ID to identify requests. Specify a unique request ID so
|
2343
|
+
# that if you must retry your request, the server knows to ignore the request
|
2344
|
+
# if it has already been completed. The server guarantees that a request
|
2345
|
+
# doesn't result in creation of duplicate commitments for at least 60
|
2346
|
+
# minutes.
|
2347
|
+
#
|
2348
|
+
# For example, consider a situation where you make an initial request and
|
2349
|
+
# the request times out. If you make the request again with the same request
|
2350
|
+
# ID, the server can check to see whether the original operation
|
2351
|
+
# was received. If it was, the server ignores the second request. This
|
2352
|
+
# behavior prevents clients from mistakenly creating duplicate commitments.
|
2353
|
+
#
|
2354
|
+
# The request ID must be a valid UUID, with the exception that zero UUID is
|
2355
|
+
# not supported (00000000-0000-0000-0000-000000000000).
|
2356
|
+
#
|
2357
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2358
|
+
# @yieldparam response [::Gapic::Operation]
|
2359
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2360
|
+
#
|
2361
|
+
# @return [::Gapic::Operation]
|
2362
|
+
#
|
2363
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2364
|
+
#
|
2365
|
+
# @example Basic example
|
2366
|
+
# require "google/cloud/network_connectivity/v1"
|
2367
|
+
#
|
2368
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2369
|
+
# client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new
|
2370
|
+
#
|
2371
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2372
|
+
# request = Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest.new
|
2373
|
+
#
|
2374
|
+
# # Call the update_group method.
|
2375
|
+
# result = client.update_group request
|
2376
|
+
#
|
2377
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2378
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2379
|
+
# # Here is how to wait for a response.
|
2380
|
+
# result.wait_until_done! timeout: 60
|
2381
|
+
# if result.response?
|
2382
|
+
# p result.response
|
2383
|
+
# else
|
2384
|
+
# puts "No response received."
|
2385
|
+
# end
|
2386
|
+
#
|
2387
|
+
def update_group request, options = nil
|
2388
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2389
|
+
|
2390
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateGroupRequest
|
2391
|
+
|
2392
|
+
# Converts hash and nil to an options object
|
2393
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2394
|
+
|
2395
|
+
# Customize the options with defaults
|
2396
|
+
metadata = @config.rpcs.update_group.metadata.to_h
|
2397
|
+
|
2398
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2399
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2400
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2401
|
+
gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
|
2402
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2403
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2404
|
+
|
2405
|
+
header_params = {}
|
2406
|
+
if request.group&.name
|
2407
|
+
header_params["group.name"] = request.group.name
|
2408
|
+
end
|
2409
|
+
|
2410
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2411
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2412
|
+
|
2413
|
+
options.apply_defaults timeout: @config.rpcs.update_group.timeout,
|
2414
|
+
metadata: metadata,
|
2415
|
+
retry_policy: @config.rpcs.update_group.retry_policy
|
2416
|
+
|
2417
|
+
options.apply_defaults timeout: @config.timeout,
|
2418
|
+
metadata: @config.metadata,
|
2419
|
+
retry_policy: @config.retry_policy
|
2420
|
+
|
2421
|
+
@hub_service_stub.call_rpc :update_group, request, options: options do |response, operation|
|
2422
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2423
|
+
yield response, operation if block_given?
|
2424
|
+
throw :response, response
|
2167
2425
|
end
|
2168
2426
|
rescue ::GRPC::BadStatus => e
|
2169
2427
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2252,6 +2510,11 @@ module Google
|
|
2252
2510
|
# default endpoint URL. The default value of nil uses the environment
|
2253
2511
|
# universe (usually the default "googleapis.com" universe).
|
2254
2512
|
# @return [::String,nil]
|
2513
|
+
# @!attribute [rw] logger
|
2514
|
+
# A custom logger to use for request/response debug logging, or the value
|
2515
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2516
|
+
# explicitly disable logging.
|
2517
|
+
# @return [::Logger,:default,nil]
|
2255
2518
|
#
|
2256
2519
|
class Configuration
|
2257
2520
|
extend ::Gapic::Config
|
@@ -2276,6 +2539,7 @@ module Google
|
|
2276
2539
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2277
2540
|
config_attr :quota_project, nil, ::String, nil
|
2278
2541
|
config_attr :universe_domain, nil, ::String, nil
|
2542
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2279
2543
|
|
2280
2544
|
# @private
|
2281
2545
|
def initialize parent_config = nil
|
@@ -2353,6 +2617,11 @@ module Google
|
|
2353
2617
|
#
|
2354
2618
|
attr_reader :list_hub_spokes
|
2355
2619
|
##
|
2620
|
+
# RPC-specific configuration for `query_hub_status`
|
2621
|
+
# @return [::Gapic::Config::Method]
|
2622
|
+
#
|
2623
|
+
attr_reader :query_hub_status
|
2624
|
+
##
|
2356
2625
|
# RPC-specific configuration for `list_spokes`
|
2357
2626
|
# @return [::Gapic::Config::Method]
|
2358
2627
|
#
|
@@ -2417,6 +2686,11 @@ module Google
|
|
2417
2686
|
# @return [::Gapic::Config::Method]
|
2418
2687
|
#
|
2419
2688
|
attr_reader :list_groups
|
2689
|
+
##
|
2690
|
+
# RPC-specific configuration for `update_group`
|
2691
|
+
# @return [::Gapic::Config::Method]
|
2692
|
+
#
|
2693
|
+
attr_reader :update_group
|
2420
2694
|
|
2421
2695
|
# @private
|
2422
2696
|
def initialize parent_rpcs = nil
|
@@ -2432,6 +2706,8 @@ module Google
|
|
2432
2706
|
@delete_hub = ::Gapic::Config::Method.new delete_hub_config
|
2433
2707
|
list_hub_spokes_config = parent_rpcs.list_hub_spokes if parent_rpcs.respond_to? :list_hub_spokes
|
2434
2708
|
@list_hub_spokes = ::Gapic::Config::Method.new list_hub_spokes_config
|
2709
|
+
query_hub_status_config = parent_rpcs.query_hub_status if parent_rpcs.respond_to? :query_hub_status
|
2710
|
+
@query_hub_status = ::Gapic::Config::Method.new query_hub_status_config
|
2435
2711
|
list_spokes_config = parent_rpcs.list_spokes if parent_rpcs.respond_to? :list_spokes
|
2436
2712
|
@list_spokes = ::Gapic::Config::Method.new list_spokes_config
|
2437
2713
|
get_spoke_config = parent_rpcs.get_spoke if parent_rpcs.respond_to? :get_spoke
|
@@ -2458,6 +2734,8 @@ module Google
|
|
2458
2734
|
@get_group = ::Gapic::Config::Method.new get_group_config
|
2459
2735
|
list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups
|
2460
2736
|
@list_groups = ::Gapic::Config::Method.new list_groups_config
|
2737
|
+
update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group
|
2738
|
+
@update_group = ::Gapic::Config::Method.new update_group_config
|
2461
2739
|
|
2462
2740
|
yield self if block_given?
|
2463
2741
|
end
|