From 9ece2b7d96f3b18b32acfd5e24ba38f52f39dab9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 13:21:44 -0700 Subject: [PATCH] feat: [batch] add support for placement policies (#4182) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add TaskStatus's new terminated state UNEXECUTED feat: add scheduling_policy IN_ORDER enum to support sequential task executions docs: update comments on boot disk fields for clearer usage scope feat: add support for placement policies docs: update block_external_network field comment to reduce confusion docs: update disk and network field comment for better readability docs: fix `book disk` typo docs: Update reservation field API doc PiperOrigin-RevId: 524883955 Source-Link: https://github.com/googleapis/googleapis/commit/0830aaf0eaf5ef3615cb2f9c4ef81c73c319e1a7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a294b7e89acf09c4801b672d36aa171f9bd69403 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJhMjk0YjdlODlhY2YwOWM0ODAxYjY3MmQzNmFhMTcxZjliZDY5NDAzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests --- feat: add support for placement policies --- feat: per-Runnable labels PiperOrigin-RevId: 530747589 Source-Link: https://github.com/googleapis/googleapis/commit/d944931a7ef52d980ee57af4308f1eff85468de6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/96b4871e5bb966512145d4199563e16e6e3d3baa Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI5NmI0ODcxZTViYjk2NjUxMjE0NWQ0MTk5NTYzZTE2ZTZlM2QzYmFhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests (#21) PiperOrigin-RevId: 530949397 Source-Link: https://github.com/googleapis/googleapis-gen/commit/50f5709c916294a900be0e7f515dca39aa2ba71c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI1MGY1NzA5YzkxNjI5NGE5MDBiZTBlN2Y1MTVkY2EzOWFhMmJhNzFjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support order_by in ListJobs and ListTasks requests --- feat: add support for placement policies --- feat: per-Runnable labels PiperOrigin-RevId: 531181280 Source-Link: https://github.com/googleapis/googleapis/commit/284507839ffb401e0e1f2a4288178ecc511ca584 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f09a853ad8080cfefdfc61b6434d762c8bfd6eb7 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJmMDlhODUzYWQ4MDgwY2ZlZmRmYzYxYjY0MzRkNzYyYzhiZmQ2ZWI3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: override HTTP URLs for LRO cancel/delete operations PiperOrigin-RevId: 532357846 Source-Link: https://github.com/googleapis/googleapis/commit/5cfe30bb7e28287ef82b319e3df1f6778b9d55fd Source-Link: https://github.com/googleapis/googleapis-gen/commit/0e1e293ad959be26640d593b978cab7fba7ced97 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwZTFlMjkzYWQ5NTliZTI2NjQwZDU5M2I5NzhjYWI3ZmJhN2NlZDk3In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add support for placement policies feat: per-Runnable labels PiperOrigin-RevId: 532437427 Source-Link: https://github.com/googleapis/googleapis/commit/288aa7fb71c9b6244db1a816cfd4108f811e6049 Source-Link: https://github.com/googleapis/googleapis-gen/commit/615d60f8e98ef120a79410c029b4c72448b53bde Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI2MTVkNjBmOGU5OGVmMTIwYTc5NDEwYzAyOWI0YzcyNDQ4YjUzYmRlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com> Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-batch/README.md | 31 +- .../protos/google/cloud/batch/v1/job.proto | 63 +- .../protos/google/cloud/batch/v1/task.proto | 13 +- .../google/cloud/batch/v1alpha/batch.proto | 8 + .../google/cloud/batch/v1alpha/job.proto | 75 +- .../google/cloud/batch/v1alpha/task.proto | 10 +- .../google-cloud-batch/protos/protos.d.ts | 245 ++++++- packages/google-cloud-batch/protos/protos.js | 686 +++++++++++++++++- .../google-cloud-batch/protos/protos.json | 54 +- packages/google-cloud-batch/samples/README.md | 18 - ...nippet_metadata.google.cloud.batch.v1.json | 2 +- .../v1alpha/batch_service.list_jobs.js | 5 + .../v1alpha/batch_service.list_tasks.js | 5 + ...t_metadata.google.cloud.batch.v1alpha.json | 14 +- .../src/v1alpha/batch_service_client.ts | 18 + 15 files changed, 1165 insertions(+), 82 deletions(-) diff --git a/packages/google-cloud-batch/README.md b/packages/google-cloud-batch/README.md index adf39f01935..a0606bdf86c 100644 --- a/packages/google-cloud-batch/README.md +++ b/packages/google-cloud-batch/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Batch: Node.js Client](https://github.com/googleapis/google-cloud-node) +# [Batch: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-batch) [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/batch.svg)](https://www.npmjs.org/package/@google-cloud/batch) @@ -107,24 +107,23 @@ callListJobs(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-batch/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js,samples/README.md) | -| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js,samples/README.md) | -| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js,samples/README.md) | -| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js,samples/README.md) | -| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js,samples/README.md) | -| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js,samples/README.md) | -| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js,samples/README.md) | -| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js,samples/README.md) | -| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js,samples/README.md) | -| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js,samples/README.md) | -| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js,samples/README.md) | -| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/test/quickstart.js,samples/README.md) | +| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.get_task | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js,packages/google-cloud-batch/samples/README.md) | +| Batch_service.list_tasks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js,packages/google-cloud-batch/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/quickstart.js,packages/google-cloud-batch/samples/README.md) | diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto index 4bed626c1ac..32e1fc416d2 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/job.proto @@ -225,12 +225,14 @@ message JobNotification { message AllocationPolicy { message LocationPolicy { // A list of allowed location names represented by internal URLs. + // // Each location can be a region or a zone. // Only one region or multiple zones in one region is supported now. // For example, // ["regions/us-central1"] allow VMs in any zones in region us-central1. // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs // in zones us-central1-a and us-central1-c. + // // All locations end up in different regions would cause errors. // For example, // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", @@ -241,25 +243,29 @@ message AllocationPolicy { // A new persistent disk or a local ssd. // A VM can only have one local SSD setting but multiple local SSD partitions. - // https://cloud.google.com/compute/docs/disks#pdspecs. + // See https://cloud.google.com/compute/docs/disks#pdspecs and // https://cloud.google.com/compute/docs/disks#localssds. message Disk { // A data source from which a PD will be created. oneof data_source { // Name of a public or custom image used as the data source. // For example, the following are all valid URLs: - // (1) Specify the image by its family name: + // + // * Specify the image by its family name: // projects/{project}/global/images/family/{image_family} - // (2) Specify the image version: + // * Specify the image version: // projects/{project}/global/images/{image_version} + // // You can also use Batch customized image in short names. // The following image values are supported for a boot disk: - // "batch-debian": use Batch Debian images. - // "batch-centos": use Batch CentOS images. - // "batch-cos": use Batch Container-Optimized images. + // + // * "batch-debian": use Batch Debian images. + // * "batch-centos": use Batch CentOS images. + // * "batch-cos": use Batch Container-Optimized images. string image = 4; // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. string snapshot = 5; } @@ -270,6 +276,7 @@ message AllocationPolicy { string type = 1; // Disk size in GB. + // // For persistent disk, this field is ignored if `data_source` is `image` or // `snapshot`. // For local SSD, size_gb should be a multiple of 375GB, @@ -324,7 +331,7 @@ message AllocationPolicy { // The minimum CPU platform. // See - // `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. // Not yet implemented. string min_cpu_platform = 3; @@ -334,8 +341,9 @@ message AllocationPolicy { // The accelerators attached to each VM instance. repeated Accelerator accelerators = 5; - // Book disk to be created and attached to each VM by this InstancePolicy. + // Boot disk to be created and attached to each VM by this InstancePolicy. // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. Disk boot_disk = 8; // Non-boot disks to be attached for each VM created by this InstancePolicy. @@ -366,18 +374,22 @@ message AllocationPolicy { message NetworkInterface { // The URL of an existing network resource. // You can specify the network as a full or partial URL. + // // For example, the following are all valid URLs: - // https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // projects/{project}/global/networks/{network} - // global/networks/{network} + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} string network = 1; // The URL of an existing subnetwork resource in the network. // You can specify the subnetwork as a full or partial URL. + // // For example, the following are all valid URLs: - // https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // projects/{project}/regions/{region}/subnetworks/{subnetwork} - // regions/{region}/subnetworks/{subnetwork} + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} string subnetwork = 2; // Default is false (with an external IP address). Required if @@ -396,6 +408,23 @@ message AllocationPolicy { repeated NetworkInterface network_interfaces = 1; } + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + // Compute Engine VM instance provisioning model. enum ProvisioningModel { // Unspecified. @@ -437,6 +466,9 @@ message AllocationPolicy { // The network policy. NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; } // A TaskGroup contains one or multiple Tasks that share the same @@ -457,11 +489,12 @@ message TaskGroup { TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; // Number of Tasks in the TaskGroup. - // default is 1 + // Default is 1. int64 task_count = 4; // Max number of tasks that can run in parallel. // Default to min(task_count, 1000). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. int64 parallelism = 5; // An array of environment variable mappings, which are passed to Tasks with diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto index 62e982976c5..b89ba09d0a1 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto @@ -72,7 +72,7 @@ message TaskExecution { message TaskStatus { // Task states. enum State { - // unknown state + // Unknown state. STATE_UNSPECIFIED = 0; // The Task is created and waiting for resources. @@ -89,6 +89,9 @@ message TaskStatus { // The Task has succeeded. SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; } // Task state @@ -124,8 +127,9 @@ message Runnable { string options = 8; // If set to true, external network access to and from container will be - // blocked. The container will use the default internal network - // 'goog-internal'. + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. bool block_external_network = 9; // Optional username for logging in to a docker registry. If username @@ -208,6 +212,9 @@ message Runnable { // Timeout for this Runnable. google.protobuf.Duration timeout = 8; + + // Labels for this Runnable. + map labels = 9; } // Spec of a task diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto index 33cccba15f2..c654d9c2596 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto @@ -177,6 +177,10 @@ message ListJobsRequest { // List filter. string filter = 4; + // Sort results. Supported are "name", "name desc", "create_time", + // "create_time desc", and "". + string order_by = 5; + // Page size. int32 page_size = 2; @@ -211,6 +215,10 @@ message ListTasksRequest { // State=RUNNING string filter = 2; + // Sort results. Supported are "name", "name desc", "create_time", + // "create_time desc", and "". + string order_by = 5; + // Page size. int32 page_size = 3; diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto index 9dc6dc85fbe..c4a2201cfbc 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/job.proto @@ -284,12 +284,14 @@ message JobNotification { message AllocationPolicy { message LocationPolicy { // A list of allowed location names represented by internal URLs. + // // Each location can be a region or a zone. // Only one region or multiple zones in one region is supported now. // For example, // ["regions/us-central1"] allow VMs in any zones in region us-central1. // ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs // in zones us-central1-a and us-central1-c. + // // All locations end up in different regions would cause errors. // For example, // ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", @@ -305,25 +307,29 @@ message AllocationPolicy { // A new persistent disk or a local ssd. // A VM can only have one local SSD setting but multiple local SSD partitions. - // https://cloud.google.com/compute/docs/disks#pdspecs. + // See https://cloud.google.com/compute/docs/disks#pdspecs and // https://cloud.google.com/compute/docs/disks#localssds. message Disk { // A data source from which a PD will be created. oneof data_source { // Name of a public or custom image used as the data source. // For example, the following are all valid URLs: - // (1) Specify the image by its family name: + // + // * Specify the image by its family name: // projects/{project}/global/images/family/{image_family} - // (2) Specify the image version: + // * Specify the image version: // projects/{project}/global/images/{image_version} + // // You can also use Batch customized image in short names. // The following image values are supported for a boot disk: - // "batch-debian": use Batch Debian images. - // "batch-centos": use Batch CentOS images. - // "batch-cos": use Batch Container-Optimized images. + // + // * "batch-debian": use Batch Debian images. + // * "batch-centos": use Batch CentOS images. + // * "batch-cos": use Batch Container-Optimized images. string image = 4; // Name of a snapshot used as the data source. + // Snapshot is not supported as boot disk now. string snapshot = 5; } @@ -334,6 +340,7 @@ message AllocationPolicy { string type = 1; // Disk size in GB. + // // For persistent disk, this field is ignored if `data_source` is `image` or // `snapshot`. // For local SSD, size_gb should be a multiple of 375GB, @@ -391,7 +398,7 @@ message AllocationPolicy { // The minimum CPU platform. // See - // `https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform`. + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. // Not yet implemented. string min_cpu_platform = 3; @@ -401,15 +408,17 @@ message AllocationPolicy { // The accelerators attached to each VM instance. repeated Accelerator accelerators = 5; - // Book disk to be created and attached to each VM by this InstancePolicy. + // Boot disk to be created and attached to each VM by this InstancePolicy. // Boot disk will be deleted when the VM is deleted. + // Batch API now only supports booting from image. Disk boot_disk = 8; // Non-boot disks to be attached for each VM created by this InstancePolicy. // New disks will be deleted when the VM is deleted. repeated AttachedDisk disks = 6; - // If specified, VMs will be allocated only inside the matching reservation. + // If specified, VMs will consume only the specified reservation. + // If not specified (default), VMs will consume any applicable reservation. string reservation = 7; } @@ -436,18 +445,22 @@ message AllocationPolicy { message NetworkInterface { // The URL of an existing network resource. // You can specify the network as a full or partial URL. + // // For example, the following are all valid URLs: - // https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} - // projects/{project}/global/networks/{network} - // global/networks/{network} + // + // * https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network} + // * projects/{project}/global/networks/{network} + // * global/networks/{network} string network = 1; // The URL of an existing subnetwork resource in the network. // You can specify the subnetwork as a full or partial URL. + // // For example, the following are all valid URLs: - // https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} - // projects/{project}/regions/{region}/subnetworks/{subnetwork} - // regions/{region}/subnetworks/{subnetwork} + // + // * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * projects/{project}/regions/{region}/subnetworks/{subnetwork} + // * regions/{region}/subnetworks/{subnetwork} string subnetwork = 2; // Default is false (with an external IP address). Required if @@ -466,6 +479,23 @@ message AllocationPolicy { repeated NetworkInterface network_interfaces = 1; } + // PlacementPolicy describes a group placement policy for the VMs controlled + // by this AllocationPolicy. + message PlacementPolicy { + // UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + // want VMs to be located close to each other for low network latency + // between the VMs. No placement policy will be generated when collocation + // is UNSPECIFIED. + string collocation = 1; + + // When specified, causes the job to fail if more than max_distance logical + // switches are required between VMs. Batch uses the most compact possible + // placement of VMs even when max_distance is not specified. An explicit + // max_distance makes that level of compactness a strict requirement. + // Not yet implemented + int64 max_distance = 2; + } + // Compute Engine VM instance provisioning model. enum ProvisioningModel { // Unspecified. @@ -519,6 +549,9 @@ message AllocationPolicy { // The network policy. NetworkPolicy network = 7; + + // The placement policy. + PlacementPolicy placement = 10; } // A TaskGroup contains one or multiple Tasks that share the same @@ -535,7 +568,15 @@ message TaskGroup { SCHEDULING_POLICY_UNSPECIFIED = 0; // Run Tasks as soon as resources are available. + // + // Tasks might be executed in parallel depending on parallelism and + // task_count values. AS_SOON_AS_POSSIBLE = 1; + + // Run Tasks sequentially with increased task index. + // + // Not yet implemented. + IN_ORDER = 2; } // Output only. TaskGroup name. @@ -548,14 +589,16 @@ message TaskGroup { TaskSpec task_spec = 3 [(google.api.field_behavior) = REQUIRED]; // Number of Tasks in the TaskGroup. - // default is 1 + // Default is 1. int64 task_count = 4; // Max number of tasks that can run in parallel. // Default to min(task_count, 1000). + // Field parallelism must be 1 if the scheduling_policy is IN_ORDER. int64 parallelism = 5; // Scheduling policy for Tasks in the TaskGroup. + // The default value is AS_SOON_AS_POSSIBLE. SchedulingPolicy scheduling_policy = 6; // Compute resource allocation for the TaskGroup. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto index b31bd9eda59..c7db752b26a 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto @@ -77,7 +77,7 @@ message TaskExecution { message TaskStatus { // Task states. enum State { - // unknown state + // Unknown state. STATE_UNSPECIFIED = 0; // The Task is created and waiting for resources. @@ -94,6 +94,9 @@ message TaskStatus { // The Task has succeeded. SUCCEEDED = 5; + + // The Task has not been executed when the Job finishes. + UNEXECUTED = 6; } // Task state @@ -139,8 +142,9 @@ message Runnable { string options = 8; // If set to true, external network access to and from container will be - // blocked. The container will use the default internal network - // 'goog-internal'. + // blocked, containers that are with block_external_network as true can + // still communicate with each other, network cannot be specified in the + // `container.options` field. bool block_external_network = 9; // Optional username for logging in to a docker registry. If username diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index d71a32d652a..4c91ccc8898 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -2031,6 +2031,9 @@ export namespace google { /** AllocationPolicy network */ network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); } /** Represents an AllocationPolicy. */ @@ -2057,6 +2060,9 @@ export namespace google { /** AllocationPolicy network. */ public network?: (google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null); + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null); + /** * Creates a new AllocationPolicy instance using the specified properties. * @param [properties] Properties to set @@ -3024,6 +3030,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** ProvisioningModel enum. */ enum ProvisioningModel { PROVISIONING_MODEL_UNSPECIFIED = 0, @@ -3714,7 +3823,8 @@ export namespace google { ASSIGNED = 2, RUNNING = 3, FAILED = 4, - SUCCEEDED = 5 + SUCCEEDED = 5, + UNEXECUTED = 6 } } @@ -3744,6 +3854,9 @@ export namespace google { /** Runnable timeout */ timeout?: (google.protobuf.IDuration|null); + + /** Runnable labels */ + labels?: ({ [k: string]: string }|null); } /** Represents a Runnable. */ @@ -3779,6 +3892,9 @@ export namespace google { /** Runnable timeout. */ public timeout?: (google.protobuf.IDuration|null); + /** Runnable labels. */ + public labels: { [k: string]: string }; + /** Runnable executable. */ public executable?: ("container"|"script"|"barrier"); @@ -5680,6 +5796,9 @@ export namespace google { /** ListJobsRequest filter */ filter?: (string|null); + /** ListJobsRequest orderBy */ + orderBy?: (string|null); + /** ListJobsRequest pageSize */ pageSize?: (number|null); @@ -5702,6 +5821,9 @@ export namespace google { /** ListJobsRequest filter. */ public filter: string; + /** ListJobsRequest orderBy. */ + public orderBy: string; + /** ListJobsRequest pageSize. */ public pageSize: number; @@ -5904,6 +6026,9 @@ export namespace google { /** ListTasksRequest filter */ filter?: (string|null); + /** ListTasksRequest orderBy */ + orderBy?: (string|null); + /** ListTasksRequest pageSize */ pageSize?: (number|null); @@ -5926,6 +6051,9 @@ export namespace google { /** ListTasksRequest filter. */ public filter: string; + /** ListTasksRequest orderBy. */ + public orderBy: string; + /** ListTasksRequest pageSize. */ public pageSize: number; @@ -7455,6 +7583,9 @@ export namespace google { /** AllocationPolicy network */ network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + + /** AllocationPolicy placement */ + placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); } /** Represents an AllocationPolicy. */ @@ -7493,6 +7624,9 @@ export namespace google { /** AllocationPolicy network. */ public network?: (google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null); + /** AllocationPolicy placement. */ + public placement?: (google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null); + /** * Creates a new AllocationPolicy instance using the specified properties. * @param [properties] Properties to set @@ -8478,6 +8612,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PlacementPolicy. */ + interface IPlacementPolicy { + + /** PlacementPolicy collocation */ + collocation?: (string|null); + + /** PlacementPolicy maxDistance */ + maxDistance?: (number|Long|string|null); + } + + /** Represents a PlacementPolicy. */ + class PlacementPolicy implements IPlacementPolicy { + + /** + * Constructs a new PlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy); + + /** PlacementPolicy collocation. */ + public collocation: string; + + /** PlacementPolicy maxDistance. */ + public maxDistance: (number|Long|string); + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns PlacementPolicy instance + */ + public static create(properties?: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @param message PlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Verifies a PlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @param message PlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PlacementPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** ProvisioningModel enum. */ enum ProvisioningModel { PROVISIONING_MODEL_UNSPECIFIED = 0, @@ -8649,7 +8886,8 @@ export namespace google { /** SchedulingPolicy enum. */ enum SchedulingPolicy { SCHEDULING_POLICY_UNSPECIFIED = 0, - AS_SOON_AS_POSSIBLE = 1 + AS_SOON_AS_POSSIBLE = 1, + IN_ORDER = 2 } } @@ -9207,7 +9445,8 @@ export namespace google { ASSIGNED = 2, RUNNING = 3, FAILED = 4, - SUCCEEDED = 5 + SUCCEEDED = 5, + UNEXECUTED = 6 } } diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index b47b7031c1c..057cb5df633 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -4974,6 +4974,7 @@ case 3: case 4: case 5: + case 6: break; } return null; @@ -5078,6 +5079,10 @@ case 5: message.newTaskState = 5; break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; } return message; }; @@ -5168,6 +5173,7 @@ * @property {google.cloud.batch.v1.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount * @property {Object.|null} [labels] AllocationPolicy labels * @property {google.cloud.batch.v1.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement */ /** @@ -5227,6 +5233,14 @@ */ AllocationPolicy.prototype.network = null; + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + /** * Creates a new AllocationPolicy instance using the specified properties. * @function create @@ -5263,6 +5277,8 @@ $root.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) $root.google.cloud.batch.v1.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -5338,6 +5354,10 @@ message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); break; } + case 10: { + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5405,6 +5425,11 @@ if (error) return "network." + error; } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } return null; }; @@ -5452,6 +5477,11 @@ throw TypeError(".google.cloud.batch.v1.AllocationPolicy.network: object expected"); message.network = $root.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy.fromObject(object.network); } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } return message; }; @@ -5476,6 +5506,7 @@ object.location = null; object.network = null; object.serviceAccount = null; + object.placement = null; } if (message.location != null && message.hasOwnProperty("location")) object.location = $root.google.cloud.batch.v1.AllocationPolicy.LocationPolicy.toObject(message.location, options); @@ -5494,6 +5525,8 @@ } if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) object.serviceAccount = $root.google.cloud.batch.v1.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); return object; }; @@ -7772,6 +7805,247 @@ return NetworkPolicy; })(); + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + /** * ProvisioningModel enum. * @name google.cloud.batch.v1.AllocationPolicy.ProvisioningModel @@ -8979,6 +9253,7 @@ case 3: case 4: case 5: + case 6: break; } return null; @@ -9041,6 +9316,10 @@ case 5: message.taskState = 5; break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; } return message; }; @@ -9470,6 +9749,7 @@ case 3: case 4: case 5: + case 6: break; } if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { @@ -9527,6 +9807,10 @@ case 5: message.state = 5; break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; } if (object.statusEvents) { if (!Array.isArray(object.statusEvents)) @@ -9604,6 +9888,7 @@ * @property {number} RUNNING=3 RUNNING value * @property {number} FAILED=4 FAILED value * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value */ TaskStatus.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -9613,6 +9898,7 @@ values[valuesById[3] = "RUNNING"] = 3; values[valuesById[4] = "FAILED"] = 4; values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; return values; })(); @@ -9633,6 +9919,7 @@ * @property {boolean|null} [alwaysRun] Runnable alwaysRun * @property {google.cloud.batch.v1.IEnvironment|null} [environment] Runnable environment * @property {google.protobuf.IDuration|null} [timeout] Runnable timeout + * @property {Object.|null} [labels] Runnable labels */ /** @@ -9644,6 +9931,7 @@ * @param {google.cloud.batch.v1.IRunnable=} [properties] Properties to set */ function Runnable(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9714,6 +10002,14 @@ */ Runnable.prototype.timeout = null; + /** + * Runnable labels. + * @member {Object.} labels + * @memberof google.cloud.batch.v1.Runnable + * @instance + */ + Runnable.prototype.labels = $util.emptyObject; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -9768,6 +10064,9 @@ $root.google.cloud.batch.v1.Environment.encode(message.environment, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; @@ -9798,7 +10097,7 @@ Runnable.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.Runnable(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9834,6 +10133,29 @@ message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -9917,6 +10239,14 @@ if (error) return "timeout." + error; } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } return null; }; @@ -9963,6 +10293,13 @@ throw TypeError(".google.cloud.batch.v1.Runnable.timeout: object expected"); message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.batch.v1.Runnable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } return message; }; @@ -9979,6 +10316,8 @@ if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { object.ignoreExitStatus = false; object.background = false; @@ -10011,6 +10350,12 @@ object.environment = $root.google.cloud.batch.v1.Environment.toObject(message.environment, options); if (message.timeout != null && message.hasOwnProperty("timeout")) object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } return object; }; @@ -14428,6 +14773,7 @@ * @interface IListJobsRequest * @property {string|null} [parent] ListJobsRequest parent * @property {string|null} [filter] ListJobsRequest filter + * @property {string|null} [orderBy] ListJobsRequest orderBy * @property {number|null} [pageSize] ListJobsRequest pageSize * @property {string|null} [pageToken] ListJobsRequest pageToken */ @@ -14463,6 +14809,14 @@ */ ListJobsRequest.prototype.filter = ""; + /** + * ListJobsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.orderBy = ""; + /** * ListJobsRequest pageSize. * @member {number} pageSize @@ -14511,6 +14865,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -14553,6 +14909,10 @@ message.filter = reader.string(); break; } + case 5: { + message.orderBy = reader.string(); + break; + } case 2: { message.pageSize = reader.int32(); break; @@ -14602,6 +14962,9 @@ if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -14627,6 +14990,8 @@ message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -14652,6 +15017,7 @@ object.pageSize = 0; object.pageToken = ""; object.filter = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -14661,6 +15027,8 @@ object.pageToken = message.pageToken; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; @@ -14989,6 +15357,7 @@ * @interface IListTasksRequest * @property {string|null} [parent] ListTasksRequest parent * @property {string|null} [filter] ListTasksRequest filter + * @property {string|null} [orderBy] ListTasksRequest orderBy * @property {number|null} [pageSize] ListTasksRequest pageSize * @property {string|null} [pageToken] ListTasksRequest pageToken */ @@ -15024,6 +15393,14 @@ */ ListTasksRequest.prototype.filter = ""; + /** + * ListTasksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.batch.v1alpha.ListTasksRequest + * @instance + */ + ListTasksRequest.prototype.orderBy = ""; + /** * ListTasksRequest pageSize. * @member {number} pageSize @@ -15072,6 +15449,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -15114,6 +15493,10 @@ message.filter = reader.string(); break; } + case 5: { + message.orderBy = reader.string(); + break; + } case 3: { message.pageSize = reader.int32(); break; @@ -15163,6 +15546,9 @@ if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -15188,6 +15574,8 @@ message.parent = String(object.parent); if (object.filter != null) message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -15213,6 +15601,7 @@ object.filter = ""; object.pageSize = 0; object.pageToken = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -15222,6 +15611,8 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; @@ -19009,6 +19400,7 @@ case 3: case 4: case 5: + case 6: break; } return null; @@ -19113,6 +19505,10 @@ case 5: message.newTaskState = 5; break; + case "UNEXECUTED": + case 6: + message.newTaskState = 6; + break; } return message; }; @@ -19207,6 +19603,7 @@ * @property {google.cloud.batch.v1alpha.IServiceAccount|null} [serviceAccount] AllocationPolicy serviceAccount * @property {Object.|null} [labels] AllocationPolicy labels * @property {google.cloud.batch.v1alpha.AllocationPolicy.INetworkPolicy|null} [network] AllocationPolicy network + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null} [placement] AllocationPolicy placement */ /** @@ -19300,6 +19697,14 @@ */ AllocationPolicy.prototype.network = null; + /** + * AllocationPolicy placement. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy|null|undefined} placement + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @instance + */ + AllocationPolicy.prototype.placement = null; + /** * Creates a new AllocationPolicy instance using the specified properties. * @function create @@ -19349,6 +19754,8 @@ $root.google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate.encode(message.instances[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) $root.google.cloud.batch.v1alpha.ServiceAccount.encode(message.serviceAccount, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.encode(message.placement, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -19449,6 +19856,10 @@ message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.decode(reader, reader.uint32()); break; } + case 10: { + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -19545,6 +19956,11 @@ if (error) return "network." + error; } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify(message.placement); + if (error) + return "placement." + error; + } return null; }; @@ -19635,6 +20051,11 @@ throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.network: object expected"); message.network = $root.google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy.fromObject(object.network); } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.placement: object expected"); + message.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.fromObject(object.placement); + } return message; }; @@ -19664,6 +20085,7 @@ object.serviceAccountEmail = ""; object.network = null; object.serviceAccount = null; + object.placement = null; } if (message.location != null && message.hasOwnProperty("location")) object.location = $root.google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy.toObject(message.location, options); @@ -19696,6 +20118,8 @@ } if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) object.serviceAccount = $root.google.cloud.batch.v1alpha.ServiceAccount.toObject(message.serviceAccount, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.toObject(message.placement, options); return object; }; @@ -22076,6 +22500,247 @@ return NetworkPolicy; })(); + AllocationPolicy.PlacementPolicy = (function() { + + /** + * Properties of a PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @interface IPlacementPolicy + * @property {string|null} [collocation] PlacementPolicy collocation + * @property {number|Long|null} [maxDistance] PlacementPolicy maxDistance + */ + + /** + * Constructs a new PlacementPolicy. + * @memberof google.cloud.batch.v1alpha.AllocationPolicy + * @classdesc Represents a PlacementPolicy. + * @implements IPlacementPolicy + * @constructor + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + */ + function PlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PlacementPolicy collocation. + * @member {string} collocation + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.collocation = ""; + + /** + * PlacementPolicy maxDistance. + * @member {number|Long} maxDistance + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + */ + PlacementPolicy.prototype.maxDistance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy instance + */ + PlacementPolicy.create = function create(properties) { + return new PlacementPolicy(properties); + }; + + /** + * Encodes the specified PlacementPolicy message. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collocation); + if (message.maxDistance != null && Object.hasOwnProperty.call(message, "maxDistance")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxDistance); + return writer; + }; + + /** + * Encodes the specified PlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.IPlacementPolicy} message PlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.collocation = reader.string(); + break; + } + case 2: { + message.maxDistance = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PlacementPolicy message. + * @function verify + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collocation != null && message.hasOwnProperty("collocation")) + if (!$util.isString(message.collocation)) + return "collocation: string expected"; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (!$util.isInteger(message.maxDistance) && !(message.maxDistance && $util.isInteger(message.maxDistance.low) && $util.isInteger(message.maxDistance.high))) + return "maxDistance: integer|Long expected"; + return null; + }; + + /** + * Creates a PlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} PlacementPolicy + */ + PlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy) + return object; + var message = new $root.google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy(); + if (object.collocation != null) + message.collocation = String(object.collocation); + if (object.maxDistance != null) + if ($util.Long) + (message.maxDistance = $util.Long.fromValue(object.maxDistance)).unsigned = false; + else if (typeof object.maxDistance === "string") + message.maxDistance = parseInt(object.maxDistance, 10); + else if (typeof object.maxDistance === "number") + message.maxDistance = object.maxDistance; + else if (typeof object.maxDistance === "object") + message.maxDistance = new $util.LongBits(object.maxDistance.low >>> 0, object.maxDistance.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy} message PlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collocation = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxDistance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxDistance = options.longs === String ? "0" : 0; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) + object.collocation = message.collocation; + if (message.maxDistance != null && message.hasOwnProperty("maxDistance")) + if (typeof message.maxDistance === "number") + object.maxDistance = options.longs === String ? String(message.maxDistance) : message.maxDistance; + else + object.maxDistance = options.longs === String ? $util.Long.prototype.toString.call(message.maxDistance) : options.longs === Number ? new $util.LongBits(message.maxDistance.low >>> 0, message.maxDistance.high >>> 0).toNumber() : message.maxDistance; + return object; + }; + + /** + * Converts this PlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + PlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PlacementPolicy + * @function getTypeUrl + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PlacementPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy"; + }; + + return PlacementPolicy; + })(); + /** * ProvisioningModel enum. * @name google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel @@ -22423,6 +23088,7 @@ return "schedulingPolicy: enum value expected"; case 0: case 1: + case 2: break; } if (message.allocationPolicy != null && message.hasOwnProperty("allocationPolicy")) { @@ -22511,6 +23177,10 @@ case 1: message.schedulingPolicy = 1; break; + case "IN_ORDER": + case 2: + message.schedulingPolicy = 2; + break; } if (object.allocationPolicy != null) { if (typeof object.allocationPolicy !== "object") @@ -22663,11 +23333,13 @@ * @enum {number} * @property {number} SCHEDULING_POLICY_UNSPECIFIED=0 SCHEDULING_POLICY_UNSPECIFIED value * @property {number} AS_SOON_AS_POSSIBLE=1 AS_SOON_AS_POSSIBLE value + * @property {number} IN_ORDER=2 IN_ORDER value */ TaskGroup.SchedulingPolicy = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "SCHEDULING_POLICY_UNSPECIFIED"] = 0; values[valuesById[1] = "AS_SOON_AS_POSSIBLE"] = 1; + values[valuesById[2] = "IN_ORDER"] = 2; return values; })(); @@ -23463,6 +24135,7 @@ case 3: case 4: case 5: + case 6: break; } return null; @@ -23525,6 +24198,10 @@ case 5: message.taskState = 5; break; + case "UNEXECUTED": + case 6: + message.taskState = 6; + break; } return message; }; @@ -23969,6 +24646,7 @@ case 3: case 4: case 5: + case 6: break; } if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { @@ -24031,6 +24709,10 @@ case 5: message.state = 5; break; + case "UNEXECUTED": + case 6: + message.state = 6; + break; } if (object.statusEvents) { if (!Array.isArray(object.statusEvents)) @@ -24117,6 +24799,7 @@ * @property {number} RUNNING=3 RUNNING value * @property {number} FAILED=4 FAILED value * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} UNEXECUTED=6 UNEXECUTED value */ TaskStatus.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -24126,6 +24809,7 @@ values[valuesById[3] = "RUNNING"] = 3; values[valuesById[4] = "FAILED"] = 4; values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "UNEXECUTED"] = 6; return values; })(); diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index 14e79ce555f..986b1da644a 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -576,6 +576,10 @@ "network": { "type": "NetworkPolicy", "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 } }, "nested": { @@ -742,6 +746,18 @@ } } }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, "ProvisioningModel": { "values": { "PROVISIONING_MODEL_UNSPECIFIED": 0, @@ -880,7 +896,8 @@ "ASSIGNED": 2, "RUNNING": 3, "FAILED": 4, - "SUCCEEDED": 5 + "SUCCEEDED": 5, + "UNEXECUTED": 6 } } } @@ -927,6 +944,11 @@ "timeout": { "type": "google.protobuf.Duration", "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 } }, "nested": { @@ -1387,6 +1409,10 @@ "type": "string", "id": 4 }, + "orderBy": { + "type": "string", + "id": 5 + }, "pageSize": { "type": "int32", "id": 2 @@ -1429,6 +1455,10 @@ "type": "string", "id": 2 }, + "orderBy": { + "type": "string", + "id": 5 + }, "pageSize": { "type": "int32", "id": 3 @@ -1830,6 +1860,10 @@ "network": { "type": "NetworkPolicy", "id": 7 + }, + "placement": { + "type": "PlacementPolicy", + "id": 10 } }, "nested": { @@ -2013,6 +2047,18 @@ } } }, + "PlacementPolicy": { + "fields": { + "collocation": { + "type": "string", + "id": 1 + }, + "maxDistance": { + "type": "int64", + "id": 2 + } + } + }, "ProvisioningModel": { "values": { "PROVISIONING_MODEL_UNSPECIFIED": 0, @@ -2086,7 +2132,8 @@ "SchedulingPolicy": { "values": { "SCHEDULING_POLICY_UNSPECIFIED": 0, - "AS_SOON_AS_POSSIBLE": 1 + "AS_SOON_AS_POSSIBLE": 1, + "IN_ORDER": 2 } } } @@ -2180,7 +2227,8 @@ "ASSIGNED": 2, "RUNNING": 3, "FAILED": 4, - "SUCCEEDED": 5 + "SUCCEEDED": 5, + "UNEXECUTED": 6 } } } diff --git a/packages/google-cloud-batch/samples/README.md b/packages/google-cloud-batch/samples/README.md index 716d48a2d69..38d48ec3190 100644 --- a/packages/google-cloud-batch/samples/README.md +++ b/packages/google-cloud-batch/samples/README.md @@ -25,7 +25,6 @@ * [Batch_service.list_jobs](#batch_service.list_jobs) * [Batch_service.list_tasks](#batch_service.list_tasks) * [Quickstart](#quickstart) - * [Quickstart](#quickstart) ## Before you begin @@ -258,23 +257,6 @@ __Usage:__ `node packages/google-cloud-batch/samples/quickstart.js` ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/test/quickstart.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-batch/samples/test/quickstart.js` - - diff --git a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json index f954cff303d..ddf569bdb95 100644 --- a/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json +++ b/packages/google-cloud-batch/samples/generated/v1/snippet_metadata.google.cloud.batch.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "0.7.0", + "version": "0.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js index b94896ae5ee..16709131898 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js @@ -36,6 +36,11 @@ function main() { * List filter. */ // const filter = 'abc123' + /** + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". + */ + // const orderBy = 'abc123' /** * Page size. */ diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js index efaa5a22b2d..c3268d24c57 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js @@ -40,6 +40,11 @@ function main(parent) { * State=RUNNING */ // const filter = 'abc123' + /** + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". + */ + // const orderBy = 'abc123' /** * Page size. */ diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json index 0d928f0bee9..d509031beef 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json +++ b/packages/google-cloud-batch/samples/generated/v1alpha/snippet_metadata.google.cloud.batch.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-batch", - "version": "0.7.0", + "version": "0.7.1", "language": "TYPESCRIPT", "apis": [ { @@ -162,7 +162,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 71, "type": "FULL" } ], @@ -179,6 +179,10 @@ "name": "filter", "type": "TYPE_STRING" }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, { "name": "page_size", "type": "TYPE_INT32" @@ -254,7 +258,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 76, "type": "FULL" } ], @@ -271,6 +275,10 @@ "name": "filter", "type": "TYPE_STRING" }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, { "name": "page_size", "type": "TYPE_INT32" diff --git a/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts b/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts index 98c9f553c5a..61203cb0b27 100644 --- a/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts +++ b/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts @@ -863,6 +863,9 @@ export class BatchServiceClient { * Parent path. * @param {string} request.filter * List filter. + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken @@ -957,6 +960,9 @@ export class BatchServiceClient { * Parent path. * @param {string} request.filter * List filter. + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken @@ -1005,6 +1011,9 @@ export class BatchServiceClient { * Parent path. * @param {string} request.filter * List filter. + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken @@ -1056,6 +1065,9 @@ export class BatchServiceClient { * Task filter, null filter matches all Tasks. * Filter string should be of the format State=TaskStatus.State e.g. * State=RUNNING + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken @@ -1154,6 +1166,9 @@ export class BatchServiceClient { * Task filter, null filter matches all Tasks. * Filter string should be of the format State=TaskStatus.State e.g. * State=RUNNING + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken @@ -1206,6 +1221,9 @@ export class BatchServiceClient { * Task filter, null filter matches all Tasks. * Filter string should be of the format State=TaskStatus.State e.g. * State=RUNNING + * @param {string} request.orderBy + * Sort results. Supported are "name", "name desc", "create_time", + * "create_time desc", and "". * @param {number} request.pageSize * Page size. * @param {string} request.pageToken