Class: Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client

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

Overview

Client for the DataTransferService service.

DataTransferService is the service for the Data Transfer API.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#destination_path, #location_path, #multicloud_data_transfer_config_path, #multicloud_data_transfer_supported_service_path

Constructor Details

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

Create a new DataTransferService client object.

Examples:


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

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

Yields:

  • (config)

    Configure the DataTransferService client.

Yield Parameters:



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
224
225
226
227
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 155

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/networkconnectivity/v1/data_transfer_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

  @data_transfer_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::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
  )

  @data_transfer_service_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 = @data_transfer_service_stub.endpoint
    config.universe_domain = @data_transfer_service_stub.universe_domain
    config.logger = @data_transfer_service_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 = @data_transfer_service_stub.endpoint
    config.universe_domain = @data_transfer_service_stub.universe_domain
    config.logger = @data_transfer_service_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)


248
249
250
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 248

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)


241
242
243
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 241

def location_client
  @location_client
end

#operations_client::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Operations (readonly)

Get the associated client for long-running operations.



234
235
236
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 234

def operations_client
  @operations_client
end

Class Method Details

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

Configure the DataTransferService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all DataTransferService clients
::Google::Cloud::NetworkConnectivity::V1::DataTransferService::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
105
106
107
108
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "NetworkConnectivity", "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.list_multicloud_data_transfer_configs.timeout = 60.0

    default_config.rpcs.get_multicloud_data_transfer_config.timeout = 60.0

    default_config.rpcs.create_multicloud_data_transfer_config.timeout = 60.0

    default_config.rpcs.update_multicloud_data_transfer_config.timeout = 60.0

    default_config.rpcs.delete_multicloud_data_transfer_config.timeout = 60.0

    default_config.rpcs.list_destinations.timeout = 60.0

    default_config.rpcs.get_destination.timeout = 60.0

    default_config.rpcs.create_destination.timeout = 60.0

    default_config.rpcs.update_destination.timeout = 60.0

    default_config.rpcs.delete_destination.timeout = 60.0

    default_config.rpcs.get_multicloud_data_transfer_supported_service.timeout = 60.0

    default_config.rpcs.list_multicloud_data_transfer_supported_services.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

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

Configure the DataTransferService 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:



125
126
127
128
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 125

def configure
  yield @config if block_given?
  @config
end

