1 // Copyright 2018 Google LLC
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
17 package google.cloud.tasks.v2beta2;
19 import "google/api/annotations.proto";
20 import "google/cloud/tasks/v2beta2/target.proto";
21 import "google/protobuf/timestamp.proto";
22 import "google/rpc/status.proto";
24 option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks";
25 option java_multiple_files = true;
26 option java_outer_classname = "TaskProto";
27 option java_package = "com.google.cloud.tasks.v2beta2";
29 // A unit of scheduled work.
31 // The view specifies a subset of [Task][google.cloud.tasks.v2beta2.Task]
34 // When a task is returned in a response, not all
35 // information is retrieved by default because some data, such as
36 // payloads, might be desirable to return only when needed because
37 // of its large size or because of the sensitivity of data that it
40 // Unspecified. Defaults to BASIC.
43 // The basic view omits fields which can be large or can contain
46 // This view does not include the
48 // AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]
50 // PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These
51 // payloads are desirable to return only when needed, because they can be
52 // large and because of the sensitivity of the data that you choose to store
56 // All information is returned.
58 // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]
59 // requires `cloudtasks.tasks.fullView` [Google
60 // IAM](https://cloud.google.com/iam/) permission on the
61 // [Queue][google.cloud.tasks.v2beta2.Queue] resource.
65 // Optionally caller-specified in
66 // [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
70 // The task name must have the following format:
71 // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
73 // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
74 // hyphens (-), colons (:), or periods (.).
75 // For more information, see
77 // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
78 // * `LOCATION_ID` is the canonical ID for the task's location.
79 // The list of available locations can be obtained by calling
80 // [ListLocations][google.cloud.location.Locations.ListLocations].
81 // For more information, see https://cloud.google.com/about/locations/.
82 // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
83 // hyphens (-). The maximum length is 100 characters.
84 // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
85 // hyphens (-), or underscores (_). The maximum length is 500 characters.
90 // The task's payload is used by the task's target to process the task.
91 // A payload is valid only if it is compatible with the queue's target.
93 // App Engine HTTP request that is sent to the task's target. Can
95 // [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target]
96 // is set on the queue.
98 // An App Engine task is a task that has
99 // [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]
101 AppEngineHttpRequest app_engine_http_request = 3;
103 // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process
104 // the task. Can be set only if
105 // [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the
108 // A pull task is a task that has
109 // [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set.
110 PullMessage pull_message = 4;
113 // The time when the task is scheduled to be attempted.
115 // For App Engine queues, this is when the task will be attempted or retried.
117 // For pull queues, this is the time when the task is available to
118 // be leased; if a task is currently leased, this is the time when
119 // the current lease expires, that is, the time that the task was
121 // [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration].
123 // `schedule_time` will be truncated to the nearest microsecond.
124 google.protobuf.Timestamp schedule_time = 5;
126 // Output only. The time that the task was created.
128 // `create_time` will be truncated to the nearest second.
129 google.protobuf.Timestamp create_time = 6;
131 // Output only. The task status.
132 TaskStatus status = 7;
134 // Output only. The view specifies which subset of the
135 // [Task][google.cloud.tasks.v2beta2.Task] has been returned.
139 // Status of the task.
141 // Output only. The number of attempts dispatched.
143 // This count includes tasks which have been dispatched but haven't
144 // received a response.
145 int32 attempt_dispatch_count = 1;
147 // Output only. The number of attempts which have received a response.
149 // This field is not calculated for [pull
150 // tasks][google.cloud.tasks.v2beta2.PullMessage].
151 int32 attempt_response_count = 2;
153 // Output only. The status of the task's first attempt.
156 // [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time]
157 // will be set. The other
158 // [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is
159 // not retained by Cloud Tasks.
161 // This field is not calculated for [pull
162 // tasks][google.cloud.tasks.v2beta2.PullMessage].
163 AttemptStatus first_attempt_status = 3;
165 // Output only. The status of the task's last attempt.
167 // This field is not calculated for [pull
168 // tasks][google.cloud.tasks.v2beta2.PullMessage].
169 AttemptStatus last_attempt_status = 4;
172 // The status of a task attempt.
173 message AttemptStatus {
174 // Output only. The time that this attempt was scheduled.
176 // `schedule_time` will be truncated to the nearest microsecond.
177 google.protobuf.Timestamp schedule_time = 1;
179 // Output only. The time that this attempt was dispatched.
181 // `dispatch_time` will be truncated to the nearest microsecond.
182 google.protobuf.Timestamp dispatch_time = 2;
184 // Output only. The time that this attempt response was received.
186 // `response_time` will be truncated to the nearest microsecond.
187 google.protobuf.Timestamp response_time = 3;
189 // Output only. The response from the target for this attempt.
191 // If the task has not been attempted or the task is currently running
192 // then the response status is unset.
193 google.rpc.Status response_status = 4;