作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在脚本中使用命令gcloud compute instances list
,但担心确切的输出格式不是静态的。我该怎么办?
最佳答案
您应该使用大多数--format
命令可用的gcloud
标志。
例如,如果您想获得与当前格式(截至撰写本答案时)完全相同的输出,则可以运行:
$ gcloud compute instances list --format="table(
name,
zone.basename(),
machineType.basename(),
scheduling.preemptible.yesno(yes=true, no=''),
networkInterfaces[0].networkIP:label=INTERNAL_IP,
networkInterfaces[0].accessConfigs[0].natIP:label=EXTERNAL_IP,
status
)"
$ gcloud compute instances list --format=yaml
$ gcloud compute instances list --format=json
table
一样,它也需要一个投影-有关如何打印每一行的规范。3
$ gcloud compute instances list --format="csv(name,zone,status)"
name,zone,status
example-instance,us-central1-f,RUNNING
...
gcloud
格式化功能的更多信息,请参见
gcloud topic formats
和
gcloud topic projections
的输出。
gcloud compute instances list --format=flattened
来查看所有可能的字段。
gcloud beta test android locales list
,您可以传递
--verbosity=INFO
标志并查找
INFO: Display format
。
关于gcloud - 我想在脚本中使用`gcloud`的输出,但是格式改变了。我该怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34600588/
使用登录后,我想吐出用户名。 但是,当我尝试单击登录按钮时, 它给了我力量。 我看着logcat,但是什么也没显示。 这种编码是在说。 它将根据我在登录屏幕中输入的名称来烘烤用户名。 不会有任何密码。
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎是题外话,因为它缺乏足够的信息来诊断问题。 更详细地描述您的问题或include a min
我是一名优秀的程序员,十分优秀!