google-cloud-batch-v1 0.21.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c6d395c50daba4f41cd99b061f77f688f1d73030a432778d69591e95cc3069e
4
- data.tar.gz: 5dacafb4a952376415f0a8dc8705e4764d994921514b9af0b4c88eef20cc077b
3
+ metadata.gz: c9f6ce6c174625239a8950fe740d3f48d2605d3b068da46521e7926bd012783b
4
+ data.tar.gz: 007be9104abde8554204f7fe582ffe0ac20067f46ebbd71116c61d54bbdc52bd
5
5
  SHA512:
6
- metadata.gz: b038c928bd1ce7036bb5549e17518bb893221bf5e69d92e4a6a9d06ec2e43cf8dfb608c6d63894aaa5da0b4120dea1bc049895fcdba541097edf860613d89700
7
- data.tar.gz: cd1f31c364e3e16b405fb44fce6ce95ac39e6a6f368b293c9532829105352ef34b8b12780fee71b4eb2c6c4a022987643a40c82162979ac992e0261f17d88d67
6
+ metadata.gz: b081304e24827b523a75930434420217f003bb500295ab082ee95c30d005861ffe643639d758c4acdd2816c0bafe06551a77427ce5fe7fd95985b3e95ab233e7
7
+ data.tar.gz: 349db8fdea3a9f2ba18f0d311301c76541325b28744ce64d7ea98406752db9771d90ad1b10a9b3e5400d281b7114740af939963a0e4497addc4f3cf9412edf74
@@ -16,7 +16,7 @@ require 'google/protobuf/empty_pb'
16
16
  require 'google/protobuf/timestamp_pb'
17
17
 
18
18
 
