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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29bf6b2a9d1b252cdeead835586c85e264285cc9
4
- data.tar.gz: e0514ddf6ca4aff91c37de3b92a432d7b7bb57bb
3
+ metadata.gz: 457ca88796684316cb1581238a9a03429f201d01
4
+ data.tar.gz: 1e763de34120a52cfbfac0aece6c69491c94b0a7
5
5
  SHA512:
6
- metadata.gz: bd09dd46c05b2cd41dc3752d874090a2865cd1cbf159f24ffdf2fbdce9bf5c265395a9cbe75ee03b214990afc024f5f71c94b5ec4acefc3ba08ce1e8707fe173
7
- data.tar.gz: e52fc9fa5d9e34caffe5dc1c647f27b4fb7404c645a547429bfa2899855538c7edbd5811765109d42a43a8b18a41d98dd39d7e61ac4b00f93161028a7be3ec50
6
+ metadata.gz: c9ebe5e8b57b249d5cf38f7f923592f084a4511a3c8ee135e9a8c87b687df8e4cf5729508bf41481153708ff216f165c0c89d71cd893b4c8115a443d0d547686
7
+ data.tar.gz: 71a40734df6b18dd2b1eef91af3c137543b8e4c5d7231b47fcf30445899d17be5581b440f264c3e5d9ec4c5f05b7c64d391494ea68113f3f72ed1cb8ac642c69
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 0.5.1 (2017/05/20)
2
+
3
+ Enhancements:
4
+
5
+ * Support google-api-ruby-client >= v0.12.0
6
+
7
+ Fixes:
8
+
9
+ * Fix to use `Config.status: ['running']` instead of `state: ['running']`
10
+
1
11
  # 0.5.0 (2017/05/20)
2
12
 
3
13
  Enhancements:
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=service_acount.json
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
@@ -22,7 +22,7 @@ class GCE
22
22
  end
23
23
 
24
24
  opts = {
25
- state: ["running"]
25
+ Config.status.to_sym => ["running"]
26
26
  }
27
27
 
28
28
  op.on('--hostname one,two,three', Array, "name") {|v|
@@ -10,10 +10,10 @@ class GCE
10
10
  def instances(condition = {})
11
11
  filter = build_filter(condition)
12
12
  instances = []
13
- res = client.list_aggregated_instances(Config.project, filter: filter)
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 = client.list_aggregated_instances(Config.project, filter: filter, page_token: res.next_page_token)
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
 
@@ -1,5 +1,5 @@
1
1
  class GCE
2
2
  class Host
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
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.0
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-05-19 00:00:00.000000000 Z
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.6.11
235
+ rubygems_version: 2.5.1
236
236
  signing_key:
237
237
  specification_version: 4
238
238
  summary: Search hosts on GCP GCE