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 bec3531475e..3c6251b94ed 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 @@ -230,8 +230,7 @@ message TaskSpec { // If task ends with non-zero exit code, retry the task with max_retry_count. repeated LifecyclePolicy lifecycle_policies = 9; - // Environment variables to set before running the Task. - // You can set up to 100 environments. + // Deprecated: please use environment(non-plural) instead. map environments = 6 [deprecated = true]; // Volumes to mount before running Tasks using this TaskSpec. 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 27d2b538110..2271d33daf6 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 @@ -369,6 +369,10 @@ 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 will be deleted when the VM is deleted. + 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; @@ -562,5 +566,5 @@ message ServiceAccount { // List of scopes to be enabled for this service account on the VM, in // addition to the cloud-platform API scope that will be added by default. - repeated string scopes = 2 [deprecated = true]; + repeated string scopes = 2; } 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 42b08568534..a28545ad495 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 @@ -238,8 +238,7 @@ message TaskSpec { // If task ends with non-zero exit code, retry the task with max_retry_count. repeated LifecyclePolicy lifecycle_policies = 9; - // Environment variables to set before running the Task. - // You can set up to 100 environments. + // Deprecated: please use environment(non-plural) instead. map environments = 6 [deprecated = true]; // Volumes to mount before running Tasks using this TaskSpec. diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index ea9304fe1db..fb3a014beed 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -7788,6 +7788,9 @@ export namespace google { /** InstancePolicy accelerators */ accelerators?: (google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]|null); + /** InstancePolicy bootDisk */ + bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + /** InstancePolicy disks */ disks?: (google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]|null); @@ -7819,6 +7822,9 @@ export namespace google { /** InstancePolicy accelerators. */ public accelerators: google.cloud.batch.v1alpha.AllocationPolicy.IAccelerator[]; + /** InstancePolicy bootDisk. */ + public bootDisk?: (google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null); + /** InstancePolicy disks. */ public disks: google.cloud.batch.v1alpha.AllocationPolicy.IAttachedDisk[]; diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index b87066cf74a..c76914c6e78 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -20143,6 +20143,7 @@ * @property {string|null} [minCpuPlatform] InstancePolicy minCpuPlatform * @property {google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel|null} [provisioningModel] InstancePolicy provisioningModel * @property {Array.|null} [accelerators] InstancePolicy accelerators + * @property {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null} [bootDisk] InstancePolicy bootDisk * @property {Array.|null} [disks] InstancePolicy disks * @property {string|null} [reservation] InstancePolicy reservation */ @@ -20205,6 +20206,14 @@ */ InstancePolicy.prototype.accelerators = $util.emptyArray; + /** + * InstancePolicy bootDisk. + * @member {google.cloud.batch.v1alpha.AllocationPolicy.IDisk|null|undefined} bootDisk + * @memberof google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy + * @instance + */ + InstancePolicy.prototype.bootDisk = null; + /** * InstancePolicy disks. * @member {Array.} disks @@ -20262,6 +20271,8 @@ $root.google.cloud.batch.v1alpha.AllocationPolicy.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.reservation); + if (message.bootDisk != null && Object.hasOwnProperty.call(message, "bootDisk")) + $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.encode(message.bootDisk, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -20320,6 +20331,10 @@ message.accelerators.push($root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.decode(reader, reader.uint32())); break; } + case 8: { + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.decode(reader, reader.uint32()); + break; + } case 6: { if (!(message.disks && message.disks.length)) message.disks = []; @@ -20397,6 +20412,11 @@ return "accelerators." + error; } } + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) { + var error = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.verify(message.bootDisk); + if (error) + return "bootDisk." + error; + } if (message.disks != null && message.hasOwnProperty("disks")) { if (!Array.isArray(message.disks)) return "disks: array expected"; @@ -20469,6 +20489,11 @@ message.accelerators[i] = $root.google.cloud.batch.v1alpha.AllocationPolicy.Accelerator.fromObject(object.accelerators[i]); } } + if (object.bootDisk != null) { + if (typeof object.bootDisk !== "object") + throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.bootDisk: object expected"); + message.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.fromObject(object.bootDisk); + } if (object.disks) { if (!Array.isArray(object.disks)) throw TypeError(".google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy.disks: array expected"); @@ -20507,6 +20532,7 @@ object.minCpuPlatform = ""; object.provisioningModel = options.enums === String ? "PROVISIONING_MODEL_UNSPECIFIED" : 0; object.reservation = ""; + object.bootDisk = null; } if (message.allowedMachineTypes && message.allowedMachineTypes.length) { object.allowedMachineTypes = []; @@ -20531,6 +20557,8 @@ } if (message.reservation != null && message.hasOwnProperty("reservation")) object.reservation = message.reservation; + if (message.bootDisk != null && message.hasOwnProperty("bootDisk")) + object.bootDisk = $root.google.cloud.batch.v1alpha.AllocationPolicy.Disk.toObject(message.bootDisk, options); return object; }; diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index b202b6c8c7a..d3eb48b0b32 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -1893,6 +1893,10 @@ "type": "Accelerator", "id": 5 }, + "bootDisk": { + "type": "Disk", + "id": 8 + }, "disks": { "rule": "repeated", "type": "AttachedDisk", @@ -2040,10 +2044,7 @@ "scopes": { "rule": "repeated", "type": "string", - "id": 2, - "options": { - "deprecated": true - } + "id": 2 } } }, diff --git a/packages/google-cloud-batch/src/v1/batch_service_client.ts b/packages/google-cloud-batch/src/v1/batch_service_client.ts index 4995bca520d..ad9412d0771 100644 --- a/packages/google-cloud-batch/src/v1/batch_service_client.ts +++ b/packages/google-cloud-batch/src/v1/batch_service_client.ts @@ -131,6 +131,9 @@ export class BatchServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -247,40 +250,16 @@ export class BatchServiceClient { { selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', get: '/v1/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', - additional_bindings: [ - {get: '/v1/{resource=projects/*/locations/*/tasks/*}:getIamPolicy'}, - {get: '/v1/{resource=projects/*/locations/*/nodes/*}:getIamPolicy'}, - ], }, { selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', post: '/v1/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', body: '*', - additional_bindings: [ - { - post: '/v1/{resource=projects/*/locations/*/tasks/*}:setIamPolicy', - body: '*', - }, - { - post: '/v1/{resource=projects/*/locations/*/nodes/*}:setIamPolicy', - body: '*', - }, - ], }, { selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', post: '/v1/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', body: '*', - additional_bindings: [ - { - post: '/v1/{resource=projects/*/locations/*/tasks/*}:testIamPermissions', - body: '*', - }, - { - post: '/v1/{resource=projects/*/locations/*/nodes/*}:testIamPermissions', - body: '*', - }, - ], }, { selector: 'google.longrunning.Operations.CancelOperation', 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 099eb126a43..aaf2979118d 100644 --- a/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts +++ b/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts @@ -131,6 +131,9 @@ export class BatchServiceClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -247,44 +250,16 @@ export class BatchServiceClient { { selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', get: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:getIamPolicy', - additional_bindings: [ - { - get: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:getIamPolicy', - }, - { - get: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:getIamPolicy', - }, - ], }, { selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', post: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:setIamPolicy', body: '*', - additional_bindings: [ - { - post: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:setIamPolicy', - body: '*', - }, - { - post: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:setIamPolicy', - body: '*', - }, - ], }, { selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', post: '/v1alpha/{resource=projects/*/locations/*/jobs/*}:testIamPermissions', body: '*', - additional_bindings: [ - { - post: '/v1alpha/{resource=projects/*/locations/*/tasks/*}:testIamPermissions', - body: '*', - }, - { - post: '/v1alpha/{resource=projects/*/locations/*/nodes/*}:testIamPermissions', - body: '*', - }, - ], }, { selector: 'google.longrunning.Operations.CancelOperation',