Google cloud platform 列出按时间排序的Google云资源
我列出了我的计算磁盘,如下所示:Google cloud platform 列出按时间排序的Google云资源,google-cloud-platform,gcloud,Google Cloud Platform,Gcloud,我列出了我的计算磁盘,如下所示: ▶ gcloud compute disks list NAME LOCATION LOCATION_SCOPE SIZE_GB TYPE STATUS foobar us-east4-b zone
▶ gcloud compute disks list
NAME LOCATION LOCATION_SCOPE SIZE_GB TYPE STATUS
foobar us-east4-b zone 50 pd-standard READY
jenkins-kos-pd us-east4-b zone 100 pd-standard READY
我想按创建时间列出它们。我无法找到这样一个选项并运行
gcloud compute disks list --format="value(name)" --sort-by=TIME --limit=1
产生不可预测的结果您可以使用
creationTimestamp
作为排序参数:
gcloud compute disks list \
--format="value(name,creationTimestamp)" \
--sort-by=creationTimestamp
请注意,您可以通过在creationTimestamp
前面添加~
按降序对它们进行排序:
gcloud compute disks list \
--format="value(name,creationTimestamp)" \
--sort-by=~creationTimestamp
您可以使用
creationTimestamp
作为排序参数:
gcloud compute disks list \
--format="value(name,creationTimestamp)" \
--sort-by=creationTimestamp
请注意,您可以通过在creationTimestamp
前面添加~
按降序对它们进行排序:
gcloud compute disks list \
--format="value(name,creationTimestamp)" \
--sort-by=~creationTimestamp