I would like to know if there is a way to rename an existing 'gcloud topic configurations' e.g. I would like rename 'foo' to 'bar' in the below example.
I couldn't find anything on this in the gcloud reference documents.
Check the available projects by running: gcloud projects list . This will give you a list of projects which you can access. To switch between projects: gcloud config set project <project-id> . Show activity on this post.
Configurations are stored in your user config directory (typically ~/. config/gcloud on MacOS and Linux, or %APPDATA%\gcloud on Windows); you can find the location of your config directory by running gcloud info --format='value(config. paths.
Before renaming the instance, stop it by using the gcloud compute instances stop command. After renaming, start the instance by using the gcloud compute instances start command. Replace the following: INSTANCE_NAME : name of the instance to rename.
You can change it by running [gcloud config set compute/zone NAME]. Your project default Compute Engine region has been set to [us-west1]. You can change it by running [gcloud config set compute/region NAME].
Technically, it is not possible to change the name of that configuration using the gcloud
command.
However, you can change it doing this little workaround:
gcloud config configurations activate [YOUR_CONFIG_NAME]
to activate the configuration you wish.gcloud info --format='get(config.paths.active_config_path)'
to find the directory where your configurations are stored. You will get the path of the file of that specific configuration, looking like this /tmp/tmp.XAfddVDdg/configurations/[YOUR_CONFIG_NAME]
cd
into the directory /tmp/tmp.XAfddVDdg/configurations/
, you will find all your configurations there. Every configuration will be named there like this config_[YOUR_CONFIG_NAME]
. Modifying the part that matches the name of your configuration will successfully change its name. DO NOT delete the config_
part of the name.gcloud config configurations list
, you will find your configuration renamed, but none will be active now. Just activate it with gcloud config configurations activate [YOUR_CONFIG_NAME]
, and you will be good to go.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With