google-cloud-scheduler-v1beta1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-scheduler-v1beta1.rb +21 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/scheduler/v1beta1.rb +35 -0
  9. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler.rb +50 -0
  10. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/client.rb +978 -0
  11. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/credentials.rb +51 -0
  12. data/lib/google/cloud/scheduler/v1beta1/cloud_scheduler/paths.rb +86 -0
  13. data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_pb.rb +66 -0
  14. data/lib/google/cloud/scheduler/v1beta1/cloudscheduler_services_pb.rb +83 -0
  15. data/lib/google/cloud/scheduler/v1beta1/job_pb.rb +59 -0
  16. data/lib/google/cloud/scheduler/v1beta1/target_pb.rb +73 -0
  17. data/lib/google/cloud/scheduler/v1beta1/version.rb +28 -0
  18. data/proto_docs/README.md +4 -0
  19. data/proto_docs/google/api/field_behavior.rb +59 -0
  20. data/proto_docs/google/api/resource.rb +247 -0
  21. data/proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb +155 -0
  22. data/proto_docs/google/cloud/scheduler/v1beta1/job.rb +231 -0
  23. data/proto_docs/google/cloud/scheduler/v1beta1/target.rb +385 -0
  24. data/proto_docs/google/protobuf/any.rb +138 -0
  25. data/proto_docs/google/protobuf/duration.rb +98 -0
  26. data/proto_docs/google/protobuf/empty.rb +36 -0
  27. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  28. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  29. data/proto_docs/google/rpc/status.rb +46 -0
  30. metadata +187 -0
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Scheduler
24
+ module V1beta1
25
+ module CloudScheduler
26
+ # Credentials for the CloudScheduler API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "SCHEDULER_CREDENTIALS",
33
+ "SCHEDULER_KEYFILE",
34
+ "GOOGLE_CLOUD_CREDENTIALS",
35
+ "GOOGLE_CLOUD_KEYFILE",
36
+ "GCLOUD_KEYFILE",
37
+ "SCHEDULER_CREDENTIALS_JSON",
38
+ "SCHEDULER_KEYFILE_JSON",
39
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
40
+ "GOOGLE_CLOUD_KEYFILE_JSON",
41
+ "GCLOUD_KEYFILE_JSON"
42
+ ]
43
+ self.paths = [
44
+ "~/.config/google_cloud/application_default_credentials.json"
45
+ ]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Scheduler
23
+ module V1beta1
24
+ module CloudScheduler
25
+ # Path helper methods for the CloudScheduler API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Job resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/jobs/{job}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param job [String]
37
+ #
38
+ # @return [::String]
39
+ def job_path project:, location:, job:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/jobs/#{job}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified Location resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ #
56
+ # @return [::String]
57
+ def location_path project:, location:
58
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
59
+
60
+ "projects/#{project}/locations/#{location}"
61
+ end
62
+
63
+ ##
64
+ # Create a fully-qualified Topic resource string.
65
+ #
66
+ # The resource will be in the following format:
67
+ #
68
+ # `projects/{project}/topics/{topic}`
69
+ #
70
+ # @param project [String]
71
+ # @param topic [String]
72
+ #
73
+ # @return [::String]
74
+ def topic_path project:, topic:
75
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
76
+
77
+ "projects/#{project}/topics/#{topic}"
78
+ end
79
+
80
+ extend self
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,66 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/scheduler/v1beta1/cloudscheduler.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/cloud/scheduler/v1beta1/job_pb'
11
+ require 'google/protobuf/empty_pb'
12
+ require 'google/protobuf/field_mask_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/scheduler/v1beta1/cloudscheduler.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.scheduler.v1beta1.ListJobsRequest" do
16
+ optional :parent, :string, 1
17
+ optional :page_size, :int32, 5
18
+ optional :page_token, :string, 6
19
+ end
20
+ add_message "google.cloud.scheduler.v1beta1.ListJobsResponse" do
21
+ repeated :jobs, :message, 1, "google.cloud.scheduler.v1beta1.Job"
22
+ optional :next_page_token, :string, 2
23
+ end
24
+ add_message "google.cloud.scheduler.v1beta1.GetJobRequest" do
25
+ optional :name, :string, 1
26
+ end
27
+ add_message "google.cloud.scheduler.v1beta1.CreateJobRequest" do
28
+ optional :parent, :string, 1
29
+ optional :job, :message, 2, "google.cloud.scheduler.v1beta1.Job"
30
+ end
31
+ add_message "google.cloud.scheduler.v1beta1.UpdateJobRequest" do
32
+ optional :job, :message, 1, "google.cloud.scheduler.v1beta1.Job"
33
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
34
+ end
35
+ add_message "google.cloud.scheduler.v1beta1.DeleteJobRequest" do
36
+ optional :name, :string, 1
37
+ end
38
+ add_message "google.cloud.scheduler.v1beta1.PauseJobRequest" do
39
+ optional :name, :string, 1
40
+ end
41
+ add_message "google.cloud.scheduler.v1beta1.ResumeJobRequest" do
42
+ optional :name, :string, 1
43
+ end
44
+ add_message "google.cloud.scheduler.v1beta1.RunJobRequest" do
45
+ optional :name, :string, 1
46
+ end
47
+ end
48
+ end
49
+
50
+ module Google
51
+ module Cloud
52
+ module Scheduler
53
+ module V1beta1
54
+ ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsRequest").msgclass
55
+ ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ListJobsResponse").msgclass
56
+ GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.GetJobRequest").msgclass
57
+ CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.CreateJobRequest").msgclass
58
+ UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.UpdateJobRequest").msgclass
59
+ DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.DeleteJobRequest").msgclass
60
+ PauseJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PauseJobRequest").msgclass
61
+ ResumeJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.ResumeJobRequest").msgclass
62
+ RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RunJobRequest").msgclass
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,83 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/scheduler/v1beta1/cloudscheduler.proto for package 'google.cloud.scheduler.v1beta1'
3
+ # Original file comments:
4
+ # Copyright 2019 Google LLC.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #
19
+
20
+ require 'grpc'
21
+ require 'google/cloud/scheduler/v1beta1/cloudscheduler_pb'
22
+
23
+ module Google
24
+ module Cloud
25
+ module Scheduler
26
+ module V1beta1
27
+ module CloudScheduler
28
+ # The Cloud Scheduler API allows external entities to reliably
29
+ # schedule asynchronous jobs.
30
+ class Service
31
+
32
+ include GRPC::GenericService
33
+
34
+ self.marshal_class_method = :encode
35
+ self.unmarshal_class_method = :decode
36
+ self.service_name = 'google.cloud.scheduler.v1beta1.CloudScheduler'
37
+
38
+ # Lists jobs.
39
+ rpc :ListJobs, ListJobsRequest, ListJobsResponse
40
+ # Gets a job.
41
+ rpc :GetJob, GetJobRequest, Job
42
+ # Creates a job.
43
+ rpc :CreateJob, CreateJobRequest, Job
44
+ # Updates a job.
45
+ #
46
+ # If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
47
+ # not exist, `NOT_FOUND` is returned.
48
+ #
49
+ # If UpdateJob does not successfully return, it is possible for the
50
+ # job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
51
+ # not be executed. If this happens, retry the UpdateJob request
52
+ # until a successful response is received.
53
+ rpc :UpdateJob, UpdateJobRequest, Job
54
+ # Deletes a job.
55
+ rpc :DeleteJob, DeleteJobRequest, Google::Protobuf::Empty
56
+ # Pauses a job.
57
+ #
58
+ # If a job is paused then the system will stop executing the job
59
+ # until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
60
+ # state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
61
+ # will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
62
+ # to be paused.
63
+ rpc :PauseJob, PauseJobRequest, Job
64
+ # Resume a job.
65
+ #
66
+ # This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
67
+ # state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
68
+ # will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
69
+ # [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
70
+ rpc :ResumeJob, ResumeJobRequest, Job
71
+ # Forces a job to run now.
72
+ #
73
+ # When this method is called, Cloud Scheduler will dispatch the job, even
74
+ # if the job is already running.
75
+ rpc :RunJob, RunJobRequest, Job
76
+ end
77
+
78
+ Stub = Service.rpc_stub_class
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,59 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/scheduler/v1beta1/job.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/resource_pb'
7
+ require 'google/cloud/scheduler/v1beta1/target_pb'
8
+ require 'google/protobuf/duration_pb'
9
+ require 'google/protobuf/timestamp_pb'
10
+ require 'google/rpc/status_pb'
11
+ require 'google/api/annotations_pb'
12
+ Google::Protobuf::DescriptorPool.generated_pool.build do
13
+ add_file("google/cloud/scheduler/v1beta1/job.proto", :syntax => :proto3) do
14
+ add_message "google.cloud.scheduler.v1beta1.Job" do
15
+ optional :name, :string, 1
16
+ optional :description, :string, 2
17
+ optional :schedule, :string, 20
18
+ optional :time_zone, :string, 21
19
+ optional :user_update_time, :message, 9, "google.protobuf.Timestamp"
20
+ optional :state, :enum, 10, "google.cloud.scheduler.v1beta1.Job.State"
21
+ optional :status, :message, 11, "google.rpc.Status"
22
+ optional :schedule_time, :message, 17, "google.protobuf.Timestamp"
23
+ optional :last_attempt_time, :message, 18, "google.protobuf.Timestamp"
24
+ optional :retry_config, :message, 19, "google.cloud.scheduler.v1beta1.RetryConfig"
25
+ optional :attempt_deadline, :message, 22, "google.protobuf.Duration"
26
+ oneof :target do
27
+ optional :pubsub_target, :message, 4, "google.cloud.scheduler.v1beta1.PubsubTarget"
28
+ optional :app_engine_http_target, :message, 5, "google.cloud.scheduler.v1beta1.AppEngineHttpTarget"
29
+ optional :http_target, :message, 6, "google.cloud.scheduler.v1beta1.HttpTarget"
30
+ end
31
+ end
32
+ add_enum "google.cloud.scheduler.v1beta1.Job.State" do
33
+ value :STATE_UNSPECIFIED, 0
34
+ value :ENABLED, 1
35
+ value :PAUSED, 2
36
+ value :DISABLED, 3
37
+ value :UPDATE_FAILED, 4
38
+ end
39
+ add_message "google.cloud.scheduler.v1beta1.RetryConfig" do
40
+ optional :retry_count, :int32, 1
41
+ optional :max_retry_duration, :message, 2, "google.protobuf.Duration"
42
+ optional :min_backoff_duration, :message, 3, "google.protobuf.Duration"
43
+ optional :max_backoff_duration, :message, 4, "google.protobuf.Duration"
44
+ optional :max_doublings, :int32, 5
45
+ end
46
+ end
47
+ end
48
+
49
+ module Google
50
+ module Cloud
51
+ module Scheduler
52
+ module V1beta1
53
+ Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job").msgclass
54
+ Job::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.Job.State").enummodule
55
+ RetryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.RetryConfig").msgclass
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,73 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/scheduler/v1beta1/target.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/resource_pb'
7
+ require 'google/api/annotations_pb'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("google/cloud/scheduler/v1beta1/target.proto", :syntax => :proto3) do
10
+ add_message "google.cloud.scheduler.v1beta1.HttpTarget" do
11
+ optional :uri, :string, 1
12
+ optional :http_method, :enum, 2, "google.cloud.scheduler.v1beta1.HttpMethod"
13
+ map :headers, :string, :string, 3
14
+ optional :body, :bytes, 4
15
+ oneof :authorization_header do
16
+ optional :oauth_token, :message, 5, "google.cloud.scheduler.v1beta1.OAuthToken"
17
+ optional :oidc_token, :message, 6, "google.cloud.scheduler.v1beta1.OidcToken"
18
+ end
19
+ end
20
+ add_message "google.cloud.scheduler.v1beta1.AppEngineHttpTarget" do
21
+ optional :http_method, :enum, 1, "google.cloud.scheduler.v1beta1.HttpMethod"
22
+ optional :app_engine_routing, :message, 2, "google.cloud.scheduler.v1beta1.AppEngineRouting"
23
+ optional :relative_uri, :string, 3
24
+ map :headers, :string, :string, 4
25
+ optional :body, :bytes, 5
26
+ end
27
+ add_message "google.cloud.scheduler.v1beta1.PubsubTarget" do
28
+ optional :topic_name, :string, 1
29
+ optional :data, :bytes, 3
30
+ map :attributes, :string, :string, 4
31
+ end
32
+ add_message "google.cloud.scheduler.v1beta1.AppEngineRouting" do
33
+ optional :service, :string, 1
34
+ optional :version, :string, 2
35
+ optional :instance, :string, 3
36
+ optional :host, :string, 4
37
+ end
38
+ add_message "google.cloud.scheduler.v1beta1.OAuthToken" do
39
+ optional :service_account_email, :string, 1
40
+ optional :scope, :string, 2
41
+ end
42
+ add_message "google.cloud.scheduler.v1beta1.OidcToken" do
43
+ optional :service_account_email, :string, 1
44
+ optional :audience, :string, 2
45
+ end
46
+ add_enum "google.cloud.scheduler.v1beta1.HttpMethod" do
47
+ value :HTTP_METHOD_UNSPECIFIED, 0
48
+ value :POST, 1
49
+ value :GET, 2
50
+ value :HEAD, 3
51
+ value :PUT, 4
52
+ value :DELETE, 5
53
+ value :PATCH, 6
54
+ value :OPTIONS, 7
55
+ end
56
+ end
57
+ end
58
+
59
+ module Google
60
+ module Cloud
61
+ module Scheduler
62
+ module V1beta1
63
+ HttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpTarget").msgclass
64
+ AppEngineHttpTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineHttpTarget").msgclass
65
+ PubsubTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.PubsubTarget").msgclass
66
+ AppEngineRouting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.AppEngineRouting").msgclass
67
+ OAuthToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OAuthToken").msgclass
68
+ OidcToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.OidcToken").msgclass
69
+ HttpMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.scheduler.v1beta1.HttpMethod").enummodule
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Scheduler
23
+ module V1beta1
24
+ VERSION = "0.1.0"
25
+ end
26
+ end
27
+ end
28
+ end