Hands-On Machine Learning on Google Cloud Platform
上QQ阅读APP看书,第一时间看更新

Gcloud config

To avoid having to specify the zone or other parameters, you can set them in the config with:

$ gcloud config set compute/zone us-east1-d

And to unset them in the config, you can use the following:

$ gcloud config unset compute/zone

For a list of all the different settings available in the config, run gcloud config set --help.

The zone and region can be also stored in the environment variable CLOUDSDK_COMPUTE_ZONE and CLOUDSDK_COMPUTE_REGION. Environment variables override default properties that you set with the gcloud config commands, but do not override explicit flags like --zone or --region.

To set the environment variable CLOUDSDK_COMPUTE_ZONE, run or add this line to your .bashrc:

$ export CLOUDSDK_COMPUTE_ZONE=us-east1-c

For more details, see https://cloud.google.com/compute/docs/gcloud-compute/#set_default_zone_and_region_in_your_local_client.