google-cloud-vm_migration-v1 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d37ba3a7ce9890c0507ec039eb6e3f8884b375cfb8ca6bba7d1dfee2a10b9436
4
- data.tar.gz: 2103cc017d7d8e3db5fbc8eb09d8c957b73f2805ec9ce2f76dc1f91d89b481e5
3
+ metadata.gz: f1a7b21b9ceb7fb0fb74bc6d87982ca2f325508255fabb29002f2d5d41142a93
4
+ data.tar.gz: eb0cd904ee33122798df3bba81dc6ceff8a8e9e5f3d9946894c9e49ab8bb8bd5
5
5
  SHA512:
6
- metadata.gz: 3d552cd9c7b863fa2db0d1cb9fbc0ac85dd720677a635acb34ccca8b947895dd5e5370ffa396edb317a28db5b64720ab0e0685119398f1043a50fd59ac1764b2
7
- data.tar.gz: 91476fbf742843087e24187a1270d5455a40389ded629a3ab020a87fbf6942ee4d72dd0eb14a836634da50e48b18a9fbadc0c88e50bb29ce75d39a0bd555305f
6
+ metadata.gz: e4221887a0ce71e8bf8650e9094735ed2e0f4a0bbc1268523d3742a94b1c896a5caeeafd800f71707d7b5fb848aae81758a2ff634c17124c0e8243ca3647d29c
7
+ data.tar.gz: 6748582517ca2cad348072857a0cab7323363524fc1314d4e2aab5073330f3ff0eb4df4b2dcf931e8fa63b04b713913c4fa2106e421331b89fe3e10a4ea0cddf
data/AUTHENTICATION.md CHANGED
@@ -112,7 +112,7 @@ credentials are discovered.
112
112
  To configure your system for this, simply:
113
113
 
114
114
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
115
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
115
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
116
116
  3. Write code as if already authenticated.
117
117
 
118
118
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module VMMigration
23
23
  module V1
24
- VERSION = "0.3.0"
24
+ VERSION = "0.4.0"
25
25
  end
26
26
  end
27
27
  end
@@ -18,6 +18,8 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/vmmigration/v1/vmmigration_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
21
23
 
22
24
  module Google
23
25
  module Cloud
@@ -147,6 +149,18 @@ module Google
147
149
  config.endpoint = @config.endpoint
148
150
  end
149
151
 