19
- descriptor_data = "\n!google/cloud/batch/v1/batch.proto\x12\x15google.cloud.batch.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/cloud/batch/v1/job.proto\x1a google/cloud/batch/v1/task.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9b\x01\n\x10\x43reateJobRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\x12\x18\x62\x61tch.googleapis.com/Job\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12,\n\x03job\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"?\n\rGetJobRequest\x12.\n\x04name\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x62\x61tch.googleapis.com/Job\"N\n\x10\x44\x65leteJobRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"o\n\x0fListJobsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"j\n\x10ListJobsResponse\x12(\n\x04jobs\x18\x01 \x03(\x0b\x32\x1a.google.cloud.batch.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x81\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"m\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.batch.v1.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"A\n\x0eGetTaskRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x62\x61tch.googleapis.com/Task\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xb6\x08\n\x0c\x42\x61tchService\x12\x9b\x01\n\tCreateJob\x12\'.google.cloud.batch.v1.CreateJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"I\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x83\x01\n\x06GetJob\x12$.google.cloud.batch.v1.GetJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xcf\x01\n\tDeleteJob\x12\'.google.cloud.batch.v1.DeleteJobRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.batch.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\x96\x01\n\x08ListJobs\x12&.google.cloud.batch.v1.ListJobsRequest\x1a\'.google.cloud.batch.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x9b\x01\n\x07GetTask\x12%.google.cloud.batch.v1.GetTaskRequest\x1a\x1b.google.cloud.batch.v1.Task\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}\x12\xae\x01\n\tListTasks\x12\'.google.cloud.batch.v1.ListTasksRequest\x1a(.google.cloud.batch.v1.ListTasksResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks\x1aH\xca\x41\x14\x62\x61tch.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xab\x01\n\x19\x63om.google.cloud.batch.v1B\nBatchProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3"
19
+ descriptor_data = "\n!google/cloud/batch/v1/batch.proto\x12\x15google.cloud.batch.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/cloud/batch/v1/job.proto\x1a google/cloud/batch/v1/task.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9b\x01\n\x10\x43reateJobRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\x12\x18\x62\x61tch.googleapis.com/Job\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12,\n\x03job\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"?\n\rGetJobRequest\x12.\n\x04name\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x62\x61tch.googleapis.com/Job\"N\n\x10\x44\x65leteJobRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"c\n\x10\x43\x61ncelJobRequest\x12.\n\x04name\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x62\x61tch.googleapis.com/Job\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x13\n\x11\x43\x61ncelJobResponse\"o\n\x0fListJobsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"j\n\x10ListJobsResponse\x12(\n\x04jobs\x18\x01 \x03(\x0b\x32\x1a.google.cloud.batch.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x81\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"m\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.batch.v1.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"A\n\x0eGetTaskRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x62\x61tch.googleapis.com/Task\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xa5\n\n\x0c\x42\x61tchService\x12\x9b\x01\n\tCreateJob\x12\'.google.cloud.batch.v1.CreateJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"I\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x83\x01\n\x06GetJob\x12$.google.cloud.batch.v1.GetJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xcf\x01\n\tDeleteJob\x12\'.google.cloud.batch.v1.DeleteJobRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.batch.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\xec\x01\n\tCancelJob\x12\'.google.cloud.batch.v1.CancelJobRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41R\n\'google.cloud.batch.v1.CancelJobResponse\x12\'google.cloud.batch.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/locations/*/jobs/*}:cancel:\x01*\x12\x96\x01\n\x08ListJobs\x12&.google.cloud.batch.v1.ListJobsRequest\x1a\'.google.cloud.batch.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x9b\x01\n\x07GetTask\x12%.google.cloud.batch.v1.GetTaskRequest\x1a\x1b.google.cloud.batch.v1.Task\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}\x12\xae\x01\n\tListTasks\x12\'.google.cloud.batch.v1.ListTasksRequest\x1a(.google.cloud.batch.v1.ListTasksResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks\x1aH\xca\x41\x14\x62\x61tch.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xab\x01\n\x19\x63om.google.cloud.batch.v1B\nBatchProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3"
20
20
 
21
21
  pool = Google::Protobuf::DescriptorPool.generated_pool
22
22
 
@@ -52,6 +52,8 @@ module Google
52
52
  CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.CreateJobRequest").msgclass
53
53
  GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GetJobRequest").msgclass
54
54
  DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.DeleteJobRequest").msgclass
55
+ CancelJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.CancelJobRequest").msgclass
56
+ CancelJobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.CancelJobResponse").msgclass
55
57
  ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsRequest").msgclass
56
58
  ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsResponse").msgclass
57
59
  ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListTasksRequest").msgclass
@@ -82,6 +82,8 @@ module Google
82
82
 
83
83
  default_config.rpcs.delete_job.timeout = 60.0
84
84
 
85
+ default_config.rpcs.cancel_job.timeout = 60.0
86
+
85
87
  default_config.rpcs.list_jobs.timeout = 60.0
86
88
  default_config.rpcs.list_jobs.retry_policy = {
87
89
  initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
@@ -546,6 +548,114 @@ module Google
546
548
  raise ::Google::Cloud::Error.from_error(e)
547
549
  end
548
550
 
551
+ ##
552
+ # Cancel a Job.
553
+ #
554
+ # @overload cancel_job(request, options = nil)
555
+ # Pass arguments to `cancel_job` via a request object, either of type
556
+ # {::Google::Cloud::Batch::V1::CancelJobRequest} or an equivalent Hash.
557
+ #
558
+ # @param request [::Google::Cloud::Batch::V1::CancelJobRequest, ::Hash]
559
+ # A request object representing the call parameters. Required. To specify no
560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
561
+ # @param options [::Gapic::CallOptions, ::Hash]
562
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
563
+ #
564
+ # @overload cancel_job(name: nil, request_id: nil)
565
+ # Pass arguments to `cancel_job` via keyword arguments. Note that at
566
+ # least one keyword argument is required. To specify no parameters, or to keep all
567
+ # the default parameter values, pass an empty Hash as a request object (see above).
568
+ #
569
+ # @param name [::String]
570
+ # Required. Job name.
571
+ # @param request_id [::String]
572
+ # Optional. An optional request ID to identify requests. Specify a unique
573
+ # request ID so that if you must retry your request, the server will know to
574
+ # ignore the request if it has already been completed. The server will
575
+ # guarantee that for at least 60 minutes after the first request.
576
+ #
577
+ # For example, consider a situation where you make an initial request and
578
+ # the request times out. If you make the request again with the same request
579
+ # ID, the server can check if original operation with the same request ID
580
+ # was received, and if so, will ignore the second request. This prevents
581
+ # clients from accidentally creating duplicate commitments.
582
+ #
583
+ # The request ID must be a valid UUID with the exception that zero UUID is
584
+ # not supported (00000000-0000-0000-0000-000000000000).
585
+ #
586
+ # @yield [response, operation] Access the result along with the RPC operation
587
+ # @yieldparam response [::Gapic::Operation]
588
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
589
+ #
590
+ # @return [::Gapic::Operation]
591
+ #
592
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
593
+ #
594
+ # @example Basic example
595
+ # require "google/cloud/batch/v1"
596
+ #
597
+ # # Create a client object. The client can be reused for multiple calls.
598
+ # client = Google::Cloud::Batch::V1::BatchService::Client.new
599
+ #
600
+ # # Create a request. To set request fields, pass in keyword arguments.
601
+ # request = Google::Cloud::Batch::V1::CancelJobRequest.new
602
+ #
603
+ # # Call the cancel_job method.
604
+ # result = client.cancel_job request
605
+ #
606
+ # # The returned object is of type Gapic::Operation. You can use it to
607
+ # # check the status of an operation, cancel it, or wait for results.
608
+ # # Here is how to wait for a response.
609
+ # result.wait_until_done! timeout: 60
610
+ # if result.response?
611
+ # p result.response
612
+ # else
613
+ # puts "No response received."
614
+ # end
615
+ #
616
+ def cancel_job request, options = nil
617
+ raise ::ArgumentError, "request must be provided" if request.nil?
618
+
619
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CancelJobRequest
620
+
621
+ # Converts hash and nil to an options object
622
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
623
+
624
+ # Customize the options with defaults
625
+ metadata = @config.rpcs.cancel_job.metadata.to_h
626
+
627
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
628
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
629
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
630
+ gapic_version: ::Google::Cloud::Batch::V1::VERSION
631
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
632
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
633
+
634
+ header_params = {}
635
+ if request.name
636
+ header_params["name"] = request.name
637
+ end
638
+
639
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
640
+ metadata[:"x-goog-request-params"] ||= request_params_header
641
+
642
+ options.apply_defaults timeout: @config.rpcs.cancel_job.timeout,
643
+ metadata: metadata,
644
+ retry_policy: @config.rpcs.cancel_job.retry_policy
645
+
646
+ options.apply_defaults timeout: @config.timeout,
647
+ metadata: @config.metadata,
648
+ retry_policy: @config.retry_policy
649
+
650
+ @batch_service_stub.call_rpc :cancel_job, request, options: options do |response, operation|
651
+ response = ::Gapic::Operation.new response, @operations_client, options: options
652
+ yield response, operation if block_given?
653
+ throw :response, response
654
+ end
655
+ rescue ::GRPC::BadStatus => e
656
+ raise ::Google::Cloud::Error.from_error(e)
657
+ end
658
+
549
659
  ##
550
660
  # List all Jobs for a project within a region.
551
661
  #
@@ -1014,6 +1124,11 @@ module Google
1014
1124
  #
1015
1125
  attr_reader :delete_job
1016
1126
  ##
1127
+ # RPC-specific configuration for `cancel_job`
1128
+ # @return [::Gapic::Config::Method]
1129
+ #
1130
+ attr_reader :cancel_job
1131
+ ##
1017
1132
  # RPC-specific configuration for `list_jobs`
1018
1133
  # @return [::Gapic::Config::Method]
1019
1134
  #
@@ -1037,6 +1152,8 @@ module Google
1037
1152
  @get_job = ::Gapic::Config::Method.new get_job_config
1038
1153
  delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
1039
1154
  @delete_job = ::Gapic::Config::Method.new delete_job_config
1155
+ cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job
1156
+ @cancel_job = ::Gapic::Config::Method.new cancel_job_config
1040
1157
  list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
1041
1158
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
1042
1159
  get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task
@@ -84,6 +84,8 @@ module Google
84
84
 
85
85
  default_config.rpcs.delete_job.timeout = 60.0
86
86
 
87
+ default_config.rpcs.cancel_job.timeout = 60.0
88
+
87
89
  default_config.rpcs.list_jobs.timeout = 60.0
88
90
  default_config.rpcs.list_jobs.retry_policy = {
89
91
  initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
@@ -519,6 +521,107 @@ module Google
519
521
  raise ::Google::Cloud::Error.from_error(e)
520
522
  end
521
523
 
524
+ ##
525
+ # Cancel a Job.
526
+ #
527
+ # @overload cancel_job(request, options = nil)
528
+ # Pass arguments to `cancel_job` via a request object, either of type
529
+ # {::Google::Cloud::Batch::V1::CancelJobRequest} or an equivalent Hash.
530
+ #
531
+ # @param request [::Google::Cloud::Batch::V1::CancelJobRequest, ::Hash]
532
+ # A request object representing the call parameters. Required. To specify no
533
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
534
+ # @param options [::Gapic::CallOptions, ::Hash]
535
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
536
+ #
537
+ # @overload cancel_job(name: nil, request_id: nil)
538
+ # Pass arguments to `cancel_job` via keyword arguments. Note that at
539
+ # least one keyword argument is required. To specify no parameters, or to keep all
540
+ # the default parameter values, pass an empty Hash as a request object (see above).
541
+ #
542
+ # @param name [::String]
543
+ # Required. Job name.
544
+ # @param request_id [::String]
545
+ # Optional. An optional request ID to identify requests. Specify a unique
546
+ # request ID so that if you must retry your request, the server will know to
547
+ # ignore the request if it has already been completed. The server will
548
+ # guarantee that for at least 60 minutes after the first request.
549
+ #
550
+ # For example, consider a situation where you make an initial request and
551
+ # the request times out. If you make the request again with the same request
552
+ # ID, the server can check if original operation with the same request ID
553
+ # was received, and if so, will ignore the second request. This prevents
554
+ # clients from accidentally creating duplicate commitments.
555
+ #
556
+ # The request ID must be a valid UUID with the exception that zero UUID is
557
+ # not supported (00000000-0000-0000-0000-000000000000).
558
+ # @yield [result, operation] Access the result along with the TransportOperation object
559
+ # @yieldparam result [::Gapic::Operation]
560
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
561
+ #
562
+ # @return [::Gapic::Operation]
563
+ #
564
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
565
+ #
566
+ # @example Basic example
567
+ # require "google/cloud/batch/v1"
568
+ #
569
+ # # Create a client object. The client can be reused for multiple calls.
570
+ # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new
571
+ #
572
+ # # Create a request. To set request fields, pass in keyword arguments.
573
+ # request = Google::Cloud::Batch::V1::CancelJobRequest.new
574
+ #
575
+ # # Call the cancel_job method.
576
+ # result = client.cancel_job request
577
+ #
578
+ # # The returned object is of type Gapic::Operation. You can use it to
579
+ # # check the status of an operation, cancel it, or wait for results.
580
+ # # Here is how to wait for a response.
581
+ # result.wait_until_done! timeout: 60
582
+ # if result.response?
583
+ # p result.response
584
+ # else
585
+ # puts "No response received."
586
+ # end
587
+ #
588
+ def cancel_job request, options = nil
589
+ raise ::ArgumentError, "request must be provided" if request.nil?
590
+
591
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CancelJobRequest
592
+
593
+ # Converts hash and nil to an options object
594
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
595
+
596
+ # Customize the options with defaults
597
+ call_metadata = @config.rpcs.cancel_job.metadata.to_h
598
+
599
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
600
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
601
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
602
+ gapic_version: ::Google::Cloud::Batch::V1::VERSION,
603
+ transports_version_send: [:rest]
604
+
605
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
606
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
607
+
608
+ options.apply_defaults timeout: @config.rpcs.cancel_job.timeout,
609
+ metadata: call_metadata,
610
+ retry_policy: @config.rpcs.cancel_job.retry_policy
611
+
612
+ options.apply_defaults timeout: @config.timeout,
613
+ metadata: @config.metadata,
614
+ retry_policy: @config.retry_policy
615
+
616
+ @batch_service_stub.cancel_job request, options do |result, operation|
617
+ result = ::Gapic::Operation.new result, @operations_client, options: options
618
+ yield result, operation if block_given?
619
+ throw :response, result
620
+ end
621
+ rescue ::Gapic::Rest::Error => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
522
625
  ##
523
626
  # List all Jobs for a project within a region.
524
627
  #
@@ -549,10 +652,10 @@ module Google
549
652
  # @param page_token [::String]
550
653
  # Page token.
551
654
  # @yield [result, operation] Access the result along with the TransportOperation object
552
- # @yieldparam result [::Google::Cloud::Batch::V1::ListJobsResponse]
655
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>]
553
656
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
554
657
  #
555
- # @return [::Google::Cloud::Batch::V1::ListJobsResponse]
658
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Job>]
556
659
  #
557
660
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
558
661
  #
@@ -604,7 +707,9 @@ module Google
604
707
  retry_policy: @config.retry_policy
605
708
 
606
709
  @batch_service_stub.list_jobs request, options do |result, operation|
710
+ result = ::Gapic::Rest::PagedEnumerable.new @batch_service_stub, :list_jobs, "jobs", request, result, options
607
711
  yield result, operation if block_given?
712
+ throw :response, result
608
713
  end
609
714
  rescue ::Gapic::Rest::Error => e
610
715
  raise ::Google::Cloud::Error.from_error(e)
@@ -719,10 +824,10 @@ module Google
719
824
  # @param page_token [::String]
720
825
  # Page token.
721
826
  # @yield [result, operation] Access the result along with the TransportOperation object
722
- # @yieldparam result [::Google::Cloud::Batch::V1::ListTasksResponse]
827
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>]
723
828
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
724
829
  #
725
- # @return [::Google::Cloud::Batch::V1::ListTasksResponse]
830
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Batch::V1::Task>]
726
831
  #
