google-cloud-filestore-v1 0.5.0 → 0.7.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: 5209525b3af543f94ab2597da4c637f46b697457b9a8901697c703965e7b12c8
4
- data.tar.gz: 3d44b32f68dcbe8911c39506c2f40d6bcf5d6a92c857831737b550976666a9bf
3
+ metadata.gz: cfb3776e64c5b473cfb007b81019634418f3a6324e624f596c53ea9c53cf7ecd
4
+ data.tar.gz: 7c3fdac0965edb54698792b1ba08903083140c454810c6ff5573571f8876e4ed
5
5
  SHA512:
6
- metadata.gz: a7285622e0b879fe37867e191871b2783afd0ea5f2019f57693f563f2a9aef981ed44dfe83d9af47cdbdc6df35f5a96a9ee2d33838f9b2dd62fa4b07ff6835d3
7
- data.tar.gz: 8557b73a45da846ec8c3dd0e69cf1ace2da5069e00545df6d137bab26208ec82d8150b71c4b24d3fbe4bea779446f05c9975e463aac303b3f0f5ce0ff787f5e0
6
+ metadata.gz: 2a13b216d5c20f4fd1e48b86f6e701061d38275cdb3e905b2ad8bdc00a5d200b17c044f43f49e6a3b9fa21f7ab6edf5f035f5552f81373ccb56f2adcf37bd628
7
+ data.tar.gz: 4824c28d05739d90457ac4b552cf6205fb98e77fc99cc352ce19713c11310a5501e5d2975d77419d1735add8e6e6b57a4b606859a4ebb7c17f594bde8cc406f2
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Filestore
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/filestore/v1/rest"
28
+ # client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Rest::Client.new
29
+ #
30
+ module V1
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "Filestore"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v1/{name}",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
57
+
58
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
59
+ uri_method: :get,
60
+ uri_template: "/v1/{name}/locations",
61
+ matches: [
62
+ ["name", %r{^projects/[^/]+/?$}, false]
63
+ ],
64
+ body: nil
65
+ )
66
+ ]
67
+ default_config
68
+ end
69
+ yield @configure if block_given?
70
+ @configure
71
+ end
72
+
73
+ ##
74
+ # @private
75
+ # Configuration class for the google.cloud.filestore.v1 package.
76
+ #
77
+ # This class contains common configuration for all services
78
+ # of the google.cloud.filestore.v1 package.
79
+ #
80
+ # This configuration is for internal use of the client library classes,
81
+ # and it is not intended that the end-users will read or change it.
82
+ #
83
+ class Configuration
84
+ extend ::Gapic::Config
85
+
86
+ # @private
87
+ # Overrides for http bindings for the RPC of the mixins for this package.
88
+ # Services in this package should use these when creating clients for the mixin services.
89
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
90
+ config_attr :bindings_override, {}, ::Hash, nil
91
+
92
+ # @private
93
+ def initialize parent_config = nil
94
+ @parent_config = parent_config unless parent_config.nil?
95
+
96
+ yield self if block_given?
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -18,6 +18,7 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/filestore/v1/cloud_filestore_service_pb"
21
+ require "google/cloud/location"
21
22
 
22
23
  module Google
23
24
  module Cloud
@@ -191,12 +192,19 @@ module Google
191
192
  config.endpoint = @config.endpoint
192
193
  end
193
194
 
195
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
196
+ config.credentials = credentials
197
+ config.quota_project = @quota_project_id
198
+ config.endpoint = @config.endpoint
199
+ end
200
+
194
201
  @cloud_filestore_manager_stub = ::Gapic::ServiceStub.new(
195
202
  ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Stub,
196
203
  credentials: credentials,
197
204
  endpoint: @config.endpoint,
198
205
  channel_args: @config.channel_args,
199
- interceptors: @config.interceptors
206
+ interceptors: @config.interceptors,
207
+ channel_pool_config: @config.channel_pool
200
208
  )
201
209
  end
202
210
 
@@ -207,6 +215,13 @@ module Google
207
215
  #
208
216
  attr_reader :operations_client
209
217
 
218
+ ##
219
+ # Get the associated client for mix-in of the Locations.
220
+ #
221
+ # @return [Google::Cloud::Location::Locations::Client]
222
+ #
223
+ attr_reader :location_client
224
+
210
225
  # Service calls
211
226
 
212
227
  ##
@@ -708,6 +723,105 @@ module Google
708
723
  raise ::Google::Cloud::Error.from_error(e)
709
724
  end
710
725
 
