Google 的云 SDK 不返回 `createTime`

gpl*_*yer 3 google-cloud-sdk

我试图列出有关使用云 SDK 的某些实例的信息,但由于某种原因该createTime字段未返回。知道为什么吗?

$ gcloud compute instances list --format="table(name,createTime)" --filter="name:florin*"
NAME                         CREATE_TIME
florin-ubuntu-18-playground
Run Code Online (Sandbox Code Playgroud)

这应该根据此工作https://cloud.google.com/sdk/gcloud/reference/topic/filters

llo*_*les 5

该命令gcloud compute instances list默认不显示实例创建时间。但gcloud--format标志可以更改显示的默认输出。

gcloud compute instances list --format="table(name,creationTimestamp)"

还可以从gcloudcomputedescribe 命令检索实例创建时间:

gcloud compute instances describe yourInstance --zone=yourInstanceZone | grep creationTimestamp
Run Code Online (Sandbox Code Playgroud)

或者:

gcloud compute instances describe yourInstance --zone=yourInstanceZone --flatten=creationTimestamp
Run Code Online (Sandbox Code Playgroud)