727
832
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
728
833
  #
@@ -774,7 +879,9 @@ module Google
774
879
  retry_policy: @config.retry_policy
775
880
 
776
881
  @batch_service_stub.list_tasks request, options do |result, operation|
882
+ result = ::Gapic::Rest::PagedEnumerable.new @batch_service_stub, :list_tasks, "tasks", request, result, options
777
883
  yield result, operation if block_given?
884
+ throw :response, result
778
885
  end
779
886
  rescue ::Gapic::Rest::Error => e
780
887
  raise ::Google::Cloud::Error.from_error(e)
@@ -949,6 +1056,11 @@ module Google
949
1056
  #
950
1057
  attr_reader :delete_job
951
1058
  ##
1059
+ # RPC-specific configuration for `cancel_job`
1060
+ # @return [::Gapic::Config::Method]
1061
+ #
1062
+ attr_reader :cancel_job
1063
+ ##
952
1064
  # RPC-specific configuration for `list_jobs`
953
1065
  # @return [::Gapic::Config::Method]
954
1066
  #
@@ -972,6 +1084,8 @@ module Google
972
1084
  @get_job = ::Gapic::Config::Method.new get_job_config
973
1085
  delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
974
1086
  @delete_job = ::Gapic::Config::Method.new delete_job_config
