lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb in google-cloud-orchestration-airflow-service-v1-1.1.0 vs lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb in google-cloud-orchestration-airflow-service-v1-1.2.0
- old
+ new
@@ -164,21 +164,41 @@
endpoint: @config.endpoint,
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
universe_domain: @config.universe_domain,
channel_args: @config.channel_args,
interceptors: @config.interceptors,
- channel_pool_config: @config.channel_pool
+ channel_pool_config: @config.channel_pool,
+ logger: @config.logger
)
+
+ @environments_stub.stub_logger&.info do |entry|
+ entry.set_system_name
+ entry.set_service
+ entry.message = "Created client for #{entry.service}"
+ entry.set_credentials_fields credentials
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
+ end
end
##
# Get the associated client for long-running operations.
#
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Operations]
#
attr_reader :operations_client
+ ##
+ # The logger used for request/response debug logging.
+ #
+ # @return [Logger]
+ #
+ def logger
+ @environments_stub.logger
+ end
+
# Service calls
##
# Create a new environment.
#
@@ -268,11 +288,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :create_environment, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -355,11 +375,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :get_environment, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -451,11 +470,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :list_environments, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @environments_stub, :list_environments, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -673,11 +692,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :update_environment, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -768,11 +787,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :delete_environment, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -864,11 +883,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :execute_airflow_command, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -960,11 +978,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :stop_airflow_command, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1055,11 +1072,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :poll_airflow_command, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1163,11 +1179,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :list_workloads, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @environments_stub, :list_workloads, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1286,11 +1302,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :check_upgrade, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1378,11 +1394,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :create_user_workloads_secret, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1469,11 +1484,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :get_user_workloads_secret, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1569,11 +1583,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :list_user_workloads_secrets, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @environments_stub, :list_user_workloads_secrets, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1658,11 +1672,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :update_user_workloads_secret, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1748,11 +1761,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :delete_user_workloads_secret, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1840,11 +1852,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :create_user_workloads_config_map, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -1930,11 +1941,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :get_user_workloads_config_map, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2030,11 +2040,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :list_user_workloads_config_maps, request, options: options do |response, operation|
response = ::Gapic::PagedEnumerable.new @environments_stub, :list_user_workloads_config_maps, request, response, operation, options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2119,11 +2129,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :update_user_workloads_config_map, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2209,11 +2218,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :delete_user_workloads_config_map, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2310,11 +2318,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :save_snapshot, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2423,11 +2431,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :load_snapshot, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2518,11 +2526,11 @@
retry_policy: @config.retry_policy
@environments_stub.call_rpc :database_failover, request, options: options do |response, operation|
response = ::Gapic::Operation.new response, @operations_client, options: options
yield response, operation if block_given?
- return response
+ throw :response, response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2605,11 +2613,10 @@
metadata: @config.metadata,
retry_policy: @config.retry_policy
@environments_stub.call_rpc :fetch_database_properties, request, options: options do |response, operation|
yield response, operation if block_given?
- return response
end
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
@@ -2694,10 +2701,15 @@
# @!attribute [rw] universe_domain
# The universe domain within which to make requests. This determines the
# default endpoint URL. The default value of nil uses the environment
# universe (usually the default "googleapis.com" universe).
# @return [::String,nil]
+ # @!attribute [rw] logger
+ # A custom logger to use for request/response debug logging, or the value
+ # `:default` (the default) to construct a default logger, or `nil` to
+ # explicitly disable logging.
+ # @return [::Logger,:default,nil]
#
class Configuration
extend ::Gapic::Config
# @private
@@ -2718,9 +2730,10 @@
config_attr :timeout, nil, ::Numeric, nil
config_attr :metadata, nil, ::Hash, nil
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
config_attr :quota_project, nil, ::String, nil
config_attr :universe_domain, nil, ::String, nil
+ config_attr :logger, :default, ::Logger, nil, :default
# @private
def initialize parent_config = nil
@parent_config = parent_config unless parent_config.nil?