Class: Google::Cloud::Datastream::V1::Datastream::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/datastream/v1/datastream/client.rb

Overview

Client for the Datastream service.

Datastream service

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#connection_profile_path, #location_path, #network_attachment_path, #networks_path, #private_connection_path, #route_path, #stream_object_path, #stream_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new Datastream client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Datastream client.

Yield Parameters:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 151

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/v1/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.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_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.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @datastream_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Datastream::V1::Datastream::Stub,
    credentials: credentials,
    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,
    logger: @config.logger
  )

  @datastream_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

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @datastream_stub.endpoint
    config.universe_domain = @datastream_stub.universe_domain
    config.logger = @datastream_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @datastream_stub.endpoint
    config.universe_domain = @datastream_stub.universe_domain
    config.logger = @datastream_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Client)


244
245
246
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 244

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Client)


237
238
239
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 237

def location_client
  @location_client
end

#operations_client::Google::Cloud::Datastream::V1::Datastream::Operations (readonly)

Get the associated client for long-running operations.



230
231
232
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 230

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the Datastream Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all Datastream clients
::Google::Cloud::Datastream::V1::Datastream::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Datastream", "V1"]
    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

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



121
122
123
124
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 121

def configure
  yield @config if block_given?
  @config
end

#create_connection_profile(request, options = nil) ⇒ ::Gapic::Operation #create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to create a connection profile in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::CreateConnectionProfileRequest.new

# Call the create_connection_profile method.
result = client.create_connection_profile request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_connection_profile(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_connection_profile via a request object, either of type CreateConnectionProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of ConnectionProfiles.

    • connection_profile_id (::String) (defaults to: nil)

      Required. The connection profile identifier.

    • connection_profile (::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash) (defaults to: nil)

      Required. The connection profile resource to create.

    • request_id (::String) (defaults to: nil)

      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).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the connection profile, but don't create any resources. The default is false.

    • force (::Boolean) (defaults to: nil)

      Optional. Create the connection profile without validating it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 522

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::V1::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
   = @config.rpcs.create_connection_profile..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_connection_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_connection_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_private_connection(request, options = nil) ⇒ ::Gapic::Operation #create_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil, force: nil, validate_only: nil) ⇒ ::Gapic::Operation

Use this method to create a private connectivity configuration.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest.new

# Call the create_private_connection method.
result = client.create_private_connection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_private_connection(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_private_connection via a request object, either of type CreatePrivateConnectionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil, force: nil, validate_only: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of PrivateConnections.

    • private_connection_id (::String) (defaults to: nil)

      Required. The private connectivity identifier.

    • private_connection (::Google::Cloud::Datastream::V1::PrivateConnection, ::Hash) (defaults to: nil)

      Required. The Private Connectivity resource to create.

    • request_id (::String) (defaults to: nil)

      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).

    • force (::Boolean) (defaults to: nil)

      Optional. If set to true, will skip validations.

    • validate_only (::Boolean) (defaults to: nil)

      Optional. When supplied with PSC Interface config, will get/create the tenant project required for the customer to allow list and won't actually create the private connection.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2169

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::V1::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
   = @config.rpcs.create_private_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_private_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_private_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_route(request, options = nil) ⇒ ::Gapic::Operation #create_route(parent: nil, route_id: nil, route: nil, request_id: nil) ⇒ ::Gapic::Operation

Use this method to create a route for a private connectivity configuration in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::CreateRouteRequest.new