1087
+ cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job
1088
+ @cancel_job = ::Gapic::Config::Method.new cancel_job_config
975
1089
  list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
976
1090
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
977
1091
  get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task
@@ -193,6 +193,46 @@ module Google
193
193
  end
194
194
  end
195
195
 
196
+ ##
197
+ # Baseline implementation for the cancel_job REST call
198
+ #
199
+ # @param request_pb [::Google::Cloud::Batch::V1::CancelJobRequest]
200
+ # A request object representing the call parameters. Required.
201
+ # @param options [::Gapic::CallOptions]
202
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203
+ #
204
+ # @yield [result, operation] Access the result along with the TransportOperation object
205
+ # @yieldparam result [::Google::Longrunning::Operation]
206
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
207
+ #
208
+ # @return [::Google::Longrunning::Operation]
209
+ # A result object deserialized from the server's reply
210
+ def cancel_job request_pb, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
212
+
213
+ verb, uri, query_string_params, body = ServiceStub.transcode_cancel_job_request request_pb
214
+ query_string_params = if query_string_params.any?
215
+ query_string_params.to_h { |p| p.split "=", 2 }
216
+ else
217
+ {}
218
+ end
219
+
220
+ response = @client_stub.make_http_request(
221
+ verb,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "cancel_job",
226
+ options: options
227
+ )
228
+ operation = ::Gapic::Rest::TransportOperation.new response
229
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
234
+ end
235
+
196
236
  ##
