diff --git a/monitoring/api/v3/README.md b/monitoring/api/v3/README.md index 72797754045c..e5a9ea37e0f1 100644 --- a/monitoring/api/v3/README.md +++ b/monitoring/api/v3/README.md @@ -14,15 +14,6 @@ value to it. Go to the [Google Cloud Console](https://console.cloud.google.com). -* Go to API Manager -> Credentials -* Click 'New Credentials', and create a Service Account or [click here](https://console.cloud.google -.com/project/_/apiui/credential/serviceaccount) - Download the JSON for this service account, and set the `GOOGLE_APPLICATION_CREDENTIALS` - environment variable to point to the file containing the JSON credentials. - - - export GOOGLE_APPLICATION_CREDENTIALS=~/Downloads/-0123456789abcdef.json - # Set Up Your Local Dev Environment To install, run the following commands. If you want to use [virtualenv](https://virtualenv.readthedocs.org/en/latest/) @@ -30,12 +21,45 @@ To install, run the following commands. If you want to use [virtualenv](https:/ * pip install -r requirements.txt -To run locally: +Create local credentials by running the following command and following the oauth2 flow: + + gcloud beta auth application-default login + +To run: python list_resources.py --project_id= python custom_metric.py --project_id= Credentials +* Click 'New Credentials', and create a Service Account or [click here](https://console.cloud.google +.com/project/_/apiui/credential/serviceaccount) + Download the JSON for this service account, and set the `GOOGLE_APPLICATION_CREDENTIALS` + environment variable to point to the file containing the JSON credentials. + + + export GOOGLE_APPLICATION_CREDENTIALS=~/Downloads/-0123456789abcdef.json + + ## Contributing changes * See [CONTRIBUTING.md](CONTRIBUTING.md)