726
+ ##
727
+ # Revert an existing instance's file system to a specified snapshot.
728
+ #
729
+ # @overload revert_instance(request, options = nil)
730
+ # Pass arguments to `revert_instance` via a request object, either of type
731
+ # {::Google::Cloud::Filestore::V1::RevertInstanceRequest} or an equivalent Hash.
732
+ #
733
+ # @param request [::Google::Cloud::Filestore::V1::RevertInstanceRequest, ::Hash]
734
+ # A request object representing the call parameters. Required. To specify no
735
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
736
+ # @param options [::Gapic::CallOptions, ::Hash]
737
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
738
+ #
739
+ # @overload revert_instance(name: nil, target_snapshot_id: nil)
740
+ # Pass arguments to `revert_instance` via keyword arguments. Note that at
741
+ # least one keyword argument is required. To specify no parameters, or to keep all
742
+ # the default parameter values, pass an empty Hash as a request object (see above).
743
+ #
744
+ # @param name [::String]
745
+ # Required.
746
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
747
+ # The resource name of the instance, in the format
748
+ # @param target_snapshot_id [::String]
749
+ # Required. The snapshot resource ID, in the format 'my-snapshot', where the
750
+ # specified ID is the \\{snapshot_id} of the fully qualified name like
751
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`
752
+ #
753
+ # @yield [response, operation] Access the result along with the RPC operation
754
+ # @yieldparam response [::Gapic::Operation]
755
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
756
+ #
757
+ # @return [::Gapic::Operation]
758
+ #
759
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
760
+ #
761
+ # @example Basic example
762
+ # require "google/cloud/filestore/v1"
763
+ #
764
+ # # Create a client object. The client can be reused for multiple calls.
765
+ # client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
766
+ #
767
+ # # Create a request. To set request fields, pass in keyword arguments.
768
+ # request = Google::Cloud::Filestore::V1::RevertInstanceRequest.new
769
+ #
770
+ # # Call the revert_instance method.
771
+ # result = client.revert_instance request
772
+ #
773
+ # # The returned object is of type Gapic::Operation. You can use it to
774
+ # # check the status of an operation, cancel it, or wait for results.
775
+ # # Here is how to wait for a response.
776
+ # result.wait_until_done! timeout: 60
777
+ # if result.response?
778
+ # p result.response
779
+ # else
780
+ # puts "No response received."
781
+ # end
782
+ #
783
+ def revert_instance request, options = nil
784
+ raise ::ArgumentError, "request must be provided" if request.nil?
785
+
786
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::RevertInstanceRequest
787
+
788
+ # Converts hash and nil to an options object
789
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
790
+
791
+ # Customize the options with defaults
792
+ metadata = @config.rpcs.revert_instance.metadata.to_h
793
+
794
+ # Set x-goog-api-client and x-goog-user-project headers
795
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
796
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
797
+ gapic_version: ::Google::Cloud::Filestore::V1::VERSION
798
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
799
+
800
+ header_params = {}
801
+ if request.name
802
+ header_params["name"] = request.name
803
+ end
804
+
805
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
806
+ metadata[:"x-goog-request-params"] ||= request_params_header
807
+
808
+ options.apply_defaults timeout: @config.rpcs.revert_instance.timeout,
809
+ metadata: metadata,
810
+ retry_policy: @config.rpcs.revert_instance.retry_policy
811
+
812
+ options.apply_defaults timeout: @config.timeout,
813
+ metadata: @config.metadata,
814
+ retry_policy: @config.retry_policy
815
+
816
+ @cloud_filestore_manager_stub.call_rpc :revert_instance, request, options: options do |response, operation|
817
+ response = ::Gapic::Operation.new response, @operations_client, options: options
818
+ yield response, operation if block_given?
819
+ return response
820
+ end
821
+ rescue ::GRPC::BadStatus => e
822
+ raise ::Google::Cloud::Error.from_error(e)
823
+ end
824
+
711
825
  ##
712
826
  # Deletes an instance.
713
827
  #
@@ -1890,6 +2004,14 @@ module Google
1890
2004
  end
1891
2005
  end
1892
2006
 
2007
+ ##
2008
+ # Configuration for the channel pool
2009
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2010
+ #
2011
+ def channel_pool
2012
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2013
+ end
2014
+
1893
2015
  ##
1894
2016
  # Configuration RPC class for the CloudFilestoreManager API.
1895
2017
  #
@@ -1934,6 +2056,11 @@ module Google
1934
2056
  #
1935
2057
  attr_reader :restore_instance
1936
2058
  ##
2059
+ # RPC-specific configuration for `revert_instance`
2060
+ # @return [::Gapic::Config::Method]
2061
+ #
2062
+ attr_reader :revert_instance
2063
+ ##
1937
2064
  # RPC-specific configuration for `delete_instance`
1938
2065
  # @return [::Gapic::Config::Method]
1939
2066
  #
@@ -2001,6 +2128,8 @@ module Google
2001
2128
  @update_instance = ::Gapic::Config::Method.new update_instance_config
2002
2129
  restore_instance_config = parent_rpcs.restore_instance if parent_rpcs.respond_to? :restore_instance
2003
2130
  @restore_instance = ::Gapic::Config::Method.new restore_instance_config
2131
+ revert_instance_config = parent_rpcs.revert_instance if parent_rpcs.respond_to? :revert_instance
2132
+ @revert_instance = ::Gapic::Config::Method.new revert_instance_config
2004
2133
  delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
2005
2134
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
2006
2135
  list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -701,6 +702,14 @@ module Google
701
702
  end
702
703
  end
703
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
704
713
  ##
705
714
  # Configuration RPC class for the Operations API.
706
715
  #