class Google::Cloud::Datastream::V1alpha1::Datastream::Client
Client
for the Datastream
service.
Datastream
service
Attributes
@private
Get the associated client for long-running operations.
@return [::Google::Cloud::Datastream::V1alpha1::Datastream::Operations]
Public Class Methods
Configure the Datastream
Client
class.
See {::Google::Cloud::Datastream::V1alpha1::Datastream::Client::Configuration} for a description of the configuration fields.
@example
# Modify the configuration for all Datastream clients ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.configure do |config| config.timeout = 10.0 end
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 56 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Datastream", "V1alpha1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.timeout = 60.0 default_config.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.create_connection_profile.timeout = 60.0 default_config.rpcs.update_connection_profile.timeout = 60.0 default_config.rpcs.delete_connection_profile.timeout = 60.0 default_config.rpcs.create_stream.timeout = 60.0 default_config.rpcs.update_stream.timeout = 60.0 default_config.rpcs.delete_stream.timeout = 60.0 default_config.rpcs.create_private_connection.timeout = 60.0 default_config.rpcs.delete_private_connection.timeout = 60.0 default_config.rpcs.create_route.timeout = 60.0 default_config.rpcs.delete_route.timeout = 60.0 default_config end yield @configure if block_given? @configure end
Create a new Datastream
client object.
@example
# Create a client using the default configuration client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config| config.timeout = 10.0 end
@yield [config] Configure the Datastream
client. @yieldparam config [Client::Configuration]
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 134 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/datastream/v1alpha1/datastream_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.endpoint = @config.endpoint end @datastream_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Datastream::V1alpha1::Datastream::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end
Public Instance Methods
Configure the Datastream
Client
instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on {Client.configure}.
See {::Google::Cloud::Datastream::V1alpha1::Datastream::Client::Configuration} for a description of the configuration fields.
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 113 def configure yield @config if block_given? @config end
Use this method to create a connection profile in a project and location.
@overload create_connection_profile
(request, options = nil)
Pass arguments to `create_connection_profile` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_connection_profile
(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil)
Pass arguments to `create_connection_profile` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of ConnectionProfiles. @param connection_profile_id [::String] Required. The connection profile identifier. @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash] Required. The connection profile resource to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 383 def create_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_connection_profile.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.create_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :create_connection_profile, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to create a private connectivity configuration.
@overload create_private_connection
(request, options = nil)
Pass arguments to `create_private_connection` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_private_connection
(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil)
Pass arguments to `create_private_connection` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of PrivateConnections. @param private_connection_id [::String] Required. The private connectivity identifier. @param private_connection [::Google::Cloud::Datastream::V1alpha1::PrivateConnection, ::Hash] Required. The Private Connectivity resource to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1292 def create_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_private_connection.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_private_connection.timeout, metadata: metadata, retry_policy: @config.rpcs.create_private_connection.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :create_private_connection, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to create a route for a private connectivity in a project and location.
@overload create_route
(request, options = nil)
Pass arguments to `create_route` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_route
(parent: nil, route_id: nil, route: nil, request_id: nil)
Pass arguments to `create_route` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of Routes. @param route_id [::String] Required. The Route identifier. @param route [::Google::Cloud::Datastream::V1alpha1::Route, ::Hash] Required. The Route resource to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1620 def create_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_route.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_route.timeout, metadata: metadata, retry_policy: @config.rpcs.create_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :create_route, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to create a stream.
@overload create_stream
(request, options = nil)
Pass arguments to `create_stream` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_stream
(parent: nil, stream_id: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
Pass arguments to `create_stream` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of streams. @param stream_id [::String] Required. The stream identifier. @param stream [::Google::Cloud::Datastream::V1alpha1::Stream, ::Hash] Required. The stream resource to create. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. Only validate the stream, but do not create any resources. The default is false. @param force [::Boolean] Optional. Create the stream without validating it.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 883 def create_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_stream.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_stream.timeout, metadata: metadata, retry_policy: @config.rpcs.create_stream.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :create_stream, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to delete a connection profile..
@overload delete_connection_profile
(request, options = nil)
Pass arguments to `delete_connection_profile` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_connection_profile
(name: nil, request_id: nil)
Pass arguments to `delete_connection_profile` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the connection profile resource to delete. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 555 def delete_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_connection_profile.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :delete_connection_profile, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to delete a private connectivity configuration.
@overload delete_private_connection
(request, options = nil)
Pass arguments to `delete_private_connection` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_private_connection
(name: nil, request_id: nil, force: nil)
Pass arguments to `delete_private_connection` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the private connectivity configuration to delete. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param force [::Boolean] Optional. If set to true, any child routes that belong to this PrivateConnection will also be deleted.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1532 def delete_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_private_connection.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_private_connection.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_private_connection.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :delete_private_connection, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to delete a route.
@overload delete_route
(request, options = nil)
Pass arguments to `delete_route` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_route
(name: nil, request_id: nil)
Pass arguments to `delete_route` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the Route resource to delete. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1857 def delete_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_route.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_route.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :delete_route, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to delete a stream.
@overload delete_stream
(request, options = nil)
Pass arguments to `delete_stream` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_stream
(name: nil, request_id: nil)
Pass arguments to `delete_stream` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the stream resource to delete. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1060 def delete_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_stream.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_stream.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_stream.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :delete_stream, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to discover a connection profile. The discover API call exposes the data objects and metadata belonging to the profile. Typically, a request returns children data objects under a parent data object that's optionally supplied in the request.
@overload discover_connection_profile
(request, options = nil)
Pass arguments to `discover_connection_profile` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload discover_connection_profile
(parent: nil, connection_profile: nil, connection_profile_name: nil, recursive: nil, recursion_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil)
Pass arguments to `discover_connection_profile` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent resource of the ConnectionProfile type. Must be in the format `projects/*/locations/*`. @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash] An ad-hoc ConnectionProfile configuration. @param connection_profile_name [::String] A reference to an existing ConnectionProfile. @param recursive [::Boolean] Whether to retrieve the full hierarchy of data objects (TRUE) or only the current level (FALSE). @param recursion_depth [::Integer] The number of hierarchy levels below the current level to be retrieved. @param oracle_rdbms [::Google::Cloud::Datastream::V1alpha1::OracleRdbms, ::Hash] Oracle RDBMS to enrich with child data objects and metadata. @param mysql_rdbms [::Google::Cloud::Datastream::V1alpha1::MysqlRdbms, ::Hash] MySQL RDBMS to enrich with child data objects and metadata.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 641 def discover_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.discover_connection_profile.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.discover_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.discover_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :discover_connection_profile, 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
Use this method to fetch any errors associated with a stream.
@overload fetch_errors
(request, options = nil)
Pass arguments to `fetch_errors` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload fetch_errors
(stream: nil)
Pass arguments to `fetch_errors` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param stream [::String] Name of the Stream resource for which to fetch any errors.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1129 def fetch_errors request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.fetch_errors.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "stream" => request.stream } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.fetch_errors.timeout, metadata: metadata, retry_policy: @config.rpcs.fetch_errors.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :fetch_errors, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
The FetchStaticIps API call exposes the static ips used by Datastream
. Typically, a request returns children data objects under a parent data object that's optionally supplied in the request.
@overload fetch_static_ips
(request, options = nil)
Pass arguments to `fetch_static_ips` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload fetch_static_ips
(name: nil, page_size: nil, page_token: nil)
Pass arguments to `fetch_static_ips` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name resource of the Response type. Must be in the format `projects/*/locations/*`. @param page_size [::Integer] Maximum number of Ips to return, will likely not be specified. @param page_token [::String] A page token, received from a previous `ListStaticIps` call. will likely not be specified.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1206 def fetch_static_ips request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.fetch_static_ips.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.fetch_static_ips.timeout, metadata: metadata, retry_policy: @config.rpcs.fetch_static_ips.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :fetch_static_ips, 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
Use this method to get details about a connection profile.
@overload get_connection_profile
(request, options = nil)
Pass arguments to `get_connection_profile` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_connection_profile
(name: nil)
Pass arguments to `get_connection_profile` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the connection profile resource to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 297 def get_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_connection_profile.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.get_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :get_connection_profile, 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
Use this method to get details about a private connectivity configuration.
@overload get_private_connection
(request, options = nil)
Pass arguments to `get_private_connection` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_private_connection
(name: nil)
Pass arguments to `get_private_connection` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the private connectivity configuration to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::PrivateConnection] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::PrivateConnection]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1361 def get_private_connection request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_private_connection.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_private_connection.timeout, metadata: metadata, retry_policy: @config.rpcs.get_private_connection.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :get_private_connection, 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
Use this method to get details about a route.
@overload get_route
(request, options = nil)
Pass arguments to `get_route` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::GetRouteRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::GetRouteRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_route
(name: nil)
Pass arguments to `get_route` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the Route resource to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::Route] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::Route]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1689 def get_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_route.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_route.timeout, metadata: metadata, retry_policy: @config.rpcs.get_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :get_route, 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
Use this method to get details about a stream.
@overload get_stream
(request, options = nil)
Pass arguments to `get_stream` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::GetStreamRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::GetStreamRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_stream
(name: nil)
Pass arguments to `get_stream` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param name [::String] Required. The name of the stream resource to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Datastream::V1alpha1::Stream] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::Datastream::V1alpha1::Stream]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 792 def get_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetStreamRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_stream.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_stream.timeout, metadata: metadata, retry_policy: @config.rpcs.get_stream.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :get_stream, 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
Use this method to list connection profiles created in a project and location.
@overload list_connection_profiles
(request, options = nil)
Pass arguments to `list_connection_profiles` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_connection_profiles
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_connection_profiles` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of connection profiles. @param page_size [::Integer] Maximum number of connection profiles to return. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. @param page_token [::String] Page token received from a previous `ListConnectionProfiles` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListConnectionProfiles` must match the call that provided the page token. @param filter [::String] Filter request. @param order_by [::String] Order by fields for the result.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::ConnectionProfile>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::ConnectionProfile>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 228 def list_connection_profiles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_connection_profiles.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_connection_profiles.timeout, metadata: metadata, retry_policy: @config.rpcs.list_connection_profiles.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_connection_profiles, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to list private connectivity configurations in a project and location.
@overload list_private_connections
(request, options = nil)
Pass arguments to `list_private_connections` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_private_connections
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_private_connections` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of private connectivity configurations. @param page_size [::Integer] Maximum number of private connectivity configurations to return. If unspecified, at most 50 private connectivity configurations that will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. @param page_token [::String] Page token received from a previous `ListPrivateConnections` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListPrivateConnections` must match the call that provided the page token. @param filter [::String] Filter request. @param order_by [::String] Order by fields for the result.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::PrivateConnection>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::PrivateConnection>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1446 def list_private_connections request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_private_connections.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_private_connections.timeout, metadata: metadata, retry_policy: @config.rpcs.list_private_connections.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :list_private_connections, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_private_connections, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to list routes created for a private connectivity in a project and location.
@overload list_routes
(request, options = nil)
Pass arguments to `list_routes` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_routes
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_routes` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of Routess. @param page_size [::Integer] Maximum number of Routes to return. The service may return fewer than this value. If unspecified, at most 50 Routes will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. @param page_token [::String] Page token received from a previous `ListRoutes` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListRoutes` must match the call that provided the page token. @param filter [::String] Filter request. @param order_by [::String] Order by fields for the result.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Route>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Route>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 1774 def list_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_routes.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_routes.timeout, metadata: metadata, retry_policy: @config.rpcs.list_routes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :list_routes, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_routes, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to list streams in a project and location.
@overload list_streams
(request, options = nil)
Pass arguments to `list_streams` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_streams
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
Pass arguments to `list_streams` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param parent [::String] Required. The parent that owns the collection of streams. @param page_size [::Integer] Maximum number of streams to return. If unspecified, at most 50 streams will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. @param page_token [::String] Page token received from a previous `ListStreams` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListStreams` must match the call that provided the page token. @param filter [::String] Filter request. @param order_by [::String] Order by fields for the result.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Stream>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Stream>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 723 def list_streams request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_streams.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_streams.timeout, metadata: metadata, retry_policy: @config.rpcs.list_streams.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :list_streams, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_streams, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to update the parameters of a connection profile.
@overload update_connection_profile
(request, options = nil)
Pass arguments to `update_connection_profile` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload update_connection_profile
(update_mask: nil, connection_profile: nil, request_id: nil)
Pass arguments to `update_connection_profile` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param update_mask [::Google::Protobuf::FieldMask, ::Hash] Optional. Field mask is used to specify the fields to be overwritten in the ConnectionProfile resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash] Required. The ConnectionProfile to update. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 472 def update_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_connection_profile.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "connection_profile.name" => request.connection_profile.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.update_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :update_connection_profile, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Use this method to update the configuration of a stream.
@overload update_stream
(request, options = nil)
Pass arguments to `update_stream` via a request object, either of type {::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest} or an equivalent Hash. @param request [::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest, ::Hash] A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload update_stream
(update_mask: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
Pass arguments to `update_stream` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). @param update_mask [::Google::Protobuf::FieldMask, ::Hash] Optional. Field mask is used to specify the fields to be overwritten in the stream resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. @param stream [::Google::Cloud::Datastream::V1alpha1::Stream, ::Hash] Required. The stream resource to update. @param request_id [::String] Optional. A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). @param validate_only [::Boolean] Optional. Only validate the stream with the changes, without actually updating it. The default is false. @param force [::Boolean] Optional. Execute the update without validating it.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/datastream/v1alpha1/datastream/client.rb, line 977 def update_stream request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.update_stream.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "stream.name" => request.stream.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.update_stream.timeout, metadata: metadata, retry_policy: @config.rpcs.update_stream.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @datastream_stub.call_rpc :update_stream, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end