google-cloud-recommender 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +12 -15
- data/lib/google-cloud-recommender.rb +3 -4
- data/lib/google/cloud/recommender/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb03bae70cf6a6a5461c0f06d749e4f947b3dbeea7a3d66c1cf247193a927f2f
|
4
|
+
data.tar.gz: 57d9fd938ce18d41f6c563af44d3972fdecb84cbd6275c025c7990ce40d74c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3e1f32e3798bb1279e7393910cc7a54caaca78db1869d55585403551e5739e7ea9eddf286f0b74dec39b87d1cb9af22a13b2b3096f44c7776a4c17ee076d17e
|
7
|
+
data.tar.gz: 894d02cf22e4bc27e3b799032967a194d2321e853e9d4eea6f4b10f501f617ef4f43ed90314292015e03bf0c2f788f040ca8614fbe1d32872b96496c7c736c87
|
data/AUTHENTICATION.md
CHANGED
@@ -26,7 +26,7 @@ export RECOMMENDER_CREDENTIALS=path/to/keyfile.json
|
|
26
26
|
```ruby
|
27
27
|
require "google/cloud/recommender"
|
28
28
|
|
29
|
-
client = Google::Cloud::Recommender.
|
29
|
+
client = Google::Cloud::Recommender.recommender_service
|
30
30
|
```
|
31
31
|
|
32
32
|
## Credential Lookup
|
@@ -49,7 +49,7 @@ code.
|
|
49
49
|
|
50
50
|
When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE),
|
51
51
|
Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions
|
52
|
-
(GCF) and Cloud Run, the **
|
52
|
+
(GCF) and Cloud Run, the **Credentials** are discovered
|
53
53
|
automatically. Code should be written as if already authenticated.
|
54
54
|
|
55
55
|
### Environment Variables
|
@@ -63,7 +63,8 @@ environment variable, or the **Credentials JSON** itself can be stored for
|
|
63
63
|
environments such as Docker containers where writing files is difficult or not
|
64
64
|
encouraged.
|
65
65
|
|
66
|
-
The environment variables that google-cloud-recommender checks for credentials
|
66
|
+
The environment variables that google-cloud-recommender checks for credentials
|
67
|
+
are configured on `Google::Cloud::Recommender::V1::Recommender::Credentials`:
|
67
68
|
|
68
69
|
1. `RECOMMENDER_CREDENTIALS` - Path to JSON file, or JSON contents
|
69
70
|
2. `RECOMMENDER_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -76,17 +77,18 @@ require "google/cloud/recommender"
|
|
76
77
|
|
77
78
|
ENV["RECOMMENDER_CREDENTIALS"] = "path/to/keyfile.json"
|
78
79
|
|
79
|
-
client = Google::Cloud::Recommender.
|
80
|
+
client = Google::Cloud::Recommender.recommender_service
|
80
81
|
```
|
81
82
|
|
82
83
|
### Configuration
|
83
84
|
|
84
|
-
The **Credentials JSON** can be configured instead of placing them in
|
85
|
+
The **Credentials JSON** can be configured instead of placing them in
|
86
|
+
environment variables. Either on an individual client initialization:
|
85
87
|
|
86
88
|
```ruby
|
87
89
|
require "google/cloud/recommender"
|
88
90
|
|
89
|
-
client = Google::Cloud::Recommender.
|
91
|
+
client = Google::Cloud::Recommender.recommender_service do |config|
|
90
92
|
config.credentials = "path/to/keyfile.json"
|
91
93
|
end
|
92
94
|
```
|
@@ -100,7 +102,7 @@ Google::Cloud::Recommender.configure do |config|
|
|
100
102
|
config.credentials = "path/to/keyfile.json"
|
101
103
|
end
|
102
104
|
|
103
|
-
client = Google::Cloud::Recommender.
|
105
|
+
client = Google::Cloud::Recommender.recommender_service
|
104
106
|
```
|
105
107
|
|
106
108
|
### Cloud SDK
|
@@ -138,15 +140,15 @@ environments](#google-cloud-platform-environments), you need a Google
|
|
138
140
|
Developers service account.
|
139
141
|
|
140
142
|
1. Visit the [Google Developers Console][dev-console].
|
141
|
-
|
142
|
-
|
143
|
+
2. Create a new project or click on an existing project.
|
144
|
+
3. Activate the slide-out navigation tray and select **API Manager**. From
|
143
145
|
here, you will enable the APIs that your application requires.
|
144
146
|
|
145
147
|
![Enable the APIs that your application requires][enable-apis]
|
146
148
|
|
147
149
|
*Note: You may need to enable billing in order to use these services.*
|
148
150
|
|
149
|
-
|
151
|
+
4. Select **Credentials** from the side navigation.
|
150
152
|
|
151
153
|
You should see a screen like one of the following.
|
152
154
|
|
@@ -165,8 +167,3 @@ Developers service account.
|
|
165
167
|
|
166
168
|
The key file you download will be used by this library to authenticate API
|
167
169
|
requests and should be stored in a secure location.
|
168
|
-
|
169
|
-
## Troubleshooting
|
170
|
-
|
171
|
-
If you're having trouble authenticating you can ask for help by following the
|
172
|
-
{file:TROUBLESHOOTING.md Troubleshooting Guide}.
|
@@ -14,9 +14,8 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
##
|
17
|
-
# This file is here to be autorequired by bundler,
|
18
|
-
#
|
19
|
-
# won't be loaded until required and used.
|
17
|
+
# This file is here to be autorequired by bundler, but the library and all
|
18
|
+
# dependencies won't be loaded until required and used.
|
20
19
|
|
21
20
|
|
22
21
|
gem "google-cloud-core"
|
@@ -24,7 +23,7 @@ require "google/cloud" unless defined? Google::Cloud.new
|
|
24
23
|
require "google/cloud/config"
|
25
24
|
require "googleauth"
|
26
25
|
|
27
|
-
# Set the default
|
26
|
+
# Set the default configuration
|
28
27
|
Google::Cloud.configure.add_config! :recommender do |config|
|
29
28
|
config.add_field! :credentials, nil, match: [String, Hash, Google::Auth::Credentials]
|
30
29
|
config.add_field! :lib_name, nil, match: String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-recommender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|