197
237
  # Baseline implementation for the list_jobs REST call
198
238
  #
@@ -377,6 +417,28 @@ module Google
377
417
  transcoder.transcode request_pb
378
418
  end
379
419
 
420
+ ##
421
+ # @private
422
+ #
423
+ # GRPC transcoding helper method for the cancel_job REST call
424
+ #
425
+ # @param request_pb [::Google::Cloud::Batch::V1::CancelJobRequest]
426
+ # A request object representing the call parameters. Required.
427
+ # @return [Array(String, [String, nil], Hash{String => String})]
428
+ # Uri, Body, Query string parameters
429
+ def self.transcode_cancel_job_request request_pb
430
+ transcoder = Gapic::Rest::GrpcTranscoder.new
431
+ .with_bindings(
432
+ uri_method: :post,
433
+ uri_template: "/v1/{name}:cancel",
434
+ body: "*",
435
+ matches: [
436
+ ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false]
437
+ ]
438
+ )
439
+ transcoder.transcode request_pb
440
+ end
441
+
380
442
  ##
381
443
  # @private
382
444
  #
@@ -41,6 +41,8 @@ module Google
41
41
  rpc :GetJob, ::Google::Cloud::Batch::V1::GetJobRequest, ::Google::Cloud::Batch::V1::Job
