google-cloud-storage_transfer-v1 0.1.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 +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +167 -0
- data/LICENSE.md +201 -0
- data/README.md +139 -0
- data/lib/google-cloud-storage_transfer-v1.rb +21 -0
- data/lib/google/cloud/storage_transfer/v1.rb +38 -0
- data/lib/google/cloud/storage_transfer/v1/storage_transfer_service.rb +51 -0
- data/lib/google/cloud/storage_transfer/v1/storage_transfer_service/client.rb +964 -0
- data/lib/google/cloud/storage_transfer/v1/storage_transfer_service/credentials.rb +47 -0
- data/lib/google/cloud/storage_transfer/v1/storage_transfer_service/operations.rb +664 -0
- data/lib/google/cloud/storage_transfer/v1/version.rb +28 -0
- data/lib/google/storagetransfer/v1/transfer_pb.rb +70 -0
- data/lib/google/storagetransfer/v1/transfer_services_pb.rb +77 -0
- data/lib/google/storagetransfer/v1/transfer_types_pb.rb +193 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +71 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/code.rb +185 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/storagetransfer/v1/transfer.rb +167 -0
- data/proto_docs/google/storagetransfer/v1/transfer_types.rb +790 -0
- data/proto_docs/google/type/date.rb +53 -0
- data/proto_docs/google/type/timeofday.rb +45 -0
- metadata +222 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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
|
+
# This gem does not autoload during Bundler.require. To load this gem,
|
20
|
+
# issue explicit require statements for the packages desired, e.g.:
|
21
|
+
# require "google/cloud/storage_transfer/v1"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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 "google/cloud/storage_transfer/v1/storage_transfer_service"
|
20
|
+
require "google/cloud/storage_transfer/v1/version"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module StorageTransfer
|
25
|
+
##
|
26
|
+
# To load this package, including all its services, and instantiate a client:
|
27
|
+
#
|
28
|
+
# require "google/cloud/storage_transfer/v1"
|
29
|
+
# client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new
|
30
|
+
#
|
31
|
+
module V1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
helper_path = ::File.join __dir__, "v1", "_helpers.rb"
|
38
|
+
require "google/cloud/storage_transfer/v1/_helpers" if ::File.file? helper_path
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/storage_transfer/v1/version"
|
24
|
+
|
25
|
+
require "google/cloud/storage_transfer/v1/storage_transfer_service/credentials"
|
26
|
+
require "google/cloud/storage_transfer/v1/storage_transfer_service/operations"
|
27
|
+
require "google/cloud/storage_transfer/v1/storage_transfer_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module StorageTransfer
|
32
|
+
module V1
|
33
|
+
##
|
34
|
+
# Storage Transfer Service and its protos.
|
35
|
+
# Transfers data between between Google Cloud Storage buckets or from a data
|
36
|
+
# source external to Google to a Cloud Storage bucket.
|
37
|
+
#
|
38
|
+
# To load this service and instantiate a client:
|
39
|
+
#
|
40
|
+
# require "google/cloud/storage_transfer/v1/storage_transfer_service"
|
41
|
+
# client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new
|
42
|
+
#
|
43
|
+
module StorageTransferService
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
helper_path = ::File.join __dir__, "storage_transfer_service", "helpers.rb"
|
51
|
+
require "google/cloud/storage_transfer/v1/storage_transfer_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,964 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 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 "google/cloud/errors"
|
20
|
+
require "google/storagetransfer/v1/transfer_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module StorageTransfer
|
25
|
+
module V1
|
26
|
+
module StorageTransferService
|
27
|
+
##
|
28
|
+
# Client for the StorageTransferService service.
|
29
|
+
#
|
30
|
+
# Storage Transfer Service and its protos.
|
31
|
+
# Transfers data between between Google Cloud Storage buckets or from a data
|
32
|
+
# source external to Google to a Cloud Storage bucket.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
# @private
|
36
|
+
attr_reader :storage_transfer_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the StorageTransferService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all StorageTransferService clients
|
47
|
+
# ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @yield [config] Configure the Client client.
|
52
|
+
# @yieldparam config [Client::Configuration]
|
53
|
+
#
|
54
|
+
# @return [Client::Configuration]
|
55
|
+
#
|
56
|
+
def self.configure
|
57
|
+
@configure ||= begin
|
58
|
+
namespace = ["Google", "Cloud", "StorageTransfer", "V1"]
|
59
|
+
parent_config = while namespace.any?
|
60
|
+
parent_name = namespace.join "::"
|
61
|
+
parent_const = const_get parent_name
|
62
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
63
|
+
namespace.pop
|
64
|
+
end
|
65
|
+
default_config = Client::Configuration.new parent_config
|
66
|
+
|
67
|
+
default_config.timeout = 60.0
|
68
|
+
|
69
|
+
default_config
|
70
|
+
end
|
71
|
+
yield @configure if block_given?
|
72
|
+
@configure
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Configure the StorageTransferService Client instance.
|
77
|
+
#
|
78
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
79
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
80
|
+
# should be made on {Client.configure}.
|
81
|
+
#
|
82
|
+
# See {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration}
|
83
|
+
# for a description of the configuration fields.
|
84
|
+
#
|
85
|
+
# @yield [config] Configure the Client client.
|
86
|
+
# @yieldparam config [Client::Configuration]
|
87
|
+
#
|
88
|
+
# @return [Client::Configuration]
|
89
|
+
#
|
90
|
+
def configure
|
91
|
+
yield @config if block_given?
|
92
|
+
@config
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Create a new StorageTransferService client object.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
#
|
100
|
+
# # Create a client using the default configuration
|
101
|
+
# client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new
|
102
|
+
#
|
103
|
+
# # Create a client using a custom configuration
|
104
|
+
# client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config|
|
105
|
+
# config.timeout = 10.0
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# @yield [config] Configure the StorageTransferService client.
|
109
|
+
# @yieldparam config [Client::Configuration]
|
110
|
+
#
|
111
|
+
def initialize
|
112
|
+
# These require statements are intentionally placed here to initialize
|
113
|
+
# the gRPC module only when it's required.
|
114
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
115
|
+
require "gapic/grpc"
|
116
|
+
require "google/storagetransfer/v1/transfer_services_pb"
|
117
|
+
|
118
|
+
# Create the configuration object
|
119
|
+
@config = Configuration.new Client.configure
|
120
|
+
|
121
|
+
# Yield the configuration if needed
|
122
|
+
yield @config if block_given?
|
123
|
+
|
124
|
+
# Create credentials
|
125
|
+
credentials = @config.credentials
|
126
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
|
+
# but only if the default endpoint does not have a region prefix.
|
128
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
129
|
+
!@config.endpoint.split(".").first.include?("-")
|
130
|
+
credentials ||= Credentials.default scope: @config.scope,
|
131
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
132
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
133
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
134
|
+
end
|
135
|
+
@quota_project_id = @config.quota_project
|
136
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
137
|
+
|
138
|
+
@operations_client = Operations.new do |config|
|
139
|
+
config.credentials = credentials
|
140
|
+
config.endpoint = @config.endpoint
|
141
|
+
end
|
142
|
+
|
143
|
+
@storage_transfer_service_stub = ::Gapic::ServiceStub.new(
|
144
|
+
::Google::Cloud::StorageTransfer::V1::StorageTransferService::Stub,
|
145
|
+
credentials: credentials,
|
146
|
+
endpoint: @config.endpoint,
|
147
|
+
channel_args: @config.channel_args,
|
148
|
+
interceptors: @config.interceptors
|
149
|
+
)
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# Get the associated client for long-running operations.
|
154
|
+
#
|
155
|
+
# @return [::Google::Cloud::StorageTransfer::V1::StorageTransferService::Operations]
|
156
|
+
#
|
157
|
+
attr_reader :operations_client
|
158
|
+
|
159
|
+
# Service calls
|
160
|
+
|
161
|
+
##
|
162
|
+
# Returns the Google service account that is used by Storage Transfer
|
163
|
+
# Service to access buckets in the project where transfers
|
164
|
+
# run or in other projects. Each Google service account is associated
|
165
|
+
# with one Google Cloud Platform Console project. Users
|
166
|
+
# should add this service account to the Google Cloud Storage bucket
|
167
|
+
# ACLs to grant access to Storage Transfer Service. This service
|
168
|
+
# account is created and owned by Storage Transfer Service and can
|
169
|
+
# only be used by Storage Transfer Service.
|
170
|
+
#
|
171
|
+
# @overload get_google_service_account(request, options = nil)
|
172
|
+
# Pass arguments to `get_google_service_account` via a request object, either of type
|
173
|
+
# {::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest} or an equivalent Hash.
|
174
|
+
#
|
175
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::Hash]
|
176
|
+
# A request object representing the call parameters. Required. To specify no
|
177
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
178
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
179
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
180
|
+
#
|
181
|
+
# @overload get_google_service_account(project_id: nil)
|
182
|
+
# Pass arguments to `get_google_service_account` via keyword arguments. Note that at
|
183
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
184
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
185
|
+
#
|
186
|
+
# @param project_id [::String]
|
187
|
+
# Required. The ID of the Google Cloud Platform Console project that the
|
188
|
+
# Google service account is associated with.
|
189
|
+
#
|
190
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
191
|
+
# @yieldparam response [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount]
|
192
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
193
|
+
#
|
194
|
+
# @return [::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount]
|
195
|
+
#
|
196
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
197
|
+
#
|
198
|
+
def get_google_service_account request, options = nil
|
199
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
200
|
+
|
201
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest
|
202
|
+
|
203
|
+
# Converts hash and nil to an options object
|
204
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
205
|
+
|
206
|
+
# Customize the options with defaults
|
207
|
+
metadata = @config.rpcs.get_google_service_account.metadata.to_h
|
208
|
+
|
209
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
210
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
211
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
212
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
213
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
214
|
+
|
215
|
+
header_params = {
|
216
|
+
"project_id" => request.project_id
|
217
|
+
}
|
218
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
219
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
220
|
+
|
221
|
+
options.apply_defaults timeout: @config.rpcs.get_google_service_account.timeout,
|
222
|
+
metadata: metadata,
|
223
|
+
retry_policy: @config.rpcs.get_google_service_account.retry_policy
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.timeout,
|
226
|
+
metadata: @config.metadata,
|
227
|
+
retry_policy: @config.retry_policy
|
228
|
+
|
229
|
+
@storage_transfer_service_stub.call_rpc :get_google_service_account, request, options: options do |response, operation|
|
230
|
+
yield response, operation if block_given?
|
231
|
+
return response
|
232
|
+
end
|
233
|
+
rescue ::GRPC::BadStatus => e
|
234
|
+
raise ::Google::Cloud::Error.from_error(e)
|
235
|
+
end
|
236
|
+
|
237
|
+
##
|
238
|
+
# Creates a transfer job that runs periodically.
|
239
|
+
#
|
240
|
+
# @overload create_transfer_job(request, options = nil)
|
241
|
+
# Pass arguments to `create_transfer_job` via a request object, either of type
|
242
|
+
# {::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest} or an equivalent Hash.
|
243
|
+
#
|
244
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::Hash]
|
245
|
+
# A request object representing the call parameters. Required. To specify no
|
246
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
247
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
248
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
249
|
+
#
|
250
|
+
# @overload create_transfer_job(transfer_job: nil)
|
251
|
+
# Pass arguments to `create_transfer_job` via keyword arguments. Note that at
|
252
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
253
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
254
|
+
#
|
255
|
+
# @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash]
|
256
|
+
# Required. The job to create.
|
257
|
+
#
|
258
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
259
|
+
# @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
260
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
261
|
+
#
|
262
|
+
# @return [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
263
|
+
#
|
264
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
265
|
+
#
|
266
|
+
def create_transfer_job request, options = nil
|
267
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
268
|
+
|
269
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest
|
270
|
+
|
271
|
+
# Converts hash and nil to an options object
|
272
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
273
|
+
|
274
|
+
# Customize the options with defaults
|
275
|
+
metadata = @config.rpcs.create_transfer_job.metadata.to_h
|
276
|
+
|
277
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
278
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
279
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
280
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
281
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
282
|
+
|
283
|
+
options.apply_defaults timeout: @config.rpcs.create_transfer_job.timeout,
|
284
|
+
metadata: metadata,
|
285
|
+
retry_policy: @config.rpcs.create_transfer_job.retry_policy
|
286
|
+
|
287
|
+
options.apply_defaults timeout: @config.timeout,
|
288
|
+
metadata: @config.metadata,
|
289
|
+
retry_policy: @config.retry_policy
|
290
|
+
|
291
|
+
@storage_transfer_service_stub.call_rpc :create_transfer_job, request, options: options do |response, operation|
|
292
|
+
yield response, operation if block_given?
|
293
|
+
return response
|
294
|
+
end
|
295
|
+
rescue ::GRPC::BadStatus => e
|
296
|
+
raise ::Google::Cloud::Error.from_error(e)
|
297
|
+
end
|
298
|
+
|
299
|
+
##
|
300
|
+
# Updates a transfer job. Updating a job's transfer spec does not affect
|
301
|
+
# transfer operations that are running already.
|
302
|
+
#
|
303
|
+
# **Note:** The job's {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}
|
304
|
+
# field can be modified using this RPC (for example, to set a job's status to
|
305
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED},
|
306
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, or
|
307
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED}).
|
308
|
+
#
|
309
|
+
# @overload update_transfer_job(request, options = nil)
|
310
|
+
# Pass arguments to `update_transfer_job` via a request object, either of type
|
311
|
+
# {::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest} or an equivalent Hash.
|
312
|
+
#
|
313
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::Hash]
|
314
|
+
# A request object representing the call parameters. Required. To specify no
|
315
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
316
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
317
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
318
|
+
#
|
319
|
+
# @overload update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil)
|
320
|
+
# Pass arguments to `update_transfer_job` via keyword arguments. Note that at
|
321
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
322
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
323
|
+
#
|
324
|
+
# @param job_name [::String]
|
325
|
+
# Required. The name of job to update.
|
326
|
+
# @param project_id [::String]
|
327
|
+
# Required. The ID of the Google Cloud Platform Console project that owns the
|
328
|
+
# job.
|
329
|
+
# @param transfer_job [::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash]
|
330
|
+
# Required. The job to update. `transferJob` is expected to specify only
|
331
|
+
# four fields:
|
332
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#description description},
|
333
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec},
|
334
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config},
|
335
|
+
# and {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. An
|
336
|
+
# `UpdateTransferJobRequest` that specifies other fields are rejected with
|
337
|
+
# the error {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}. Updating a
|
338
|
+
# job status to
|
339
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED} requires
|
340
|
+
# `storagetransfer.jobs.delete` permissions.
|
341
|
+
# @param update_transfer_job_field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
342
|
+
# The field mask of the fields in `transferJob` that are to be updated in
|
343
|
+
# this request. Fields in `transferJob` that can be updated are:
|
344
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#description description},
|
345
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#transfer_spec transfer_spec},
|
346
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob#notification_config notification_config},
|
347
|
+
# and {::Google::Cloud::StorageTransfer::V1::TransferJob#status status}. To update the
|
348
|
+
# `transfer_spec` of the job, a complete transfer specification must be
|
349
|
+
# provided. An incomplete specification missing any required fields is
|
350
|
+
# rejected with the error
|
351
|
+
# {::Google::Rpc::Code::INVALID_ARGUMENT INVALID_ARGUMENT}.
|
352
|
+
#
|
353
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
354
|
+
# @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
355
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
356
|
+
#
|
357
|
+
# @return [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
358
|
+
#
|
359
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
360
|
+
#
|
361
|
+
def update_transfer_job request, options = nil
|
362
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
363
|
+
|
364
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest
|
365
|
+
|
366
|
+
# Converts hash and nil to an options object
|
367
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
368
|
+
|
369
|
+
# Customize the options with defaults
|
370
|
+
metadata = @config.rpcs.update_transfer_job.metadata.to_h
|
371
|
+
|
372
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
373
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
374
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
375
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
376
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
377
|
+
|
378
|
+
header_params = {
|
379
|
+
"job_name" => request.job_name
|
380
|
+
}
|
381
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
382
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
383
|
+
|
384
|
+
options.apply_defaults timeout: @config.rpcs.update_transfer_job.timeout,
|
385
|
+
metadata: metadata,
|
386
|
+
retry_policy: @config.rpcs.update_transfer_job.retry_policy
|
387
|
+
|
388
|
+
options.apply_defaults timeout: @config.timeout,
|
389
|
+
metadata: @config.metadata,
|
390
|
+
retry_policy: @config.retry_policy
|
391
|
+
|
392
|
+
@storage_transfer_service_stub.call_rpc :update_transfer_job, request, options: options do |response, operation|
|
393
|
+
yield response, operation if block_given?
|
394
|
+
return response
|
395
|
+
end
|
396
|
+
rescue ::GRPC::BadStatus => e
|
397
|
+
raise ::Google::Cloud::Error.from_error(e)
|
398
|
+
end
|
399
|
+
|
400
|
+
##
|
401
|
+
# Gets a transfer job.
|
402
|
+
#
|
403
|
+
# @overload get_transfer_job(request, options = nil)
|
404
|
+
# Pass arguments to `get_transfer_job` via a request object, either of type
|
405
|
+
# {::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest} or an equivalent Hash.
|
406
|
+
#
|
407
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::Hash]
|
408
|
+
# A request object representing the call parameters. Required. To specify no
|
409
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
410
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
411
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
412
|
+
#
|
413
|
+
# @overload get_transfer_job(job_name: nil, project_id: nil)
|
414
|
+
# Pass arguments to `get_transfer_job` via keyword arguments. Note that at
|
415
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
416
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
417
|
+
#
|
418
|
+
# @param job_name [::String]
|
419
|
+
# Required.
|
420
|
+
# The job to get.
|
421
|
+
# @param project_id [::String]
|
422
|
+
# Required. The ID of the Google Cloud Platform Console project that owns the
|
423
|
+
# job.
|
424
|
+
#
|
425
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
426
|
+
# @yieldparam response [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
427
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
428
|
+
#
|
429
|
+
# @return [::Google::Cloud::StorageTransfer::V1::TransferJob]
|
430
|
+
#
|
431
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
432
|
+
#
|
433
|
+
def get_transfer_job request, options = nil
|
434
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
435
|
+
|
436
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest
|
437
|
+
|
438
|
+
# Converts hash and nil to an options object
|
439
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
440
|
+
|
441
|
+
# Customize the options with defaults
|
442
|
+
metadata = @config.rpcs.get_transfer_job.metadata.to_h
|
443
|
+
|
444
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
445
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
446
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
447
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
448
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
449
|
+
|
450
|
+
header_params = {
|
451
|
+
"job_name" => request.job_name
|
452
|
+
}
|
453
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
454
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.get_transfer_job.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.get_transfer_job.retry_policy
|
459
|
+
|
460
|
+
options.apply_defaults timeout: @config.timeout,
|
461
|
+
metadata: @config.metadata,
|
462
|
+
retry_policy: @config.retry_policy
|
463
|
+
|
464
|
+
@storage_transfer_service_stub.call_rpc :get_transfer_job, request, options: options do |response, operation|
|
465
|
+
yield response, operation if block_given?
|
466
|
+
return response
|
467
|
+
end
|
468
|
+
rescue ::GRPC::BadStatus => e
|
469
|
+
raise ::Google::Cloud::Error.from_error(e)
|
470
|
+
end
|
471
|
+
|
472
|
+
##
|
473
|
+
# Lists transfer jobs.
|
474
|
+
#
|
475
|
+
# @overload list_transfer_jobs(request, options = nil)
|
476
|
+
# Pass arguments to `list_transfer_jobs` via a request object, either of type
|
477
|
+
# {::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest} or an equivalent Hash.
|
478
|
+
#
|
479
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::Hash]
|
480
|
+
# A request object representing the call parameters. Required. To specify no
|
481
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
482
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
483
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
484
|
+
#
|
485
|
+
# @overload list_transfer_jobs(filter: nil, page_size: nil, page_token: nil)
|
486
|
+
# Pass arguments to `list_transfer_jobs` via keyword arguments. Note that at
|
487
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
488
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
489
|
+
#
|
490
|
+
# @param filter [::String]
|
491
|
+
# Required. A list of query parameters specified as JSON text in the form of:
|
492
|
+
# `{"projectId":"my_project_id",
|
493
|
+
# "jobNames":["jobid1","jobid2",...],
|
494
|
+
# "jobStatuses":["status1","status2",...]}`
|
495
|
+
#
|
496
|
+
# Since `jobNames` and `jobStatuses` support multiple values, their values
|
497
|
+
# must be specified with array notation. `projectId` is required.
|
498
|
+
# `jobNames` and `jobStatuses` are optional. The valid values for
|
499
|
+
# `jobStatuses` are case-insensitive:
|
500
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::ENABLED ENABLED},
|
501
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DISABLED DISABLED}, and
|
502
|
+
# {::Google::Cloud::StorageTransfer::V1::TransferJob::Status::DELETED DELETED}.
|
503
|
+
# @param page_size [::Integer]
|
504
|
+
# The list page size. The max allowed value is 256.
|
505
|
+
# @param page_token [::String]
|
506
|
+
# The list page token.
|
507
|
+
#
|
508
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
509
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>]
|
510
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
511
|
+
#
|
512
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>]
|
513
|
+
#
|
514
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
515
|
+
#
|
516
|
+
def list_transfer_jobs request, options = nil
|
517
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
518
|
+
|
519
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest
|
520
|
+
|
521
|
+
# Converts hash and nil to an options object
|
522
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
523
|
+
|
524
|
+
# Customize the options with defaults
|
525
|
+
metadata = @config.rpcs.list_transfer_jobs.metadata.to_h
|
526
|
+
|
527
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
528
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
529
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
530
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
531
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
532
|
+
|
533
|
+
options.apply_defaults timeout: @config.rpcs.list_transfer_jobs.timeout,
|
534
|
+
metadata: metadata,
|
535
|
+
retry_policy: @config.rpcs.list_transfer_jobs.retry_policy
|
536
|
+
|
537
|
+
options.apply_defaults timeout: @config.timeout,
|
538
|
+
metadata: @config.metadata,
|
539
|
+
retry_policy: @config.retry_policy
|
540
|
+
|
541
|
+
@storage_transfer_service_stub.call_rpc :list_transfer_jobs, request, options: options do |response, operation|
|
542
|
+
response = ::Gapic::PagedEnumerable.new @storage_transfer_service_stub, :list_transfer_jobs, request, response, operation, options
|
543
|
+
yield response, operation if block_given?
|
544
|
+
return response
|
545
|
+
end
|
546
|
+
rescue ::GRPC::BadStatus => e
|
547
|
+
raise ::Google::Cloud::Error.from_error(e)
|
548
|
+
end
|
549
|
+
|
550
|
+
##
|
551
|
+
# Pauses a transfer operation.
|
552
|
+
#
|
553
|
+
# @overload pause_transfer_operation(request, options = nil)
|
554
|
+
# Pass arguments to `pause_transfer_operation` via a request object, either of type
|
555
|
+
# {::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest} or an equivalent Hash.
|
556
|
+
#
|
557
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::Hash]
|
558
|
+
# A request object representing the call parameters. Required. To specify no
|
559
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
560
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
561
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
562
|
+
#
|
563
|
+
# @overload pause_transfer_operation(name: nil)
|
564
|
+
# Pass arguments to `pause_transfer_operation` via keyword arguments. Note that at
|
565
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
566
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
567
|
+
#
|
568
|
+
# @param name [::String]
|
569
|
+
# Required. The name of the transfer operation.
|
570
|
+
#
|
571
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
572
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
573
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
574
|
+
#
|
575
|
+
# @return [::Google::Protobuf::Empty]
|
576
|
+
#
|
577
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
578
|
+
#
|
579
|
+
def pause_transfer_operation request, options = nil
|
580
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
581
|
+
|
582
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest
|
583
|
+
|
584
|
+
# Converts hash and nil to an options object
|
585
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
586
|
+
|
587
|
+
# Customize the options with defaults
|
588
|
+
metadata = @config.rpcs.pause_transfer_operation.metadata.to_h
|
589
|
+
|
590
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
591
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
592
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
593
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
594
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
595
|
+
|
596
|
+
header_params = {
|
597
|
+
"name" => request.name
|
598
|
+
}
|
599
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
600
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
601
|
+
|
602
|
+
options.apply_defaults timeout: @config.rpcs.pause_transfer_operation.timeout,
|
603
|
+
metadata: metadata,
|
604
|
+
retry_policy: @config.rpcs.pause_transfer_operation.retry_policy
|
605
|
+
|
606
|
+
options.apply_defaults timeout: @config.timeout,
|
607
|
+
metadata: @config.metadata,
|
608
|
+
retry_policy: @config.retry_policy
|
609
|
+
|
610
|
+
@storage_transfer_service_stub.call_rpc :pause_transfer_operation, request, options: options do |response, operation|
|
611
|
+
yield response, operation if block_given?
|
612
|
+
return response
|
613
|
+
end
|
614
|
+
rescue ::GRPC::BadStatus => e
|
615
|
+
raise ::Google::Cloud::Error.from_error(e)
|
616
|
+
end
|
617
|
+
|
618
|
+
##
|
619
|
+
# Resumes a transfer operation that is paused.
|
620
|
+
#
|
621
|
+
# @overload resume_transfer_operation(request, options = nil)
|
622
|
+
# Pass arguments to `resume_transfer_operation` via a request object, either of type
|
623
|
+
# {::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest} or an equivalent Hash.
|
624
|
+
#
|
625
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::Hash]
|
626
|
+
# A request object representing the call parameters. Required. To specify no
|
627
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
628
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
629
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
630
|
+
#
|
631
|
+
# @overload resume_transfer_operation(name: nil)
|
632
|
+
# Pass arguments to `resume_transfer_operation` via keyword arguments. Note that at
|
633
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
634
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
635
|
+
#
|
636
|
+
# @param name [::String]
|
637
|
+
# Required. The name of the transfer operation.
|
638
|
+
#
|
639
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
640
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
641
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
642
|
+
#
|
643
|
+
# @return [::Google::Protobuf::Empty]
|
644
|
+
#
|
645
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
646
|
+
#
|
647
|
+
def resume_transfer_operation request, options = nil
|
648
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
649
|
+
|
650
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest
|
651
|
+
|
652
|
+
# Converts hash and nil to an options object
|
653
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
654
|
+
|
655
|
+
# Customize the options with defaults
|
656
|
+
metadata = @config.rpcs.resume_transfer_operation.metadata.to_h
|
657
|
+
|
658
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
659
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
660
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
661
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
662
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
663
|
+
|
664
|
+
header_params = {
|
665
|
+
"name" => request.name
|
666
|
+
}
|
667
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
668
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
669
|
+
|
670
|
+
options.apply_defaults timeout: @config.rpcs.resume_transfer_operation.timeout,
|
671
|
+
metadata: metadata,
|
672
|
+
retry_policy: @config.rpcs.resume_transfer_operation.retry_policy
|
673
|
+
|
674
|
+
options.apply_defaults timeout: @config.timeout,
|
675
|
+
metadata: @config.metadata,
|
676
|
+
retry_policy: @config.retry_policy
|
677
|
+
|
678
|
+
@storage_transfer_service_stub.call_rpc :resume_transfer_operation, request, options: options do |response, operation|
|
679
|
+
yield response, operation if block_given?
|
680
|
+
return response
|
681
|
+
end
|
682
|
+
rescue ::GRPC::BadStatus => e
|
683
|
+
raise ::Google::Cloud::Error.from_error(e)
|
684
|
+
end
|
685
|
+
|
686
|
+
##
|
687
|
+
# Attempts to start a new TransferOperation for the current TransferJob. A
|
688
|
+
# TransferJob has a maximum of one active TransferOperation. If this method
|
689
|
+
# is called while a TransferOperation is active, an error wil be returned.
|
690
|
+
#
|
691
|
+
# @overload run_transfer_job(request, options = nil)
|
692
|
+
# Pass arguments to `run_transfer_job` via a request object, either of type
|
693
|
+
# {::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest} or an equivalent Hash.
|
694
|
+
#
|
695
|
+
# @param request [::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::Hash]
|
696
|
+
# A request object representing the call parameters. Required. To specify no
|
697
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
698
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
699
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
700
|
+
#
|
701
|
+
# @overload run_transfer_job(job_name: nil, project_id: nil)
|
702
|
+
# Pass arguments to `run_transfer_job` via keyword arguments. Note that at
|
703
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
704
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
705
|
+
#
|
706
|
+
# @param job_name [::String]
|
707
|
+
# Required. The name of the transfer job.
|
708
|
+
# @param project_id [::String]
|
709
|
+
# Required. The ID of the Google Cloud Platform Console project that owns the
|
710
|
+
# transfer job.
|
711
|
+
#
|
712
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
713
|
+
# @yieldparam response [::Gapic::Operation]
|
714
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
715
|
+
#
|
716
|
+
# @return [::Gapic::Operation]
|
717
|
+
#
|
718
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
719
|
+
#
|
720
|
+
def run_transfer_job request, options = nil
|
721
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
722
|
+
|
723
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest
|
724
|
+
|
725
|
+
# Converts hash and nil to an options object
|
726
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
727
|
+
|
728
|
+
# Customize the options with defaults
|
729
|
+
metadata = @config.rpcs.run_transfer_job.metadata.to_h
|
730
|
+
|
731
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
732
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
733
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
734
|
+
gapic_version: ::Google::Cloud::StorageTransfer::V1::VERSION
|
735
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
736
|
+
|
737
|
+
header_params = {
|
738
|
+
"job_name" => request.job_name
|
739
|
+
}
|
740
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
741
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
742
|
+
|
743
|
+
options.apply_defaults timeout: @config.rpcs.run_transfer_job.timeout,
|
744
|
+
metadata: metadata,
|
745
|
+
retry_policy: @config.rpcs.run_transfer_job.retry_policy
|
746
|
+
|
747
|
+
options.apply_defaults timeout: @config.timeout,
|
748
|
+
metadata: @config.metadata,
|
749
|
+
retry_policy: @config.retry_policy
|
750
|
+
|
751
|
+
@storage_transfer_service_stub.call_rpc :run_transfer_job, request, options: options do |response, operation|
|
752
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
753
|
+
yield response, operation if block_given?
|
754
|
+
return response
|
755
|
+
end
|
756
|
+
rescue ::GRPC::BadStatus => e
|
757
|
+
raise ::Google::Cloud::Error.from_error(e)
|
758
|
+
end
|
759
|
+
|
760
|
+
##
|
761
|
+
# Configuration class for the StorageTransferService API.
|
762
|
+
#
|
763
|
+
# This class represents the configuration for StorageTransferService,
|
764
|
+
# providing control over timeouts, retry behavior, logging, transport
|
765
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
766
|
+
# applied individually to specific RPCs. See
|
767
|
+
# {::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client::Configuration::Rpcs}
|
768
|
+
# for a list of RPCs that can be configured independently.
|
769
|
+
#
|
770
|
+
# Configuration can be applied globally to all clients, or to a single client
|
771
|
+
# on construction.
|
772
|
+
#
|
773
|
+
# @example
|
774
|
+
#
|
775
|
+
# # Modify the global config, setting the timeout for
|
776
|
+
# # get_google_service_account to 20 seconds,
|
777
|
+
# # and all remaining timeouts to 10 seconds.
|
778
|
+
# ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config|
|
779
|
+
# config.timeout = 10.0
|
780
|
+
# config.rpcs.get_google_service_account.timeout = 20.0
|
781
|
+
# end
|
782
|
+
#
|
783
|
+
# # Apply the above configuration only to a new client.
|
784
|
+
# client = ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new do |config|
|
785
|
+
# config.timeout = 10.0
|
786
|
+
# config.rpcs.get_google_service_account.timeout = 20.0
|
787
|
+
# end
|
788
|
+
#
|
789
|
+
# @!attribute [rw] endpoint
|
790
|
+
# The hostname or hostname:port of the service endpoint.
|
791
|
+
# Defaults to `"storagetransfer.googleapis.com"`.
|
792
|
+
# @return [::String]
|
793
|
+
# @!attribute [rw] credentials
|
794
|
+
# Credentials to send with calls. You may provide any of the following types:
|
795
|
+
# * (`String`) The path to a service account key file in JSON format
|
796
|
+
# * (`Hash`) A service account key as a Hash
|
797
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
798
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
799
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
800
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
801
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
802
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
803
|
+
# * (`nil`) indicating no credentials
|
804
|
+
# @return [::Object]
|
805
|
+
# @!attribute [rw] scope
|
806
|
+
# The OAuth scopes
|
807
|
+
# @return [::Array<::String>]
|
808
|
+
# @!attribute [rw] lib_name
|
809
|
+
# The library name as recorded in instrumentation and logging
|
810
|
+
# @return [::String]
|
811
|
+
# @!attribute [rw] lib_version
|
812
|
+
# The library version as recorded in instrumentation and logging
|
813
|
+
# @return [::String]
|
814
|
+
# @!attribute [rw] channel_args
|
815
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
816
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
817
|
+
# @return [::Hash]
|
818
|
+
# @!attribute [rw] interceptors
|
819
|
+
# An array of interceptors that are run before calls are executed.
|
820
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
821
|
+
# @!attribute [rw] timeout
|
822
|
+
# The call timeout in seconds.
|
823
|
+
# @return [::Numeric]
|
824
|
+
# @!attribute [rw] metadata
|
825
|
+
# Additional gRPC headers to be sent with the call.
|
826
|
+
# @return [::Hash{::Symbol=>::String}]
|
827
|
+
# @!attribute [rw] retry_policy
|
828
|
+
# The retry policy. The value is a hash with the following keys:
|
829
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
830
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
831
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
832
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
833
|
+
# trigger a retry.
|
834
|
+
# @return [::Hash]
|
835
|
+
# @!attribute [rw] quota_project
|
836
|
+
# A separate project against which to charge quota.
|
837
|
+
# @return [::String]
|
838
|
+
#
|
839
|
+
class Configuration
|
840
|
+
extend ::Gapic::Config
|
841
|
+
|
842
|
+
config_attr :endpoint, "storagetransfer.googleapis.com", ::String
|
843
|
+
config_attr :credentials, nil do |value|
|
844
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
845
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
846
|
+
allowed.any? { |klass| klass === value }
|
847
|
+
end
|
848
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
849
|
+
config_attr :lib_name, nil, ::String, nil
|
850
|
+
config_attr :lib_version, nil, ::String, nil
|
851
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
852
|
+
config_attr :interceptors, nil, ::Array, nil
|
853
|
+
config_attr :timeout, nil, ::Numeric, nil
|
854
|
+
config_attr :metadata, nil, ::Hash, nil
|
855
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
856
|
+
config_attr :quota_project, nil, ::String, nil
|
857
|
+
|
858
|
+
# @private
|
859
|
+
def initialize parent_config = nil
|
860
|
+
@parent_config = parent_config unless parent_config.nil?
|
861
|
+
|
862
|
+
yield self if block_given?
|
863
|
+
end
|
864
|
+
|
865
|
+
##
|
866
|
+
# Configurations for individual RPCs
|
867
|
+
# @return [Rpcs]
|
868
|
+
#
|
869
|
+
def rpcs
|
870
|
+
@rpcs ||= begin
|
871
|
+
parent_rpcs = nil
|
872
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
873
|
+
Rpcs.new parent_rpcs
|
874
|
+
end
|
875
|
+
end
|
876
|
+
|
877
|
+
##
|
878
|
+
# Configuration RPC class for the StorageTransferService API.
|
879
|
+
#
|
880
|
+
# Includes fields providing the configuration for each RPC in this service.
|
881
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
882
|
+
# the following configuration fields:
|
883
|
+
#
|
884
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
885
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
886
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
887
|
+
# include the following keys:
|
888
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
889
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
890
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
891
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
892
|
+
# trigger a retry.
|
893
|
+
#
|
894
|
+
class Rpcs
|
895
|
+
##
|
896
|
+
# RPC-specific configuration for `get_google_service_account`
|
897
|
+
# @return [::Gapic::Config::Method]
|
898
|
+
#
|
899
|
+
attr_reader :get_google_service_account
|
900
|
+
##
|
901
|
+
# RPC-specific configuration for `create_transfer_job`
|
902
|
+
# @return [::Gapic::Config::Method]
|
903
|
+
#
|
904
|
+
attr_reader :create_transfer_job
|
905
|
+
##
|
906
|
+
# RPC-specific configuration for `update_transfer_job`
|
907
|
+
# @return [::Gapic::Config::Method]
|
908
|
+
#
|
909
|
+
attr_reader :update_transfer_job
|
910
|
+
##
|
911
|
+
# RPC-specific configuration for `get_transfer_job`
|
912
|
+
# @return [::Gapic::Config::Method]
|
913
|
+
#
|
914
|
+
attr_reader :get_transfer_job
|
915
|
+
##
|
916
|
+
# RPC-specific configuration for `list_transfer_jobs`
|
917
|
+
# @return [::Gapic::Config::Method]
|
918
|
+
#
|
919
|
+
attr_reader :list_transfer_jobs
|
920
|
+
##
|
921
|
+
# RPC-specific configuration for `pause_transfer_operation`
|
922
|
+
# @return [::Gapic::Config::Method]
|
923
|
+
#
|
924
|
+
attr_reader :pause_transfer_operation
|
925
|
+
##
|
926
|
+
# RPC-specific configuration for `resume_transfer_operation`
|
927
|
+
# @return [::Gapic::Config::Method]
|
928
|
+
#
|
929
|
+
attr_reader :resume_transfer_operation
|
930
|
+
##
|
931
|
+
# RPC-specific configuration for `run_transfer_job`
|
932
|
+
# @return [::Gapic::Config::Method]
|
933
|
+
#
|
934
|
+
attr_reader :run_transfer_job
|
935
|
+
|
936
|
+
# @private
|
937
|
+
def initialize parent_rpcs = nil
|
938
|
+
get_google_service_account_config = parent_rpcs.get_google_service_account if parent_rpcs.respond_to? :get_google_service_account
|
939
|
+
@get_google_service_account = ::Gapic::Config::Method.new get_google_service_account_config
|
940
|
+
create_transfer_job_config = parent_rpcs.create_transfer_job if parent_rpcs.respond_to? :create_transfer_job
|
941
|
+
@create_transfer_job = ::Gapic::Config::Method.new create_transfer_job_config
|
942
|
+
update_transfer_job_config = parent_rpcs.update_transfer_job if parent_rpcs.respond_to? :update_transfer_job
|
943
|
+
@update_transfer_job = ::Gapic::Config::Method.new update_transfer_job_config
|
944
|
+
get_transfer_job_config = parent_rpcs.get_transfer_job if parent_rpcs.respond_to? :get_transfer_job
|
945
|
+
@get_transfer_job = ::Gapic::Config::Method.new get_transfer_job_config
|
946
|
+
list_transfer_jobs_config = parent_rpcs.list_transfer_jobs if parent_rpcs.respond_to? :list_transfer_jobs
|
947
|
+
@list_transfer_jobs = ::Gapic::Config::Method.new list_transfer_jobs_config
|
948
|
+
pause_transfer_operation_config = parent_rpcs.pause_transfer_operation if parent_rpcs.respond_to? :pause_transfer_operation
|
949
|
+
@pause_transfer_operation = ::Gapic::Config::Method.new pause_transfer_operation_config
|
950
|
+
resume_transfer_operation_config = parent_rpcs.resume_transfer_operation if parent_rpcs.respond_to? :resume_transfer_operation
|
951
|
+
@resume_transfer_operation = ::Gapic::Config::Method.new resume_transfer_operation_config
|
952
|
+
run_transfer_job_config = parent_rpcs.run_transfer_job if parent_rpcs.respond_to? :run_transfer_job
|
953
|
+
@run_transfer_job = ::Gapic::Config::Method.new run_transfer_job_config
|
954
|
+
|
955
|
+
yield self if block_given?
|
956
|
+
end
|
957
|
+
end
|
958
|
+
end
|
959
|
+
end
|
960
|
+
end
|
961
|
+
end
|
962
|
+
end
|
963
|
+
end
|
964
|
+
end
|