1

I am looking for a gcloud CLI command to retrieve all the instance created in the last one hour

gcloud compute instances list

Eva
  • 515
  • 4
  • 28

1 Answers1

2

You can filter the results, like this.

gcloud compute instances list --filter="creationTimestamp>=2020-12-01T00:00:00"

Then, build the timestamp that you want.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76
  • 2
    Thanks guillaume, It worked. I modified it `gcloud compute instances list --filter="creationTimestamp>=-p0h20m"` It gives me list of instances created in last 20mins – Eva Jan 12 '21 at 00:14