Skip to content

Commit

Permalink
feat(v1): [google-cloud-batch] promote block_project_ssh_keys support…
Browse files Browse the repository at this point in the history
… to batch v1 API (#13046)

BEGIN_COMMIT_OVERRIDE
feat(v1): promote block_project_ssh_keys support to batch v1 API
END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 670424240

Source-Link:
googleapis/googleapis@4bf146f

Source-Link:
googleapis/googleapis-gen@38ece34
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiIzOGVjZTM0MmJhM2NkZjA3ZGI2YjVlM2MzNzI1MmFlOGYzZjdhZGU2In0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 4f468fa commit 63a6de0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
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.26" # {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.26" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
24 changes: 24 additions & 0 deletions packages/google-cloud-batch/google/cloud/batch_v1/types/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,26 @@ class InstancePolicyOrTemplate(proto.Message):
Optional. Set this field true if you want
Batch to install Ops Agent on your behalf.
Default is false.
block_project_ssh_keys (bool):
Optional. Set this field to ``true`` if you want Batch to
block project-level SSH keys from accessing this job's VMs.
Alternatively, you can configure the job to specify a VM
instance template that blocks project-level SSH keys. In
either case, Batch blocks project-level SSH keys while
creating the VMs for this job.
Batch allows project-level SSH keys for a job's VMs only if
all the following are true:
- This field is undefined or set to ``false``.
- The job's VM instance template (if any) doesn't block
project-level SSH keys.
Notably, you can override this behavior by manually updating
a VM to block or allow project-level SSH keys. For more
information about blocking project-level SSH keys, see the
Compute Engine documentation:
https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys
"""

policy: "AllocationPolicy.InstancePolicy" = proto.Field(
Expand All @@ -831,6 +851,10 @@ class InstancePolicyOrTemplate(proto.Message):
proto.BOOL,
number=4,
)
block_project_ssh_keys: bool = proto.Field(
proto.BOOL,
number=5,
)

class NetworkInterface(proto.Message):
r"""A network interface.
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.26" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
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.26"
"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.26"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3867,6 +3867,7 @@ def test_create_job_rest(request_type):
"instance_template": "instance_template_value",
"install_gpu_drivers": True,
"install_ops_agent": True,
"block_project_ssh_keys": True,
}
],
"service_account": {
Expand Down

0 comments on commit 63a6de0

Please sign in to comment.