google-cloud-deploy-v1 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/lib/google/cloud/deploy/v1/cloud_deploy/client.rb +441 -0
- data/lib/google/cloud/deploy/v1/cloud_deploy/paths.rb +25 -0
- data/lib/google/cloud/deploy/v1/cloud_deploy_pb.rb +175 -0
- data/lib/google/cloud/deploy/v1/cloud_deploy_services_pb.rb +8 -0
- data/lib/google/cloud/deploy/v1/jobrun_notification_payload_pb.rb +30 -0
- data/lib/google/cloud/deploy/v1/version.rb +1 -1
- data/proto_docs/google/cloud/deploy/v1/cloud_deploy.rb +450 -8
- data/proto_docs/google/cloud/deploy/v1/jobrun_notification_payload.rb +55 -0
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/type/expr.rb +75 -0
- metadata +47 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 312989380e7a6fda223916d37a03a53755283da4267e2e136886d37bc2ae091e
|
4
|
+
data.tar.gz: b0708974b014544a14baddaaf5ad712501be3a453576e5822b8fa21ef5c949b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96b89630ec81ae8329548f8b04ce7ae64d3e320acf0497cf3b1ef1f5ec9e7fa4a9c097f0117427ec812e7595de0c42d001943210a20ac61160eebc7bcbe99b0f
|
7
|
+
data.tar.gz: a85977ade4d674228e22f8d8a1206fbc47ccbd7656fa8bedac76464f22fb74db26c061adccf92c2a01f3c491269f4c19b631ffc9e16dc995fcf87199c5205403
|
data/AUTHENTICATION.md
CHANGED
@@ -112,7 +112,7 @@ credentials are discovered.
|
|
112
112
|
To configure your system for this, simply:
|
113
113
|
|
114
114
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
115
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
115
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
116
116
|
3. Write code as if already authenticated.
|
117
117
|
|
118
118
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
@@ -18,6 +18,8 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/deploy/v1/cloud_deploy_pb"
|
21
|
+
require "google/cloud/location"
|
22
|
+
require "google/iam/v1"
|
21
23
|
|
22
24
|
module Google
|
23
25
|
module Cloud
|
@@ -109,6 +111,8 @@ module Google
|
|
109
111
|
|
110
112
|
default_config.rpcs.create_release.timeout = 60.0
|
111
113
|
|
114
|
+
default_config.rpcs.abandon_release.timeout = 60.0
|
115
|
+
|
112
116
|
default_config.rpcs.approve_rollout.timeout = 60.0
|
113
117
|
|
114
118
|
default_config.rpcs.list_rollouts.timeout = 60.0
|
@@ -123,6 +127,18 @@ module Google
|
|
123
127
|
|
124
128
|
default_config.rpcs.create_rollout.timeout = 60.0
|
125
129
|
|
130
|
+
default_config.rpcs.retry_job.timeout = 60.0
|
131
|
+
|
132
|
+
default_config.rpcs.list_job_runs.timeout = 60.0
|
133
|
+
default_config.rpcs.list_job_runs.retry_policy = {
|
134
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
135
|
+
}
|
136
|
+
|
137
|
+
default_config.rpcs.get_job_run.timeout = 60.0
|
138
|
+
default_config.rpcs.get_job_run.retry_policy = {
|
139
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
140
|
+
}
|
141
|
+
|
126
142
|
default_config.rpcs.get_config.timeout = 60.0
|
127
143
|
default_config.rpcs.get_config.retry_policy = {
|
128
144
|
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
@@ -203,6 +219,18 @@ module Google
|
|
203
219
|
config.endpoint = @config.endpoint
|
204
220
|
end
|
205
221
|
|
222
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
223
|
+
config.credentials = credentials
|
224
|
+
config.quota_project = @quota_project_id
|
225
|
+
config.endpoint = @config.endpoint
|
226
|
+
end
|
227
|
+
|
228
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
229
|
+
config.credentials = credentials
|
230
|
+
config.quota_project = @quota_project_id
|
231
|
+
config.endpoint = @config.endpoint
|
232
|
+
end
|
233
|
+
|
206
234
|
@cloud_deploy_stub = ::Gapic::ServiceStub.new(
|
207
235
|
::Google::Cloud::Deploy::V1::CloudDeploy::Stub,
|
208
236
|
credentials: credentials,
|
@@ -219,6 +247,20 @@ module Google
|
|
219
247
|
#
|
220
248
|
attr_reader :operations_client
|
221
249
|
|
250
|
+
##
|
251
|
+
# Get the associated client for mix-in of the Locations.
|
252
|
+
#
|
253
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
254
|
+
#
|
255
|
+
attr_reader :location_client
|
256
|
+
|
257
|
+
##
|
258
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
259
|
+
#
|
260
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
261
|
+
#
|
262
|
+
attr_reader :iam_policy_client
|
263
|
+
|
222
264
|
# Service calls
|
223
265
|
|
224
266
|
##
|
@@ -1628,6 +1670,93 @@ module Google
|
|
1628
1670
|
raise ::Google::Cloud::Error.from_error(e)
|
1629
1671
|
end
|
1630
1672
|
|
1673
|
+
##
|
1674
|
+
# Abandons a Release in the Delivery Pipeline.
|
1675
|
+
#
|
1676
|
+
# @overload abandon_release(request, options = nil)
|
1677
|
+
# Pass arguments to `abandon_release` via a request object, either of type
|
1678
|
+
# {::Google::Cloud::Deploy::V1::AbandonReleaseRequest} or an equivalent Hash.
|
1679
|
+
#
|
1680
|
+
# @param request [::Google::Cloud::Deploy::V1::AbandonReleaseRequest, ::Hash]
|
1681
|
+
# A request object representing the call parameters. Required. To specify no
|
1682
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1683
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1684
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1685
|
+
#
|
1686
|
+
# @overload abandon_release(name: nil)
|
1687
|
+
# Pass arguments to `abandon_release` via keyword arguments. Note that at
|
1688
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1689
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1690
|
+
#
|
1691
|
+
# @param name [::String]
|
1692
|
+
# Required. Name of the Release. Format is
|
1693
|
+
# projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/
|
1694
|
+
# releases/\\{release}.
|
1695
|
+
#
|
1696
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1697
|
+
# @yieldparam response [::Google::Cloud::Deploy::V1::AbandonReleaseResponse]
|
1698
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1699
|
+
#
|
1700
|
+
# @return [::Google::Cloud::Deploy::V1::AbandonReleaseResponse]
|
1701
|
+
#
|
1702
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1703
|
+
#
|
1704
|
+
# @example Basic example
|
1705
|
+
# require "google/cloud/deploy/v1"
|
1706
|
+
#
|
1707
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1708
|
+
# client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new
|
1709
|
+
#
|
1710
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1711
|
+
# request = Google::Cloud::Deploy::V1::AbandonReleaseRequest.new
|
1712
|
+
#
|
1713
|
+
# # Call the abandon_release method.
|
1714
|
+
# result = client.abandon_release request
|
1715
|
+
#
|
1716
|
+
# # The returned object is of type Google::Cloud::Deploy::V1::AbandonReleaseResponse.
|
1717
|
+
# p result
|
1718
|
+
#
|
1719
|
+
def abandon_release request, options = nil
|
1720
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1721
|
+
|
1722
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::AbandonReleaseRequest
|
1723
|
+
|
1724
|
+
# Converts hash and nil to an options object
|
1725
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1726
|
+
|
1727
|
+
# Customize the options with defaults
|
1728
|
+
metadata = @config.rpcs.abandon_release.metadata.to_h
|
1729
|
+
|
1730
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1731
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1732
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1733
|
+
gapic_version: ::Google::Cloud::Deploy::V1::VERSION
|
1734
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1735
|
+
|
1736
|
+
header_params = {}
|
1737
|
+
if request.name
|
1738
|
+
header_params["name"] = request.name
|
1739
|
+
end
|
1740
|
+
|
1741
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1742
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1743
|
+
|
1744
|
+
options.apply_defaults timeout: @config.rpcs.abandon_release.timeout,
|
1745
|
+
metadata: metadata,
|
1746
|
+
retry_policy: @config.rpcs.abandon_release.retry_policy
|
1747
|
+
|
1748
|
+
options.apply_defaults timeout: @config.timeout,
|
1749
|
+
metadata: @config.metadata,
|
1750
|
+
retry_policy: @config.retry_policy
|
1751
|
+
|
1752
|
+
@cloud_deploy_stub.call_rpc :abandon_release, request, options: options do |response, operation|
|
1753
|
+
yield response, operation if block_given?
|
1754
|
+
return response
|
1755
|
+
end
|
1756
|
+
rescue ::GRPC::BadStatus => e
|
1757
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1758
|
+
end
|
1759
|
+
|
1631
1760
|
##
|
1632
1761
|
# Approves a Rollout.
|
1633
1762
|
#
|
@@ -2026,6 +2155,290 @@ module Google
|
|
2026
2155
|
raise ::Google::Cloud::Error.from_error(e)
|
2027
2156
|
end
|
2028
2157
|
|
2158
|
+
##
|
2159
|
+
# Retries the specified Job in a Rollout.
|
2160
|
+
#
|
2161
|
+
# @overload retry_job(request, options = nil)
|
2162
|
+
# Pass arguments to `retry_job` via a request object, either of type
|
2163
|
+
# {::Google::Cloud::Deploy::V1::RetryJobRequest} or an equivalent Hash.
|
2164
|
+
#
|
2165
|
+
# @param request [::Google::Cloud::Deploy::V1::RetryJobRequest, ::Hash]
|
2166
|
+
# A request object representing the call parameters. Required. To specify no
|
2167
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2168
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2169
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2170
|
+
#
|
2171
|
+
# @overload retry_job(rollout: nil, phase_id: nil, job_id: nil)
|
2172
|
+
# Pass arguments to `retry_job` via keyword arguments. Note that at
|
2173
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2174
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2175
|
+
#
|
2176
|
+
# @param rollout [::String]
|
2177
|
+
# Required. Name of the Rollout. Format is
|
2178
|
+
# projects/\\{project}/locations/\\{location}/deliveryPipelines/\\{deliveryPipeline}/
|
2179
|
+
# releases/\\{release}/rollouts/\\{rollout}.
|
2180
|
+
# @param phase_id [::String]
|
2181
|
+
# Required. The phase ID the Job to retry belongs to.
|
2182
|
+
# @param job_id [::String]
|
2183
|
+
# Required. The job ID for the Job to retry.
|
2184
|
+
#
|
2185
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2186
|
+
# @yieldparam response [::Google::Cloud::Deploy::V1::RetryJobResponse]
|
2187
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2188
|
+
#
|
2189
|
+
# @return [::Google::Cloud::Deploy::V1::RetryJobResponse]
|
2190
|
+
#
|
2191
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2192
|
+
#
|
2193
|
+
# @example Basic example
|
2194
|
+
# require "google/cloud/deploy/v1"
|
2195
|
+
#
|
2196
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2197
|
+
# client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new
|
2198
|
+
#
|
2199
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2200
|
+
# request = Google::Cloud::Deploy::V1::RetryJobRequest.new
|
2201
|
+
#
|
2202
|
+
# # Call the retry_job method.
|
2203
|
+
# result = client.retry_job request
|
2204
|
+
#
|
2205
|
+
# # The returned object is of type Google::Cloud::Deploy::V1::RetryJobResponse.
|
2206
|
+
# p result
|
2207
|
+
#
|
2208
|
+
def retry_job request, options = nil
|
2209
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2210
|
+
|
2211
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::RetryJobRequest
|
2212
|
+
|
2213
|
+
# Converts hash and nil to an options object
|
2214
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2215
|
+
|
2216
|
+
# Customize the options with defaults
|
2217
|
+
metadata = @config.rpcs.retry_job.metadata.to_h
|
2218
|
+
|
2219
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2220
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2221
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2222
|
+
gapic_version: ::Google::Cloud::Deploy::V1::VERSION
|
2223
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2224
|
+
|
2225
|
+
header_params = {}
|
2226
|
+
if request.rollout
|
2227
|
+
header_params["rollout"] = request.rollout
|
2228
|
+
end
|
2229
|
+
|
2230
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2231
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2232
|
+
|
2233
|
+
options.apply_defaults timeout: @config.rpcs.retry_job.timeout,
|
2234
|
+
metadata: metadata,
|
2235
|
+
retry_policy: @config.rpcs.retry_job.retry_policy
|
2236
|
+
|
2237
|
+
options.apply_defaults timeout: @config.timeout,
|
2238
|
+
metadata: @config.metadata,
|
2239
|
+
retry_policy: @config.retry_policy
|
2240
|
+
|
2241
|
+
@cloud_deploy_stub.call_rpc :retry_job, request, options: options do |response, operation|
|
2242
|
+
yield response, operation if block_given?
|
2243
|
+
return response
|
2244
|
+
end
|
2245
|
+
rescue ::GRPC::BadStatus => e
|
2246
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2247
|
+
end
|
2248
|
+
|
2249
|
+
##
|
2250
|
+
# Lists JobRuns in a given project and location.
|
2251
|
+
#
|
2252
|
+
# @overload list_job_runs(request, options = nil)
|
2253
|
+
# Pass arguments to `list_job_runs` via a request object, either of type
|
2254
|
+
# {::Google::Cloud::Deploy::V1::ListJobRunsRequest} or an equivalent Hash.
|
2255
|
+
#
|
2256
|
+
# @param request [::Google::Cloud::Deploy::V1::ListJobRunsRequest, ::Hash]
|
2257
|
+
# A request object representing the call parameters. Required. To specify no
|
2258
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2259
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2260
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2261
|
+
#
|
2262
|
+
# @overload list_job_runs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
2263
|
+
# Pass arguments to `list_job_runs` via keyword arguments. Note that at
|
2264
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2265
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2266
|
+
#
|
2267
|
+
# @param parent [::String]
|
2268
|
+
# Required. The `Rollout` which owns this collection of `JobRun` objects.
|
2269
|
+
# @param page_size [::Integer]
|
2270
|
+
# Optional. The maximum number of `JobRun` objects to return. The service may return
|
2271
|
+
# fewer than this value. If unspecified, at most 50 `JobRun` objects will be
|
2272
|
+
# returned. The maximum value is 1000; values above 1000 will be set to 1000.
|
2273
|
+
# @param page_token [::String]
|
2274
|
+
# Optional. A page token, received from a previous `ListJobRuns` call. Provide this
|
2275
|
+
# to retrieve the subsequent page.
|
2276
|
+
#
|
2277
|
+
# When paginating, all other provided parameters match the call that provided
|
2278
|
+
# the page token.
|
2279
|
+
# @param filter [::String]
|
2280
|
+
# Optional. Filter results to be returned. See https://google.aip.dev/160 for more
|
2281
|
+
# details.
|
2282
|
+
# @param order_by [::String]
|
2283
|
+
# Optional. Field to sort by. See https://google.aip.dev/132#ordering for more details.
|
2284
|
+
#
|
2285
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2286
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::JobRun>]
|
2287
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2288
|
+
#
|
2289
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Deploy::V1::JobRun>]
|
2290
|
+
#
|
2291
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2292
|
+
#
|
2293
|
+
# @example Basic example
|
2294
|
+
# require "google/cloud/deploy/v1"
|
2295
|
+
#
|
2296
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2297
|
+
# client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new
|
2298
|
+
#
|
2299
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2300
|
+
# request = Google::Cloud::Deploy::V1::ListJobRunsRequest.new
|
2301
|
+
#
|
2302
|
+
# # Call the list_job_runs method.
|
2303
|
+
# result = client.list_job_runs request
|
2304
|
+
#
|
2305
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2306
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2307
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2308
|
+
# # methods are also available for managing paging directly.
|
2309
|
+
# result.each do |response|
|
2310
|
+
# # Each element is of type ::Google::Cloud::Deploy::V1::JobRun.
|
2311
|
+
# p response
|
2312
|
+
# end
|
2313
|
+
#
|
2314
|
+
def list_job_runs request, options = nil
|
2315
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2316
|
+
|
2317
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::ListJobRunsRequest
|
2318
|
+
|
2319
|
+
# Converts hash and nil to an options object
|
2320
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2321
|
+
|
2322
|
+
# Customize the options with defaults
|
2323
|
+
metadata = @config.rpcs.list_job_runs.metadata.to_h
|
2324
|
+
|
2325
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2326
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2327
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2328
|
+
gapic_version: ::Google::Cloud::Deploy::V1::VERSION
|
2329
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2330
|
+
|
2331
|
+
header_params = {}
|
2332
|
+
if request.parent
|
2333
|
+
header_params["parent"] = request.parent
|
2334
|
+
end
|
2335
|
+
|
2336
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2337
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2338
|
+
|
2339
|
+
options.apply_defaults timeout: @config.rpcs.list_job_runs.timeout,
|
2340
|
+
metadata: metadata,
|
2341
|
+
retry_policy: @config.rpcs.list_job_runs.retry_policy
|
2342
|
+
|
2343
|
+
options.apply_defaults timeout: @config.timeout,
|
2344
|
+
metadata: @config.metadata,
|
2345
|
+
retry_policy: @config.retry_policy
|
2346
|
+
|
2347
|
+
@cloud_deploy_stub.call_rpc :list_job_runs, request, options: options do |response, operation|
|
2348
|
+
response = ::Gapic::PagedEnumerable.new @cloud_deploy_stub, :list_job_runs, request, response, operation, options
|
2349
|
+
yield response, operation if block_given?
|
2350
|
+
return response
|
2351
|
+
end
|
2352
|
+
rescue ::GRPC::BadStatus => e
|
2353
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2354
|
+
end
|
2355
|
+
|
2356
|
+
##
|
2357
|
+
# Gets details of a single JobRun.
|
2358
|
+
#
|
2359
|
+
# @overload get_job_run(request, options = nil)
|
2360
|
+
# Pass arguments to `get_job_run` via a request object, either of type
|
2361
|
+
# {::Google::Cloud::Deploy::V1::GetJobRunRequest} or an equivalent Hash.
|
2362
|
+
#
|
2363
|
+
# @param request [::Google::Cloud::Deploy::V1::GetJobRunRequest, ::Hash]
|
2364
|
+
# A request object representing the call parameters. Required. To specify no
|
2365
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2366
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2367
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2368
|
+
#
|
2369
|
+
# @overload get_job_run(name: nil)
|
2370
|
+
# Pass arguments to `get_job_run` via keyword arguments. Note that at
|
2371
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2372
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2373
|
+
#
|
2374
|
+
# @param name [::String]
|
2375
|
+
# Required. Name of the `JobRun`. Format must be
|
2376
|
+
# projects/\\{project_id}/locations/\\{location_name}/deliveryPipelines/\\{pipeline_name}/releases/\\{release_name}/rollouts/\\{rollout_name}/jobRuns/\\{job_run_name}.
|
2377
|
+
#
|
2378
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2379
|
+
# @yieldparam response [::Google::Cloud::Deploy::V1::JobRun]
|
2380
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2381
|
+
#
|
2382
|
+
# @return [::Google::Cloud::Deploy::V1::JobRun]
|
2383
|
+
#
|
2384
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2385
|
+
#
|
2386
|
+
# @example Basic example
|
2387
|
+
# require "google/cloud/deploy/v1"
|
2388
|
+
#
|
2389
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2390
|
+
# client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new
|
2391
|
+
#
|
2392
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2393
|
+
# request = Google::Cloud::Deploy::V1::GetJobRunRequest.new
|
2394
|
+
#
|
2395
|
+
# # Call the get_job_run method.
|
2396
|
+
# result = client.get_job_run request
|
2397
|
+
#
|
2398
|
+
# # The returned object is of type Google::Cloud::Deploy::V1::JobRun.
|
2399
|
+
# p result
|
2400
|
+
#
|
2401
|
+
def get_job_run request, options = nil
|
2402
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2403
|
+
|
2404
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Deploy::V1::GetJobRunRequest
|
2405
|
+
|
2406
|
+
# Converts hash and nil to an options object
|
2407
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2408
|
+
|
2409
|
+
# Customize the options with defaults
|
2410
|
+
metadata = @config.rpcs.get_job_run.metadata.to_h
|
2411
|
+
|
2412
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2413
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2414
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2415
|
+
gapic_version: ::Google::Cloud::Deploy::V1::VERSION
|
2416
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2417
|
+
|
2418
|
+
header_params = {}
|
2419
|
+
if request.name
|
2420
|
+
header_params["name"] = request.name
|
2421
|
+
end
|
2422
|
+
|
2423
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2424
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2425
|
+
|
2426
|
+
options.apply_defaults timeout: @config.rpcs.get_job_run.timeout,
|
2427
|
+
metadata: metadata,
|
2428
|
+
retry_policy: @config.rpcs.get_job_run.retry_policy
|
2429
|
+
|
2430
|
+
options.apply_defaults timeout: @config.timeout,
|
2431
|
+
metadata: @config.metadata,
|
2432
|
+
retry_policy: @config.retry_policy
|
2433
|
+
|
2434
|
+
@cloud_deploy_stub.call_rpc :get_job_run, request, options: options do |response, operation|
|
2435
|
+
yield response, operation if block_given?
|
2436
|
+
return response
|
2437
|
+
end
|
2438
|
+
rescue ::GRPC::BadStatus => e
|
2439
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2440
|
+
end
|
2441
|
+
|
2029
2442
|
##
|
2030
2443
|
# Gets the configuration for a location.
|
2031
2444
|
#
|
@@ -2312,6 +2725,11 @@ module Google
|
|
2312
2725
|
#
|
2313
2726
|
attr_reader :create_release
|
2314
2727
|
##
|
2728
|
+
# RPC-specific configuration for `abandon_release`
|
2729
|
+
# @return [::Gapic::Config::Method]
|
2730
|
+
#
|
2731
|
+
attr_reader :abandon_release
|
2732
|
+
##
|
2315
2733
|
# RPC-specific configuration for `approve_rollout`
|
2316
2734
|
# @return [::Gapic::Config::Method]
|
2317
2735
|
#
|
@@ -2332,6 +2750,21 @@ module Google
|
|
2332
2750
|
#
|
2333
2751
|
attr_reader :create_rollout
|
2334
2752
|
##
|
2753
|
+
# RPC-specific configuration for `retry_job`
|
2754
|
+
# @return [::Gapic::Config::Method]
|
2755
|
+
#
|
2756
|
+
attr_reader :retry_job
|
2757
|
+
##
|
2758
|
+
# RPC-specific configuration for `list_job_runs`
|
2759
|
+
# @return [::Gapic::Config::Method]
|
2760
|
+
#
|
2761
|
+
attr_reader :list_job_runs
|
2762
|
+
##
|
2763
|
+
# RPC-specific configuration for `get_job_run`
|
2764
|
+
# @return [::Gapic::Config::Method]
|
2765
|
+
#
|
2766
|
+
attr_reader :get_job_run
|
2767
|
+
##
|
2335
2768
|
# RPC-specific configuration for `get_config`
|
2336
2769
|
# @return [::Gapic::Config::Method]
|
2337
2770
|
#
|
@@ -2365,6 +2798,8 @@ module Google
|
|
2365
2798
|
@get_release = ::Gapic::Config::Method.new get_release_config
|
2366
2799
|
create_release_config = parent_rpcs.create_release if parent_rpcs.respond_to? :create_release
|
2367
2800
|
@create_release = ::Gapic::Config::Method.new create_release_config
|
2801
|
+
abandon_release_config = parent_rpcs.abandon_release if parent_rpcs.respond_to? :abandon_release
|
2802
|
+
@abandon_release = ::Gapic::Config::Method.new abandon_release_config
|
2368
2803
|
approve_rollout_config = parent_rpcs.approve_rollout if parent_rpcs.respond_to? :approve_rollout
|
2369
2804
|
@approve_rollout = ::Gapic::Config::Method.new approve_rollout_config
|
2370
2805
|
list_rollouts_config = parent_rpcs.list_rollouts if parent_rpcs.respond_to? :list_rollouts
|
@@ -2373,6 +2808,12 @@ module Google
|
|
2373
2808
|
@get_rollout = ::Gapic::Config::Method.new get_rollout_config
|
2374
2809
|
create_rollout_config = parent_rpcs.create_rollout if parent_rpcs.respond_to? :create_rollout
|
2375
2810
|
@create_rollout = ::Gapic::Config::Method.new create_rollout_config
|
2811
|
+
retry_job_config = parent_rpcs.retry_job if parent_rpcs.respond_to? :retry_job
|
2812
|
+
@retry_job = ::Gapic::Config::Method.new retry_job_config
|
2813
|
+
list_job_runs_config = parent_rpcs.list_job_runs if parent_rpcs.respond_to? :list_job_runs
|
2814
|
+
@list_job_runs = ::Gapic::Config::Method.new list_job_runs_config
|
2815
|
+
get_job_run_config = parent_rpcs.get_job_run if parent_rpcs.respond_to? :get_job_run
|
2816
|
+
@get_job_run = ::Gapic::Config::Method.new get_job_run_config
|
2376
2817
|
get_config_config = parent_rpcs.get_config if parent_rpcs.respond_to? :get_config
|
2377
2818
|
@get_config = ::Gapic::Config::Method.new get_config_config
|
2378
2819
|
|
@@ -98,6 +98,31 @@ module Google
|
|
98
98
|
"projects/#{project}/locations/#{location}/deliveryPipelines/#{delivery_pipeline}"
|
99
99
|
end
|
100
100
|
|
101
|
+
##
|
102
|
+
# Create a fully-qualified JobRun resource string.
|
103
|
+
#
|
104
|
+
# The resource will be in the following format:
|
105
|
+
#
|
106
|
+
# `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}`
|
107
|
+
#
|
108
|
+
# @param project [String]
|
109
|
+
# @param location [String]
|
110
|
+
# @param delivery_pipeline [String]
|
111
|
+
# @param release [String]
|
112
|
+
# @param rollout [String]
|
113
|
+
# @param job_run [String]
|
114
|
+
#
|
115
|
+
# @return [::String]
|
116
|
+
def job_run_path project:, location:, delivery_pipeline:, release:, rollout:, job_run:
|
117
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
118
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
119
|
+
raise ::ArgumentError, "delivery_pipeline cannot contain /" if delivery_pipeline.to_s.include? "/"
|
120
|
+
raise ::ArgumentError, "release cannot contain /" if release.to_s.include? "/"
|
121
|
+
raise ::ArgumentError, "rollout cannot contain /" if rollout.to_s.include? "/"
|
122
|
+
|
123
|
+
"projects/#{project}/locations/#{location}/deliveryPipelines/#{delivery_pipeline}/releases/#{release}/rollouts/#{rollout}/jobRuns/#{job_run}"
|
124
|
+
end
|
125
|
+
|
101
126
|
##
|
102
127
|
# Create a fully-qualified Location resource string.
|
103
128
|
#
|