cloudtasks.proto 25 KB

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