8000 docs: [google-cloud-batch] update comments on ServiceAccount email an… · googleapis/google-cloud-python@93b90df · GitHub
[go: up one dir, main page]

Skip to content

Commit 93b90df

Browse files
docs: [google-cloud-batch] update comments on ServiceAccount email and scopes fields (#12558)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 623205186 Source-Link: googleapis/googleapis@bbcce1d Source-Link: googleapis/googleapis-gen@e8b3121 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJlOGIzMTIxMGU2ZWE3N2FmNjc5MTI0M2E2OWI3MjBhMjk3Nzc5NTgxIn0= BEGIN_COMMIT_OVERRIDE docs: Update comments for ServiceAccount email and scopes fields fix: Add optional flag of existing fields `limit` and `consumed` in ResourceAllowance feat: Add a service_account field to taskGroup for service account support END_COMMIT_OVERRIDE BEGIN_NESTED_COMMIT fix: [google-cloud-batch] Added optional flag of an existing field `limit`, `consumed`, `carryover` in ResourceAllowance --- --- feat: add a service_account field to taskGroup for service account support PiperOrigin-RevId: 623158227 Source-Link: googleapis/googleapis@f9d39f9 Source-Link: googleapis/googleapis-gen@0f5663a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIwZjU2NjNhYjhhMjlhNGZhNjM5YWYxZjgwOTlkM2JlYmM0MzRlNzMyIn0= END_NESTED_COMMIT --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 773154c commit 93b90df

File tree

9 files changed

+65
-27
lines changed

9 files changed

+65
-27
lines changed

packages/google-cloud-batch/google/cloud/batch/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.17" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.17" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1/types/job.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,19 @@ class AllocationPolicy(proto.Message):
424424
Describe instances that can be created by this
425425
AllocationPolicy. Only instances[0] is supported now.
426426
service_account (google.cloud.batch_v1.types.ServiceAccount):
427-
Service account that VMs will run as.
427+
Defines the service account for Batch-created VMs. If
428+
omitted, the `default Compute Engine service
429+
account <https://cloud.google.com/compute/docs/access/service-accounts#default_service_account>`__
430+
is used. Must match the service account specified in any
431+
used instance template configured in the Batch job.
432+
433+
Includes the following fields:
434+
435+
- email: The service account's email address. If not set,
436+
the default Compute Engine service account is used.
437+
- scopes: Additional OAuth scopes to grant the service
438+
account, beyond the default cloud-platform scope. (list
439+
of strings)
428440
labels (MutableMapping[str, str]):
429441
Labels applied to all VM instances and other resources
430442
created by AllocationPolicy. Labels could be user provided
@@ -1065,18 +1077,10 @@ class ServiceAccount(proto.Message):
10651077
10661078
Attributes:
10671079
email (str):
1068-
Email address of the service account. If not
1069-
specified, the default Compute Engine service
1070-
account for the project will be used. If
1071-
instance template is being used, the service
1072-
account has to be specified in the instance
1073-
template and it has to match the email field
1074-
here.
1080+
Email address of the service account.
10751081
scopes (MutableSequence[str]):
10761082
List of scopes to be enabled for this service
1077-
account on the VM, in addition to the
1078-
cloud-platform API scope that will be added by
1079-
default.
1083+
account.
10801084
"""
10811085

10821086
email: str = proto.Field(

packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.17" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,19 @@ class AllocationPolicy(proto.Message):
536536
service_account_email (str):
537537
Deprecated: please use service_account instead.
538538
service_account (google.cloud.batch_v1alpha.types.ServiceAccount):
539-
Service account that VMs will run as.
539+
Defines the service account for Batch-created VMs. If
540+
omitted, the `default Compute Engine service
541+
account <https://cloud.google.com/compute/docs/access/service-accounts#default_service_account>`__
542+
is used. Must match the service account specified in any
543+
used instance template configured in the Batch job.
544+
545+
Includes the following fields:
546+
547+
- email: The service account's email address. If not set,
548+
the default Compute Engine service account is used.
549+
- scopes: Additional OAuth scopes to grant the service
550+
account, beyond the default cloud-platform scope. (list
551+
of strings)
540552
labels (MutableMapping[str, str]):
541553
Labels applied to all VM instances and other resources
542554
created by AllocationPolicy. Labels could be user provided
@@ -1148,6 +1160,17 @@ class TaskGroup(proto.Message):
11481160
user Batch used is generated by OS Login. For more
11491161
information, see `About OS
11501162
Login <https://cloud.google.com/compute/docs/oslogin>`__.
1163+
service_account (google.cloud.batch_v1alpha.types.ServiceAccount):
1164+
Optional. ServiceAccount used by tasks within the task group
1165+
for the access to other Cloud resources. This allows tasks
1166+
to operate with permissions distinct from the service
1167+
account for the VM set at ``AllocationPolicy``. Use this
1168+
field when tasks require different access rights than those
1169+
of the VM.
1170+
1171+
Specify the service account's ``email`` field. Ensure
1172+
``scopes`` include any necessary permissions for tasks, in
1173+
addition to the default 'cloud-platform' scope.
11511174
"""
11521175

11531176
class SchedulingPolicy(proto.Enum):
@@ -1223,25 +1246,22 @@ class SchedulingPolicy(proto.Enum):
12231246
proto.BOOL,
12241247
number=14,
12251248
)
1249+
service_account: "ServiceAccount" = proto.Field(
1250+
proto.MESSAGE,
1251+
number=15,
1252+
message="ServiceAccount",
1253+
)
12261254