#create_destination(request, options = nil) ⇒ ::Gapic::Operation #create_destination(parent: nil, destination_id: nil, destination: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a Destination resource in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the create_destination method.
result = client.create_destination 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_destination(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest, ::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_destination(parent: nil, destination_id: nil, destination: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_destination 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 name of the parent resource.

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

      Required. The ID to use for the Destination resource, which becomes the final component of the Destination resource name.

    • destination (::Google::Cloud::NetworkConnectivity::V1::Destination, ::Hash) (defaults to: nil)

      Required. The Destination 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request. This prevents clients from accidentally creating duplicate Destination resources.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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.



1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 1053

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest

  # 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_destination..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::NetworkConnectivity::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_destination.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_destination.retry_policy

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

  @data_transfer_service_stub.call_rpc :create_destination, 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation #create_multicloud_data_transfer_config(parent: nil, multicloud_data_transfer_config_id: nil, multicloud_data_transfer_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a MulticloudDataTransferConfig resource in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the create_multicloud_data_transfer_config method.
result = client.create_multicloud_data_transfer_config 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

  • #create_multicloud_data_transfer_config(parent: nil, multicloud_data_transfer_config_id: nil, multicloud_data_transfer_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_multicloud_data_transfer_config 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 name of the parent resource.

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

      Required. The ID to use for the MulticloudDataTransferConfig resource, which becomes the final component of the MulticloudDataTransferConfig resource name.

    • multicloud_data_transfer_config (::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig, ::Hash) (defaults to: nil)

      Required. The MulticloudDataTransferConfig 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request. This prevents clients from accidentally creating duplicate MulticloudDataTransferConfig resources.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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/network_connectivity/v1/data_transfer_service/client.rb', line 522

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateMulticloudDataTransferConfigRequest

  # 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_multicloud_data_transfer_config..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::NetworkConnectivity::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_multicloud_data_transfer_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_multicloud_data_transfer_config.retry_policy

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

  @data_transfer_service_stub.call_rpc :create_multicloud_data_transfer_config, 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_destination(request, options = nil) ⇒ ::Gapic::Operation #delete_destination(name: nil, request_id: nil, etag: nil) ⇒ ::Gapic::Operation

Deletes a Destination resource.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the delete_destination method.
result = client.delete_destination 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_destination(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_destination via a request object, either of type Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest, ::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_destination(name: nil, request_id: nil, etag: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_destination 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 Destination 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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

      Optional. The etag is computed by the server, and might be sent with update and delete requests so that the client has an up-to-date value before proceeding.

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.



1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 1277

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest

  # 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_destination..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::NetworkConnectivity::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_destination.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_destination.retry_policy

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

  @data_transfer_service_stub.call_rpc :delete_destination, 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation #delete_multicloud_data_transfer_config(name: nil, request_id: nil, etag: nil) ⇒ ::Gapic::Operation

Deletes a MulticloudDataTransferConfig resource.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the delete_multicloud_data_transfer_config method.
result = client.delete_multicloud_data_transfer_config 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_multicloud_data_transfer_config via a request object, either of type Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest or an equivalent Hash.

    Parameters:

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

    Pass arguments to delete_multicloud_data_transfer_config 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 MulticloudDataTransferConfig 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request. This prevents clients from accidentally creating duplicate MulticloudDataTransferConfig resources.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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

      Optional. The etag is computed by the server, and might be sent with update and delete requests so that the client has an up-to-date value before proceeding.

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.



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
791
792
793
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 752

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest

  # 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_multicloud_data_transfer_config..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::NetworkConnectivity::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_multicloud_data_transfer_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_multicloud_data_transfer_config.retry_policy

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

  @data_transfer_service_stub.call_rpc :delete_multicloud_data_transfer_config, 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

#get_destination(request, options = nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::Destination #get_destination(name: nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::Destination

Gets the details of a Destination resource.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1::Destination.
p result

Overloads:

  • #get_destination(request, options = nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::Destination

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

    Parameters:

    • request (::Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest, ::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_destination(name: nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::Destination

    Pass arguments to get_destination 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 Destination 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.



941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 941

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest

  # 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_destination..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::NetworkConnectivity::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_destination.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_destination.retry_policy

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

  @data_transfer_service_stub.call_rpc :get_destination, 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig #get_multicloud_data_transfer_config(name: nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig

Gets the details of a MulticloudDataTransferConfig resource.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
447
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 408

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferConfigRequest

  # 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_multicloud_data_transfer_config..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::NetworkConnectivity::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_multicloud_data_transfer_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_multicloud_data_transfer_config.retry_policy

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

  @data_transfer_service_stub.call_rpc :get_multicloud_data_transfer_config, 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_multicloud_data_transfer_supported_service(request, options = nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService #get_multicloud_data_transfer_supported_service(name: nil) ⇒ ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService

Gets the details of a service that is supported for Data Transfer Essentials.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 1365

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferSupportedServiceRequest

  # 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_multicloud_data_transfer_supported_service..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::NetworkConnectivity::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_multicloud_data_transfer_supported_service.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_multicloud_data_transfer_supported_service.retry_policy

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

  @data_transfer_service_stub.call_rpc :get_multicloud_data_transfer_supported_service, 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_destinations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination> #list_destinations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination>

Lists the Destination resources in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the list_destinations method.
result = client.list_destinations 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::NetworkConnectivity::V1::Destination.
  p item
end

Overloads:

  • #list_destinations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination>

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

    Parameters:

    • request (::Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest, ::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_destinations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination>

    Pass arguments to list_destinations 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 name of the parent resource.

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

      Optional. The maximum number of results listed per page.

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

      Optional. The page token.

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

      Optional. An expression that filters the results listed in the response.

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

      Optional. The sort order of the results.

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

      Optional. If true, allow partial responses for multi-regional aggregated list requests.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 854

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest

  # 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_destinations..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::NetworkConnectivity::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_destinations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_destinations.retry_policy

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

  @data_transfer_service_stub.call_rpc :list_destinations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_destinations, 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_multicloud_data_transfer_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig> #list_multicloud_data_transfer_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig>

Lists the MulticloudDataTransferConfig resources in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the list_multicloud_data_transfer_configs method.
result = client.list_multicloud_data_transfer_configs 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::NetworkConnectivity::V1::MulticloudDataTransferConfig.
  p item
end

Overloads:

  • #list_multicloud_data_transfer_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig>

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

    Parameters:

  • #list_multicloud_data_transfer_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig>

    Pass arguments to list_multicloud_data_transfer_configs 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 name of the parent resource.

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

      Optional. The maximum number of results listed per page.

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

      Optional. The page token.

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

      Optional. An expression that filters the results listed in the response.

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

      Optional. The sort order of the results.

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

      Optional. If true, allows partial responses for multi-regional aggregated list requests.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
362
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 321

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferConfigsRequest

  # 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_multicloud_data_transfer_configs..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::NetworkConnectivity::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_multicloud_data_transfer_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_multicloud_data_transfer_configs.retry_policy

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

  @data_transfer_service_stub.call_rpc :list_multicloud_data_transfer_configs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_multicloud_data_transfer_configs, 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_multicloud_data_transfer_supported_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService> #list_multicloud_data_transfer_supported_services(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService>

Lists the services in the project for a region that are supported for Data Transfer Essentials.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the list_multicloud_data_transfer_supported_services method.
result = client.list_multicloud_data_transfer_supported_services 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::NetworkConnectivity::V1::MulticloudDataTransferSupportedService.
  p item
end

Overloads:

  • #list_multicloud_data_transfer_supported_services(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService>

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

    Parameters:

  • #list_multicloud_data_transfer_supported_services(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService>

    Pass arguments to list_multicloud_data_transfer_supported_services 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 name of the parent resource.

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

      Optional. The maximum number of results listed per page.

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

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



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 1459

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferSupportedServicesRequest

  # 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_multicloud_data_transfer_supported_services..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::NetworkConnectivity::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_multicloud_data_transfer_supported_services.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_multicloud_data_transfer_supported_services.retry_policy

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

  @data_transfer_service_stub.call_rpc :list_multicloud_data_transfer_supported_services, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_multicloud_data_transfer_supported_services, 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)


255
256
257
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 255

def logger
  @data_transfer_service_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


135
136
137
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 135

def universe_domain
  @data_transfer_service_stub.universe_domain
end

#update_destination(request, options = nil) ⇒ ::Gapic::Operation #update_destination(update_mask: nil, destination: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates a Destination resource in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the update_destination method.
result = client.update_destination 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_destination(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest, ::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_destination(update_mask: nil, destination: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_destination 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. FieldMask is used to specify the fields to be overwritten in the Destinationresource by the update. The fields specified inupdate_mask` are relative to the resource, not the full request. A field is overwritten if it is in the mask. If you don't specify a mask, all fields are overwritten.

    • destination (::Google::Cloud::NetworkConnectivity::V1::Destination, ::Hash) (defaults to: nil)

      Required. The Destination 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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.



1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 1166

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest

  # 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_destination..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::NetworkConnectivity::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.destination&.name
    header_params["destination.name"] = request.destination.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_destination.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_destination.retry_policy

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

  @data_transfer_service_stub.call_rpc :update_destination, 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation #update_multicloud_data_transfer_config(update_mask: nil, multicloud_data_transfer_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates a MulticloudDataTransferConfig resource in a specified project and location.

Examples:

Basic example

require "google/cloud/network_connectivity/v1"

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

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

# Call the update_multicloud_data_transfer_config method.
result = client.update_multicloud_data_transfer_config 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_multicloud_data_transfer_config(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

  • #update_multicloud_data_transfer_config(update_mask: nil, multicloud_data_transfer_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_multicloud_data_transfer_config 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. FieldMask is used to specify the fields in the MulticloudDataTransferConfig resource to be overwritten by the update. The fields specified in update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If you don't specify a mask, all fields are overwritten.

    • multicloud_data_transfer_config (::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig, ::Hash) (defaults to: nil)

      Required. The MulticloudDataTransferConfig 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 can ignore the request if it has already been completed. The server waits 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, can ignore the second request. This prevents clients from accidentally creating duplicate MulticloudDataTransferConfig resources.

      The request ID must be a valid UUID with the exception that zero UUID (00000000-0000-0000-0000-000000000000) isn't supported.

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.



638
639
640
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
# File 'lib/google/cloud/network_connectivity/v1/data_transfer_service/client.rb', line 638

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateMulticloudDataTransferConfigRequest

  # 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_multicloud_data_transfer_config..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::NetworkConnectivity::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.multicloud_data_transfer_config&.name
    header_params["multicloud_data_transfer_config.name"] = request.multicloud_data_transfer_config.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_multicloud_data_transfer_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_multicloud_data_transfer_config.retry_policy

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

  @data_transfer_service_stub.call_rpc :update_multicloud_data_transfer_config, 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