Class: Google::Cloud::VMMigration::V1::VMMigration::Client

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

Overview

Client for the VmMigration service.

VM Migration Service

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#clone_job_path, #cutover_job_path, #datacenter_connector_path, #group_path, #location_path, #migrating_vm_path, #replication_cycle_path, #source_path, #target_project_path, #utilization_report_path

Constructor Details

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

Create a new VmMigration client object.

Examples:


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

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

Yields:

  • (config)

    Configure the VmMigration client.

Yield Parameters:



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 134

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/vmmigration/v1/vmmigration_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

  @vm_migration_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::VMMigration::V1::VmMigration::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
  )

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


227
228
229
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 227

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)


220
221
222
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 220

def location_client
  @location_client
end

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

Get the associated client for long-running operations.



213
214
215
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 213

def operations_client
  @operations_client
end

Class Method Details

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

Configure the VmMigration Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all VmMigration clients
::Google::Cloud::VMMigration::V1::VMMigration::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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "VMMigration", "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.rpcs.create_source.timeout = 900.0

    default_config.rpcs.fetch_inventory.timeout = 300.0

    default_config.rpcs.create_utilization_report.timeout = 300.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#add_group_migration(request, options = nil) ⇒ ::Gapic::Operation #add_group_migration(group: nil, migrating_vm: nil) ⇒ ::Gapic::Operation

Adds a MigratingVm to a Group.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the add_group_migration method.
result = client.add_group_migration 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:

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

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

    Parameters:

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

  • #add_group_migration(group: nil, migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to add_group_migration 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:

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

      Required. The full path name of the Group to add to.

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

      The full path name of the MigratingVm to add.

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.



4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4075

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest

  # 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.add_group_migration..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::VMMigration::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.group
    header_params["group"] = request.group
  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.add_group_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.add_group_migration.retry_policy

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

  @vm_migration_stub.call_rpc :add_group_migration, 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

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

Initiates the cancellation of a running clone job.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the cancel_clone_job method.
result = client.cancel_clone_job 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:

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

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

    Parameters:

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

  • #cancel_clone_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to cancel_clone_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:

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

      Required. The clone job id

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.



2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2864

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest

  # 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.cancel_clone_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::VMMigration::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.cancel_clone_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :cancel_clone_job, 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

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

Initiates the cancellation of a running cutover job.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the cancel_cutover_job method.
result = client.cancel_cutover_job 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:

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

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

    Parameters:

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

  • #cancel_cutover_job(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to cancel_cutover_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:

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

      Required. The cutover job id

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.



3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3263

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest

  # 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.cancel_cutover_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::VMMigration::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.cancel_cutover_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.cancel_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :cancel_cutover_job, 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

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

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



104
105
106
107
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 104

def configure
  yield @config if block_given?
  @config
end

#create_clone_job(request, options = nil) ⇒ ::Gapic::Operation #create_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) ⇒ ::Gapic::Operation

Initiates a Clone of a specific migrating VM.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::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_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_clone_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:

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

      Required. The Clone's parent.

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

      Required. The clone job identifier.

    • clone_job (::Google::Cloud::VMMigration::V1::CloneJob, ::Hash) (defaults to: nil)

      Required. The clone request body.

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

      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 t he 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.



2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2770

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest

  # 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_clone_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::VMMigration::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_clone_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :create_clone_job, 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_cutover_job(request, options = nil) ⇒ ::Gapic::Operation #create_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) ⇒ ::Gapic::Operation

Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::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_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_cutover_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:

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

      Required. The Cutover's parent.

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

      Required. The cutover job identifier.

    • cutover_job (::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash) (defaults to: nil)

      Required. The cutover request body.

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

      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 t he 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.



3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3169

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest

  # 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_cutover_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::VMMigration::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_cutover_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :create_cutover_job, 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_datacenter_connector(request, options = nil) ⇒ ::Gapic::Operation #create_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new DatacenterConnector in a given Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::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_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_datacenter_connector 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 DatacenterConnector's parent. Required. The Source in where the new DatacenterConnector will be created. For example: projects/my-project/locations/us-central1/sources/my-source

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

      Required. The datacenterConnector identifier.

    • datacenter_connector (::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash) (defaults to: nil)

      Required. The create request body.

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

      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 t he 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.



