google-cloud-metastore-v1 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/metastore/v1/dataproc_metastore.rb +2 -2
- data/lib/google/cloud/metastore/v1/dataproc_metastore/client.rb +536 -51
- data/lib/google/cloud/metastore/v1/dataproc_metastore/operations.rb +34 -25
- data/lib/google/cloud/metastore/v1/dataproc_metastore/paths.rb +21 -0
- data/lib/google/cloud/metastore/v1/metastore_pb.rb +82 -0
- data/lib/google/cloud/metastore/v1/metastore_services_pb.rb +12 -2
- data/lib/google/cloud/metastore/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/metastore/v1/metastore.rb +280 -1
- data/proto_docs/google/type/dayofweek.rb +9 -9
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392784d5b3f5dc4fccffe9cbbfd599e6a57afe1ea632be69ce58dcc997299f9b
|
4
|
+
data.tar.gz: 8d00d1efbc2986bad4ab62e8a9b5700f29312d89fa93c62cdcafd055b20a0dc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b3c274ffdb0c7b14099b7002ddfcfe0f46ad6cafb840a313b55a3700820e4a3f02c71f9ca5ced8fe0c844965d681f7b554a233027d4ef0345b26c251c1af71b
|
7
|
+
data.tar.gz: 4c469984519c40097dc03505d6e620762833825b933c7d059f08f313070c54d7515e9a00fe28d407fdfe69f47c0b855c389ed54b33215984bcf71fb3e1837eb7
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-metastore-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Metastore::V1::DataprocMetastore::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `METASTORE_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `METASTORE_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/metastore/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/metastore/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |confi
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/metastore/v1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/metastore/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Metastore::V1::ListServicesRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.list_services request
|
38
38
|
```
|
39
39
|
|
@@ -33,8 +33,8 @@ module Google
|
|
33
33
|
module V1
|
34
34
|
##
|
35
35
|
# Configures and manages metastore services.
|
36
|
-
# Metastore services are fully managed, highly available,
|
37
|
-
#
|
36
|
+
# Metastore services are fully managed, highly available, autoscaled,
|
37
|
+
# autohealing, OSS-native deployments of technical metadata management
|
38
38
|
# software. Each metastore service exposes a network endpoint through which
|
39
39
|
# metadata queries are served. Metadata queries can originate from a variety
|
40
40
|
# of sources, including Apache Hive, Apache Presto, and Apache Spark.
|
@@ -28,8 +28,8 @@ module Google
|
|
28
28
|
# Client for the DataprocMetastore service.
|
29
29
|
#
|
30
30
|
# Configures and manages metastore services.
|
31
|
-
# Metastore services are fully managed, highly available,
|
32
|
-
#
|
31
|
+
# Metastore services are fully managed, highly available, autoscaled,
|
32
|
+
# autohealing, OSS-native deployments of technical metadata management
|
33
33
|
# software. Each metastore service exposes a network endpoint through which
|
34
34
|
# metadata queries are served. Metadata queries can originate from a variety
|
35
35
|
# of sources, including Apache Hive, Apache Presto, and Apache Spark.
|
@@ -57,13 +57,12 @@ module Google
|
|
57
57
|
# See {::Google::Cloud::Metastore::V1::DataprocMetastore::Client::Configuration}
|
58
58
|
# for a description of the configuration fields.
|
59
59
|
#
|
60
|
-
#
|
60
|
+
# @example
|
61
61
|
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
# end
|
62
|
+
# # Modify the configuration for all DataprocMetastore clients
|
63
|
+
# ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
|
64
|
+
# config.timeout = 10.0
|
65
|
+
# end
|
67
66
|
#
|
68
67
|
# @yield [config] Configure the Client client.
|
69
68
|
# @yieldparam config [Client::Configuration]
|
@@ -83,10 +82,7 @@ module Google
|
|
83
82
|
|
84
83
|
default_config.timeout = 60.0
|
85
84
|
default_config.retry_policy = {
|
86
|
-
initial_delay: 1.0,
|
87
|
-
max_delay: 10.0,
|
88
|
-
multiplier: 1.3,
|
89
|
-
retry_codes: [14]
|
85
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
90
86
|
}
|
91
87
|
|
92
88
|
default_config.rpcs.create_service.timeout = 60.0
|
@@ -101,6 +97,12 @@ module Google
|
|
101
97
|
|
102
98
|
default_config.rpcs.export_metadata.timeout = 60.0
|
103
99
|
|
100
|
+
default_config.rpcs.restore_service.timeout = 60.0
|
101
|
+
|
102
|
+
default_config.rpcs.create_backup.timeout = 60.0
|
103
|
+
|
104
|
+
default_config.rpcs.delete_backup.timeout = 60.0
|
105
|
+
|
104
106
|
default_config
|
105
107
|
end
|
106
108
|
yield @configure if block_given?
|
@@ -130,19 +132,15 @@ module Google
|
|
130
132
|
##
|
131
133
|
# Create a new DataprocMetastore client object.
|
132
134
|
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
# To create a new DataprocMetastore client with the default
|
136
|
-
# configuration:
|
137
|
-
#
|
138
|
-
# client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
|
135
|
+
# @example
|
139
136
|
#
|
140
|
-
#
|
141
|
-
#
|
137
|
+
# # Create a client using the default configuration
|
138
|
+
# client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new
|
142
139
|
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
140
|
+
# # Create a client using a custom configuration
|
141
|
+
# client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
|
142
|
+
# config.timeout = 10.0
|
143
|
+
# end
|
146
144
|
#
|
147
145
|
# @yield [config] Configure the DataprocMetastore client.
|
148
146
|
# @yieldparam config [Client::Configuration]
|
@@ -162,14 +160,13 @@ module Google
|
|
162
160
|
|
163
161
|
# Create credentials
|
164
162
|
credentials = @config.credentials
|
165
|
-
# Use self-signed JWT if the
|
163
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
166
164
|
# but only if the default endpoint does not have a region prefix.
|
167
|
-
enable_self_signed_jwt = @config.
|
168
|
-
@config.endpoint == Client.configure.endpoint &&
|
165
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
169
166
|
!@config.endpoint.split(".").first.include?("-")
|
170
167
|
credentials ||= Credentials.default scope: @config.scope,
|
171
168
|
enable_self_signed_jwt: enable_self_signed_jwt
|
172
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
169
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
173
170
|
credentials = Credentials.new credentials, scope: @config.scope
|
174
171
|
end
|
175
172
|
@quota_project_id = @config.quota_project
|
@@ -275,7 +272,9 @@ module Google
|
|
275
272
|
options.apply_defaults timeout: @config.rpcs.list_services.timeout,
|
276
273
|
metadata: metadata,
|
277
274
|
retry_policy: @config.rpcs.list_services.retry_policy
|
278
|
-
|
275
|
+
|
276
|
+
options.apply_defaults timeout: @config.timeout,
|
277
|
+
metadata: @config.metadata,
|
279
278
|
retry_policy: @config.retry_policy
|
280
279
|
|
281
280
|
@dataproc_metastore_stub.call_rpc :list_services, request, options: options do |response, operation|
|
@@ -345,7 +344,9 @@ module Google
|
|
345
344
|
options.apply_defaults timeout: @config.rpcs.get_service.timeout,
|
346
345
|
metadata: metadata,
|
347
346
|
retry_policy: @config.rpcs.get_service.retry_policy
|
348
|
-
|
347
|
+
|
348
|
+
options.apply_defaults timeout: @config.timeout,
|
349
|
+
metadata: @config.metadata,
|
349
350
|
retry_policy: @config.retry_policy
|
350
351
|
|
351
352
|
@dataproc_metastore_stub.call_rpc :get_service, request, options: options do |response, operation|
|
@@ -438,7 +439,9 @@ module Google
|
|
438
439
|
options.apply_defaults timeout: @config.rpcs.create_service.timeout,
|
439
440
|
metadata: metadata,
|
440
441
|
retry_policy: @config.rpcs.create_service.retry_policy
|
441
|
-
|
442
|
+
|
443
|
+
options.apply_defaults timeout: @config.timeout,
|
444
|
+
metadata: @config.metadata,
|
442
445
|
retry_policy: @config.retry_policy
|
443
446
|
|
444
447
|
@dataproc_metastore_stub.call_rpc :create_service, request, options: options do |response, operation|
|
@@ -527,7 +530,9 @@ module Google
|
|
527
530
|
options.apply_defaults timeout: @config.rpcs.update_service.timeout,
|
528
531
|
metadata: metadata,
|
529
532
|
retry_policy: @config.rpcs.update_service.retry_policy
|
530
|
-
|
533
|
+
|
534
|
+
options.apply_defaults timeout: @config.timeout,
|
535
|
+
metadata: @config.metadata,
|
531
536
|
retry_policy: @config.retry_policy
|
532
537
|
|
533
538
|
@dataproc_metastore_stub.call_rpc :update_service, request, options: options do |response, operation|
|
@@ -610,7 +615,9 @@ module Google
|
|
610
615
|
options.apply_defaults timeout: @config.rpcs.delete_service.timeout,
|
611
616
|
metadata: metadata,
|
612
617
|
retry_policy: @config.rpcs.delete_service.retry_policy
|
613
|
-
|
618
|
+
|
619
|
+
options.apply_defaults timeout: @config.timeout,
|
620
|
+
metadata: @config.metadata,
|
614
621
|
retry_policy: @config.retry_policy
|
615
622
|
|
616
623
|
@dataproc_metastore_stub.call_rpc :delete_service, request, options: options do |response, operation|
|
@@ -699,7 +706,9 @@ module Google
|
|
699
706
|
options.apply_defaults timeout: @config.rpcs.list_metadata_imports.timeout,
|
700
707
|
metadata: metadata,
|
701
708
|
retry_policy: @config.rpcs.list_metadata_imports.retry_policy
|
702
|
-
|
709
|
+
|
710
|
+
options.apply_defaults timeout: @config.timeout,
|
711
|
+
metadata: @config.metadata,
|
703
712
|
retry_policy: @config.retry_policy
|
704
713
|
|
705
714
|
@dataproc_metastore_stub.call_rpc :list_metadata_imports, request, options: options do |response, operation|
|
@@ -769,7 +778,9 @@ module Google
|
|
769
778
|
options.apply_defaults timeout: @config.rpcs.get_metadata_import.timeout,
|
770
779
|
metadata: metadata,
|
771
780
|
retry_policy: @config.rpcs.get_metadata_import.retry_policy
|
772
|
-
|
781
|
+
|
782
|
+
options.apply_defaults timeout: @config.timeout,
|
783
|
+
metadata: @config.metadata,
|
773
784
|
retry_policy: @config.retry_policy
|
774
785
|
|
775
786
|
@dataproc_metastore_stub.call_rpc :get_metadata_import, request, options: options do |response, operation|
|
@@ -862,7 +873,9 @@ module Google
|
|
862
873
|
options.apply_defaults timeout: @config.rpcs.create_metadata_import.timeout,
|
863
874
|
metadata: metadata,
|
864
875
|
retry_policy: @config.rpcs.create_metadata_import.retry_policy
|
865
|
-
|
876
|
+
|
877
|
+
options.apply_defaults timeout: @config.timeout,
|
878
|
+
metadata: @config.metadata,
|
866
879
|
retry_policy: @config.retry_policy
|
867
880
|
|
868
881
|
@dataproc_metastore_stub.call_rpc :create_metadata_import, request, options: options do |response, operation|
|
@@ -952,7 +965,9 @@ module Google
|
|
952
965
|
options.apply_defaults timeout: @config.rpcs.update_metadata_import.timeout,
|
953
966
|
metadata: metadata,
|
954
967
|
retry_policy: @config.rpcs.update_metadata_import.retry_policy
|
955
|
-
|
968
|
+
|
969
|
+
options.apply_defaults timeout: @config.timeout,
|
970
|
+
metadata: @config.metadata,
|
956
971
|
retry_policy: @config.retry_policy
|
957
972
|
|
958
973
|
@dataproc_metastore_stub.call_rpc :update_metadata_import, request, options: options do |response, operation|
|
@@ -1041,7 +1056,9 @@ module Google
|
|
1041
1056
|
options.apply_defaults timeout: @config.rpcs.export_metadata.timeout,
|
1042
1057
|
metadata: metadata,
|
1043
1058
|
retry_policy: @config.rpcs.export_metadata.retry_policy
|
1044
|
-
|
1059
|
+
|
1060
|
+
options.apply_defaults timeout: @config.timeout,
|
1061
|
+
metadata: @config.metadata,
|
1045
1062
|
retry_policy: @config.retry_policy
|
1046
1063
|
|
1047
1064
|
@dataproc_metastore_stub.call_rpc :export_metadata, request, options: options do |response, operation|
|
@@ -1053,6 +1070,440 @@ module Google
|
|
1053
1070
|
raise ::Google::Cloud::Error.from_error(e)
|
1054
1071
|
end
|
1055
1072
|
|
1073
|
+
##
|
1074
|
+
# Restores a service from a backup.
|
1075
|
+
#
|
1076
|
+
# @overload restore_service(request, options = nil)
|
1077
|
+
# Pass arguments to `restore_service` via a request object, either of type
|
1078
|
+
# {::Google::Cloud::Metastore::V1::RestoreServiceRequest} or an equivalent Hash.
|
1079
|
+
#
|
1080
|
+
# @param request [::Google::Cloud::Metastore::V1::RestoreServiceRequest, ::Hash]
|
1081
|
+
# A request object representing the call parameters. Required. To specify no
|
1082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1084
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1085
|
+
#
|
1086
|
+
# @overload restore_service(service: nil, backup: nil, restore_type: nil, request_id: nil)
|
1087
|
+
# Pass arguments to `restore_service` via keyword arguments. Note that at
|
1088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1090
|
+
#
|
1091
|
+
# @param service [::String]
|
1092
|
+
# Required. The relative resource name of the metastore service to run restore, in the
|
1093
|
+
# following form:
|
1094
|
+
#
|
1095
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}`.
|
1096
|
+
# @param backup [::String]
|
1097
|
+
# Required. The relative resource name of the metastore service backup to restore
|
1098
|
+
# from, in the following form:
|
1099
|
+
#
|
1100
|
+
# `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
|
1101
|
+
# @param restore_type [::Google::Cloud::Metastore::V1::Restore::RestoreType]
|
1102
|
+
# Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
|
1103
|
+
# @param request_id [::String]
|
1104
|
+
# Optional. A request ID. Specify a unique request ID to allow the server to ignore the
|
1105
|
+
# request if it has completed. The server will ignore subsequent requests
|
1106
|
+
# that provide a duplicate request ID for at least 60 minutes after the first
|
1107
|
+
# request.
|
1108
|
+
#
|
1109
|
+
# For example, if an initial request times out, followed by another request
|
1110
|
+
# with the same request ID, the server ignores the second request to prevent
|
1111
|
+
# the creation of duplicate commitments.
|
1112
|
+
#
|
1113
|
+
# The request ID must be a valid
|
1114
|
+
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
|
1115
|
+
# A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
1116
|
+
#
|
1117
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1118
|
+
# @yieldparam response [::Gapic::Operation]
|
1119
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1120
|
+
#
|
1121
|
+
# @return [::Gapic::Operation]
|
1122
|
+
#
|
1123
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1124
|
+
#
|
1125
|
+
def restore_service request, options = nil
|
1126
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1127
|
+
|
1128
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::RestoreServiceRequest
|
1129
|
+
|
1130
|
+
# Converts hash and nil to an options object
|
1131
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1132
|
+
|
1133
|
+
# Customize the options with defaults
|
1134
|
+
metadata = @config.rpcs.restore_service.metadata.to_h
|
1135
|
+
|
1136
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1137
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1138
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1139
|
+
gapic_version: ::Google::Cloud::Metastore::V1::VERSION
|
1140
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1141
|
+
|
1142
|
+
header_params = {
|
1143
|
+
"service" => request.service
|
1144
|
+
}
|
1145
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1146
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1147
|
+
|
1148
|
+
options.apply_defaults timeout: @config.rpcs.restore_service.timeout,
|
1149
|
+
metadata: metadata,
|
1150
|
+
retry_policy: @config.rpcs.restore_service.retry_policy
|
1151
|
+
|
1152
|
+
options.apply_defaults timeout: @config.timeout,
|
1153
|
+
metadata: @config.metadata,
|
1154
|
+
retry_policy: @config.retry_policy
|
1155
|
+
|
1156
|
+
@dataproc_metastore_stub.call_rpc :restore_service, request, options: options do |response, operation|
|
1157
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1158
|
+
yield response, operation if block_given?
|
1159
|
+
return response
|
1160
|
+
end
|
1161
|
+
rescue ::GRPC::BadStatus => e
|
1162
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1163
|
+
end
|
1164
|
+
|
1165
|
+
##
|
1166
|
+
# Lists backups in a service.
|
1167
|
+
#
|
1168
|
+
# @overload list_backups(request, options = nil)
|
1169
|
+
# Pass arguments to `list_backups` via a request object, either of type
|
1170
|
+
# {::Google::Cloud::Metastore::V1::ListBackupsRequest} or an equivalent Hash.
|
1171
|
+
#
|
1172
|
+
# @param request [::Google::Cloud::Metastore::V1::ListBackupsRequest, ::Hash]
|
1173
|
+
# A request object representing the call parameters. Required. To specify no
|
1174
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1175
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1176
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1177
|
+
#
|
1178
|
+
# @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
1179
|
+
# Pass arguments to `list_backups` via keyword arguments. Note that at
|
1180
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1181
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1182
|
+
#
|
1183
|
+
# @param parent [::String]
|
1184
|
+
# Required. The relative resource name of the service whose backups to
|
1185
|
+
# list, in the following form:
|
1186
|
+
#
|
1187
|
+
# `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
|
1188
|
+
# @param page_size [::Integer]
|
1189
|
+
# Optional. The maximum number of backups to return. The response may contain less
|
1190
|
+
# than the maximum number. If unspecified, no more than 500 backups are
|
1191
|
+
# returned. The maximum value is 1000; values above 1000 are changed to 1000.
|
1192
|
+
# @param page_token [::String]
|
1193
|
+
# Optional. A page token, received from a previous {::Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_backups DataprocMetastore.ListBackups}
|
1194
|
+
# call. Provide this token to retrieve the subsequent page.
|
1195
|
+
#
|
1196
|
+
# To retrieve the first page, supply an empty page token.
|
1197
|
+
#
|
1198
|
+
# When paginating, other parameters provided to
|
1199
|
+
# {::Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_backups DataprocMetastore.ListBackups} must match the call that provided the
|
1200
|
+
# page token.
|
1201
|
+
# @param filter [::String]
|
1202
|
+
# Optional. The filter to apply to list results.
|
1203
|
+
# @param order_by [::String]
|
1204
|
+
# Optional. Specify the ordering of results as described in [Sorting
|
1205
|
+
# Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
|
1206
|
+
# If not specified, the results will be sorted in the default order.
|
1207
|
+
#
|
1208
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1209
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>]
|
1210
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1211
|
+
#
|
1212
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Metastore::V1::Backup>]
|
1213
|
+
#
|
1214
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1215
|
+
#
|
1216
|
+
def list_backups request, options = nil
|
1217
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1218
|
+
|
1219
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::ListBackupsRequest
|
1220
|
+
|
1221
|
+
# Converts hash and nil to an options object
|
1222
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1223
|
+
|
1224
|
+
# Customize the options with defaults
|
1225
|
+
metadata = @config.rpcs.list_backups.metadata.to_h
|
1226
|
+
|
1227
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1228
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1229
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1230
|
+
gapic_version: ::Google::Cloud::Metastore::V1::VERSION
|
1231
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1232
|
+
|
1233
|
+
header_params = {
|
1234
|
+
"parent" => request.parent
|
1235
|
+
}
|
1236
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1237
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1238
|
+
|
1239
|
+
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
1240
|
+
metadata: metadata,
|
1241
|
+
retry_policy: @config.rpcs.list_backups.retry_policy
|
1242
|
+
|
1243
|
+
options.apply_defaults timeout: @config.timeout,
|
1244
|
+
metadata: @config.metadata,
|
1245
|
+
retry_policy: @config.retry_policy
|
1246
|
+
|
1247
|
+
@dataproc_metastore_stub.call_rpc :list_backups, request, options: options do |response, operation|
|
1248
|
+
response = ::Gapic::PagedEnumerable.new @dataproc_metastore_stub, :list_backups, request, response, operation, options
|
1249
|
+
yield response, operation if block_given?
|
1250
|
+
return response
|
1251
|
+
end
|
1252
|
+
rescue ::GRPC::BadStatus => e
|
1253
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1254
|
+
end
|
1255
|
+
|
1256
|
+
##
|
1257
|
+
# Gets details of a single backup.
|
1258
|
+
#
|
1259
|
+
# @overload get_backup(request, options = nil)
|
1260
|
+
# Pass arguments to `get_backup` via a request object, either of type
|
1261
|
+
# {::Google::Cloud::Metastore::V1::GetBackupRequest} or an equivalent Hash.
|
1262
|
+
#
|
1263
|
+
# @param request [::Google::Cloud::Metastore::V1::GetBackupRequest, ::Hash]
|
1264
|
+
# A request object representing the call parameters. Required. To specify no
|
1265
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1266
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1267
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1268
|
+
#
|
1269
|
+
# @overload get_backup(name: nil)
|
1270
|
+
# Pass arguments to `get_backup` via keyword arguments. Note that at
|
1271
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1272
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1273
|
+
#
|
1274
|
+
# @param name [::String]
|
1275
|
+
# Required. The relative resource name of the backup to retrieve, in the
|
1276
|
+
# following form:
|
1277
|
+
#
|
1278
|
+
# `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
|
1279
|
+
#
|
1280
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1281
|
+
# @yieldparam response [::Google::Cloud::Metastore::V1::Backup]
|
1282
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1283
|
+
#
|
1284
|
+
# @return [::Google::Cloud::Metastore::V1::Backup]
|
1285
|
+
#
|
1286
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1287
|
+
#
|
1288
|
+
def get_backup request, options = nil
|
1289
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1290
|
+
|
1291
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::GetBackupRequest
|
1292
|
+
|
1293
|
+
# Converts hash and nil to an options object
|
1294
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1295
|
+
|
1296
|
+
# Customize the options with defaults
|
1297
|
+
metadata = @config.rpcs.get_backup.metadata.to_h
|
1298
|
+
|
1299
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1300
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1301
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1302
|
+
gapic_version: ::Google::Cloud::Metastore::V1::VERSION
|
1303
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1304
|
+
|
1305
|
+
header_params = {
|
1306
|
+
"name" => request.name
|
1307
|
+
}
|
1308
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1309
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1310
|
+
|
1311
|
+
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
1312
|
+
metadata: metadata,
|
1313
|
+
retry_policy: @config.rpcs.get_backup.retry_policy
|
1314
|
+
|
1315
|
+
options.apply_defaults timeout: @config.timeout,
|
1316
|
+
metadata: @config.metadata,
|
1317
|
+
retry_policy: @config.retry_policy
|
1318
|
+
|
1319
|
+
@dataproc_metastore_stub.call_rpc :get_backup, request, options: options do |response, operation|
|
1320
|
+
yield response, operation if block_given?
|
1321
|
+
return response
|
1322
|
+
end
|
1323
|
+
rescue ::GRPC::BadStatus => e
|
1324
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
##
|
1328
|
+
# Creates a new backup in a given project and location.
|
1329
|
+
#
|
1330
|
+
# @overload create_backup(request, options = nil)
|
1331
|
+
# Pass arguments to `create_backup` via a request object, either of type
|
1332
|
+
# {::Google::Cloud::Metastore::V1::CreateBackupRequest} or an equivalent Hash.
|
1333
|
+
#
|
1334
|
+
# @param request [::Google::Cloud::Metastore::V1::CreateBackupRequest, ::Hash]
|
1335
|
+
# A request object representing the call parameters. Required. To specify no
|
1336
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1337
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1338
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1339
|
+
#
|
1340
|
+
# @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil)
|
1341
|
+
# Pass arguments to `create_backup` via keyword arguments. Note that at
|
1342
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1343
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1344
|
+
#
|
1345
|
+
# @param parent [::String]
|
1346
|
+
# Required. The relative resource name of the service in which to create a backup
|
1347
|
+
# of the following form:
|
1348
|
+
#
|
1349
|
+
# `projects/{project_number}/locations/{location_id}/services/{service_id}`.
|
1350
|
+
# @param backup_id [::String]
|
1351
|
+
# Required. The ID of the backup, which is used as the final component of the
|
1352
|
+
# backup's name.
|
1353
|
+
#
|
1354
|
+
# This value must be between 1 and 64 characters long, begin with a letter,
|
1355
|
+
# end with a letter or number, and consist of alpha-numeric ASCII characters
|
1356
|
+
# or hyphens.
|
1357
|
+
# @param backup [::Google::Cloud::Metastore::V1::Backup, ::Hash]
|
1358
|
+
# Required. The backup to create. The `name` field is ignored. The ID of the created
|
1359
|
+
# backup must be provided in the request's `backup_id` field.
|
1360
|
+
# @param request_id [::String]
|
1361
|
+
# Optional. A request ID. Specify a unique request ID to allow the server to ignore the
|
1362
|
+
# request if it has completed. The server will ignore subsequent requests
|
1363
|
+
# that provide a duplicate request ID for at least 60 minutes after the first
|
1364
|
+
# request.
|
1365
|
+
#
|
1366
|
+
# For example, if an initial request times out, followed by another request
|
1367
|
+
# with the same request ID, the server ignores the second request to prevent
|
1368
|
+
# the creation of duplicate commitments.
|
1369
|
+
#
|
1370
|
+
# The request ID must be a valid
|
1371
|
+
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
|
1372
|
+
# A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
1373
|
+
#
|
1374
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1375
|
+
# @yieldparam response [::Gapic::Operation]
|
1376
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1377
|
+
#
|
1378
|
+
# @return [::Gapic::Operation]
|
1379
|
+
#
|
1380
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1381
|
+
#
|
1382
|
+
def create_backup request, options = nil
|
1383
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1384
|
+
|
1385
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::CreateBackupRequest
|
1386
|
+
|
1387
|
+
# Converts hash and nil to an options object
|
1388
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1389
|
+
|
1390
|
+
# Customize the options with defaults
|
1391
|
+
metadata = @config.rpcs.create_backup.metadata.to_h
|
1392
|
+
|
1393
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1394
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1395
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1396
|
+
gapic_version: ::Google::Cloud::Metastore::V1::VERSION
|
1397
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1398
|
+
|
1399
|
+
header_params = {
|
1400
|
+
"parent" => request.parent
|
1401
|
+
}
|
1402
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1403
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1404
|
+
|
1405
|
+
options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
|
1406
|
+
metadata: metadata,
|
1407
|
+
retry_policy: @config.rpcs.create_backup.retry_policy
|
1408
|
+
|
1409
|
+
options.apply_defaults timeout: @config.timeout,
|
1410
|
+
metadata: @config.metadata,
|
1411
|
+
retry_policy: @config.retry_policy
|
1412
|
+
|
1413
|
+
@dataproc_metastore_stub.call_rpc :create_backup, request, options: options do |response, operation|
|
1414
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1415
|
+
yield response, operation if block_given?
|
1416
|
+
return response
|
1417
|
+
end
|
1418
|
+
rescue ::GRPC::BadStatus => e
|
1419
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1420
|
+
end
|
1421
|
+
|
1422
|
+
##
|
1423
|
+
# Deletes a single backup.
|
1424
|
+
#
|
1425
|
+
# @overload delete_backup(request, options = nil)
|
1426
|
+
# Pass arguments to `delete_backup` via a request object, either of type
|
1427
|
+
# {::Google::Cloud::Metastore::V1::DeleteBackupRequest} or an equivalent Hash.
|
1428
|
+
#
|
1429
|
+
# @param request [::Google::Cloud::Metastore::V1::DeleteBackupRequest, ::Hash]
|
1430
|
+
# A request object representing the call parameters. Required. To specify no
|
1431
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1432
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1433
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1434
|
+
#
|
1435
|
+
# @overload delete_backup(name: nil, request_id: nil)
|
1436
|
+
# Pass arguments to `delete_backup` via keyword arguments. Note that at
|
1437
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1438
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1439
|
+
#
|
1440
|
+
# @param name [::String]
|
1441
|
+
# Required. The relative resource name of the backup to delete, in the
|
1442
|
+
# following form:
|
1443
|
+
#
|
1444
|
+
# `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
|
1445
|
+
# @param request_id [::String]
|
1446
|
+
# Optional. A request ID. Specify a unique request ID to allow the server to ignore the
|
1447
|
+
# request if it has completed. The server will ignore subsequent requests
|
1448
|
+
# that provide a duplicate request ID for at least 60 minutes after the first
|
1449
|
+
# request.
|
1450
|
+
#
|
1451
|
+
# For example, if an initial request times out, followed by another request
|
1452
|
+
# with the same request ID, the server ignores the second request to prevent
|
1453
|
+
# the creation of duplicate commitments.
|
1454
|
+
#
|
1455
|
+
# The request ID must be a valid
|
1456
|
+
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
|
1457
|
+
# A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
1458
|
+
#
|
1459
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1460
|
+
# @yieldparam response [::Gapic::Operation]
|
1461
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1462
|
+
#
|
1463
|
+
# @return [::Gapic::Operation]
|
1464
|
+
#
|
1465
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1466
|
+
#
|
1467
|
+
def delete_backup request, options = nil
|
1468
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1469
|
+
|
1470
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Metastore::V1::DeleteBackupRequest
|
1471
|
+
|
1472
|
+
# Converts hash and nil to an options object
|
1473
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1474
|
+
|
1475
|
+
# Customize the options with defaults
|
1476
|
+
metadata = @config.rpcs.delete_backup.metadata.to_h
|
1477
|
+
|
1478
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1479
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1480
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1481
|
+
gapic_version: ::Google::Cloud::Metastore::V1::VERSION
|
1482
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1483
|
+
|
1484
|
+
header_params = {
|
1485
|
+
"name" => request.name
|
1486
|
+
}
|
1487
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1488
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1489
|
+
|
1490
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
1491
|
+
metadata: metadata,
|
1492
|
+
retry_policy: @config.rpcs.delete_backup.retry_policy
|
1493
|
+
|
1494
|
+
options.apply_defaults timeout: @config.timeout,
|
1495
|
+
metadata: @config.metadata,
|
1496
|
+
retry_policy: @config.retry_policy
|
1497
|
+
|
1498
|
+
@dataproc_metastore_stub.call_rpc :delete_backup, request, options: options do |response, operation|
|
1499
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1500
|
+
yield response, operation if block_given?
|
1501
|
+
return response
|
1502
|
+
end
|
1503
|
+
rescue ::GRPC::BadStatus => e
|
1504
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1505
|
+
end
|
1506
|
+
|
1056
1507
|
##
|
1057
1508
|
# Configuration class for the DataprocMetastore API.
|
1058
1509
|
#
|
@@ -1066,22 +1517,21 @@ module Google
|
|
1066
1517
|
# Configuration can be applied globally to all clients, or to a single client
|
1067
1518
|
# on construction.
|
1068
1519
|
#
|
1069
|
-
#
|
1070
|
-
#
|
1071
|
-
# To modify the global config, setting the timeout for list_services
|
1072
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
1520
|
+
# @example
|
1073
1521
|
#
|
1074
|
-
#
|
1075
|
-
#
|
1076
|
-
#
|
1077
|
-
#
|
1522
|
+
# # Modify the global config, setting the timeout for
|
1523
|
+
# # list_services to 20 seconds,
|
1524
|
+
# # and all remaining timeouts to 10 seconds.
|
1525
|
+
# ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.configure do |config|
|
1526
|
+
# config.timeout = 10.0
|
1527
|
+
# config.rpcs.list_services.timeout = 20.0
|
1528
|
+
# end
|
1078
1529
|
#
|
1079
|
-
#
|
1080
|
-
#
|
1081
|
-
#
|
1082
|
-
#
|
1083
|
-
#
|
1084
|
-
# end
|
1530
|
+
# # Apply the above configuration only to a new client.
|
1531
|
+
# client = ::Google::Cloud::Metastore::V1::DataprocMetastore::Client.new do |config|
|
1532
|
+
# config.timeout = 10.0
|
1533
|
+
# config.rpcs.list_services.timeout = 20.0
|
1534
|
+
# end
|
1085
1535
|
#
|
1086
1536
|
# @!attribute [rw] endpoint
|
1087
1537
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1239,6 +1689,31 @@ module Google
|
|
1239
1689
|
# @return [::Gapic::Config::Method]
|
1240
1690
|
#
|
1241
1691
|
attr_reader :export_metadata
|
1692
|
+
##
|
1693
|
+
# RPC-specific configuration for `restore_service`
|
1694
|
+
# @return [::Gapic::Config::Method]
|
1695
|
+
#
|
1696
|
+
attr_reader :restore_service
|
1697
|
+
##
|
1698
|
+
# RPC-specific configuration for `list_backups`
|
1699
|
+
# @return [::Gapic::Config::Method]
|
1700
|
+
#
|
1701
|
+
attr_reader :list_backups
|
1702
|
+
##
|
1703
|
+
# RPC-specific configuration for `get_backup`
|
1704
|
+
# @return [::Gapic::Config::Method]
|
1705
|
+
#
|
1706
|
+
attr_reader :get_backup
|
1707
|
+
##
|
1708
|
+
# RPC-specific configuration for `create_backup`
|
1709
|
+
# @return [::Gapic::Config::Method]
|
1710
|
+
#
|
1711
|
+
attr_reader :create_backup
|
1712
|
+
##
|
1713
|
+
# RPC-specific configuration for `delete_backup`
|
1714
|
+
# @return [::Gapic::Config::Method]
|
1715
|
+
#
|
1716
|
+
attr_reader :delete_backup
|
1242
1717
|
|
1243
1718
|
# @private
|
1244
1719
|
def initialize parent_rpcs = nil
|
@@ -1262,6 +1737,16 @@ module Google
|
|
1262
1737
|
@update_metadata_import = ::Gapic::Config::Method.new update_metadata_import_config
|
1263
1738
|
export_metadata_config = parent_rpcs.export_metadata if parent_rpcs.respond_to? :export_metadata
|
1264
1739
|
@export_metadata = ::Gapic::Config::Method.new export_metadata_config
|
1740
|
+
restore_service_config = parent_rpcs.restore_service if parent_rpcs.respond_to? :restore_service
|
1741
|
+
@restore_service = ::Gapic::Config::Method.new restore_service_config
|
1742
|
+
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
1743
|
+
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
1744
|
+
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
1745
|
+
@get_backup = ::Gapic::Config::Method.new get_backup_config
|
1746
|
+
create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
|
1747
|
+
@create_backup = ::Gapic::Config::Method.new create_backup_config
|
1748
|
+
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
1749
|
+
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
1265
1750
|
|
1266
1751
|
yield self if block_given?
|
1267
1752
|
end
|