152
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
153
+ config.credentials = credentials
154
+ config.quota_project = @quota_project_id
155
+ config.endpoint = @config.endpoint
156
+ end
157
+
158
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ end
163
+
150
164
  @vm_migration_stub = ::Gapic::ServiceStub.new(
151
165
  ::Google::Cloud::VMMigration::V1::VmMigration::Stub,
152
166
  credentials: credentials,
@@ -163,6 +177,20 @@ module Google
163
177
  #
164
178
  attr_reader :operations_client
165
179
 
180
+ ##
181
+ # Get the associated client for mix-in of the Locations.
182
+ #
183
+ # @return [Google::Cloud::Location::Locations::Client]
184
+ #
185
+ attr_reader :location_client
186
+
187
+ ##
188
+ # Get the associated client for mix-in of the IAMPolicy.
189
+ #
190
+ # @return [Google::Iam::V1::IAMPolicy::Client]
191
+ #
192
+ attr_reader :iam_policy_client
193
+
166
194
  # Service calls
167
195
 
168
196
  ##
@@ -4660,6 +4688,198 @@ module Google
4660
4688
  raise ::Google::Cloud::Error.from_error(e)
4661
4689
  end
4662
4690
 
4691
+ ##
4692
+ # Lists ReplicationCycles in a given MigratingVM.
4693
+ #
4694
+ # @overload list_replication_cycles(request, options = nil)
4695
+ # Pass arguments to `list_replication_cycles` via a request object, either of type
4696
+ # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash.
4697
+ #
4698
+ # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash]
4699
+ # A request object representing the call parameters. Required. To specify no
4700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4701
+ # @param options [::Gapic::CallOptions, ::Hash]
4702
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4703
+ #
4704
+ # @overload list_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
4705
+ # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at
4706
+ # least one keyword argument is required. To specify no parameters, or to keep all
4707
+ # the default parameter values, pass an empty Hash as a request object (see above).
4708
+ #
4709
+ # @param parent [::String]
4710
+ # Required. The parent, which owns this collection of ReplicationCycles.
4711
+ # @param page_size [::Integer]
4712
+ # Optional. The maximum number of replication cycles to return. The service
4713
+ # may return fewer than this value. If unspecified, at most 100 migrating VMs
4714
+ # will be returned. The maximum value is 100; values above 100 will be
4715
+ # coerced to 100.
4716
+ # @param page_token [::String]
4717
+ # Required. A page token, received from a previous `ListReplicationCycles`
4718
+ # call. Provide this to retrieve the subsequent page.
4719
+ #
4720
+ # When paginating, all other parameters provided to `ListReplicationCycles`
4721
+ # must match the call that provided the page token.
4722
+ # @param filter [::String]
4723
+ # Optional. The filter request.
4724
+ # @param order_by [::String]
4725
+ # Optional. the order by fields for the result.
4726
+ #
4727
+ # @yield [response, operation] Access the result along with the RPC operation
4728
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4729
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4730
+ #
4731
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>]
4732
+ #
4733
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4734
+ #
4735
+ # @example Basic example
4736
+ # require "google/cloud/vm_migration/v1"
4737
+ #
4738
+ # # Create a client object. The client can be reused for multiple calls.
4739
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4740
+ #
4741
+ # # Create a request. To set request fields, pass in keyword arguments.
4742
+ # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new
4743
+ #
4744
+ # # Call the list_replication_cycles method.
4745
+ # result = client.list_replication_cycles request
4746
+ #
4747
+ # # The returned object is of type Gapic::PagedEnumerable. You can
4748
+ # # iterate over all elements by calling #each, and the enumerable
4749
+ # # will lazily make API calls to fetch subsequent pages. Other
4750
+ # # methods are also available for managing paging directly.
4751
+ # result.each do |response|
4752
+ # # Each element is of type ::Google::Cloud::VMMigration::V1::ReplicationCycle.
4753
+ # p response
4754
+ # end
4755
+ #
4756
+ def list_replication_cycles request, options = nil
4757
+ raise ::ArgumentError, "request must be provided" if request.nil?
4758
+
4759
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest
4760
+
4761
+ # Converts hash and nil to an options object
4762
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4763
+
4764
+ # Customize the options with defaults
4765
+ metadata = @config.rpcs.list_replication_cycles.metadata.to_h
4766
+
4767
+ # Set x-goog-api-client and x-goog-user-project headers
4768
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4769
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4770
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4771
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4772
+
4773
+ header_params = {}
4774
+ if request.parent
4775
+ header_params["parent"] = request.parent
4776
+ end
4777
+
4778
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4779
+ metadata[:"x-goog-request-params"] ||= request_params_header
4780
+
4781
+ options.apply_defaults timeout: @config.rpcs.list_replication_cycles.timeout,
4782
+ metadata: metadata,
4783
+ retry_policy: @config.rpcs.list_replication_cycles.retry_policy
4784
+
4785
+ options.apply_defaults timeout: @config.timeout,
4786
+ metadata: @config.metadata,
4787
+ retry_policy: @config.retry_policy
4788
+
4789
+ @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation|
4790
+ response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, request, response, operation, options
4791
+ yield response, operation if block_given?
4792
+ return response
4793
+ end
4794
+ rescue ::GRPC::BadStatus => e
4795
+ raise ::Google::Cloud::Error.from_error(e)
4796
+ end
4797
+
4798
+ ##
4799
+ # Gets details of a single ReplicationCycle.
4800
+ #
4801
+ # @overload get_replication_cycle(request, options = nil)
4802
+ # Pass arguments to `get_replication_cycle` via a request object, either of type
4803
+ # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash.
4804
+ #
4805
+ # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash]
4806
+ # A request object representing the call parameters. Required. To specify no
4807
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4808
+ # @param options [::Gapic::CallOptions, ::Hash]
4809
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4810
+ #
4811
+ # @overload get_replication_cycle(name: nil)
4812
+ # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at
4813
+ # least one keyword argument is required. To specify no parameters, or to keep all
4814
+ # the default parameter values, pass an empty Hash as a request object (see above).
4815
+ #
4816
+ # @param name [::String]
4817
+ # Required. The name of the ReplicationCycle.
4818
+ #
4819
+ # @yield [response, operation] Access the result along with the RPC operation
4820
+ # @yieldparam response [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4821
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4822
+ #
4823
+ # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle]
4824
+ #
4825
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4826
+ #
4827
+ # @example Basic example
4828
+ # require "google/cloud/vm_migration/v1"
4829
+ #
4830
+ # # Create a client object. The client can be reused for multiple calls.
4831
+ # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new
4832
+ #
4833
+ # # Create a request. To set request fields, pass in keyword arguments.
4834
+ # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new
4835
+ #
4836
+ # # Call the get_replication_cycle method.
4837
+ # result = client.get_replication_cycle request
4838
+ #
4839
+ # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle.
4840
+ # p result
4841
+ #
4842
+ def get_replication_cycle request, options = nil
4843
+ raise ::ArgumentError, "request must be provided" if request.nil?
4844
+
4845
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest
4846
+
4847
+ # Converts hash and nil to an options object
4848
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4849
+
4850
+ # Customize the options with defaults
4851
+ metadata = @config.rpcs.get_replication_cycle.metadata.to_h
4852
+
4853
+ # Set x-goog-api-client and x-goog-user-project headers
4854
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4855
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4856
+ gapic_version: ::Google::Cloud::VMMigration::V1::VERSION
4857
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4858
+
4859
+ header_params = {}
4860
+ if request.name
4861
+ header_params["name"] = request.name
4862
+ end
4863
+
4864
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4865
+ metadata[:"x-goog-request-params"] ||= request_params_header
4866
+
4867
+ options.apply_defaults timeout: @config.rpcs.get_replication_cycle.timeout,
4868
+ metadata: metadata,
4869
+ retry_policy: @config.rpcs.get_replication_cycle.retry_policy
4870
+
4871
+ options.apply_defaults timeout: @config.timeout,
4872
+ metadata: @config.metadata,
4873
+ retry_policy: @config.retry_policy
4874
+
4875
+ @vm_migration_stub.call_rpc :get_replication_cycle, request, options: options do |response, operation|
4876
+ yield response, operation if block_given?
4877
+ return response
4878
+ end
4879
+ rescue ::GRPC::BadStatus => e
4880
+ raise ::Google::Cloud::Error.from_error(e)
4881
+ end
4882
+
4663
4883
  ##