1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1543

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest

  # 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_datacenter_connector..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::VMMigration::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_datacenter_connector.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :create_datacenter_connector, 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_group(request, options = nil) ⇒ ::Gapic::Operation #create_group(parent: nil, group_id: nil, group: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new Group in a given project and location.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::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_group(parent: nil, group_id: nil, group: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_group 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 Group's parent.

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

      Required. The group identifier.

    • group (::Google::Cloud::VMMigration::V1::Group, ::Hash) (defaults to: nil)

      Required. The create request body.

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

      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 t he 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.



3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3757

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest

  # 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_group..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::VMMigration::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_group.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_group.retry_policy

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

  @vm_migration_stub.call_rpc :create_group, 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_migrating_vm(request, options = nil) ⇒ ::Gapic::Operation #create_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new MigratingVm in a given Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::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_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_migrating_vm 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 MigratingVm's parent.

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

      Required. The migratingVm identifier.

    • migrating_vm (::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash) (defaults to: nil)

      Required. The create request body.

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

      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 t he 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.



1872
1873
1874
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1872

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest

  # 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_migrating_vm..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::VMMigration::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_migrating_vm.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :create_migrating_vm, 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_source(request, options = nil) ⇒ ::Gapic::Operation #create_source(parent: nil, source_id: nil, source: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new Source in a given project and location.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::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_source(parent: nil, source_id: nil, source: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_source 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 Source's parent.

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

      Required. The source identifier.

    • source (::Google::Cloud::VMMigration::V1::Source, ::Hash) (defaults to: nil)

      Required. The create request body.

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

      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 t he 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.



500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 500

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest

  # 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_source..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::VMMigration::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_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_source.retry_policy

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

  @vm_migration_stub.call_rpc :create_source, 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_target_project(request, options = nil) ⇒ ::Gapic::Operation #create_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new TargetProject in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::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_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_target_project 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 TargetProject's parent.

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

      Required. The target_project identifier.

    • target_project (::Google::Cloud::VMMigration::V1::TargetProject, ::Hash) (defaults to: nil)

      Required. The create request body.

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

      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 t he 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.



4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4483

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest

  # 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_target_project..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::VMMigration::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_target_project.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :create_target_project, 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_utilization_report(request, options = nil) ⇒ ::Gapic::Operation #create_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new UtilizationReport.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::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_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_utilization_report 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 Utilization Report's parent.

    • utilization_report (::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash) (defaults to: nil)

      Required. The report to create.

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

      Required. The ID to use for the report, which will become the final component of the reports's resource name.

      This value maximum length is 63 characters, and valid characters are /[a-z][0-9]-/. It must start with an english letter and must not end with a hyphen.

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

      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 t he 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.



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1128

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest

  # 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_utilization_report..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::VMMigration::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_utilization_report.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :create_utilization_report, 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_datacenter_connector(request, options = nil) ⇒ ::Gapic::Operation #delete_datacenter_connector(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single DatacenterConnector.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::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_datacenter_connector(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_datacenter_connector 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 DatacenterConnector name.

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

      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 t he 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.



1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1651

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest

  # 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_datacenter_connector..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::VMMigration::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_datacenter_connector.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :delete_datacenter_connector, 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_group(request, options = nil) ⇒ ::Gapic::Operation #delete_group(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single Group.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::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_group(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_group 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 Group name.

    • 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 t he 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.



3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3979

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest

  # 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_group..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::VMMigration::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_group.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_group.retry_policy

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

  @vm_migration_stub.call_rpc :delete_group, 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_migrating_vm(request, options = nil) ⇒ ::Gapic::Operation #delete_migrating_vm(name: nil) ⇒ ::Gapic::Operation

