How to display Google Artifact Registry repo's location using gcloud?

545 views Asked by At

I try to display 3 fields about my repos using:

gcloud artifacts repositories list --format 'value(name,format,location)'

but this command doesn't show location, only name and format. How do I get location (eg: europe-west1) for my repos?

  • I use gcloud 451.0.0
  • I know I can run list command without any arguments and it displays many fields, including these 3, but can gcloud limit the fields to specific 3 (name/format/location) that I need?
2

There are 2 answers

0
Errorname On BEST ANSWER

I encountered the same issue, but I tried uppercasing "location", and it worked:

gcloud artifacts repositories list --format 'value(name,LOCATION)'

Be careful: It's probably a bug on the gcloud cli, so this may break in the future

4
Sandeep Vokkareni On

As stated in the Documentation, to display the 3 fields i.e., name, format and location of a google artifact registry repository run the following command:

gcloud artifacts repositories list --location=all

Update:

I have tried with the same command you mentioned, and faced the same issue. Then I tried to display other fields like name, format and mode except location, it displayed output for the below command.

gcloud artifacts repositories list --format 'value(name,format,mode)'

The problem is with the location filed. It seems like it is not possible to view the location. It is worth raising a issue at Public Issue Tracker.

In case if you want to list images of artifact registry for a particular location, you need to be specifically mention location name along with the command as stated in this Documentation

gcloud artifacts repositories list --format 'value(name,format)' --location=us-central1

Replace us-central1 with the desired location.