google-cloud-run-v2 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/lib/google/cloud/run/v2/build_pb.rb +1 -1
- data/lib/google/cloud/run/v2/builds/client.rb +2 -2
- data/lib/google/cloud/run/v2/builds/credentials.rb +2 -1
- data/lib/google/cloud/run/v2/builds/rest/client.rb +2 -2
- data/lib/google/cloud/run/v2/condition_pb.rb +2 -1
- data/lib/google/cloud/run/v2/execution_pb.rb +1 -1
- data/lib/google/cloud/run/v2/execution_template_pb.rb +1 -1
- data/lib/google/cloud/run/v2/executions/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/instance_pb.rb +7 -1
- data/lib/google/cloud/run/v2/instance_services_pb.rb +14 -2
- data/lib/google/cloud/run/v2/instances/client.rb +424 -12
- data/lib/google/cloud/run/v2/instances/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/instances/rest/client.rb +393 -12
- data/lib/google/cloud/run/v2/instances/rest/service_stub.rb +247 -0
- data/lib/google/cloud/run/v2/job_pb.rb +1 -1
- data/lib/google/cloud/run/v2/jobs/client.rb +2 -1
- data/lib/google/cloud/run/v2/jobs/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/jobs/rest/client.rb +2 -1
- data/lib/google/cloud/run/v2/k8s.min_pb.rb +3 -1
- data/lib/google/cloud/run/v2/rest.rb +1 -0
- data/lib/google/cloud/run/v2/revision_pb.rb +2 -1
- data/lib/google/cloud/run/v2/revision_template_pb.rb +2 -1
- data/lib/google/cloud/run/v2/revisions/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/sandbox_pb.rb +25 -0
- data/lib/google/cloud/run/v2/service_pb.rb +1 -1
- data/lib/google/cloud/run/v2/services/client.rb +12 -2
- data/lib/google/cloud/run/v2/services/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/services/rest/client.rb +12 -2
- data/lib/google/cloud/run/v2/source_upload/client.rb +505 -0
- data/lib/google/cloud/run/v2/source_upload/credentials.rb +48 -0
- data/lib/google/cloud/run/v2/source_upload/paths.rb +69 -0
- data/lib/google/cloud/run/v2/source_upload/rest/client.rb +452 -0
- data/lib/google/cloud/run/v2/source_upload/rest/service_stub.rb +143 -0
- data/lib/google/cloud/run/v2/source_upload/rest.rb +53 -0
- data/lib/google/cloud/run/v2/source_upload.rb +56 -0
- data/lib/google/cloud/run/v2/source_upload_pb.rb +29 -0
- data/lib/google/cloud/run/v2/source_upload_services_pb.rb +52 -0
- data/lib/google/cloud/run/v2/task_pb.rb +2 -1
- data/lib/google/cloud/run/v2/task_template_pb.rb +2 -1
- data/lib/google/cloud/run/v2/tasks/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/vendor_settings_pb.rb +6 -1
- data/lib/google/cloud/run/v2/version.rb +1 -1
- data/lib/google/cloud/run/v2/worker_pool_pb.rb +1 -1
- data/lib/google/cloud/run/v2/worker_pool_revision_template_pb.rb +2 -1
- data/lib/google/cloud/run/v2/worker_pools/client.rb +2 -1
- data/lib/google/cloud/run/v2/worker_pools/credentials.rb +3 -1
- data/lib/google/cloud/run/v2/worker_pools/rest/client.rb +2 -1
- data/lib/google/cloud/run/v2.rb +1 -0
- data/proto_docs/google/cloud/run/v2/build.rb +2 -2
- data/proto_docs/google/cloud/run/v2/condition.rb +29 -3
- data/proto_docs/google/cloud/run/v2/execution.rb +7 -1
- data/proto_docs/google/cloud/run/v2/execution_template.rb +10 -0
- data/proto_docs/google/cloud/run/v2/instance.rb +74 -32
- data/proto_docs/google/cloud/run/v2/job.rb +9 -1
- data/proto_docs/google/cloud/run/v2/k8s.min.rb +78 -16
- data/proto_docs/google/cloud/run/v2/revision.rb +17 -2
- data/proto_docs/google/cloud/run/v2/revision_template.rb +16 -1
- data/proto_docs/google/cloud/run/v2/sandbox.rb +67 -0
- data/proto_docs/google/cloud/run/v2/service.rb +18 -1
- data/proto_docs/google/cloud/run/v2/source_upload.rb +48 -0
- data/proto_docs/google/cloud/run/v2/task.rb +6 -0
- data/proto_docs/google/cloud/run/v2/task_template.rb +6 -0
- data/proto_docs/google/cloud/run/v2/vendor_settings.rb +80 -2
- data/proto_docs/google/cloud/run/v2/worker_pool.rb +2 -1
- data/proto_docs/google/cloud/run/v2/worker_pool_revision_template.rb +9 -0
- metadata +13 -1
|
@@ -225,11 +225,14 @@ module Google
|
|
|
225
225
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
226
226
|
#
|
|
227
227
|
# @param parent [::String]
|
|
228
|
+
# Required. The location and project in which this Instance should be
|
|
229
|
+
# created.
|
|
228
230
|
# @param instance [::Google::Cloud::Run::V2::Instance, ::Hash]
|
|
229
231
|
# @param instance_id [::String]
|
|
230
|
-
#
|
|
232
|
+
# Optional. The unique identifier for the Instance. It must begin with
|
|
231
233
|
# letter, and cannot end with hyphen; must contain fewer than 50 characters.
|
|
232
234
|
# The name of the instance becomes \\{parent}/instances/\\{instance_id}.
|
|
235
|
+
# If not provided, the server will generate a unique `instance_id`.
|
|
233
236
|
# @param validate_only [::Boolean]
|
|
234
237
|
# Optional. Indicates that the request should be validated and default values
|
|
235
238
|
# populated, without persisting the request or creating any resources.
|
|
@@ -301,7 +304,103 @@ module Google
|
|
|
301
304
|
end
|
|
302
305
|
|
|
303
306
|
##
|
|
304
|
-
#
|
|
307
|
+
# Updates an Instance.
|
|
308
|
+
#
|
|
309
|
+
# @overload update_instance(request, options = nil)
|
|
310
|
+
# Pass arguments to `update_instance` via a request object, either of type
|
|
311
|
+
# {::Google::Cloud::Run::V2::UpdateInstanceRequest} or an equivalent Hash.
|
|
312
|
+
#
|
|
313
|
+
# @param request [::Google::Cloud::Run::V2::UpdateInstanceRequest, ::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_instance(update_mask: nil, instance: nil, validate_only: nil, allow_missing: nil)
|
|
320
|
+
# Pass arguments to `update_instance` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
325
|
+
# Optional. The list of fields to be updated.
|
|
326
|
+
# @param instance [::Google::Cloud::Run::V2::Instance, ::Hash]
|
|
327
|
+
# Required. The Instance to be updated.
|
|
328
|
+
# @param validate_only [::Boolean]
|
|
329
|
+
# Optional. Indicates that the request should be validated and default values
|
|
330
|
+
# populated, without persisting the request or updating any resources.
|
|
331
|
+
# @param allow_missing [::Boolean]
|
|
332
|
+
# Optional. If set to `true`, and if the Instance does not exist, it will
|
|
333
|
+
# create a new one. The caller must have `run.instances.create` permissions
|
|
334
|
+
# if this is set to `true` and the Instance does not exist.
|
|
335
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
336
|
+
# @yieldparam result [::Gapic::Operation]
|
|
337
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
338
|
+
#
|
|
339
|
+
# @return [::Gapic::Operation]
|
|
340
|
+
#
|
|
341
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
342
|
+
#
|
|
343
|
+
# @example Basic example
|
|
344
|
+
# require "google/cloud/run/v2"
|
|
345
|
+
#
|
|
346
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
347
|
+
# client = Google::Cloud::Run::V2::Instances::Rest::Client.new
|
|
348
|
+
#
|
|
349
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
350
|
+
# request = Google::Cloud::Run::V2::UpdateInstanceRequest.new
|
|
351
|
+
#
|
|
352
|
+
# # Call the update_instance method.
|
|
353
|
+
# result = client.update_instance request
|
|
354
|
+
#
|
|
355
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
356
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
357
|
+
# # Here is how to wait for a response.
|
|
358
|
+
# result.wait_until_done! timeout: 60
|
|
359
|
+
# if result.response?
|
|
360
|
+
# p result.response
|
|
361
|
+
# else
|
|
362
|
+
# puts "No response received."
|
|
363
|
+
# end
|
|
364
|
+
#
|
|
365
|
+
def update_instance request, options = nil
|
|
366
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
367
|
+
|
|
368
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::UpdateInstanceRequest
|
|
369
|
+
|
|
370
|
+
# Converts hash and nil to an options object
|
|
371
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
372
|
+
|
|
373
|
+
# Customize the options with defaults
|
|
374
|
+
call_metadata = @config.rpcs.update_instance.metadata.to_h
|
|
375
|
+
|
|
376
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
377
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
378
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
379
|
+
gapic_version: ::Google::Cloud::Run::V2::VERSION,
|
|
380
|
+
transports_version_send: [:rest]
|
|
381
|
+
|
|
382
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
383
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
384
|
+
|
|
385
|
+
options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
|
|
386
|
+
metadata: call_metadata,
|
|
387
|
+
retry_policy: @config.rpcs.update_instance.retry_policy
|
|
388
|
+
|
|
389
|
+
options.apply_defaults timeout: @config.timeout,
|
|
390
|
+
metadata: @config.metadata,
|
|
391
|
+
retry_policy: @config.retry_policy
|
|
392
|
+
|
|
393
|
+
@instances_stub.update_instance request, options do |result, operation|
|
|
394
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
|
395
|
+
yield result, operation if block_given?
|
|
396
|
+
throw :response, result
|
|
397
|
+
end
|
|
398
|
+
rescue ::Gapic::Rest::Error => e
|
|
399
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
##
|
|
403
|
+
# Deletes an Instance
|
|
305
404
|
#
|
|
306
405
|
# @overload delete_instance(request, options = nil)
|
|
307
406
|
# Pass arguments to `delete_instance` via a request object, either of type
|
|
@@ -319,6 +418,7 @@ module Google
|
|
|
319
418
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
320
419
|
#
|
|
321
420
|
# @param name [::String]
|
|
421
|
+
# Required. The name of the Instance to delete.
|
|
322
422
|
# @param validate_only [::Boolean]
|
|
323
423
|
# Optional. Indicates that the request should be validated without actually
|
|
324
424
|
# deleting any resources.
|
|
@@ -393,7 +493,7 @@ module Google
|
|
|
393
493
|
end
|
|
394
494
|
|
|
395
495
|
##
|
|
396
|
-
# Gets
|
|
496
|
+
# Gets an Instance
|
|
397
497
|
#
|
|
398
498
|
# @overload get_instance(request, options = nil)
|
|
399
499
|
# Pass arguments to `get_instance` via a request object, either of type
|
|
@@ -411,6 +511,7 @@ module Google
|
|
|
411
511
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
412
512
|
#
|
|
413
513
|
# @param name [::String]
|
|
514
|
+
# Required. The name of the Instance to retrieve.
|
|
414
515
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
415
516
|
# @yieldparam result [::Google::Cloud::Run::V2::Instance]
|
|
416
517
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
@@ -489,8 +590,6 @@ module Google
|
|
|
489
590
|
#
|
|
490
591
|
# @param parent [::String]
|
|
491
592
|
# Required. The location and project to list resources on.
|
|
492
|
-
# Format: projects/\\{project}/locations/\\{location}, where \\{project} can be
|
|
493
|
-
# project id or number.
|
|
494
593
|
# @param page_size [::Integer]
|
|
495
594
|
# Optional. Maximum number of Instances to return in this call.
|
|
496
595
|
# @param page_token [::String]
|
|
@@ -583,9 +682,6 @@ module Google
|
|
|
583
682
|
#
|
|
584
683
|
# @param name [::String]
|
|
585
684
|
# Required. The name of the Instance to stop.
|
|
586
|
-
# Format:
|
|
587
|
-
# `projects/{project}/locations/{location}/instances/{instance}`,
|
|
588
|
-
# where `{project}` can be project id or number.
|
|
589
685
|
# @param validate_only [::Boolean]
|
|
590
686
|
# Optional. Indicates that the request should be validated without actually
|
|
591
687
|
# stopping any resources.
|
|
@@ -678,10 +774,7 @@ module Google
|
|
|
678
774
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
679
775
|
#
|
|
680
776
|
# @param name [::String]
|
|
681
|
-
# Required. The name of the Instance to
|
|
682
|
-
# Format:
|
|
683
|
-
# `projects/{project}/locations/{location}/instances/{instance}`,
|
|
684
|
-
# where `{project}` can be project id or number.
|
|
777
|
+
# Required. The name of the Instance to start.
|
|
685
778
|
# @param validate_only [::Boolean]
|
|
686
779
|
# Optional. Indicates that the request should be validated without actually
|
|
687
780
|
# stopping any resources.
|
|
@@ -755,6 +848,266 @@ module Google
|
|
|
755
848
|
raise ::Google::Cloud::Error.from_error(e)
|
|
756
849
|
end
|
|
757
850
|
|
|
851
|
+
##
|
|
852
|
+
# Gets the IAM Access Control policy currently in effect for the given
|
|
853
|
+
# Instance. This result does not include any inherited policies.
|
|
854
|
+
#
|
|
855
|
+
# @overload get_iam_policy(request, options = nil)
|
|
856
|
+
# Pass arguments to `get_iam_policy` via a request object, either of type
|
|
857
|
+
# {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
|
858
|
+
#
|
|
859
|
+
# @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
|
|
860
|
+
# A request object representing the call parameters. Required. To specify no
|
|
861
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
862
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
863
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
864
|
+
#
|
|
865
|
+
# @overload get_iam_policy(resource: nil, options: nil)
|
|
866
|
+
# Pass arguments to `get_iam_policy` via keyword arguments. Note that at
|
|
867
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
868
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
869
|
+
#
|
|
870
|
+
# @param resource [::String]
|
|
871
|
+
# REQUIRED: The resource for which the policy is being requested.
|
|
872
|
+
# See the operation documentation for the appropriate value for this field.
|
|
873
|
+
# @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
|
|
874
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
|
875
|
+
# `GetIamPolicy`.
|
|
876
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
877
|
+
# @yieldparam result [::Google::Iam::V1::Policy]
|
|
878
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
879
|
+
#
|
|
880
|
+
# @return [::Google::Iam::V1::Policy]
|
|
881
|
+
#
|
|
882
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
883
|
+
#
|
|
884
|
+
# @example Basic example
|
|
885
|
+
# require "google/cloud/run/v2"
|
|
886
|
+
#
|
|
887
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
888
|
+
# client = Google::Cloud::Run::V2::Instances::Rest::Client.new
|
|
889
|
+
#
|
|
890
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
891
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
|
892
|
+
#
|
|
893
|
+
# # Call the get_iam_policy method.
|
|
894
|
+
# result = client.get_iam_policy request
|
|
895
|
+
#
|
|
896
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
|
897
|
+
# p result
|
|
898
|
+
#
|
|
899
|
+
def get_iam_policy request, options = nil
|
|
900
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
901
|
+
|
|
902
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
|
|
903
|
+
|
|
904
|
+
# Converts hash and nil to an options object
|
|
905
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
906
|
+
|
|
907
|
+
# Customize the options with defaults
|
|
908
|
+
call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
|
909
|
+
|
|
910
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
911
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
912
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
913
|
+
gapic_version: ::Google::Cloud::Run::V2::VERSION,
|
|
914
|
+
transports_version_send: [:rest]
|
|
915
|
+
|
|
916
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
917
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
918
|
+
|
|
919
|
+
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
|
920
|
+
metadata: call_metadata,
|
|
921
|
+
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
|
922
|
+
|
|
923
|
+
options.apply_defaults timeout: @config.timeout,
|
|
924
|
+
metadata: @config.metadata,
|
|
925
|
+
retry_policy: @config.retry_policy
|
|
926
|
+
|
|
927
|
+
@instances_stub.get_iam_policy request, options do |result, operation|
|
|
928
|
+
yield result, operation if block_given?
|
|
929
|
+
end
|
|
930
|
+
rescue ::Gapic::Rest::Error => e
|
|
931
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
932
|
+
end
|
|
933
|
+
|
|
934
|
+
##
|
|
935
|
+
# Sets the IAM Access control policy for the specified Instance. Overwrites
|
|
936
|
+
# any existing policy.
|
|
937
|
+
#
|
|
938
|
+
# @overload set_iam_policy(request, options = nil)
|
|
939
|
+
# Pass arguments to `set_iam_policy` via a request object, either of type
|
|
940
|
+
# {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
|
941
|
+
#
|
|
942
|
+
# @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
|
|
943
|
+
# A request object representing the call parameters. Required. To specify no
|
|
944
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
945
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
946
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
947
|
+
#
|
|
948
|
+
# @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
|
|
949
|
+
# Pass arguments to `set_iam_policy` via keyword arguments. Note that at
|
|
950
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
951
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
952
|
+
#
|
|
953
|
+
# @param resource [::String]
|
|
954
|
+
# REQUIRED: The resource for which the policy is being specified.
|
|
955
|
+
# See the operation documentation for the appropriate value for this field.
|
|
956
|
+
# @param policy [::Google::Iam::V1::Policy, ::Hash]
|
|
957
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
|
958
|
+
# the policy is limited to a few 10s of KB. An empty policy is a
|
|
959
|
+
# valid policy but certain Cloud Platform services (such as Projects)
|
|
960
|
+
# might reject them.
|
|
961
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
|
962
|
+
# OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
|
|
963
|
+
# the fields in the mask will be modified. If no mask is provided, the
|
|
964
|
+
# following default mask is used:
|
|
965
|
+
#
|
|
966
|
+
# `paths: "bindings, etag"`
|
|
967
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
968
|
+
# @yieldparam result [::Google::Iam::V1::Policy]
|
|
969
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
970
|
+
#
|
|
971
|
+
# @return [::Google::Iam::V1::Policy]
|
|
972
|
+
#
|
|
973
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
974
|
+
#
|
|
975
|
+
# @example Basic example
|
|
976
|
+
# require "google/cloud/run/v2"
|
|
977
|
+
#
|
|
978
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
979
|
+
# client = Google::Cloud::Run::V2::Instances::Rest::Client.new
|
|
980
|
+
#
|
|
981
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
982
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
|
983
|
+
#
|
|
984
|
+
# # Call the set_iam_policy method.
|
|
985
|
+
# result = client.set_iam_policy request
|
|
986
|
+
#
|
|
987
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
|
988
|
+
# p result
|
|
989
|
+
#
|
|
990
|
+
def set_iam_policy request, options = nil
|
|
991
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
992
|
+
|
|
993
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
|
|
994
|
+
|
|
995
|
+
# Converts hash and nil to an options object
|
|
996
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
997
|
+
|
|
998
|
+
# Customize the options with defaults
|
|
999
|
+
call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
|
1000
|
+
|
|
1001
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1002
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1003
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1004
|
+
gapic_version: ::Google::Cloud::Run::V2::VERSION,
|
|
1005
|
+
transports_version_send: [:rest]
|
|
1006
|
+
|
|
1007
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1008
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1009
|
+
|
|
1010
|
+
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
|
1011
|
+
metadata: call_metadata,
|
|
1012
|
+
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
|
1013
|
+
|
|
1014
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1015
|
+
metadata: @config.metadata,
|
|
1016
|
+
retry_policy: @config.retry_policy
|
|
1017
|
+
|
|
1018
|
+
@instances_stub.set_iam_policy request, options do |result, operation|
|
|
1019
|
+
yield result, operation if block_given?
|
|
1020
|
+
end
|
|
1021
|
+
rescue ::Gapic::Rest::Error => e
|
|
1022
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1023
|
+
end
|
|
1024
|
+
|
|
1025
|
+
##
|
|
1026
|
+
# Returns permissions that a caller has on the specified Instance.
|
|
1027
|
+
#
|
|
1028
|
+
# There are no permissions required for making this API call.
|
|
1029
|
+
#
|
|
1030
|
+
# @overload test_iam_permissions(request, options = nil)
|
|
1031
|
+
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
|
1032
|
+
# {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
|
1033
|
+
#
|
|
1034
|
+
# @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
|
|
1035
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1036
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1037
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1038
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
1039
|
+
#
|
|
1040
|
+
# @overload test_iam_permissions(resource: nil, permissions: nil)
|
|
1041
|
+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
|
|
1042
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1043
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1044
|
+
#
|
|
1045
|
+
# @param resource [::String]
|
|
1046
|
+
# REQUIRED: The resource for which the policy detail is being requested.
|
|
1047
|
+
# See the operation documentation for the appropriate value for this field.
|
|
1048
|
+
# @param permissions [::Array<::String>]
|
|
1049
|
+
# The set of permissions to check for the `resource`. Permissions with
|
|
1050
|
+
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
|
1051
|
+
# information see
|
|
1052
|
+
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
|
1053
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
1054
|
+
# @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
|
|
1055
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
1056
|
+
#
|
|
1057
|
+
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
|
1058
|
+
#
|
|
1059
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
1060
|
+
#
|
|
1061
|
+
# @example Basic example
|
|
1062
|
+
# require "google/cloud/run/v2"
|
|
1063
|
+
#
|
|
1064
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1065
|
+
# client = Google::Cloud::Run::V2::Instances::Rest::Client.new
|
|
1066
|
+
#
|
|
1067
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1068
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
|
1069
|
+
#
|
|
1070
|
+
# # Call the test_iam_permissions method.
|
|
1071
|
+
# result = client.test_iam_permissions request
|
|
1072
|
+
#
|
|
1073
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
|
1074
|
+
# p result
|
|
1075
|
+
#
|
|
1076
|
+
def test_iam_permissions request, options = nil
|
|
1077
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1078
|
+
|
|
1079
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
|
|
1080
|
+
|
|
1081
|
+
# Converts hash and nil to an options object
|
|
1082
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1083
|
+
|
|
1084
|
+
# Customize the options with defaults
|
|
1085
|
+
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
|
1086
|
+
|
|
1087
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1088
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1089
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1090
|
+
gapic_version: ::Google::Cloud::Run::V2::VERSION,
|
|
1091
|
+
transports_version_send: [:rest]
|
|
1092
|
+
|
|
1093
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1094
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1095
|
+
|
|
1096
|
+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
|
1097
|
+
metadata: call_metadata,
|
|
1098
|
+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
|
1099
|
+
|
|
1100
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1101
|
+
metadata: @config.metadata,
|
|
1102
|
+
retry_policy: @config.retry_policy
|
|
1103
|
+
|
|
1104
|
+
@instances_stub.test_iam_permissions request, options do |result, operation|
|
|
1105
|
+
yield result, operation if block_given?
|
|
1106
|
+
end
|
|
1107
|
+
rescue ::Gapic::Rest::Error => e
|
|
1108
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1109
|
+
end
|
|
1110
|
+
|
|
758
1111
|
##
|
|
759
1112
|
# Configuration class for the Instances REST API.
|
|
760
1113
|
#
|
|
@@ -909,6 +1262,11 @@ module Google
|
|
|
909
1262
|
#
|
|
910
1263
|
attr_reader :create_instance
|
|
911
1264
|
##
|
|
1265
|
+
# RPC-specific configuration for `update_instance`
|
|
1266
|
+
# @return [::Gapic::Config::Method]
|
|
1267
|
+
#
|
|
1268
|
+
attr_reader :update_instance
|
|
1269
|
+
##
|
|
912
1270
|
# RPC-specific configuration for `delete_instance`
|
|
913
1271
|
# @return [::Gapic::Config::Method]
|
|
914
1272
|
#
|
|
@@ -933,11 +1291,28 @@ module Google
|
|
|
933
1291
|
# @return [::Gapic::Config::Method]
|
|
934
1292
|
#
|
|
935
1293
|
attr_reader :start_instance
|
|
1294
|
+
##
|
|
1295
|
+
# RPC-specific configuration for `get_iam_policy`
|
|
1296
|
+
# @return [::Gapic::Config::Method]
|
|
1297
|
+
#
|
|
1298
|
+
attr_reader :get_iam_policy
|
|
1299
|
+
##
|
|
1300
|
+
# RPC-specific configuration for `set_iam_policy`
|
|
1301
|
+
# @return [::Gapic::Config::Method]
|
|
1302
|
+
#
|
|
1303
|
+
attr_reader :set_iam_policy
|
|
1304
|
+
##
|
|
1305
|
+
# RPC-specific configuration for `test_iam_permissions`
|
|
1306
|
+
# @return [::Gapic::Config::Method]
|
|
1307
|
+
#
|
|
1308
|
+
attr_reader :test_iam_permissions
|
|
936
1309
|
|
|
937
1310
|
# @private
|
|
938
1311
|
def initialize parent_rpcs = nil
|
|
939
1312
|
create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
|
|
940
1313
|
@create_instance = ::Gapic::Config::Method.new create_instance_config
|
|
1314
|
+
update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
|
|
1315
|
+
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
|
941
1316
|
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
|
942
1317
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
|
943
1318
|
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|
|
@@ -948,6 +1323,12 @@ module Google
|
|
|
948
1323
|
@stop_instance = ::Gapic::Config::Method.new stop_instance_config
|
|
949
1324
|
start_instance_config = parent_rpcs.start_instance if parent_rpcs.respond_to? :start_instance
|
|
950
1325
|
@start_instance = ::Gapic::Config::Method.new start_instance_config
|
|
1326
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
|
1327
|
+
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
|
1328
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
|
1329
|
+
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
|
1330
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
|
1331
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
|
951
1332
|
|
|
952
1333
|
yield self if block_given?
|
|
953
1334
|
end
|