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