gce-host 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/lib/gce/host/cli.rb +1 -1
- data/lib/gce/host/gce_client.rb +10 -2
- data/lib/gce/host/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457ca88796684316cb1581238a9a03429f201d01
|
4
|
+
data.tar.gz: 1e763de34120a52cfbfac0aece6c69491c94b0a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9ebe5e8b57b249d5cf38f7f923592f084a4511a3c8ee135e9a8c87b687df8e4cf5729508bf41481153708ff216f165c0c89d71cd893b4c8115a443d0d547686
|
7
|
+
data.tar.gz: 71a40734df6b18dd2b1eef91af3c137543b8e4c5d7231b47fcf30445899d17be5581b440f264c3e5d9ec4c5f05b7c64d391494ea68113f3f72ed1cb8ac642c69
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -172,7 +172,7 @@ Configure .env file as
|
|
172
172
|
|
173
173
|
```
|
174
174
|
AUTH_METHOD=service_account
|
175
|
-
GOOGLE_APPLICATION_CREDENTIALS=
|
175
|
+
GOOGLE_APPLICATION_CREDENTIALS=service_account.json
|
176
176
|
GOOGLE_PROJECT=XXXXXXXXXXXXX
|
177
177
|
OPTIONAL_STRING_KEYS=service,status
|
178
178
|
OPTIONAL_ARRAY_KEYS=tags
|
data/lib/gce/host/cli.rb
CHANGED
data/lib/gce/host/gce_client.rb
CHANGED
@@ -10,10 +10,10 @@ class GCE
|
|
10
10
|
def instances(condition = {})
|
11
11
|
filter = build_filter(condition)
|
12
12
|
instances = []
|
13
|
-
res =
|
13
|
+
res = list_aggregated_instances(Config.project, filter: filter)
|
14
14
|
instances.concat(res.items.values.map(&:instances).compact.flatten(1))
|
15
15
|
while res.next_page_token
|
16
|
-
res =
|
16
|
+
res = list_aggregated_instances(project, filter: filter, page_token: res.next_page_token)
|
17
17
|
instances.concat(res.items.values.map(&:instances).compact.flatten(1))
|
18
18
|
end
|
19
19
|
instances
|
@@ -21,6 +21,14 @@ class GCE
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
+
def list_aggregated_instances(project, **kwargs)
|
25
|
+
if client.respond_to?(:list_aggregated_instances) # < 0.12.0
|
26
|
+
client.list_aggregated_instances(Config.project, **kwargs)
|
27
|
+
else
|
28
|
+
client.aggregated_instance_list(Config.project, **kwargs)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
def client
|
25
33
|
return @client if @client && @client_expiration > Time.now
|
26
34
|
|
data/lib/gce/host/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gce-host
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 2.
|
235
|
+
rubygems_version: 2.5.1
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: Search hosts on GCP GCE
|