42
42
  # Delete a Job.
43
43
  rpc :DeleteJob, ::Google::Cloud::Batch::V1::DeleteJobRequest, ::Google::Longrunning::Operation
44
+ # Cancel a Job.
45
+ rpc :CancelJob, ::Google::Cloud::Batch::V1::CancelJobRequest, ::Google::Longrunning::Operation
44
46
  # List all Jobs for a project within a region.
45
47
  rpc :ListJobs, ::Google::Cloud::Batch::V1::ListJobsRequest, ::Google::Cloud::Batch::V1::ListJobsResponse
46
48
  # Return a single Task.
@@ -11,7 +11,7 @@ require 'google/protobuf/duration_pb'
11
11
  require 'google/protobuf/timestamp_pb'
12
12
 
13
13
 
14
- descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\x80\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"{\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\x81\x0f\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xf6\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x62lock_project_ssh_keys\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3"
14
+ descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\xae\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"\xa8\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\x12\x1c\n\x18\x43\x41NCELLATION_IN_PROGRESS\x10\x07\x12\r\n\tCANCELLED\x10\x08\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\x81\x0f\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xf6\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x62lock_project_ssh_keys\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3"
15
15
 
16
16
  pool = Google::Protobuf::DescriptorPool.generated_pool
17
17
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Batch
23
23
  module V1
