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

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

Overview

REST 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 REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the VmMigration client.

Yield Parameters:



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

def initialize
  # 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 = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::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 = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @vm_migration_stub.logger(stub: true)&.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::Rest::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.bindings_override = @config.bindings_override
    config.logger = @vm_migration_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::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::Rest::Client (readonly)

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

Returns:

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


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

def iam_policy_client
  @iam_policy_client
end

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

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

Returns:

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


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

def location_client
  @location_client
end

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

Get the associated client for long-running operations.



207
208
209
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 207

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::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 66

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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3809

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.add_group_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2682

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.cancel_clone_job request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3053
3054
3055
3056
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3053

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.cancel_cutover_job request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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:



106
107
108
109
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 106

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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2595

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_clone_job request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2966
2967
2968
2969
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2966

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_cutover_job request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1452

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_datacenter_connector request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3512

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_group request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call 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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1760

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_migrating_vm request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 479

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_source request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4189

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_target_project request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1065

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.create_utilization_report request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



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
1585
1586
1587
1588
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1553

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_datacenter_connector request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3720

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_group request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2135

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_migrating_vm request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 687

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_source request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4403

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_target_project request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



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

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.delete_utilization_report request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 774

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.fetch_inventory request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2490

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.finalize_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



2861
2862
2863
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2861

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_clone_job request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3232

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_cutover_job request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_datacenter_connector request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3409

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_group request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1943

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_migrating_vm request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4582

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_replication_cycle request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 376

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_source request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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/rest/client.rb', line 4083

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_target_project request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 957

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.get_utilization_report request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_clone_jobs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_clone_jobs, "clone_jobs", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_cutover_jobs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob> #list_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3152

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_cutover_jobs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_cutover_jobs, "cutover_jobs", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_datacenter_connectors(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector> #list_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1266

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_datacenter_connectors request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, "datacenter_connectors", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_groups(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group> #list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3329

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_groups request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_groups, "groups", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_migrating_vms(request, options = nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 1861

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_migrating_vms request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, "migrating_vms", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_replication_cycles(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle> #list_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4502

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_replication_cycles request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, "replication_cycles", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_sources(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source> #list_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



296
297
298
299
300
301
302
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
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 296

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_sources request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_sources, "sources", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_target_projects(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject> #list_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4000

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_target_projects request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_target_projects, "target_projects", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_utilization_reports(request, options = nil) ⇒ ::Gapic::Rest::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::Rest::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::Rest::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::Rest::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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 874

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.list_utilization_reports request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, "utilization_reports", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


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

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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2402

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.pause_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3898

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.remove_group_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2313

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.resume_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2223

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.start_migration request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


116
117
118
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 116

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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 3619

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_group request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 2048

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_migrating_vm request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 586

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_source request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
# File 'lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb', line 4299

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.update_target_project request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => 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::Rest::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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



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

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,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  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.upgrade_appliance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end