cloudtasks.proto 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. // Copyright 2020 Google LLC
  2. //
  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
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  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.
  14. syntax = "proto3";
  15. package google.cloud.tasks.v2beta3;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/tasks/v2beta3/queue.proto";
  21. import "google/cloud/tasks/v2beta3/task.proto";
  22. import "google/iam/v1/iam_policy.proto";
  23. import "google/iam/v1/policy.proto";
  24. import "google/protobuf/empty.proto";
  25. import "google/protobuf/field_mask.proto";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "CloudTasksProto";
  29. option java_package = "com.google.cloud.tasks.v2beta3";
  30. option objc_class_prefix = "TASKS";
  31. // Cloud Tasks allows developers to manage the execution of background
  32. // work in their applications.
  33. service CloudTasks {
  34. option (google.api.default_host) = "cloudtasks.googleapis.com";
  35. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  36. // Lists queues.
  37. //
  38. // Queues are returned in lexicographical order.
  39. rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) {
  40. option (google.api.http) = {
  41. get: "/v2beta3/{parent=projects/*/locations/*}/queues"
  42. };
  43. option (google.api.method_signature) = "parent";
  44. }
  45. // Gets a queue.
  46. rpc GetQueue(GetQueueRequest) returns (Queue) {
  47. option (google.api.http) = {
  48. get: "/v2beta3/{name=projects/*/locations/*/queues/*}"
  49. };
  50. option (google.api.method_signature) = "name";
  51. }
  52. // Creates a queue.
  53. //
  54. // Queues created with this method allow tasks to live for a maximum of 31
  55. // days. After a task is 31 days old, the task will be deleted regardless of whether
  56. // it was dispatched or not.
  57. //
  58. // WARNING: Using this method may have unintended side effects if you are
  59. // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
  60. // Read
  61. // [Overview of Queue Management and
  62. // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
  63. // this method.
  64. rpc CreateQueue(CreateQueueRequest) returns (Queue) {
  65. option (google.api.http) = {
  66. post: "/v2beta3/{parent=projects/*/locations/*}/queues"
  67. body: "queue"
  68. };
  69. option (google.api.method_signature) = "parent,queue";
  70. }
  71. // Updates a queue.
  72. //
  73. // This method creates the queue if it does not exist and updates
  74. // the queue if it does exist.
  75. //
  76. // Queues created with this method allow tasks to live for a maximum of 31
  77. // days. After a task is 31 days old, the task will be deleted regardless of whether
  78. // it was dispatched or not.
  79. //
  80. // WARNING: Using this method may have unintended side effects if you are
  81. // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
  82. // Read
  83. // [Overview of Queue Management and
  84. // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
  85. // this method.
  86. rpc UpdateQueue(UpdateQueueRequest) returns (Queue) {
  87. option (google.api.http) = {
  88. patch: "/v2beta3/{queue.name=projects/*/locations/*/queues/*}"
  89. body: "queue"
  90. };
  91. option (google.api.method_signature) = "queue,update_mask";
  92. }
  93. // Deletes a queue.
  94. //
  95. // This command will delete the queue even if it has tasks in it.
  96. //
  97. // Note: If you delete a queue, a queue with the same name can't be created
  98. // for 7 days.
  99. //
  100. // WARNING: Using this method may have unintended side effects if you are
  101. // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues.
  102. // Read
  103. // [Overview of Queue Management and
  104. // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using
  105. // this method.
  106. rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) {
  107. option (google.api.http) = {
  108. delete: "/v2beta3/{name=projects/*/locations/*/queues/*}"
  109. };
  110. option (google.api.method_signature) = "name";
  111. }
  112. // Purges a queue by deleting all of its tasks.
  113. //
  114. // All tasks created before this method is called are permanently deleted.
  115. //
  116. // Purge operations can take up to one minute to take effect. Tasks
  117. // might be dispatched before the purge takes effect. A purge is irreversible.
  118. rpc PurgeQueue(PurgeQueueRequest) returns (Queue) {
  119. option (google.api.http) = {
  120. post: "/v2beta3/{name=projects/*/locations/*/queues/*}:purge"
  121. body: "*"
  122. };
  123. option (google.api.method_signature) = "name";
  124. }
  125. // Pauses the queue.
  126. //
  127. // If a queue is paused then the system will stop dispatching tasks
  128. // until the queue is resumed via
  129. // [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added
  130. // when the queue is paused. A queue is paused if its
  131. // [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].
  132. rpc PauseQueue(PauseQueueRequest) returns (Queue) {
  133. option (google.api.http) = {
  134. post: "/v2beta3/{name=projects/*/locations/*/queues/*}:pause"
  135. body: "*"
  136. };
  137. option (google.api.method_signature) = "name";
  138. }
  139. // Resume a queue.
  140. //
  141. // This method resumes a queue after it has been
  142. // [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or
  143. // [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored
  144. // in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it
  145. // will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING].
  146. //
  147. // WARNING: Resuming many high-QPS queues at the same time can
  148. // lead to target overloading. If you are resuming high-QPS
  149. // queues, follow the 500/50/5 pattern described in
  150. // [Managing Cloud Tasks Scaling
  151. // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
  152. rpc ResumeQueue(ResumeQueueRequest) returns (Queue) {
  153. option (google.api.http) = {
  154. post: "/v2beta3/{name=projects/*/locations/*/queues/*}:resume"
  155. body: "*"
  156. };
  157. option (google.api.method_signature) = "name";
  158. }
  159. // Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue].
  160. // Returns an empty policy if the resource exists and does not have a policy
  161. // set.
  162. //
  163. // Authorization requires the following
  164. // [Google IAM](https://cloud.google.com/iam) permission on the specified
  165. // resource parent:
  166. //
  167. // * `cloudtasks.queues.getIamPolicy`
  168. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  169. option (google.api.http) = {
  170. post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy"
  171. body: "*"
  172. };
  173. option (google.api.method_signature) = "resource";
  174. }
  175. // Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing
  176. // policy.
  177. //
  178. // Note: The Cloud Console does not check queue-level IAM permissions yet.
  179. // Project-level permissions are required to use the Cloud Console.
  180. //
  181. // Authorization requires the following
  182. // [Google IAM](https://cloud.google.com/iam) permission on the specified
  183. // resource parent:
  184. //
  185. // * `cloudtasks.queues.setIamPolicy`
  186. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  187. option (google.api.http) = {
  188. post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy"
  189. body: "*"
  190. };
  191. option (google.api.method_signature) = "resource,policy";
  192. }
  193. // Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue].
  194. // If the resource does not exist, this will return an empty set of
  195. // permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error.
  196. //
  197. // Note: This operation is designed to be used for building permission-aware
  198. // UIs and command-line tools, not for authorization checking. This operation
  199. // may "fail open" without warning.
  200. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  201. option (google.api.http) = {
  202. post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions"
  203. body: "*"
  204. };
  205. option (google.api.method_signature) = "resource,permissions";
  206. }
  207. // Lists the tasks in a queue.
  208. //
  209. // By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved
  210. // due to performance considerations;
  211. // [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the
  212. // subset of information which is returned.
  213. //
  214. // The tasks may be returned in any order. The ordering may change at any
  215. // time.
  216. rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
  217. option (google.api.http) = {
  218. get: "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks"
  219. };
  220. option (google.api.method_signature) = "parent";
  221. }
  222. // Gets a task.
  223. rpc GetTask(GetTaskRequest) returns (Task) {
  224. option (google.api.http) = {
  225. get: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}"
  226. };
  227. option (google.api.method_signature) = "name";
  228. }
  229. // Creates a task and adds it to a queue.
  230. //
  231. // Tasks cannot be updated after creation; there is no UpdateTask command.
  232. //
  233. // * The maximum task size is 100KB.
  234. rpc CreateTask(CreateTaskRequest) returns (Task) {
  235. option (google.api.http) = {
  236. post: "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks"
  237. body: "*"
  238. };
  239. option (google.api.method_signature) = "parent,task";
  240. }
  241. // Deletes a task.
  242. //
  243. // A task can be deleted if it is scheduled or dispatched. A task
  244. // cannot be deleted if it has executed successfully or permanently
  245. // failed.
  246. rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty) {
  247. option (google.api.http) = {
  248. delete: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}"
  249. };
  250. option (google.api.method_signature) = "name";
  251. }
  252. // Forces a task to run now.
  253. //
  254. // When this method is called, Cloud Tasks will dispatch the task, even if
  255. // the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or
  256. // is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].
  257. //
  258. // This command is meant to be used for manual debugging. For
  259. // example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed
  260. // task after a fix has been made or to manually force a task to be
  261. // dispatched now.
  262. //
  263. // The dispatched task is returned. That is, the task that is returned
  264. // contains the [status][Task.status] after the task is dispatched but
  265. // before the task is received by its target.
  266. //
  267. // If Cloud Tasks receives a successful response from the task's
  268. // target, then the task will be deleted; otherwise the task's
  269. // [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that
  270. // [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified
  271. // in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig].
  272. //
  273. // [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns
  274. // [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a
  275. // task that has already succeeded or permanently failed.
  276. rpc RunTask(RunTaskRequest) returns (Task) {
  277. option (google.api.http) = {
  278. post: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run"
  279. body: "*"
  280. };
  281. option (google.api.method_signature) = "name";
  282. }
  283. }
  284. // Request message for [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues].
  285. message ListQueuesRequest {
  286. // Required. The location name.
  287. // For example: `projects/PROJECT_ID/locations/LOCATION_ID`
  288. string parent = 1 [
  289. (google.api.field_behavior) = REQUIRED,
  290. (google.api.resource_reference) = {
  291. child_type: "cloudtasks.googleapis.com/Queue"
  292. }
  293. ];
  294. // `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2beta3.Queue]
  295. // field can be used as a filter and several operators as supported.
  296. // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
  297. // described in
  298. // [Stackdriver's Advanced Logs
  299. // Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
  300. //
  301. // Sample filter "state: PAUSED".
  302. //
  303. // Note that using filters might cause fewer queues than the
  304. // requested page_size to be returned.
  305. string filter = 2;
  306. // Requested page size.
  307. //
  308. // The maximum page size is 9800. If unspecified, the page size will
  309. // be the maximum. Fewer queues than requested might be returned,
  310. // even if more queues exist; use the
  311. // [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] in the
  312. // response to determine if more queues exist.
  313. int32 page_size = 3;
  314. // A token identifying the page of results to return.
  315. //
  316. // To request the first page results, page_token must be empty. To
  317. // request the next page of results, page_token must be the value of
  318. // [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] returned
  319. // from the previous call to [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues]
  320. // method. It is an error to switch the value of the
  321. // [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while iterating through pages.
  322. string page_token = 4;
  323. // Optional. Read mask is used for a more granular control over what the API returns.
  324. // If the mask is not present all fields will be returned except
  325. // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
  326. // specified in the mask.
  327. google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL];
  328. }
  329. // Response message for [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues].
  330. message ListQueuesResponse {
  331. // The list of queues.
  332. repeated Queue queues = 1;
  333. // A token to retrieve next page of results.
  334. //
  335. // To return the next page of results, call
  336. // [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this value as the
  337. // [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token].
  338. //
  339. // If the next_page_token is empty, there are no more results.
  340. //
  341. // The page token is valid for only 2 hours.
  342. string next_page_token = 2;
  343. }
  344. // Request message for [GetQueue][google.cloud.tasks.v2beta3.CloudTasks.GetQueue].
  345. message GetQueueRequest {
  346. // Required. The resource name of the queue. For example:
  347. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
  348. string name = 1 [
  349. (google.api.field_behavior) = REQUIRED,
  350. (google.api.resource_reference) = {
  351. type: "cloudtasks.googleapis.com/Queue"
  352. }
  353. ];
  354. // Optional. Read mask is used for a more granular control over what the API returns.
  355. // If the mask is not present all fields will be returned except
  356. // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly
  357. // specified in the mask.
  358. google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL];
  359. }
  360. // Request message for [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue].
  361. message CreateQueueRequest {
  362. // Required. The location name in which the queue will be created.
  363. // For example: `projects/PROJECT_ID/locations/LOCATION_ID`
  364. //
  365. // The list of allowed locations can be obtained by calling Cloud
  366. // Tasks' implementation of
  367. // [ListLocations][google.cloud.location.Locations.ListLocations].
  368. string parent = 1 [
  369. (google.api.field_behavior) = REQUIRED,
  370. (google.api.resource_reference) = {
  371. child_type: "cloudtasks.googleapis.com/Queue"
  372. }
  373. ];
  374. // Required. The queue to create.
  375. //
  376. // [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as an existing queue.
  377. Queue queue = 2 [(google.api.field_behavior) = REQUIRED];
  378. }
  379. // Request message for [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue].
  380. message UpdateQueueRequest {
  381. // Required. The queue to create or update.
  382. //
  383. // The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be specified.
  384. //
  385. // Output only fields cannot be modified using UpdateQueue.
  386. // Any value specified for an output only field will be ignored.
  387. // The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be changed.
  388. Queue queue = 1 [(google.api.field_behavior) = REQUIRED];
  389. // A mask used to specify which fields of the queue are being updated.
  390. //
  391. // If empty, then all fields will be updated.
  392. google.protobuf.FieldMask update_mask = 2;
  393. }
  394. // Request message for [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue].
  395. message DeleteQueueRequest {
  396. // Required. The queue name. For example:
  397. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
  398. string name = 1 [
  399. (google.api.field_behavior) = REQUIRED,
  400. (google.api.resource_reference) = {
  401. type: "cloudtasks.googleapis.com/Queue"
  402. }
  403. ];
  404. }
  405. // Request message for [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue].
  406. message PurgeQueueRequest {
  407. // Required. The queue name. For example:
  408. // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
  409. string name = 1 [
  410. (google.api.field_behavior) = REQUIRED,
  411. (google.api.resource_reference) = {
  412. type: "cloudtasks.googleapis.com/Queue"
  413. }
  414. ];
  415. }
  416. // Request message for [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue].
  417. message PauseQueueRequest {
  418. // Required. The queue name. For example:
  419. // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
  420. string name = 1 [
  421. (google.api.field_behavior) = REQUIRED,
  422. (google.api.resource_reference) = {
  423. type: "cloudtasks.googleapis.com/Queue"
  424. }
  425. ];
  426. }
  427. // Request message for [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue].
  428. message ResumeQueueRequest {
  429. // Required. The queue name. For example:
  430. // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
  431. string name = 1 [
  432. (google.api.field_behavior) = REQUIRED,
  433. (google.api.resource_reference) = {
  434. type: "cloudtasks.googleapis.com/Queue"
  435. }
  436. ];
  437. }
  438. // Request message for listing tasks using [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks].
  439. message ListTasksRequest {
  440. // Required. The queue name. For example:
  441. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
  442. string parent = 1 [
  443. (google.api.field_behavior) = REQUIRED,
  444. (google.api.resource_reference) = {
  445. child_type: "cloudtasks.googleapis.com/Task"
  446. }
  447. ];
  448. // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be
  449. // returned.
  450. //
  451. // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all
  452. // information is retrieved by default because some data, such as
  453. // payloads, might be desirable to return only when needed because
  454. // of its large size or because of the sensitivity of data that it
  455. // contains.
  456. //
  457. // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
  458. // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
  459. // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource.
  460. Task.View response_view = 2;
  461. // Maximum page size.
  462. //
  463. // Fewer tasks than requested might be returned, even if more tasks exist; use
  464. // [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] in the response to
  465. // determine if more tasks exist.
  466. //
  467. // The maximum page size is 1000. If unspecified, the page size will be the
  468. // maximum.
  469. int32 page_size = 3;
  470. // A token identifying the page of results to return.
  471. //
  472. // To request the first page results, page_token must be empty. To
  473. // request the next page of results, page_token must be the value of
  474. // [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] returned
  475. // from the previous call to [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks]
  476. // method.
  477. //
  478. // The page token is valid for only 2 hours.
  479. string page_token = 4;
  480. }
  481. // Response message for listing tasks using [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks].
  482. message ListTasksResponse {
  483. // The list of tasks.
  484. repeated Task tasks = 1;
  485. // A token to retrieve next page of results.
  486. //
  487. // To return the next page of results, call
  488. // [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this value as the
  489. // [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token].
  490. //
  491. // If the next_page_token is empty, there are no more results.
  492. string next_page_token = 2;
  493. }
  494. // Request message for getting a task using [GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask].
  495. message GetTaskRequest {
  496. // Required. The task name. For example:
  497. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
  498. string name = 1 [
  499. (google.api.field_behavior) = REQUIRED,
  500. (google.api.resource_reference) = {
  501. type: "cloudtasks.googleapis.com/Task"
  502. }
  503. ];
  504. // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be
  505. // returned.
  506. //
  507. // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all
  508. // information is retrieved by default because some data, such as
  509. // payloads, might be desirable to return only when needed because
  510. // of its large size or because of the sensitivity of data that it
  511. // contains.
  512. //
  513. // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
  514. // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
  515. // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource.
  516. Task.View response_view = 2;
  517. }
  518. // Request message for [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
  519. message CreateTaskRequest {
  520. // Required. The queue name. For example:
  521. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
  522. //
  523. // The queue must already exist.
  524. string parent = 1 [
  525. (google.api.field_behavior) = REQUIRED,
  526. (google.api.resource_reference) = {
  527. child_type: "cloudtasks.googleapis.com/Task"
  528. }
  529. ];
  530. // Required. The task to add.
  531. //
  532. // Task names have the following format:
  533. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
  534. // The user can optionally specify a task [name][google.cloud.tasks.v2beta3.Task.name]. If a
  535. // name is not specified then the system will generate a random
  536. // unique task id, which will be set in the task returned in the
  537. // [response][google.cloud.tasks.v2beta3.Task.name].
  538. //
  539. // If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not set or is in the
  540. // past then Cloud Tasks will set it to the current time.
  541. //
  542. // Task De-duplication:
  543. //
  544. // Explicitly specifying a task ID enables task de-duplication. If
  545. // a task's ID is identical to that of an existing task or a task
  546. // that was deleted or executed recently then the call will fail
  547. // with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
  548. // If the task's queue was created using Cloud Tasks, then another task with
  549. // the same name can't be created for ~1hour after the original task was
  550. // deleted or executed. If the task's queue was created using queue.yaml or
  551. // queue.xml, then another task with the same name can't be created
  552. // for ~9days after the original task was deleted or executed.
  553. //
  554. // Because there is an extra lookup cost to identify duplicate task
  555. // names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly
  556. // increased latency. Using hashed strings for the task id or for
  557. // the prefix of the task id is recommended. Choosing task ids that
  558. // are sequential or have sequential prefixes, for example using a
  559. // timestamp, causes an increase in latency and error rates in all
  560. // task commands. The infrastructure relies on an approximately
  561. // uniform distribution of task ids to store and serve tasks
  562. // efficiently.
  563. Task task = 2 [(google.api.field_behavior) = REQUIRED];
  564. // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be
  565. // returned.
  566. //
  567. // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all
  568. // information is retrieved by default because some data, such as
  569. // payloads, might be desirable to return only when needed because
  570. // of its large size or because of the sensitivity of data that it
  571. // contains.
  572. //
  573. // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
  574. // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
  575. // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource.
  576. Task.View response_view = 3;
  577. }
  578. // Request message for deleting a task using
  579. // [DeleteTask][google.cloud.tasks.v2beta3.CloudTasks.DeleteTask].
  580. message DeleteTaskRequest {
  581. // Required. The task name. For example:
  582. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
  583. string name = 1 [
  584. (google.api.field_behavior) = REQUIRED,
  585. (google.api.resource_reference) = {
  586. type: "cloudtasks.googleapis.com/Task"
  587. }
  588. ];
  589. }
  590. // Request message for forcing a task to run now using
  591. // [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask].
  592. message RunTaskRequest {
  593. // Required. The task name. For example:
  594. // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
  595. string name = 1 [
  596. (google.api.field_behavior) = REQUIRED,
  597. (google.api.resource_reference) = {
  598. type: "cloudtasks.googleapis.com/Task"
  599. }
  600. ];
  601. // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be
  602. // returned.
  603. //
  604. // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all
  605. // information is retrieved by default because some data, such as
  606. // payloads, might be desirable to return only when needed because
  607. // of its large size or because of the sensitivity of data that it
  608. // contains.
  609. //
  610. // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
  611. // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
  612. // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource.
  613. Task.View response_view = 2;
  614. }