4664
4884
  # Configuration class for the VmMigration API.
4665
4885
  #
@@ -5015,6 +5235,16 @@ module Google
5015
5235
  # @return [::Gapic::Config::Method]
5016
5236
  #
5017
5237
  attr_reader :delete_target_project
5238
+ ##
5239
+ # RPC-specific configuration for `list_replication_cycles`
5240
+ # @return [::Gapic::Config::Method]
5241
+ #
5242
+ attr_reader :list_replication_cycles
5243
+ ##
5244
+ # RPC-specific configuration for `get_replication_cycle`
5245
+ # @return [::Gapic::Config::Method]
5246
+ #
5247
+ attr_reader :get_replication_cycle
5018
5248
 
5019
5249
  # @private
5020
5250
  def initialize parent_rpcs = nil
@@ -5106,6 +5336,10 @@ module Google
5106
5336
  @update_target_project = ::Gapic::Config::Method.new update_target_project_config
5107
5337
  delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project
5108
5338
  @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config
5339
+ list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles
5340
+ @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config
5341
+ get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle
5342
+ @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config
5109
5343
 
5110
5344
  yield self if block_given?
5111
5345
  end
@@ -148,6 +148,29 @@ module Google
148
148
  "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}"
149
149
  end
150
150
 
151
+ ##
152
+ # Create a fully-qualified ReplicationCycle resource string.
153
+ #
154
+ # The resource will be in the following format:
155
+ #
156
+ # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}`
157
+ #
158
+ # @param project [String]
159
+ # @param location [String]
160
+ # @param source [String]
161
+ # @param migrating_vm [String]
162
+ # @param replication_cycle [String]
163
+ #
164
+ # @return [::String]
165
+ def replication_cycle_path project:, location:, source:, migrating_vm:, replication_cycle:
166
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
167
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
168
+ raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/"
169
+ raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/"
170
+
171
+ "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/replicationCycles/#{replication_cycle}"
172
+ end
173
+
151
174
  ##
152
175
  # Create a fully-qualified Source resource string.
153
176
  #
@@ -34,7 +34,7 @@ module Google
34
34
  ##
35
35
  # VM Migration Service
36
36
  #
37
- # To load this service and instantiate a client:
37
+ # @example Load this service and instantiate a gRPC client
38
38
  #
39
39
  # require "google/cloud/vm_migration/v1/vm_migration"
40
40
  # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new
@@ -23,9 +23,9 @@ module Google
23
23
  module Cloud
24
24
  module VMMigration
25
25
  ##
26
- # To load this package, including all its services, and instantiate a client:
26
+ # API client module.
27
27
  #
28
- # @example
28
+ # @example Load this package, including all its services, and instantiate a gRPC client
29
29
  #
30
30
  # require "google/cloud/vm_migration/v1"
31
31
  # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new