启用Google Cloud Shell的“提升"功能通过gcloud cli模式 [英] Enabling Google Cloud Shell "boost" mode via gcloud cli

查看:132
本文介绍了启用Google Cloud Shell的“提升"功能通过gcloud cli模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此出色答案 https://stackoverflow.com/a/49515502/10690958 中提到的方法在我的ubuntu工作站上通过ssh连接到Google Cloud Shell.有时,我需要启用升压模式".在那种情况下,我目前必须通过firefox( https://console.cloud.google.com/cloudshell/editor?shellonly=true ),然后登录并启用增强模式.之后,我可以关闭firefox,并使用gcloud方法以增强模式访问云外壳VM.

I use the method mentioned in this excellent answer https://stackoverflow.com/a/49515502/10690958 to connect to Google Cloud Shell via ssh on my ubuntu workstation. Occasionally, I need to enable "boost-mode". In that case, I currently have to open the Cloud Shell via firefox (https://console.cloud.google.com/cloudshell/editor?shellonly=true), then login and enable boost mode. After that I can close firefox, and use the gcloud method to access the cloud shell VM in boost mode.

我想仅通过gcloud cli来执行此操作(访问增强模式),因为使用浏览器非常麻烦.

I would like to do this (access boost-mode) purely through the gcloud cli, since using the browser is quite cumbersome.

官方文档没有提及通过gcloud启用增强模式的任何方法.似乎只有三个选项,即通过 gcloud alpha cloud-shell 的ssh/scp/sshfs.也许有一种方法可以通过一些配置选项来启用它吗?

The official docs dont mention any method of enabling boost mode via gcloud There seem to be only three options i.e. ssh/scp/sshfs via gcloud alpha cloud-shell. Is there perhaps a way to enable this via some configuration option?

谢谢

推荐答案

似乎没有任何选项可以通过 v1alpha1 版本的云Shell API (两个版本均未记录).

There does not seem to be any option to enable the boost mode from either the v1 or v1alpha1 versions of the Cloud Shell API (both versions undocumented).

gcloud 命令实际上使用API​​获取您的Cloud Shell环境,其中包含有关如何通过SSH连接的信息,并在需要时更新SSH密钥,然后使用该信息进行连接(使用 gcloud alpha cloud-shell ssh--log-http (如果您想自己检查).

The gcloud command actually uses the API to get the status of your Cloud Shell environment, which contains information about how to connect through SSH, updates the SSH keys if needed, and then connects using that info (use gcloud alpha cloud-shell ssh --log-http if you want to check it by yourself).

据我所知,当您单击"Boost模式"按钮时,浏览器将调用 https://ssh.cloud.google.com/devshell?boost=true&forceNewVm=true(以及其他一些参数),但是我无法使其在命令行上运行,所以我猜测它正在做我无法识别的其他事情.

As far as I can see, when you click the "Boost mode" button, the browser makes a call to https://ssh.cloud.google.com/devshell?boost=true&forceNewVm=true (and some more parameters), but I can't make it work on the command line, so I'm guessing it's doing some other stuff that I can't identify.

如果您的工作流程需要此功能,则可以提高功能在Google的问题跟踪器上发出请求.

If you need this for your workflow, you could raise a feature request on Google's issue tracker.

这篇关于启用Google Cloud Shell的“提升"功能通过gcloud cli模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