24
- VERSION = "0.21.0"
24
+ VERSION = "1.1.0"
25
25
  end
26
26
  end
27
27
  end
@@ -221,6 +221,12 @@ module Google
221
221
  # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
222
  # enabled by default 1 month after launching the feature in preview
223
223
  # packages.
224
+ # @!attribute [rw] unversioned_package_disabled
225
+ # @return [::Boolean]
226
+ # Disables generation of an unversioned Python package for this client
227
+ # library. This means that the module names will need to be versioned in
228
+ # import statements. For example `import google.cloud.library_v2` instead
229
+ # of `import google.cloud.library`.
224
230
  class ExperimentalFeatures
225
231
  include ::Google::Protobuf::MessageExts
226
232
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -409,6 +415,14 @@ module Google
409
415
  # @return [::Array<::String>]
410
416
  # An allowlist of the fully qualified names of RPCs that should be included
411
417
  # on public client surfaces.
418
+ # @!attribute [rw] generate_omitted_as_internal
419
+ # @return [::Boolean]
420
+ # Setting this to true indicates to the client generators that methods
421
+ # that would be excluded from the generation should instead be generated
422
+ # in a way that indicates these methods should not be consumed by
423
+ # end users. How this is expressed is up to individual language
424
+ # implementations to decide. Some examples may be: added annotations,
425
+ # obfuscated identifiers, or other language idiomatic patterns.
412
426
  class SelectiveGapicGeneration
413
427
  include ::Google::Protobuf::MessageExts
414
428
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -96,6 +96,36 @@ module Google
96
96
  extend ::Google::Protobuf::MessageExts::ClassMethods
97
97
  end
98
98
 
99
+ # CancelJob Request.
100
+ # @!attribute [rw] name
101
+ # @return [::String]
102
+ # Required. Job name.
103
+ # @!attribute [rw] request_id
104
+ # @return [::String]
105
+ # Optional. An optional request ID to identify requests. Specify a unique
106
+ # request ID so that if you must retry your request, the server will know to
107
+ # ignore the request if it has already been completed. The server will
108
+ # guarantee that for at least 60 minutes after the first request.
109
+ #
110
+ # For example, consider a situation where you make an initial request and
111
+ # the request times out. If you make the request again with the same request
112
+ # ID, the server can check if original operation with the same request ID
113
+ # was received, and if so, will ignore the second request. This prevents
114
+ # clients from accidentally creating duplicate commitments.
115
+ #
116
+ # The request ID must be a valid UUID with the exception that zero UUID is
117
+ # not supported (00000000-0000-0000-0000-000000000000).
118
+ class CancelJobRequest
119
+ include ::Google::Protobuf::MessageExts
120
+ extend ::Google::Protobuf::MessageExts::ClassMethods
121
+ end
122
+
123
+ # Response to the CancelJob request.
124
+ class CancelJobResponse
125
+ include ::Google::Protobuf::MessageExts
126
+ extend ::Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
99
129
  # ListJob Request.
100
130
  # @!attribute [rw] parent
101
131
  # @return [::String]
@@ -234,6 +234,14 @@ module Google
234
234
  # The Job will be deleted, but has not been deleted yet. Typically this is
235
235
  # because resources used by the Job are still being cleaned up.
236
236
  DELETION_IN_PROGRESS = 6
237
+
238
+ # The Job cancellation is in progress, this is because the resources used
239
+ # by the Job are still being cleaned up.
240
+ CANCELLATION_IN_PROGRESS = 7
241
+
242
+ # The Job has been cancelled, the task executions were stopped and the
243
+ # resources were cleaned up.
244
+ CANCELLED = 8
237
245
  end
238
246
  end
239
247
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-batch-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 2025-02-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: gapic-common
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 3.6.2
163
+ rubygems_version: 3.6.3
164
164
  specification_version: 4
165
165
  summary: An API to manage the running of Batch resources on Google Cloud Platform.
166
166
  test_files: []