AUTHENTICATION.md in google-cloud-monitoring-0.32.0 vs AUTHENTICATION.md in google-cloud-monitoring-0.33.0
- old
+ new
@@ -24,11 +24,11 @@
3. Initialize the client.
```ruby
require "google/cloud/monitoring"
-client = Google::Cloud::Monitoring.new
+client = Google::Cloud::Monitoring::AlertPolicy.new
```
## Project and Credential Lookup
The google-cloud-monitoring library aims to make authentication
@@ -39,51 +39,29 @@
**Project ID** is discovered in the following order:
1. Specify project ID in method arguments
2. Specify project ID in configuration
3. Discover project ID in environment variables
-4. Discover GCE project ID
+4. Discover GCP project ID
5. Discover project ID in credentials JSON
**Credentials** are discovered in the following order:
1. Specify credentials in method arguments
2. Specify credentials in configuration
3. Discover credentials path in environment variables
4. Discover credentials JSON in environment variables
5. Discover credentials file in the Cloud SDK's path
-6. Discover GCE credentials
+6. Discover GCP credentials
### Google Cloud Platform environments
-While running on Google Cloud Platform environments such as Google Compute
-Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed.
-The **Project ID** and **Credentials** and are discovered automatically. Code
-should be written as if already authenticated. Just be sure when you [set up the
-GCE instance][gce-how-to], you add the correct scopes for the APIs you want to
-access. For example:
+When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE),
+Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions
+(GCF) and Cloud Run, the **Project ID** and **Credentials** and are discovered
+automatically. Code should be written as if already authenticated.
- * **All APIs**
- * `https://www.googleapis.com/auth/cloud-platform`
- * `https://www.googleapis.com/auth/cloud-platform.read-only`
- * **BigQuery**
- * `https://www.googleapis.com/auth/bigquery`
- * `https://www.googleapis.com/auth/bigquery.insertdata`
- * **Compute Engine**
- * `https://www.googleapis.com/auth/compute`
- * **Datastore**
- * `https://www.googleapis.com/auth/datastore`
- * `https://www.googleapis.com/auth/userinfo.email`
- * **DNS**
- * `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
- * **Pub/Sub**
- * `https://www.googleapis.com/auth/pubsub`
- * **Storage**
- * `https://www.googleapis.com/auth/devstorage.full_control`
- * `https://www.googleapis.com/auth/devstorage.read_only`
- * `https://www.googleapis.com/auth/devstorage.read_write`
-
### Environment Variables
The **Project ID** and **Credentials JSON** can be placed in environment
variables instead of declaring them directly in code. Each service has its own
environment variable, allowing for different service accounts to be used for
@@ -110,11 +88,11 @@
require "google/cloud/monitoring"
ENV["MONITORING_PROJECT"] = "my-project-id"
ENV["MONITORING_CREDENTIALS"] = "path/to/keyfile.json"
-client = Google::Cloud::Monitoring.new
+client = Google::Cloud::Monitoring::AlertPolicy.new
```
### Configuration
The **Project ID** and **Credentials JSON** can be configured instead of placing them in environment variables or providing them as arguments.
@@ -125,10 +103,10 @@
Google::Cloud::Monitoring.configure do |config|
config.project_id = "my-project-id"
config.credentials = "path/to/keyfile.json"
end
-client = Google::Cloud::Monitoring.new
+client = Google::Cloud::Monitoring::AlertPolicy.new
```
### Cloud SDK
This option allows for an easy way to authenticate during development. If