google-cloud-filestore-v1 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb +539 -20
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/operations.rb +2 -2
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/paths.rb +21 -0
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb +399 -20
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/operations.rb +2 -2
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb +297 -0
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest.rb +6 -6
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager.rb +6 -6
- data/lib/google/cloud/filestore/v1/cloud_filestore_service_pb.rb +69 -0
- data/lib/google/cloud/filestore/v1/cloud_filestore_service_services_pb.rb +17 -6
- data/lib/google/cloud/filestore/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +9 -3
- data/proto_docs/google/cloud/filestore/v1/cloud_filestore_service.rb +237 -29
- metadata +2 -2
@@ -27,23 +27,23 @@ module Google
|
|
27
27
|
##
|
28
28
|
# Client for the CloudFilestoreManager service.
|
29
29
|
#
|
30
|
-
# Configures and manages
|
30
|
+
# Configures and manages Filestore resources.
|
31
31
|
#
|
32
|
-
#
|
32
|
+
# Filestore Manager v1.
|
33
33
|
#
|
34
|
-
# The `file.googleapis.com` service implements the
|
34
|
+
# The `file.googleapis.com` service implements the Filestore API and
|
35
35
|
# defines the following resource model for managing instances:
|
36
36
|
# * The service works with a collection of cloud projects, named: `/projects/*`
|
37
37
|
# * Each project has a collection of available locations, named: `/locations/*`
|
38
38
|
# * Each location has a collection of instances and backups, named:
|
39
39
|
# `/instances/*` and `/backups/*` respectively.
|
40
|
-
# * As such,
|
40
|
+
# * As such, Filestore instances are resources of the form:
|
41
41
|
# `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
|
42
42
|
# and backups are resources of the form:
|
43
43
|
# `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
|
44
44
|
#
|
45
|
-
# Note that location_id must be a
|
46
|
-
# `region` for backups; for example:
|
45
|
+
# Note that location_id must be a Google Cloud `zone` for instances, but
|
46
|
+
# a Google Cloud `region` for backups; for example:
|
47
47
|
# * `projects/12345/locations/us-central1-c/instances/my-filestore`
|
48
48
|
# * `projects/12345/locations/us-central1/backups/my-backup`
|
49
49
|
#
|
@@ -231,8 +231,9 @@ module Google
|
|
231
231
|
# @param parent [::String]
|
232
232
|
# Required. The project and location for which to retrieve instance
|
233
233
|
# information, in the format `projects/{project_id}/locations/{location}`. In
|
234
|
-
# Cloud Filestore, locations map to
|
235
|
-
# retrieve instance information for all locations, use "-"
|
234
|
+
# Cloud Filestore, locations map to Google Cloud zones, for example
|
235
|
+
# **us-west1-b**. To retrieve instance information for all locations, use "-"
|
236
|
+
# for the
|
236
237
|
# `{location}` value.
|
237
238
|
# @param page_size [::Integer]
|
238
239
|
# The maximum number of items to return.
|
@@ -422,8 +423,8 @@ module Google
|
|
422
423
|
#
|
423
424
|
# @param parent [::String]
|
424
425
|
# Required. The instance's project and location, in the format
|
425
|
-
# `projects/{project_id}/locations/{location}`. In
|
426
|
-
# locations map to
|
426
|
+
# `projects/{project_id}/locations/{location}`. In Filestore,
|
427
|
+
# locations map to Google Cloud zones, for example **us-west1-b**.
|
427
428
|
# @param instance_id [::String]
|
428
429
|
# Required. The name of the instance to create.
|
429
430
|
# The name must be unique for the specified project and location.
|
@@ -629,8 +630,8 @@ module Google
|
|
629
630
|
# Required. The resource name of the instance, in the format
|
630
631
|
# `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
|
631
632
|
# @param file_share [::String]
|
632
|
-
# Required. Name of the file share in the
|
633
|
-
#
|
633
|
+
# Required. Name of the file share in the Filestore instance that the backup
|
634
|
+
# is being restored to.
|
634
635
|
# @param source_backup [::String]
|
635
636
|
# The resource name of the backup, in the format
|
636
637
|
# `projects/{project_number}/locations/{location_id}/backups/{backup_id}`.
|
@@ -720,7 +721,7 @@ module Google
|
|
720
721
|
# @param options [::Gapic::CallOptions, ::Hash]
|
721
722
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
722
723
|
#
|
723
|
-
# @overload delete_instance(name: nil)
|
724
|
+
# @overload delete_instance(name: nil, force: nil)
|
724
725
|
# Pass arguments to `delete_instance` via keyword arguments. Note that at
|
725
726
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
726
727
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -728,6 +729,9 @@ module Google
|
|
728
729
|
# @param name [::String]
|
729
730
|
# Required. The instance resource name, in the format
|
730
731
|
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
732
|
+
# @param force [::Boolean]
|
733
|
+
# If set to true, all snapshots of the instance will also be deleted.
|
734
|
+
# (Otherwise, the request will only work if the instance has no snapshots.)
|
731
735
|
#
|
732
736
|
# @yield [response, operation] Access the result along with the RPC operation
|
733
737
|
# @yieldparam response [::Gapic::Operation]
|
@@ -801,6 +805,486 @@ module Google
|
|
801
805
|
raise ::Google::Cloud::Error.from_error(e)
|
802
806
|
end
|
803
807
|
|
808
|
+
##
|
809
|
+
# Lists all snapshots in a project for either a specified location
|
810
|
+
# or for all locations.
|
811
|
+
#
|
812
|
+
# @overload list_snapshots(request, options = nil)
|
813
|
+
# Pass arguments to `list_snapshots` via a request object, either of type
|
814
|
+
# {::Google::Cloud::Filestore::V1::ListSnapshotsRequest} or an equivalent Hash.
|
815
|
+
#
|
816
|
+
# @param request [::Google::Cloud::Filestore::V1::ListSnapshotsRequest, ::Hash]
|
817
|
+
# A request object representing the call parameters. Required. To specify no
|
818
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
819
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
820
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
821
|
+
#
|
822
|
+
# @overload list_snapshots(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil)
|
823
|
+
# Pass arguments to `list_snapshots` via keyword arguments. Note that at
|
824
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
825
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
826
|
+
#
|
827
|
+
# @param parent [::String]
|
828
|
+
# Required. The instance for which to retrieve snapshot information,
|
829
|
+
# in the format
|
830
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`.
|
831
|
+
# @param page_size [::Integer]
|
832
|
+
# The maximum number of items to return.
|
833
|
+
# @param page_token [::String]
|
834
|
+
# The next_page_token value to use if there are additional
|
835
|
+
# results to retrieve for this list request.
|
836
|
+
# @param order_by [::String]
|
837
|
+
# Sort results. Supported values are "name", "name desc" or "" (unsorted).
|
838
|
+
# @param filter [::String]
|
839
|
+
# List filter.
|
840
|
+
#
|
841
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
842
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Snapshot>]
|
843
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
844
|
+
#
|
845
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Snapshot>]
|
846
|
+
#
|
847
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
848
|
+
#
|
849
|
+
# @example Basic example
|
850
|
+
# require "google/cloud/filestore/v1"
|
851
|
+
#
|
852
|
+
# # Create a client object. The client can be reused for multiple calls.
|
853
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
854
|
+
#
|
855
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
856
|
+
# request = Google::Cloud::Filestore::V1::ListSnapshotsRequest.new
|
857
|
+
#
|
858
|
+
# # Call the list_snapshots method.
|
859
|
+
# result = client.list_snapshots request
|
860
|
+
#
|
861
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
862
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
863
|
+
# result.each do |item|
|
864
|
+
# # Each element is of type ::Google::Cloud::Filestore::V1::Snapshot.
|
865
|
+
# p item
|
866
|
+
# end
|
867
|
+
#
|
868
|
+
def list_snapshots request, options = nil
|
869
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
870
|
+
|
871
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::ListSnapshotsRequest
|
872
|
+
|
873
|
+
# Converts hash and nil to an options object
|
874
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
875
|
+
|
876
|
+
# Customize the options with defaults
|
877
|
+
metadata = @config.rpcs.list_snapshots.metadata.to_h
|
878
|
+
|
879
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
880
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
881
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
882
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
883
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
884
|
+
|
885
|
+
header_params = {}
|
886
|
+
if request.parent
|
887
|
+
header_params["parent"] = request.parent
|
888
|
+
end
|
889
|
+
|
890
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
891
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
892
|
+
|
893
|
+
options.apply_defaults timeout: @config.rpcs.list_snapshots.timeout,
|
894
|
+
metadata: metadata,
|
895
|
+
retry_policy: @config.rpcs.list_snapshots.retry_policy
|
896
|
+
|
897
|
+
options.apply_defaults timeout: @config.timeout,
|
898
|
+
metadata: @config.metadata,
|
899
|
+
retry_policy: @config.retry_policy
|
900
|
+
|
901
|
+
@cloud_filestore_manager_stub.call_rpc :list_snapshots, request, options: options do |response, operation|
|
902
|
+
response = ::Gapic::PagedEnumerable.new @cloud_filestore_manager_stub, :list_snapshots, request, response, operation, options
|
903
|
+
yield response, operation if block_given?
|
904
|
+
return response
|
905
|
+
end
|
906
|
+
rescue ::GRPC::BadStatus => e
|
907
|
+
raise ::Google::Cloud::Error.from_error(e)
|
908
|
+
end
|
909
|
+
|
910
|
+
##
|
911
|
+
# Gets the details of a specific snapshot.
|
912
|
+
#
|
913
|
+
# @overload get_snapshot(request, options = nil)
|
914
|
+
# Pass arguments to `get_snapshot` via a request object, either of type
|
915
|
+
# {::Google::Cloud::Filestore::V1::GetSnapshotRequest} or an equivalent Hash.
|
916
|
+
#
|
917
|
+
# @param request [::Google::Cloud::Filestore::V1::GetSnapshotRequest, ::Hash]
|
918
|
+
# A request object representing the call parameters. Required. To specify no
|
919
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
920
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
921
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
922
|
+
#
|
923
|
+
# @overload get_snapshot(name: nil)
|
924
|
+
# Pass arguments to `get_snapshot` via keyword arguments. Note that at
|
925
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
926
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
927
|
+
#
|
928
|
+
# @param name [::String]
|
929
|
+
# Required. The snapshot resource name, in the format
|
930
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
|
931
|
+
#
|
932
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
933
|
+
# @yieldparam response [::Google::Cloud::Filestore::V1::Snapshot]
|
934
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
935
|
+
#
|
936
|
+
# @return [::Google::Cloud::Filestore::V1::Snapshot]
|
937
|
+
#
|
938
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
939
|
+
#
|
940
|
+
# @example Basic example
|
941
|
+
# require "google/cloud/filestore/v1"
|
942
|
+
#
|
943
|
+
# # Create a client object. The client can be reused for multiple calls.
|
944
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
945
|
+
#
|
946
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
947
|
+
# request = Google::Cloud::Filestore::V1::GetSnapshotRequest.new
|
948
|
+
#
|
949
|
+
# # Call the get_snapshot method.
|
950
|
+
# result = client.get_snapshot request
|
951
|
+
#
|
952
|
+
# # The returned object is of type Google::Cloud::Filestore::V1::Snapshot.
|
953
|
+
# p result
|
954
|
+
#
|
955
|
+
def get_snapshot request, options = nil
|
956
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
957
|
+
|
958
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::GetSnapshotRequest
|
959
|
+
|
960
|
+
# Converts hash and nil to an options object
|
961
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
962
|
+
|
963
|
+
# Customize the options with defaults
|
964
|
+
metadata = @config.rpcs.get_snapshot.metadata.to_h
|
965
|
+
|
966
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
967
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
968
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
969
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
970
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
971
|
+
|
972
|
+
header_params = {}
|
973
|
+
if request.name
|
974
|
+
header_params["name"] = request.name
|
975
|
+
end
|
976
|
+
|
977
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
978
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
979
|
+
|
980
|
+
options.apply_defaults timeout: @config.rpcs.get_snapshot.timeout,
|
981
|
+
metadata: metadata,
|
982
|
+
retry_policy: @config.rpcs.get_snapshot.retry_policy
|
983
|
+
|
984
|
+
options.apply_defaults timeout: @config.timeout,
|
985
|
+
metadata: @config.metadata,
|
986
|
+
retry_policy: @config.retry_policy
|
987
|
+
|
988
|
+
@cloud_filestore_manager_stub.call_rpc :get_snapshot, request, options: options do |response, operation|
|
989
|
+
yield response, operation if block_given?
|
990
|
+
return response
|
991
|
+
end
|
992
|
+
rescue ::GRPC::BadStatus => e
|
993
|
+
raise ::Google::Cloud::Error.from_error(e)
|
994
|
+
end
|
995
|
+
|
996
|
+
##
|
997
|
+
# Creates a snapshot.
|
998
|
+
#
|
999
|
+
# @overload create_snapshot(request, options = nil)
|
1000
|
+
# Pass arguments to `create_snapshot` via a request object, either of type
|
1001
|
+
# {::Google::Cloud::Filestore::V1::CreateSnapshotRequest} or an equivalent Hash.
|
1002
|
+
#
|
1003
|
+
# @param request [::Google::Cloud::Filestore::V1::CreateSnapshotRequest, ::Hash]
|
1004
|
+
# A request object representing the call parameters. Required. To specify no
|
1005
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1006
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1007
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1008
|
+
#
|
1009
|
+
# @overload create_snapshot(parent: nil, snapshot_id: nil, snapshot: nil)
|
1010
|
+
# Pass arguments to `create_snapshot` via keyword arguments. Note that at
|
1011
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1012
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1013
|
+
#
|
1014
|
+
# @param parent [::String]
|
1015
|
+
# Required. The Filestore Instance to create the snapshots of, in the format
|
1016
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}`
|
1017
|
+
# @param snapshot_id [::String]
|
1018
|
+
# Required. The ID to use for the snapshot.
|
1019
|
+
# The ID must be unique within the specified instance.
|
1020
|
+
#
|
1021
|
+
# This value must start with a lowercase letter followed by up to 62
|
1022
|
+
# lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
|
1023
|
+
# @param snapshot [::Google::Cloud::Filestore::V1::Snapshot, ::Hash]
|
1024
|
+
# Required. A snapshot resource.
|
1025
|
+
#
|
1026
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1027
|
+
# @yieldparam response [::Gapic::Operation]
|
1028
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1029
|
+
#
|
1030
|
+
# @return [::Gapic::Operation]
|
1031
|
+
#
|
1032
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1033
|
+
#
|
1034
|
+
# @example Basic example
|
1035
|
+
# require "google/cloud/filestore/v1"
|
1036
|
+
#
|
1037
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1038
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
1039
|
+
#
|
1040
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1041
|
+
# request = Google::Cloud::Filestore::V1::CreateSnapshotRequest.new
|
1042
|
+
#
|
1043
|
+
# # Call the create_snapshot method.
|
1044
|
+
# result = client.create_snapshot request
|
1045
|
+
#
|
1046
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1047
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1048
|
+
# # Here is how to wait for a response.
|
1049
|
+
# result.wait_until_done! timeout: 60
|
1050
|
+
# if result.response?
|
1051
|
+
# p result.response
|
1052
|
+
# else
|
1053
|
+
# puts "No response received."
|
1054
|
+
# end
|
1055
|
+
#
|
1056
|
+
def create_snapshot request, options = nil
|
1057
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1058
|
+
|
1059
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::CreateSnapshotRequest
|
1060
|
+
|
1061
|
+
# Converts hash and nil to an options object
|
1062
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1063
|
+
|
1064
|
+
# Customize the options with defaults
|
1065
|
+
metadata = @config.rpcs.create_snapshot.metadata.to_h
|
1066
|
+
|
1067
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1068
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1069
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1070
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
1071
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1072
|
+
|
1073
|
+
header_params = {}
|
1074
|
+
if request.parent
|
1075
|
+
header_params["parent"] = request.parent
|
1076
|
+
end
|
1077
|
+
|
1078
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1079
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1080
|
+
|
1081
|
+
options.apply_defaults timeout: @config.rpcs.create_snapshot.timeout,
|
1082
|
+
metadata: metadata,
|
1083
|
+
retry_policy: @config.rpcs.create_snapshot.retry_policy
|
1084
|
+
|
1085
|
+
options.apply_defaults timeout: @config.timeout,
|
1086
|
+
metadata: @config.metadata,
|
1087
|
+
retry_policy: @config.retry_policy
|
1088
|
+
|
1089
|
+
@cloud_filestore_manager_stub.call_rpc :create_snapshot, request, options: options do |response, operation|
|
1090
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1091
|
+
yield response, operation if block_given?
|
1092
|
+
return response
|
1093
|
+
end
|
1094
|
+
rescue ::GRPC::BadStatus => e
|
1095
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
##
|
1099
|
+
# Deletes a snapshot.
|
1100
|
+
#
|
1101
|
+
# @overload delete_snapshot(request, options = nil)
|
1102
|
+
# Pass arguments to `delete_snapshot` via a request object, either of type
|
1103
|
+
# {::Google::Cloud::Filestore::V1::DeleteSnapshotRequest} or an equivalent Hash.
|
1104
|
+
#
|
1105
|
+
# @param request [::Google::Cloud::Filestore::V1::DeleteSnapshotRequest, ::Hash]
|
1106
|
+
# A request object representing the call parameters. Required. To specify no
|
1107
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1108
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1109
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1110
|
+
#
|
1111
|
+
# @overload delete_snapshot(name: nil)
|
1112
|
+
# Pass arguments to `delete_snapshot` via keyword arguments. Note that at
|
1113
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1114
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1115
|
+
#
|
1116
|
+
# @param name [::String]
|
1117
|
+
# Required. The snapshot resource name, in the format
|
1118
|
+
# `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
|
1119
|
+
#
|
1120
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1121
|
+
# @yieldparam response [::Gapic::Operation]
|
1122
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1123
|
+
#
|
1124
|
+
# @return [::Gapic::Operation]
|
1125
|
+
#
|
1126
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1127
|
+
#
|
1128
|
+
# @example Basic example
|
1129
|
+
# require "google/cloud/filestore/v1"
|
1130
|
+
#
|
1131
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1132
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
1133
|
+
#
|
1134
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1135
|
+
# request = Google::Cloud::Filestore::V1::DeleteSnapshotRequest.new
|
1136
|
+
#
|
1137
|
+
# # Call the delete_snapshot method.
|
1138
|
+
# result = client.delete_snapshot request
|
1139
|
+
#
|
1140
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1141
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1142
|
+
# # Here is how to wait for a response.
|
1143
|
+
# result.wait_until_done! timeout: 60
|
1144
|
+
# if result.response?
|
1145
|
+
# p result.response
|
1146
|
+
# else
|
1147
|
+
# puts "No response received."
|
1148
|
+
# end
|
1149
|
+
#
|
1150
|
+
def delete_snapshot request, options = nil
|
1151
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1152
|
+
|
1153
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::DeleteSnapshotRequest
|
1154
|
+
|
1155
|
+
# Converts hash and nil to an options object
|
1156
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1157
|
+
|
1158
|
+
# Customize the options with defaults
|
1159
|
+
metadata = @config.rpcs.delete_snapshot.metadata.to_h
|
1160
|
+
|
1161
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1162
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1163
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1164
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
1165
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1166
|
+
|
1167
|
+
header_params = {}
|
1168
|
+
if request.name
|
1169
|
+
header_params["name"] = request.name
|
1170
|
+
end
|
1171
|
+
|
1172
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1173
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1174
|
+
|
1175
|
+
options.apply_defaults timeout: @config.rpcs.delete_snapshot.timeout,
|
1176
|
+
metadata: metadata,
|
1177
|
+
retry_policy: @config.rpcs.delete_snapshot.retry_policy
|
1178
|
+
|
1179
|
+
options.apply_defaults timeout: @config.timeout,
|
1180
|
+
metadata: @config.metadata,
|
1181
|
+
retry_policy: @config.retry_policy
|
1182
|
+
|
1183
|
+
@cloud_filestore_manager_stub.call_rpc :delete_snapshot, request, options: options do |response, operation|
|
1184
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1185
|
+
yield response, operation if block_given?
|
1186
|
+
return response
|
1187
|
+
end
|
1188
|
+
rescue ::GRPC::BadStatus => e
|
1189
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
##
|
1193
|
+
# Updates the settings of a specific snapshot.
|
1194
|
+
#
|
1195
|
+
# @overload update_snapshot(request, options = nil)
|
1196
|
+
# Pass arguments to `update_snapshot` via a request object, either of type
|
1197
|
+
# {::Google::Cloud::Filestore::V1::UpdateSnapshotRequest} or an equivalent Hash.
|
1198
|
+
#
|
1199
|
+
# @param request [::Google::Cloud::Filestore::V1::UpdateSnapshotRequest, ::Hash]
|
1200
|
+
# A request object representing the call parameters. Required. To specify no
|
1201
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1202
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1203
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1204
|
+
#
|
1205
|
+
# @overload update_snapshot(update_mask: nil, snapshot: nil)
|
1206
|
+
# Pass arguments to `update_snapshot` via keyword arguments. Note that at
|
1207
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1208
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1209
|
+
#
|
1210
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1211
|
+
# Required. Mask of fields to update. At least one path must be supplied in
|
1212
|
+
# this field.
|
1213
|
+
# @param snapshot [::Google::Cloud::Filestore::V1::Snapshot, ::Hash]
|
1214
|
+
# Required. A snapshot resource.
|
1215
|
+
#
|
1216
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1217
|
+
# @yieldparam response [::Gapic::Operation]
|
1218
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1219
|
+
#
|
1220
|
+
# @return [::Gapic::Operation]
|
1221
|
+
#
|
1222
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1223
|
+
#
|
1224
|
+
# @example Basic example
|
1225
|
+
# require "google/cloud/filestore/v1"
|
1226
|
+
#
|
1227
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1228
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
1229
|
+
#
|
1230
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1231
|
+
# request = Google::Cloud::Filestore::V1::UpdateSnapshotRequest.new
|
1232
|
+
#
|
1233
|
+
# # Call the update_snapshot method.
|
1234
|
+
# result = client.update_snapshot request
|
1235
|
+
#
|
1236
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1237
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1238
|
+
# # Here is how to wait for a response.
|
1239
|
+
# result.wait_until_done! timeout: 60
|
1240
|
+
# if result.response?
|
1241
|
+
# p result.response
|
1242
|
+
# else
|
1243
|
+
# puts "No response received."
|
1244
|
+
# end
|
1245
|
+
#
|
1246
|
+
def update_snapshot request, options = nil
|
1247
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1248
|
+
|
1249
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::UpdateSnapshotRequest
|
1250
|
+
|
1251
|
+
# Converts hash and nil to an options object
|
1252
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1253
|
+
|
1254
|
+
# Customize the options with defaults
|
1255
|
+
metadata = @config.rpcs.update_snapshot.metadata.to_h
|
1256
|
+
|
1257
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1258
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1259
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1260
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
1261
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1262
|
+
|
1263
|
+
header_params = {}
|
1264
|
+
if request.snapshot&.name
|
1265
|
+
header_params["snapshot.name"] = request.snapshot.name
|
1266
|
+
end
|
1267
|
+
|
1268
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1269
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1270
|
+
|
1271
|
+
options.apply_defaults timeout: @config.rpcs.update_snapshot.timeout,
|
1272
|
+
metadata: metadata,
|
1273
|
+
retry_policy: @config.rpcs.update_snapshot.retry_policy
|
1274
|
+
|
1275
|
+
options.apply_defaults timeout: @config.timeout,
|
1276
|
+
metadata: @config.metadata,
|
1277
|
+
retry_policy: @config.retry_policy
|
1278
|
+
|
1279
|
+
@cloud_filestore_manager_stub.call_rpc :update_snapshot, request, options: options do |response, operation|
|
1280
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1281
|
+
yield response, operation if block_given?
|
1282
|
+
return response
|
1283
|
+
end
|
1284
|
+
rescue ::GRPC::BadStatus => e
|
1285
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1286
|
+
end
|
1287
|
+
|
804
1288
|
##
|
805
1289
|
# Lists all backups in a project for either a specified location or for all
|
806
1290
|
# locations.
|
@@ -823,9 +1307,9 @@ module Google
|
|
823
1307
|
# @param parent [::String]
|
824
1308
|
# Required. The project and location for which to retrieve backup
|
825
1309
|
# information, in the format
|
826
|
-
# `projects/{project_number}/locations/{location}`. In
|
827
|
-
#
|
828
|
-
# backup information for all locations, use "-" for the
|
1310
|
+
# `projects/{project_number}/locations/{location}`. In Filestore, backup
|
1311
|
+
# locations map to Google Cloud regions, for example **us-west1**. To
|
1312
|
+
# retrieve backup information for all locations, use "-" for the
|
829
1313
|
# `{location}` value.
|
830
1314
|
# @param page_size [::Integer]
|
831
1315
|
# The maximum number of items to return.
|
@@ -1012,8 +1496,8 @@ module Google
|
|
1012
1496
|
#
|
1013
1497
|
# @param parent [::String]
|
1014
1498
|
# Required. The backup's project and location, in the format
|
1015
|
-
# `projects/{project_number}/locations/{location}`. In
|
1016
|
-
# backup locations map to
|
1499
|
+
# `projects/{project_number}/locations/{location}`. In Filestore,
|
1500
|
+
# backup locations map to Google Cloud regions, for example **us-west1**.
|
1017
1501
|
# @param backup [::Google::Cloud::Filestore::V1::Backup, ::Hash]
|
1018
1502
|
# Required. A {::Google::Cloud::Filestore::V1::Backup backup resource}
|
1019
1503
|
# @param backup_id [::String]
|
@@ -1325,9 +1809,9 @@ module Google
|
|
1325
1809
|
# * (`String`) The path to a service account key file in JSON format
|
1326
1810
|
# * (`Hash`) A service account key as a Hash
|
1327
1811
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1328
|
-
# (see the [googleauth docs](https://
|
1812
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1329
1813
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1330
|
-
# (see the [signet docs](https://
|
1814
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1331
1815
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1332
1816
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1333
1817
|
# * (`nil`) indicating no credentials
|
@@ -1453,6 +1937,31 @@ module Google
|
|
1453
1937
|
#
|
1454
1938
|
attr_reader :delete_instance
|
1455
1939
|
##
|
1940
|
+
# RPC-specific configuration for `list_snapshots`
|
1941
|
+
# @return [::Gapic::Config::Method]
|
1942
|
+
#
|
1943
|
+
attr_reader :list_snapshots
|
1944
|
+
##
|
1945
|
+
# RPC-specific configuration for `get_snapshot`
|
1946
|
+
# @return [::Gapic::Config::Method]
|
1947
|
+
#
|
1948
|
+
attr_reader :get_snapshot
|
1949
|
+
##
|
1950
|
+
# RPC-specific configuration for `create_snapshot`
|
1951
|
+
# @return [::Gapic::Config::Method]
|
1952
|
+
#
|
1953
|
+
attr_reader :create_snapshot
|
1954
|
+
##
|
1955
|
+
# RPC-specific configuration for `delete_snapshot`
|
1956
|
+
# @return [::Gapic::Config::Method]
|
1957
|
+
#
|
1958
|
+
attr_reader :delete_snapshot
|
1959
|
+
##
|
1960
|
+
# RPC-specific configuration for `update_snapshot`
|
1961
|
+
# @return [::Gapic::Config::Method]
|
1962
|
+
#
|
1963
|
+
attr_reader :update_snapshot
|
1964
|
+
##
|
1456
1965
|
# RPC-specific configuration for `list_backups`
|
1457
1966
|
# @return [::Gapic::Config::Method]
|
1458
1967
|
#
|
@@ -1492,6 +2001,16 @@ module Google
|
|
1492
2001
|
@restore_instance = ::Gapic::Config::Method.new restore_instance_config
|
1493
2002
|
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
1494
2003
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
2004
|
+
list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots
|
2005
|
+
@list_snapshots = ::Gapic::Config::Method.new list_snapshots_config
|
2006
|
+
get_snapshot_config = parent_rpcs.get_snapshot if parent_rpcs.respond_to? :get_snapshot
|
2007
|
+
@get_snapshot = ::Gapic::Config::Method.new get_snapshot_config
|
2008
|
+
create_snapshot_config = parent_rpcs.create_snapshot if parent_rpcs.respond_to? :create_snapshot
|
2009
|
+
@create_snapshot = ::Gapic::Config::Method.new create_snapshot_config
|
2010
|
+
delete_snapshot_config = parent_rpcs.delete_snapshot if parent_rpcs.respond_to? :delete_snapshot
|
2011
|
+
@delete_snapshot = ::Gapic::Config::Method.new delete_snapshot_config
|
2012
|
+
update_snapshot_config = parent_rpcs.update_snapshot if parent_rpcs.respond_to? :update_snapshot
|
2013
|
+
@update_snapshot = ::Gapic::Config::Method.new update_snapshot_config
|
1495
2014
|
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
1496
2015
|
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
1497
2016
|
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
@@ -620,9 +620,9 @@ module Google
|
|
620
620
|
# * (`String`) The path to a service account key file in JSON format
|
621
621
|
# * (`Hash`) A service account key as a Hash
|
622
622
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
623
|
-
# (see the [googleauth docs](https://
|
623
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
624
624
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
625
|
-
# (see the [signet docs](https://
|
625
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
626
626
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
627
627
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
628
628
|
# * (`nil`) indicating no credentials
|