Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google's cloud SDK doesn't return `createTime`

I'm trying to list info about some instances using cloud sdk, but for some reason the createTime field is not returned. Any idea why?

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

This should work according to this https://cloud.google.com/sdk/gcloud/reference/topic/filters

like image 292
gplayer Avatar asked Sep 01 '26 16:09

gplayer


1 Answers

The command gcloud compute instances list does not show the instances creation time by default. But the gcloud --format flag can change the default output displayed.

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

It is also possible to retrieve the instance creation time from the gcloud compute describe command:

gcloud compute instances describe yourInstance --zone=yourInstanceZone | grep creationTimestamp

Or:

gcloud compute instances describe yourInstance --zone=yourInstanceZone --flatten=creationTimestamp
like image 152
2 revsllompalles Avatar answered Sep 04 '26 14:09

2 revsllompalles