google-cloud-batch-v1 1.0.0 → 1.1.1

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: b822f46d30d5a5620a763f7737d65810b4248c796be3fd2b42d83a6501d0f9c0
4
- data.tar.gz: 315bd0c00e30b1be6954c39dffa334a8df8ec38010a1289cb2ab0b112aa79e9b
3
+ metadata.gz: aceda2ebfb0a10ca3f07f4c503a727374316a9678615781871d10ea68c03ccf6
4
+ data.tar.gz: 5371880f19b22011d7567b659243216ae9a6f80fe54489b81f43d29f1980a3d3
5
5
  SHA512:
6
- metadata.gz: b32d740def6b95fc2f8afeb8a1836340cd5b140f0ddf68bcb4d0061baa6174601be041cf80dee526cfcb779dba235667e96f0a1f3b8de07c662ae04430b52c8d
7
- data.tar.gz: d05a7b3769ca92c9005f1e88ee2800717976a66e0a73a49e3f1b7dc519fce93e30c622c41f6557e6206e788a202924fb98792fb5328838e3f8290fc74e9602be
6
+ metadata.gz: 78761a8504c277208bf9a6b20933319d4ff6a9bb72cb484b395a37ad7f51c236ae8b4dc4afc5affe7646f9d09e16a338f0bd319fd974ae812339ac4d0ea6bf6f
7
+ data.tar.gz: 29ad817aa31fa26a9cb8f9baba69579e4470165f9ffc4ff7d6d803cee8d0d1a7abe3b9362035371ee633256558cfdc974023b35d537c76c6c8caf52fffca6efd
@@ -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
  #
@@ -937,8 +1047,8 @@ module Google
937
1047
 
938
1048
  config_attr :endpoint, nil, ::String, nil
939
1049
  config_attr :credentials, nil do |value|
940
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
941
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1050
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1051
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
942
1052
  allowed.any? { |klass| klass === value }
943
1053
  end
944
1054
  config_attr :scope, nil, ::String, ::Array, nil
@@ -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
@@ -701,8 +701,8 @@ module Google
701
701
 
702
702
  config_attr :endpoint, nil, ::String, nil
703
703
  config_attr :credentials, nil do |value|
704
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
705
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
704
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
705
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
706
706
  allowed.any? { |klass| klass === value }
707
707
  end
708
708
  config_attr :scope, nil, ::String, ::Array, nil
@@ -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
  #
@@ -880,7 +983,7 @@ module Google
880
983
 
881
984
  config_attr :endpoint, nil, ::String, nil
882
985
  config_attr :credentials, nil do |value|
883
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
986
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
884
987
  allowed.any? { |klass| klass === value }
885
988
  end
886
989
  config_attr :scope, nil, ::String, ::Array, nil
@@ -953,6 +1056,11 @@ module Google
953
1056
  #
954
1057
  attr_reader :delete_job
955
1058
  ##
1059
+ # RPC-specific configuration for `cancel_job`
1060
+ # @return [::Gapic::Config::Method]
1061
+ #
1062
+ attr_reader :cancel_job
1063
+ ##
956
1064
  # RPC-specific configuration for `list_jobs`
957
1065
  # @return [::Gapic::Config::Method]
958
1066
  #
@@ -976,6 +1084,8 @@ module Google
976
1084
  @get_job = ::Gapic::Config::Method.new get_job_config
977
1085
  delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
978
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
979
1089
  list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
980
1090
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
981
1091
  get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task
@@ -556,7 +556,7 @@ module Google
556
556
 
557
557
  config_attr :endpoint, nil, ::String, nil
558
558
  config_attr :credentials, nil do |value|
559
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
559
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
560
560
  allowed.any? { |klass| klass === value }
561
561
  end
562
562
  config_attr :scope, nil, ::String, ::Array, nil
@@ -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 = "1.0.0"
24
+ VERSION = "1.1.1"
25
25
  end
26
26
  end
27
27
  end
@@ -613,8 +613,8 @@ module Google
613
613
 
614
614
  config_attr :endpoint, nil, ::String, nil
615
615
  config_attr :credentials, nil do |value|
616
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
617
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
616
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
617
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
618
618
  allowed.any? { |klass| klass === value }
619
619
  end
620
620
  config_attr :scope, nil, ::String, ::Array, nil
@@ -577,7 +577,7 @@ module Google
577
577
 
578
578
  config_attr :endpoint, nil, ::String, nil
579
579
  config_attr :credentials, nil do |value|
580
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
580
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
581
581
  allowed.any? { |klass| klass === value }
582
582
  end
583
583
  config_attr :scope, nil, ::String, ::Array, nil
@@ -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
@@ -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: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 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.3
163
+ rubygems_version: 3.6.8
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: []