Deletes a single MigratingVm.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::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_migrating_vm(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_migrating_vm 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 MigratingVm.

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.



2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2275

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest

  # 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_migrating_vm..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::VMMigration::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_migrating_vm.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :delete_migrating_vm, 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_source(request, options = nil) ⇒ ::Gapic::Operation #delete_source(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::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_source(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_source 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 Source name.

    • 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 t he 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.



722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 722

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest

  # 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_source..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::VMMigration::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_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_source.retry_policy

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

  @vm_migration_stub.call_rpc :delete_source, 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_target_project(request, options = nil) ⇒ ::Gapic::Operation #delete_target_project(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::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_target_project(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_target_project 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 TargetProject name.

    • 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 t he 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.



4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4711

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest

  # 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_target_project..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::VMMigration::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_target_project.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :delete_target_project, 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_utilization_report(request, options = nil) ⇒ ::Gapic::Operation #delete_utilization_report(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single Utilization Report.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::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_utilization_report(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_utilization_report 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 Utilization Report name.

    • 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 t he 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.



1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1236

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest

  # 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_utilization_report..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::VMMigration::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_utilization_report.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :delete_utilization_report, 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

#fetch_inventory(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::FetchInventoryResponse #fetch_inventory(source: nil, force_refresh: nil) ⇒ ::Google::Cloud::VMMigration::V1::FetchInventoryResponse

List remote source's inventory of VMs. The remote source is the onprem vCenter (remote in the sense it's not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse.
p result

Overloads:

  • #fetch_inventory(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::FetchInventoryResponse

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::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_inventory(source: nil, force_refresh: nil) ⇒ ::Google::Cloud::VMMigration::V1::FetchInventoryResponse

    Pass arguments to fetch_inventory 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:

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

      Required. The name of the Source.

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

      If this flag is set to true, the source will be queried instead of using cached results. Using this flag will make the call slower.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 816

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest

  # 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_inventory..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::VMMigration::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.source
    header_params["source"] = request.source
  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_inventory.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_inventory.retry_policy

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

  @vm_migration_stub.call_rpc :fetch_inventory, 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

#finalize_migration(request, options = nil) ⇒ ::Gapic::Operation #finalize_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the finalize_migration method.
result = client.finalize_migration 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:

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

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

    Parameters:

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

  • #finalize_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to finalize_migration 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:

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

      Required. The name of the MigratingVm.

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.



2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2658

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest

  # 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.finalize_migration..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::VMMigration::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.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  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.finalize_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.finalize_migration.retry_policy

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

  @vm_migration_stub.call_rpc :finalize_migration, 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_clone_job(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::CloneJob #get_clone_job(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::CloneJob

Gets details of a single CloneJob.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::CloneJob.
p result

Overloads:

  • #get_clone_job(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::CloneJob

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::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_clone_job(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::CloneJob

    Pass arguments to get_clone_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:

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

      Required. The name of the CloneJob.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3057

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest

  # 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_clone_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::VMMigration::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_clone_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :get_clone_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

#get_cutover_job(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::CutoverJob #get_cutover_job(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::CutoverJob

Gets details of a single CutoverJob.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob.
p result

Overloads:

  • #get_cutover_job(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::CutoverJob

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::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_cutover_job(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::CutoverJob

    Pass arguments to get_cutover_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:

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

      Required. The name of the CutoverJob.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3456

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest

  # 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_cutover_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::VMMigration::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_cutover_job.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :get_cutover_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

#get_datacenter_connector(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::DatacenterConnector #get_datacenter_connector(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::DatacenterConnector

Gets details of a single DatacenterConnector.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector.
p result

Overloads:

  • #get_datacenter_connector(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::DatacenterConnector

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::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_datacenter_connector(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::DatacenterConnector

    Pass arguments to get_datacenter_connector 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 DatacenterConnector.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1430

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest

  # 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_datacenter_connector..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::VMMigration::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_datacenter_connector.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :get_datacenter_connector, 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_group(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::Group #get_group(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::Group

Gets details of a single Group.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::Group.
p result

Overloads:

  • #get_group(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::Group

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetGroupRequest, ::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_group(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::Group

    Pass arguments to get_group 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 group name.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3647

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest

  # 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_group..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::VMMigration::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_group.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_group.retry_policy

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

  @vm_migration_stub.call_rpc :get_group, 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_migrating_vm(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::MigratingVm #get_migrating_vm(name: nil, view: nil) ⇒ ::Google::Cloud::VMMigration::V1::MigratingVm

Gets details of a single MigratingVm.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm.
p result

Overloads:

  • #get_migrating_vm(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::MigratingVm

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::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_migrating_vm(name: nil, view: nil) ⇒ ::Google::Cloud::VMMigration::V1::MigratingVm

    Pass arguments to get_migrating_vm 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:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2069

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest

  # 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_migrating_vm..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::VMMigration::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_migrating_vm.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :get_migrating_vm, 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_replication_cycle(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::ReplicationCycle #get_replication_cycle(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::ReplicationCycle

Gets details of a single ReplicationCycle.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle.
p result

Overloads:

  • #get_replication_cycle(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::ReplicationCycle

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::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_replication_cycle(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::ReplicationCycle

    Pass arguments to get_replication_cycle 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 ReplicationCycle.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4904

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest

  # 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_replication_cycle..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::VMMigration::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_replication_cycle.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_replication_cycle.retry_policy

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

  @vm_migration_stub.call_rpc :get_replication_cycle, 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_source(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::Source #get_source(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::Source

Gets details of a single Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::Source.
p result

Overloads:

  • #get_source(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::Source

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetSourceRequest, ::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_source(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::Source

    Pass arguments to get_source 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 Source name.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 390

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest

  # 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_source..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::VMMigration::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_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_source.retry_policy

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

  @vm_migration_stub.call_rpc :get_source, 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_target_project(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::TargetProject #get_target_project(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::TargetProject

Gets details of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::TargetProject.
p result

Overloads:

  • #get_target_project(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::TargetProject

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::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_target_project(name: nil) ⇒ ::Google::Cloud::VMMigration::V1::TargetProject

    Pass arguments to get_target_project 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 TargetProject name.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4370

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest

  # 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_target_project..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::VMMigration::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_target_project.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :get_target_project, 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_utilization_report(request, options = nil) ⇒ ::Google::Cloud::VMMigration::V1::UtilizationReport #get_utilization_report(name: nil, view: nil) ⇒ ::Google::Cloud::VMMigration::V1::UtilizationReport

Gets a single Utilization Report.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport.
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.



1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1013

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest

  # 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_utilization_report..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::VMMigration::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_utilization_report.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :get_utilization_report, 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_clone_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob> #list_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>

Lists CloneJobs of a given migrating VM.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_clone_jobs method.
result = client.list_clone_jobs 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::VMMigration::V1::CloneJob.
  p item
end

Overloads:

  • #list_clone_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::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_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>

    Pass arguments to list_clone_jobs 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, which owns this collection of source VMs.

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

      Optional. The maximum number of clone jobs to return. The service may return fewer than this value. If unspecified, at most 500 clone jobs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListCloneJobs call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2970

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest

  # 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_clone_jobs..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::VMMigration::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_clone_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_clone_jobs.retry_policy

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

  @vm_migration_stub.call_rpc :list_clone_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_clone_jobs, 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_cutover_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob> #list_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>

Lists CutoverJobs of a given migrating VM.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_cutover_jobs method.
result = client.list_cutover_jobs 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::VMMigration::V1::CutoverJob.
  p item
end

Overloads:

  • #list_cutover_jobs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::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_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>

    Pass arguments to list_cutover_jobs 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, which owns this collection of migrating VMs.

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

      Optional. The maximum number of cutover jobs to return. The service may return fewer than this value. If unspecified, at most 500 cutover jobs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListCutoverJobs call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3369

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest

  # 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_cutover_jobs..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::VMMigration::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_cutover_jobs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_cutover_jobs.retry_policy

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

  @vm_migration_stub.call_rpc :list_cutover_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_cutover_jobs, 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_datacenter_connectors(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector> #list_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>

Lists DatacenterConnectors in a given Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_datacenter_connectors method.
result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector.
  p item
end

Overloads:

  • #list_datacenter_connectors(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::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_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>

    Pass arguments to list_datacenter_connectors 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, which owns this collection of connectors.

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

      Optional. The maximum number of connectors to return. The service may return fewer than this value. If unspecified, at most 500 sources will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListDatacenterConnectors call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1343

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest

  # 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_datacenter_connectors..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::VMMigration::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_datacenter_connectors.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy

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

  @vm_migration_stub.call_rpc :list_datacenter_connectors, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, 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_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group> #list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>

Lists Groups in a given project and location.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_groups method.
result = client.list_groups 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::VMMigration::V1::Group.
  p item
end

Overloads:

  • #list_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::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_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>

    Pass arguments to list_groups 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, which owns this collection of groups.

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

      Optional. The maximum number of groups to return. The service may return fewer than this value. If unspecified, at most 500 groups will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListGroups call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3560

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest

  # 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_groups..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::VMMigration::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_groups.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_groups.retry_policy

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

  @vm_migration_stub.call_rpc :list_groups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_groups, 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_migrating_vms(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm> #list_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>

Lists MigratingVms in a given Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_migrating_vms method.
result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm.
  p item
end

Overloads:

  • #list_migrating_vms(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::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_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>

    Pass arguments to list_migrating_vms 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, which owns this collection of MigratingVms.

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

      Optional. The maximum number of migrating VMs to return. The service may return fewer than this value. If unspecified, at most 500 migrating VMs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListMigratingVms call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

      Optional. the order by fields for the result.

    • view (::Google::Cloud::VMMigration::V1::MigratingVmView) (defaults to: nil)

      Optional. The level of details of each migrating VM.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1980

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest

  # 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_migrating_vms..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::VMMigration::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_migrating_vms.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_migrating_vms.retry_policy

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

  @vm_migration_stub.call_rpc :list_migrating_vms, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, 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_replication_cycles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle> #list_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>

Lists ReplicationCycles in a given MigratingVM.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_replication_cycles method.
result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle.
  p item
end

Overloads:

  • #list_replication_cycles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::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_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>

    Pass arguments to list_replication_cycles 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, which owns this collection of ReplicationCycles.

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

      Optional. The maximum number of replication cycles to return. The service may return fewer than this value. If unspecified, at most 100 migrating VMs will be returned. The maximum value is 100; values above 100 will be coerced to 100.

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

      Required. A page token, received from a previous ListReplicationCycles call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4817

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest

  # 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_replication_cycles..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::VMMigration::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_replication_cycles.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_replication_cycles.retry_policy

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

  @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, 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_sources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source> #list_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>

Lists Sources in a given project and location.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_sources method.
result = client.list_sources 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::VMMigration::V1::Source.
  p item
end

Overloads:

  • #list_sources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::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_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>

    Pass arguments to list_sources 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, which owns this collection of sources.

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

      Optional. The maximum number of sources to return. The service may return fewer than this value. If unspecified, at most 500 sources will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListSources call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 303

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest

  # 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_sources..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::VMMigration::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_sources.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_sources.retry_policy

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

  @vm_migration_stub.call_rpc :list_sources, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_sources, 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_target_projects(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject> #list_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>

Lists TargetProjects in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_target_projects method.
result = client.list_target_projects 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::VMMigration::V1::TargetProject.
  p item
end

Overloads:

  • #list_target_projects(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::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_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>

    Pass arguments to list_target_projects 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, which owns this collection of targets.

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

      Optional. The maximum number of targets to return. The service may return fewer than this value. If unspecified, at most 500 targets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListTargets call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4280

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest

  # 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_target_projects..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::VMMigration::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_target_projects.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_target_projects.retry_policy

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

  @vm_migration_stub.call_rpc :list_target_projects, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_target_projects, 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_utilization_reports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport> #list_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>

Lists Utilization Reports of the given Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the list_utilization_reports method.
result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport.
  p item
end

Overloads:

  • #list_utilization_reports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::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_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>

    Pass arguments to list_utilization_reports 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 Utilization Reports parent.

    • view (::Google::Cloud::VMMigration::V1::UtilizationReportView) (defaults to: nil)

      Optional. The level of details of each report. Defaults to BASIC.

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

      Optional. The maximum number of reports to return. The service may return fewer than this value. If unspecified, at most 500 reports will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

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

      Required. A page token, received from a previous ListUtilizationReports call. Provide this to retrieve the subsequent page.

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

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

      Optional. The filter request.

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

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



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 923

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest

  # 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_utilization_reports..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::VMMigration::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_utilization_reports.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_utilization_reports.retry_policy

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

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


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

def logger
  @vm_migration_stub.logger
end

#pause_migration(request, options = nil) ⇒ ::Gapic::Operation #pause_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the pause_migration method.
result = client.pause_migration 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:

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

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

    Parameters:

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

  • #pause_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to pause_migration 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:

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

      Required. The name of the MigratingVm.

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.



2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2563

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest

  # 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.pause_migration..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::VMMigration::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.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  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.pause_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.pause_migration.retry_policy

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

  @vm_migration_stub.call_rpc :pause_migration, 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

#remove_group_migration(request, options = nil) ⇒ ::Gapic::Operation #remove_group_migration(group: nil, migrating_vm: nil) ⇒ ::Gapic::Operation

Removes a MigratingVm from a Group.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the remove_group_migration method.
result = client.remove_group_migration 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:

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

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

    Parameters:

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

  • #remove_group_migration(group: nil, migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to remove_group_migration 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:

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

      Required. The name of the Group.

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

      The MigratingVm to remove.

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.



4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4171

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest

  # 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.remove_group_migration..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::VMMigration::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.group
    header_params["group"] = request.group
  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.remove_group_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.remove_group_migration.retry_policy

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

  @vm_migration_stub.call_rpc :remove_group_migration, 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

#resume_migration(request, options = nil) ⇒ ::Gapic::Operation #resume_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the resume_migration method.
result = client.resume_migration 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:

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

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

    Parameters:

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

  • #resume_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to resume_migration 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:

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

      Required. The name of the MigratingVm.

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.



2467
2468
2469
2470
2471
2472
2473
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2467

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest

  # 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.resume_migration..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::VMMigration::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.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  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.resume_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.resume_migration.retry_policy

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

  @vm_migration_stub.call_rpc :resume_migration, 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_migration(request, options = nil) ⇒ ::Gapic::Operation #start_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the start_migration method.
result = client.start_migration 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:

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::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_migration(migrating_vm: nil) ⇒ ::Gapic::Operation

    Pass arguments to start_migration 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:

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

      Required. The name of the MigratingVm.

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.



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
2405
2406
2407
2408
2409
2410
2411
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2370

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest

  # 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_migration..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::VMMigration::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.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  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_migration.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_migration.retry_policy

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

  @vm_migration_stub.call_rpc :start_migration, 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

#universe_domainString

The effective universe domain

Returns:

  • (String)


114
115
116
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 114

def universe_domain
  @vm_migration_stub.universe_domain
end

#update_group(request, options = nil) ⇒ ::Gapic::Operation #update_group(update_mask: nil, group: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the parameters of a single Group.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::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_group(update_mask: nil, group: nil, request_id: nil) ⇒ ::Gapic::Operation

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

      Field mask is used to specify the fields to be overwritten in the Group 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.

    • group (::Google::Cloud::VMMigration::V1::Group, ::Hash) (defaults to: nil)

      Required. The update request body.

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

      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 t he 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.



3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 3871

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest

  # 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_group..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::VMMigration::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.group&.name
    header_params["group.name"] = request.group.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_group.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_group.retry_policy

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

  @vm_migration_stub.call_rpc :update_group, 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_migrating_vm(request, options = nil) ⇒ ::Gapic::Operation #update_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the parameters of a single MigratingVm.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::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_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) ⇒ ::Gapic::Operation

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

      Field mask is used to specify the fields to be overwritten in the MigratingVm 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.

    • migrating_vm (::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash) (defaults to: nil)

      Required. The update request body.

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

      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 t he 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.



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
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 2181

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest

  # 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_migrating_vm..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::VMMigration::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.migrating_vm&.name
    header_params["migrating_vm.name"] = request.migrating_vm.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_migrating_vm.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :update_migrating_vm, 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_source(request, options = nil) ⇒ ::Gapic::Operation #update_source(update_mask: nil, source: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the parameters of a single Source.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::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_source(update_mask: nil, source: nil, request_id: nil) ⇒ ::Gapic::Operation

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

      Field mask is used to specify the fields to be overwritten in the Source 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.

    • source (::Google::Cloud::VMMigration::V1::Source, ::Hash) (defaults to: nil)

      Required. The update request body.

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

      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 t he 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.



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 614

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest

  # 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_source..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::VMMigration::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.source&.name
    header_params["source.name"] = request.source.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_source.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_source.retry_policy

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

  @vm_migration_stub.call_rpc :update_source, 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_target_project(request, options = nil) ⇒ ::Gapic::Operation #update_target_project(update_mask: nil, target_project: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates the parameters of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::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_target_project(update_mask: nil, target_project: nil, request_id: nil) ⇒ ::Gapic::Operation

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

      Field mask is used to specify the fields to be overwritten in the TargetProject 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.

    • target_project (::Google::Cloud::VMMigration::V1::TargetProject, ::Hash) (defaults to: nil)

      Required. The update request body.

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

      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 t he 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.



4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 4600

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest

  # 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_target_project..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::VMMigration::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.target_project&.name
    header_params["target_project.name"] = request.target_project.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_target_project.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :update_target_project, 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

#upgrade_appliance(request, options = nil) ⇒ ::Gapic::Operation #upgrade_appliance(datacenter_connector: nil, request_id: nil) ⇒ ::Gapic::Operation

Upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.

Examples:

Basic example

require "google/cloud/vm_migration/v1"

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

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

# Call the upgrade_appliance method.
result = client.upgrade_appliance 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:

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

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

    Parameters:

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

  • #upgrade_appliance(datacenter_connector: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to upgrade_appliance 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:

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

      Required. The DatacenterConnector name.

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

      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 t he 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.



1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
# File 'lib/google/cloud/vm_migration/v1/vm_migration/client.rb', line 1760

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest

  # 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.upgrade_appliance..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::VMMigration::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.datacenter_connector
    header_params["datacenter_connector"] = request.datacenter_connector
  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.upgrade_appliance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.upgrade_appliance.retry_policy

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

  @vm_migration_stub.call_rpc :upgrade_appliance, 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