diff --git a/packages/google-cloud-batch/google/cloud/batch/gapic_version.py b/packages/google-cloud-batch/google/cloud/batch/gapic_version.py index 2f5ec559806c..558c8aab67c5 100644 --- a/packages/google-cloud-batch/google/cloud/batch/gapic_version.py +++ b/packages/google-cloud-batch/google/cloud/batch/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.17.17" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py b/packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py index 2f5ec559806c..558c8aab67c5 100644 --- a/packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py +++ b/packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.17.17" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-batch/google/cloud/batch_v1/types/job.py b/packages/google-cloud-batch/google/cloud/batch_v1/types/job.py index 182cfaaae741..5c1b3df3f810 100644 --- a/packages/google-cloud-batch/google/cloud/batch_v1/types/job.py +++ b/packages/google-cloud-batch/google/cloud/batch_v1/types/job.py @@ -424,7 +424,19 @@ class AllocationPolicy(proto.Message): Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now. service_account (google.cloud.batch_v1.types.ServiceAccount): - Service account that VMs will run as. + Defines the service account for Batch-created VMs. If + omitted, the `default Compute Engine service + account `__ + is used. Must match the service account specified in any + used instance template configured in the Batch job. + + Includes the following fields: + + - email: The service account's email address. If not set, + the default Compute Engine service account is used. + - scopes: Additional OAuth scopes to grant the service + account, beyond the default cloud-platform scope. (list + of strings) labels (MutableMapping[str, str]): Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided @@ -1065,18 +1077,10 @@ class ServiceAccount(proto.Message): Attributes: email (str): - Email address of the service account. If not - specified, the default Compute Engine service - account for the project will be used. If - instance template is being used, the service - account has to be specified in the instance - template and it has to match the email field - here. + Email address of the service account. scopes (MutableSequence[str]): 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. + account. """ email: str = proto.Field( diff --git a/packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py b/packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py index 2f5ec559806c..558c8aab67c5 100644 --- a/packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py +++ b/packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.17.17" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py b/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py index bdf6de3ee532..a93e32489415 100644 --- a/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py +++ b/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py @@ -536,7 +536,19 @@ class AllocationPolicy(proto.Message): service_account_email (str): Deprecated: please use service_account instead. service_account (google.cloud.batch_v1alpha.types.ServiceAccount): - Service account that VMs will run as. + Defines the service account for Batch-created VMs. If + omitted, the `default Compute Engine service + account `__ + is used. Must match the service account specified in any + used instance template configured in the Batch job. + + Includes the following fields: + + - email: The service account's email address. If not set, + the default Compute Engine service account is used. + - scopes: Additional OAuth scopes to grant the service + account, beyond the default cloud-platform scope. (list + of strings) labels (MutableMapping[str, str]): Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided @@ -1148,6 +1160,17 @@ class TaskGroup(proto.Message): user Batch used is generated by OS Login. For more information, see `About OS Login `__. + service_account (google.cloud.batch_v1alpha.types.ServiceAccount): + Optional. ServiceAccount used by tasks within the task group + for the access to other Cloud resources. This allows tasks + to operate with permissions distinct from the service + account for the VM set at ``AllocationPolicy``. Use this + field when tasks require different access rights than those + of the VM. + + Specify the service account's ``email`` field. Ensure + ``scopes`` include any necessary permissions for tasks, in + addition to the default 'cloud-platform' scope. """ class SchedulingPolicy(proto.Enum): @@ -1223,6 +1246,11 @@ class SchedulingPolicy(proto.Enum): proto.BOOL, number=14, ) + service_account: "ServiceAccount" = proto.Field( + proto.MESSAGE, + number=15, + message="ServiceAccount", + ) class ServiceAccount(proto.Message): @@ -1230,18 +1258,10 @@ class ServiceAccount(proto.Message): Attributes: email (str): - Email address of the service account. If not - specified, the default Compute Engine service - account for the project will be used. If - instance template is being used, the service - account has to be specified in the instance - template and it has to match the email field - here. + Email address of the service account. scopes (MutableSequence[str]): 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. + account. """ email: str = proto.Field( diff --git a/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/resource_allowance.py b/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/resource_allowance.py index d0dfbd0fa762..d4733516af01 100644 --- a/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/resource_allowance.py +++ b/packages/google-cloud-batch/google/cloud/batch_v1alpha/types/resource_allowance.py @@ -263,15 +263,21 @@ class UsageResourceAllowanceStatus(proto.Message): class LimitStatus(proto.Message): r"""UsageResourceAllowanceStatus detail about usage consumption. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: consumption_interval (google.type.interval_pb2.Interval): Output only. The consumption interval. limit (float): Output only. Limit value of a UsageResourceAllowance within its one duration. + + This field is a member of `oneof`_ ``_limit``. consumed (float): Output only. Accumulated consumption during ``consumption_interval``. + + This field is a member of `oneof`_ ``_consumed``. """ consumption_interval: interval_pb2.Interval = proto.Field( @@ -282,21 +288,27 @@ class LimitStatus(proto.Message): limit: float = proto.Field( proto.DOUBLE, number=2, + optional=True, ) consumed: float = proto.Field( proto.DOUBLE, number=3, + optional=True, ) class PeriodConsumption(proto.Message): r""" + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: consumption_interval (google.type.interval_pb2.Interval): Output only. The consumption interval. consumed (float): Output only. Accumulated consumption during ``consumption_interval``. + + This field is a member of `oneof`_ ``_consumed``. """ consumption_interval: interval_pb2.Interval = proto.Field( @@ -307,6 +319,7 @@ class PeriodConsumption(proto.Message): consumed: float = proto.Field( proto.DOUBLE, number=2, + optional=True, ) class ConsumptionReport(proto.Message): diff --git a/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index 48f8d597690d..e2df1067e4dd 100644 --- a/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.17.17" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index bd7ed14e1793..9b1da03cdd52 100644 --- a/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.17.17" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py b/packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py index 832fce39da83..6c70f45eaeca 100644 --- a/packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py +++ b/packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py @@ -5242,6 +5242,7 @@ def test_create_job_rest(request_type): "require_hosts_file": True, "permissive_ssh": True, "run_as_non_root": True, + "service_account": {}, } ], "scheduling_policy": 1,