# Call the create_route method.
result = client.create_route request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_route(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_route via a request object, either of type CreateRouteRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_route(parent: nil, route_id: nil, route: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of Routes.

    • route_id (::String) (defaults to: nil)

      Required. The Route identifier.

    • route (::Google::Cloud::Datastream::V1::Route, ::Hash) (defaults to: nil)

      Required. The Route resource to create.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2587

def create_route request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.create_route..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_route.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_route.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_stream(request, options = nil) ⇒ ::Gapic::Operation #create_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to create a stream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::CreateStreamRequest.new

# Call the create_stream method.
result = client.create_stream request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_stream(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_stream via a request object, either of type CreateStreamRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of streams.

    • stream_id (::String) (defaults to: nil)

      Required. The stream identifier.

    • stream (::Google::Cloud::Datastream::V1::Stream, ::Hash) (defaults to: nil)

      Required. The stream resource to create.

    • request_id (::String) (defaults to: nil)

      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).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the stream, but don't create any resources. The default is false.

    • force (::Boolean) (defaults to: nil)

      Optional. Create the stream without validating it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1186

def create_stream request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.create_stream..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_stream.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_stream.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_connection_profile(request, options = nil) ⇒ ::Gapic::Operation #delete_connection_profile(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Use this method to delete a connection profile.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest.new

# Call the delete_connection_profile method.
result = client.delete_connection_profile request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_connection_profile(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_connection_profile via a request object, either of type Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_connection_profile(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the connection profile resource to delete.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 749

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::V1::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
   = @config.rpcs.delete_connection_profile..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_connection_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_connection_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_private_connection(request, options = nil) ⇒ ::Gapic::Operation #delete_private_connection(name: nil, request_id: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to delete a private connectivity configuration.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest.new

# Call the delete_private_connection method.
result = client.delete_private_connection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_private_connection(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_private_connection via a request object, either of type Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_private_connection(name: nil, request_id: nil, force: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the private connectivity configuration to delete.

    • request_id (::String) (defaults to: nil)

      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).

    • force (::Boolean) (defaults to: nil)

      Optional. If set to true, any child routes that belong to this PrivateConnection will also be deleted.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2474

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::V1::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
   = @config.rpcs.delete_private_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_private_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_private_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_route(request, options = nil) ⇒ ::Gapic::Operation #delete_route(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Use this method to delete a route.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::DeleteRouteRequest.new

# Call the delete_route method.
result = client.delete_route request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_route(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_route via a request object, either of type Google::Cloud::Datastream::V1::DeleteRouteRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_route(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Route resource to delete.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2888

def delete_route request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.delete_route..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_route.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_route.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_stream(request, options = nil) ⇒ ::Gapic::Operation #delete_stream(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Use this method to delete a stream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::DeleteStreamRequest.new

# Call the delete_stream method.
result = client.delete_stream request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_stream(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_stream via a request object, either of type Google::Cloud::Datastream::V1::DeleteStreamRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_stream(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the stream resource to delete.

    • request_id (::String) (defaults to: nil)

      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).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1413

def delete_stream request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.delete_stream..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_stream.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_stream.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#discover_connection_profile(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse #discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, full_hierarchy: nil, hierarchy_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil, postgresql_rdbms: nil, sql_server_rdbms: nil, salesforce_org: nil, mongodb_cluster: nil) ⇒ ::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse

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 of a parent data object that's optionally supplied in the request.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest.new

# Call the discover_connection_profile method.
result = client.discover_connection_profile request

# The returned object is of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse.
p result

Overloads:

  • #discover_connection_profile(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse

    Pass arguments to discover_connection_profile via a request object, either of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, full_hierarchy: nil, hierarchy_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil, postgresql_rdbms: nil, sql_server_rdbms: nil, salesforce_org: nil, mongodb_cluster: nil) ⇒ ::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent resource of the connection profile type. Must be in the format projects/*/locations/*.

    • connection_profile (::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash) (defaults to: nil)

      An ad-hoc connection profile configuration.

      Note: The following parameters are mutually exclusive: connection_profile, connection_profile_name. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • connection_profile_name (::String) (defaults to: nil)

      A reference to an existing connection profile.

      Note: The following parameters are mutually exclusive: connection_profile_name, connection_profile. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • full_hierarchy (::Boolean) (defaults to: nil)

      Whether to retrieve the full hierarchy of data objects (TRUE) or only the current level (FALSE).

      Note: The following parameters are mutually exclusive: full_hierarchy, hierarchy_depth. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • hierarchy_depth (::Integer) (defaults to: nil)

      The number of hierarchy levels below the current level to be retrieved.

      Note: The following parameters are mutually exclusive: hierarchy_depth, full_hierarchy. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • oracle_rdbms (::Google::Cloud::Datastream::V1::OracleRdbms, ::Hash) (defaults to: nil)

      Oracle RDBMS to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: oracle_rdbms, mysql_rdbms, postgresql_rdbms, sql_server_rdbms, salesforce_org, mongodb_cluster. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • mysql_rdbms (::Google::Cloud::Datastream::V1::MysqlRdbms, ::Hash) (defaults to: nil)

      MySQL RDBMS to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: mysql_rdbms, oracle_rdbms, postgresql_rdbms, sql_server_rdbms, salesforce_org, mongodb_cluster. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • postgresql_rdbms (::Google::Cloud::Datastream::V1::PostgresqlRdbms, ::Hash) (defaults to: nil)

      PostgreSQL RDBMS to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: postgresql_rdbms, oracle_rdbms, mysql_rdbms, sql_server_rdbms, salesforce_org, mongodb_cluster. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • sql_server_rdbms (::Google::Cloud::Datastream::V1::SqlServerRdbms, ::Hash) (defaults to: nil)

      SQLServer RDBMS to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: sql_server_rdbms, oracle_rdbms, mysql_rdbms, postgresql_rdbms, salesforce_org, mongodb_cluster. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • salesforce_org (::Google::Cloud::Datastream::V1::SalesforceOrg, ::Hash) (defaults to: nil)

      Salesforce organization to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: salesforce_org, oracle_rdbms, mysql_rdbms, postgresql_rdbms, sql_server_rdbms, mongodb_cluster. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

    • mongodb_cluster (::Google::Cloud::Datastream::V1::MongodbCluster, ::Hash) (defaults to: nil)

      MongoDB cluster to enrich with child data objects and metadata.

      Note: The following parameters are mutually exclusive: mongodb_cluster, oracle_rdbms, mysql_rdbms, postgresql_rdbms, sql_server_rdbms, salesforce_org. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 881

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::V1::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
   = @config.rpcs.discover_connection_profile..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.discover_connection_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.discover_connection_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :discover_connection_profile, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_static_ips(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::FetchStaticIpsResponse #fetch_static_ips(name: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Datastream::V1::FetchStaticIpsResponse

The FetchStaticIps API call exposes the static IP addresses used by Datastream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::FetchStaticIpsRequest.new

# Call the fetch_static_ips method.
result = client.fetch_static_ips request

# The returned object is of type Google::Cloud::Datastream::V1::FetchStaticIpsResponse.
p result

Overloads:

  • #fetch_static_ips(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::FetchStaticIpsResponse

    Pass arguments to fetch_static_ips via a request object, either of type FetchStaticIpsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #fetch_static_ips(name: nil, page_size: nil, page_token: nil) ⇒ ::Google::Cloud::Datastream::V1::FetchStaticIpsResponse

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name for the location for which static IPs should be returned. Must be in the format projects/*/locations/*.

    • page_size (::Integer) (defaults to: nil)

      Maximum number of Ips to return, will likely not be specified.

    • page_token (::String) (defaults to: nil)

      A page token, received from a previous ListStaticIps call. will likely not be specified.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2053

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::V1::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
   = @config.rpcs.fetch_static_ips..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.fetch_static_ips.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_static_ips.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :fetch_static_ips, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_connection_profile(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::ConnectionProfile #get_connection_profile(name: nil) ⇒ ::Google::Cloud::Datastream::V1::ConnectionProfile

Use this method to get details about a connection profile.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::GetConnectionProfileRequest.new

# Call the get_connection_profile method.
result = client.get_connection_profile request

# The returned object is of type Google::Cloud::Datastream::V1::ConnectionProfile.
p result

Overloads:

  • #get_connection_profile(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::ConnectionProfile

    Pass arguments to get_connection_profile via a request object, either of type GetConnectionProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_connection_profile(name: nil) ⇒ ::Google::Cloud::Datastream::V1::ConnectionProfile

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the connection profile resource to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 407

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::V1::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
   = @config.rpcs.get_connection_profile..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_connection_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_connection_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :get_connection_profile, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_private_connection(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::PrivateConnection #get_private_connection(name: nil) ⇒ ::Google::Cloud::Datastream::V1::PrivateConnection

Use this method to get details about a private connectivity configuration.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::GetPrivateConnectionRequest.new

# Call the get_private_connection method.
result = client.get_private_connection request

# The returned object is of type Google::Cloud::Datastream::V1::PrivateConnection.
p result

Overloads:

  • #get_private_connection(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::PrivateConnection

    Pass arguments to get_private_connection via a request object, either of type GetPrivateConnectionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_private_connection(name: nil) ⇒ ::Google::Cloud::Datastream::V1::PrivateConnection

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the private connectivity configuration to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2256

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::V1::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
   = @config.rpcs.get_private_connection..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_private_connection.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_private_connection.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :get_private_connection, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_route(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::Route #get_route(name: nil) ⇒ ::Google::Cloud::Datastream::V1::Route

Use this method to get details about a route.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::GetRouteRequest.new

# Call the get_route method.
result = client.get_route request

# The returned object is of type Google::Cloud::Datastream::V1::Route.
p result

Overloads:

  • #get_route(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::Route

    Pass arguments to get_route via a request object, either of type GetRouteRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_route(name: nil) ⇒ ::Google::Cloud::Datastream::V1::Route

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the Route resource to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2674

def get_route request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.get_route..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_route.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_route.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :get_route, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_stream(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::Stream #get_stream(name: nil) ⇒ ::Google::Cloud::Datastream::V1::Stream

Use this method to get details about a stream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::GetStreamRequest.new

# Call the get_stream method.
result = client.get_stream request

# The returned object is of type Google::Cloud::Datastream::V1::Stream.
p result

Overloads:

  • #get_stream(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::Stream

    Pass arguments to get_stream via a request object, either of type GetStreamRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_stream(name: nil) ⇒ ::Google::Cloud::Datastream::V1::Stream

    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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the stream resource to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1071

def get_stream request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.get_stream..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_stream.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_stream.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :get_stream, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_stream_object(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject #get_stream_object(name: nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

Use this method to get details about a stream object.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::GetStreamObjectRequest.new

# Call the get_stream_object method.
result = client.get_stream_object request

# The returned object is of type Google::Cloud::Datastream::V1::StreamObject.
p result

Overloads:

  • #get_stream_object(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

    Pass arguments to get_stream_object via a request object, either of type GetStreamObjectRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::GetStreamObjectRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_stream_object(name: nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

    Pass arguments to get_stream_object 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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the stream object resource to get.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1601

def get_stream_object request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetStreamObjectRequest

  # 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
   = @config.rpcs.get_stream_object..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_stream_object.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_stream_object.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :get_stream_object, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_connection_profiles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile> #list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile>

Use this method to list connection profiles created in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::ListConnectionProfilesRequest.new

# Call the list_connection_profiles method.
result = client.list_connection_profiles request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Datastream::V1::ConnectionProfile.
  p item
end

Overloads:

  • #list_connection_profiles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile>

    Pass arguments to list_connection_profiles via a request object, either of type ListConnectionProfilesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of connection profiles.

    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      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.

    • filter (::String) (defaults to: nil)

      Filter request.

    • order_by (::String) (defaults to: nil)

      Order by fields for the result.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 320

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::V1::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
   = @config.rpcs.list_connection_profiles..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_connection_profiles.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_connection_profiles.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_private_connections(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection> #list_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection>

Use this method to list private connectivity configurations in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest.new

# Call the list_private_connections method.
result = client.list_private_connections request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Datastream::V1::PrivateConnection.
  p item
end

Overloads:

  • #list_private_connections(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection>

    Pass arguments to list_private_connections via a request object, either of type ListPrivateConnectionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of private connectivity configurations.

    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      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.

    • filter (::String) (defaults to: nil)

      Filter request.

    • order_by (::String) (defaults to: nil)

      Order by fields for the result.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2363

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::V1::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
   = @config.rpcs.list_private_connections..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_private_connections.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_private_connections.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_routes(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route> #list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route>

Use this method to list routes created for a private connectivity configuration in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::ListRoutesRequest.new

# Call the list_routes method.
result = client.list_routes request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Datastream::V1::Route.
  p item
end

Overloads:

  • #list_routes(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route>

    Pass arguments to list_routes via a request object, either of type ListRoutesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of Routess.

    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      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.

    • filter (::String) (defaults to: nil)

      Filter request.

    • order_by (::String) (defaults to: nil)

      Order by fields for the result.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 2780

def list_routes request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.list_routes..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_routes.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_routes.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_stream_objects(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject> #list_stream_objects(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>

Use this method to list the objects of a specific stream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::ListStreamObjectsRequest.new

# Call the list_stream_objects method.
result = client.list_stream_objects request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Datastream::V1::StreamObject.
  p item
end

Overloads:

  • #list_stream_objects(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>

    Pass arguments to list_stream_objects via a request object, either of type ListStreamObjectsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::ListStreamObjectsRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_stream_objects(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>

    Pass arguments to list_stream_objects 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent stream that owns the collection of objects.

    • page_size (::Integer) (defaults to: nil)

      Maximum number of objects to return. Default is 50. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Page token received from a previous ListStreamObjectsRequest call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListStreamObjectsRequest must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1787

def list_stream_objects request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListStreamObjectsRequest

  # 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
   = @config.rpcs.list_stream_objects..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_stream_objects.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_stream_objects.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :list_stream_objects, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_stream_objects, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_streams(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream> #list_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream>

Use this method to list streams in a project and location.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::ListStreamsRequest.new

# Call the list_streams method.
result = client.list_streams request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Datastream::V1::Stream.
  p item
end

Overloads:

  • #list_streams(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream>

    Pass arguments to list_streams via a request object, either of type ListStreamsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream>

    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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent that owns the collection of streams.

    • page_size (::Integer) (defaults to: nil)

      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.

    • page_token (::String) (defaults to: nil)

      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.

    • filter (::String) (defaults to: nil)

      Filter request.

    • order_by (::String) (defaults to: nil)

      Order by fields for the result.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 984

def list_streams request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.list_streams..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_streams.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_streams.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


251
252
253
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 251

def logger
  @datastream_stub.logger
end

#lookup_stream_object(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject #lookup_stream_object(parent: nil, source_object_identifier: nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

Use this method to look up a stream object by its source object identifier.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::LookupStreamObjectRequest.new

# Call the lookup_stream_object method.
result = client.lookup_stream_object request

# The returned object is of type Google::Cloud::Datastream::V1::StreamObject.
p result

Overloads:

  • #lookup_stream_object(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

    Pass arguments to lookup_stream_object via a request object, either of type LookupStreamObjectRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::LookupStreamObjectRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #lookup_stream_object(parent: nil, source_object_identifier: nil) ⇒ ::Google::Cloud::Datastream::V1::StreamObject

    Pass arguments to lookup_stream_object 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).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent stream that owns the collection of objects.

    • source_object_identifier (::Google::Cloud::Datastream::V1::SourceObjectIdentifier, ::Hash) (defaults to: nil)

      Required. The source object identifier which maps to the stream object.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1688

def lookup_stream_object request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::LookupStreamObjectRequest

  # 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
   = @config.rpcs.lookup_stream_object..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.lookup_stream_object.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.lookup_stream_object.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :lookup_stream_object, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#run_stream(request, options = nil) ⇒ ::Gapic::Operation #run_stream(name: nil, cdc_strategy: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to start, resume or recover a stream with a non default CDC strategy.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::RunStreamRequest.new

# Call the run_stream method.
result = client.run_stream request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #run_stream(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to run_stream via a request object, either of type RunStreamRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::RunStreamRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #run_stream(name: nil, cdc_strategy: nil, force: nil) ⇒ ::Gapic::Operation

    Pass arguments to run_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).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the stream resource to start, in the format: projects/{project_id}/locations/{location}/streams/{stream_name}

    • cdc_strategy (::Google::Cloud::Datastream::V1::CdcStrategy, ::Hash) (defaults to: nil)

      Optional. The CDC strategy of the stream. If not set, the system's default value will be used.

    • force (::Boolean) (defaults to: nil)

      Optional. Update the stream without validating it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1514

def run_stream request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::RunStreamRequest

  # 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
   = @config.rpcs.run_stream..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.run_stream.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.run_stream.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :run_stream, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_backfill_job(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StartBackfillJobResponse #start_backfill_job(object: nil) ⇒ ::Google::Cloud::Datastream::V1::StartBackfillJobResponse

Use this method to start a backfill job for the specified stream object.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::StartBackfillJobRequest.new

# Call the start_backfill_job method.
result = client.start_backfill_job request

# The returned object is of type Google::Cloud::Datastream::V1::StartBackfillJobResponse.
p result

Overloads:

  • #start_backfill_job(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StartBackfillJobResponse

    Pass arguments to start_backfill_job via a request object, either of type StartBackfillJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::StartBackfillJobRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #start_backfill_job(object: nil) ⇒ ::Google::Cloud::Datastream::V1::StartBackfillJobResponse

    Pass arguments to start_backfill_job 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).

    Parameters:

    • object (::String) (defaults to: nil)

      Required. The name of the stream object resource to start a backfill job for.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1875

def start_backfill_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::StartBackfillJobRequest

  # 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
   = @config.rpcs.start_backfill_job..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.object
    header_params["object"] = request.object
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.start_backfill_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_backfill_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :start_backfill_job, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_backfill_job(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StopBackfillJobResponse #stop_backfill_job(object: nil) ⇒ ::Google::Cloud::Datastream::V1::StopBackfillJobResponse

Use this method to stop a backfill job for the specified stream object.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::StopBackfillJobRequest.new

# Call the stop_backfill_job method.
result = client.stop_backfill_job request

# The returned object is of type Google::Cloud::Datastream::V1::StopBackfillJobResponse.
p result

Overloads:

  • #stop_backfill_job(request, options = nil) ⇒ ::Google::Cloud::Datastream::V1::StopBackfillJobResponse

    Pass arguments to stop_backfill_job via a request object, either of type StopBackfillJobRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::StopBackfillJobRequest, ::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #stop_backfill_job(object: nil) ⇒ ::Google::Cloud::Datastream::V1::StopBackfillJobResponse

    Pass arguments to stop_backfill_job 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).

    Parameters:

    • object (::String) (defaults to: nil)

      Required. The name of the stream object resource to stop the backfill job for.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1961

def stop_backfill_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::StopBackfillJobRequest

  # 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
   = @config.rpcs.stop_backfill_job..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.object
    header_params["object"] = request.object
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.stop_backfill_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_backfill_job.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @datastream_stub.call_rpc :stop_backfill_job, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


131
132
133
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 131

def universe_domain
  @datastream_stub.universe_domain
end

#update_connection_profile(request, options = nil) ⇒ ::Gapic::Operation #update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to update the parameters of a connection profile.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest.new

# Call the update_connection_profile method.
result = client.update_connection_profile request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_connection_profile(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_connection_profile via a request object, either of type UpdateConnectionProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

    • connection_profile (::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash) (defaults to: nil)

      Required. The connection profile to update.

    • request_id (::String) (defaults to: nil)

      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).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the connection profile, but don't update any resources. The default is false.

    • force (::Boolean) (defaults to: nil)

      Optional. Update the connection profile without validating it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 641

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::V1::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
   = @config.rpcs.update_connection_profile..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.connection_profile&.name
    header_params["connection_profile.name"] = request.connection_profile.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_connection_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_connection_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_stream(request, options = nil) ⇒ ::Gapic::Operation #update_stream(update_mask: nil, stream: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

Use this method to update the configuration of a stream.

Examples:

Basic example

require "google/cloud/datastream/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Datastream::V1::Datastream::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Datastream::V1::UpdateStreamRequest.new

# Call the update_stream method.
result = client.update_stream request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_stream(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_stream via a request object, either of type UpdateStreamRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Datastream::V1::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.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_stream(update_mask: nil, stream: nil, request_id: nil, validate_only: nil, force: nil) ⇒ ::Gapic::Operation

    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).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      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.

    • stream (::Google::Cloud::Datastream::V1::Stream, ::Hash) (defaults to: nil)

      Required. The stream resource to update.

    • request_id (::String) (defaults to: nil)

      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).

    • validate_only (::Boolean) (defaults to: nil)

      Optional. Only validate the stream with the changes, without actually updating it. The default is false.

    • force (::Boolean) (defaults to: nil)

      Optional. Update the stream without validating it.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
# File 'lib/google/cloud/datastream/v1/datastream/client.rb', line 1305

def update_stream request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::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
   = @config.rpcs.update_stream..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"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::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.stream&.name
    header_params["stream.name"] = request.stream.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_stream.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_stream.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         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?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end