Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
26 changes: 15 additions & 11 deletions packages/google-cloud-batch/google/cloud/batch_v1/types/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://cloud.google.com/compute/docs/access/service-accounts#default_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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://cloud.google.com/compute/docs/access/service-accounts#default_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
Expand Down Expand Up @@ -1148,6 +1160,17 @@ class TaskGroup(proto.Message):
user Batch used is generated by OS Login. For more
information, see `About OS
Login <https://cloud.google.com/compute/docs/oslogin>`__.
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):
Expand Down Expand Up @@ -1223,25 +1246,22 @@ class SchedulingPolicy(proto.Enum):
proto.BOOL,
number=14,
)
service_account: "ServiceAccount" = proto.Field(
proto.MESSAGE,
number=15,
message="ServiceAccount",
)


class ServiceAccount(proto.Message):
r"""Carries information about a Google Cloud service account.

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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -307,6 +319,7 @@ class PeriodConsumption(proto.Message):
consumed: float = proto.Field(
proto.DOUBLE,
number=2,
optional=True,
)

class ConsumptionReport(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.17"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.17"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down