12271255

12281256
class ServiceAccount(proto.Message):
12291257
r"""Carries information about a Google Cloud service account.
12301258
12311259
Attributes:
12321260
email (str):
1233-
Email address of the service account. If not
1234-
specified, the default Compute Engine service
1235-
account for the project will be used. If
1236-
instance template is being used, the service
1237-
account has to be specified in the instance
1238-
template and it has to match the email field
1239-
here.
1261+
Email address of the service account.
12401262
scopes (MutableSequence[str]):
12411263
List of scopes to be enabled for this service
1242-
account on the VM, in addition to the
1243-
cloud-platform API scope that will be added by
1244-
default.
1264+
account.
12451265
"""
12461266

12471267
email: str = proto.Field(

packages/google-cloud-batch/google/cloud/batch_v1alpha/types/resource_allowance.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,21 @@ class UsageResourceAllowanceStatus(proto.Message):
263263
class LimitStatus(proto.Message):
264264
r"""UsageResourceAllowanceStatus detail about usage consumption.
265265
266+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
267+
266268
Attributes:
267269
consumption_interval (google.type.interval_pb2.Interval):
268270
Output only. The consumption interval.
269271
limit (float):
270272
Output only. Limit value of a
271273
UsageResourceAllowance within its one duration.
274+
275+
This field is a member of `oneof`_ ``_limit``.
272276
consumed (float):
273277
Output only. Accumulated consumption during
274278
``consumption_interval``.
279+
280+
This field is a member of `oneof`_ ``_consumed``.
275281
"""
276282

277283
consumption_interval: interval_pb2.Interval = proto.Field(
@@ -282,21 +288,27 @@ class LimitStatus(proto.Message):
282288
limit: float = proto.Field(
283289
proto.DOUBLE,
284290
number=2,
291+
optional=True,
285292
)
286293
consumed: float = proto.Field(
287294
proto.DOUBLE,
288295
number=3,
296+
optional=True,
289297
)
290298

291299
class PeriodConsumption(proto.Message):
292300
r"""
293301
302+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
303+
294304
Attributes:
295305
consumption_interval (google.type.interval_pb2.Interval):
296306
Output only. The consumption interval.
297307
consumed (float):
298308
Output only. Accumulated consumption during
299309
``consumption_interval``.
310+
311+
This field is a member of `oneof`_ ``_consumed``.
300312
"""
301313

302314
consumption_interval: interval_pb2.Interval = proto.Field(
@@ -307,6 +319,7 @@ class PeriodConsumption(proto.Message):
307319
consumed: float = proto.Field(
308320
proto.DOUBLE,
309321
number=2,
322+
optional=True,
310323
)
311324

312325
class ConsumptionReport(proto.Message):

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.17"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.17"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,6 +5242,7 @@ def test_create_job_rest(request_type):
52425242
"require_hosts_file": True,
52435243
"permissive_ssh": True,
52445244
"run_as_non_root": True,
5245+
"service_account": {},
52455246
}
52465247
],
52475248
"scheduling_policy": 1,

0 commit comments

Comments
 (0)
0