GCE In and Out Lab Video: During 4:27 the command mentioned using filter is deprecated, here is the output i got when i tried the same command $ gcloud compute machine-types list –filters="NAME:f1-micro AND ZONE~us-west" WARNING: Argument
NAME is deprecated. Use
--filter="name=( 'NAME' ... )" instead. Listed 0 items. so now this is the new command that is working $ gcloud compute machine-types list –filter="name=(f1-micro AND ZONE~us-west)"
Interesting! I’ve tried replicating this using the command
gcloud compute machine-types list --filter "name:f1-micro AND zone~us-west" both on my local machine, and the Cloud Shell using v270 of the SDK. Haven’t been able to replicate that issue so far. If I try using the original form of the command which is specified in the help file, such as
gcloud compute machine-types list f1-micro, I definitely get that same warning about the command being deprecated.
So far, I’m suspecting that will only be an issue where the older form of the command is being used, and it doesn’t look like we show that anywhere in the video at this point.
If you can replicate this again, let us know, and we’ll take a closer look at it! Great find though, and a good point that these commands are always liable to change, and it’s worth keeping up on the latest ways to do things in the cloud.
Best of luck with your studies!
The deprecation of Name argument was done back at least in the 190.0.0 (2018-02-21) or earlier depending on the service as per the release notes for Cloud SDK (https://cloud.google.com/sdk/docs/release-notes). The older command dating back from 2017 or so would have been gcloud compute machine-type list NAME which is now replaced by –filter.
Sorry i have no idea how to do the markdown highlighting…