Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 列出按时间排序的Google云资源_Google Cloud Platform_Gcloud - Fatal编程技术网

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