gce-host 0.1.0
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 +7 -0
- data/.gitignore +20 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +3 -0
- data/LICENSE +22 -0
- data/README.md +210 -0
- data/Rakefile +30 -0
- data/bin/gce-host +4 -0
- data/docs/GCE.html +132 -0
- data/docs/GCE/Host.html +901 -0
- data/docs/GCE/Host/CLI.html +610 -0
- data/docs/GCE/Host/Config.html +1195 -0
- data/docs/GCE/Host/GCEClient.html +215 -0
- data/docs/GCE/Host/GCEClient/Error.html +127 -0
- data/docs/GCE/Host/GCEClient/NotFound.html +131 -0
- data/docs/GCE/Host/HashUtil.html +178 -0
- data/docs/GCE/Host/HostData.html +1658 -0
- data/docs/GCE/Host/RoleData.html +932 -0
- data/docs/GCE/Host/StringUtil.html +359 -0
- data/docs/_index.html +231 -0
- data/docs/class_list.html +58 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +57 -0
- data/docs/css/style.css +339 -0
- data/docs/file.LICENSE.html +95 -0
- data/docs/file.README.html +312 -0
- data/docs/file_list.html +63 -0
- data/docs/frames.html +26 -0
- data/docs/index.html +312 -0
- data/docs/js/app.js +219 -0
- data/docs/js/full_list.js +181 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +477 -0
- data/docs/top-level-namespace.html +112 -0
- data/example/example.conf +8 -0
- data/example/example.rb +6 -0
- data/gce-host.gemspec +26 -0
- data/lib/gce-host.rb +7 -0
- data/lib/gce/host.rb +120 -0
- data/lib/gce/host/cli.rb +151 -0
- data/lib/gce/host/config.rb +109 -0
- data/lib/gce/host/gce_client.rb +69 -0
- data/lib/gce/host/hash_util.rb +11 -0
- data/lib/gce/host/host_data.rb +227 -0
- data/lib/gce/host/role_data.rb +64 -0
- data/lib/gce/host/string_util.rb +31 -0
- data/lib/gce/host/version.rb +5 -0
- data/spec/gce_client_spec.rb +29 -0
- data/spec/host_spec.rb +199 -0
- data/spec/spec_helper.rb +22 -0
- data/terraform.tf +52 -0
- metadata +226 -0
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
ENV['RACK_ENV'] = 'test'
|
|
2
|
+
Bundler.require :test
|
|
3
|
+
|
|
4
|
+
# require 'simplecov'
|
|
5
|
+
# SimpleCov.start do
|
|
6
|
+
# add_filter 'vendor/'
|
|
7
|
+
# add_filter 'spec/'
|
|
8
|
+
# add_group 'libs', 'lib'
|
|
9
|
+
# end
|
|
10
|
+
|
|
11
|
+
Bundler.require :default # <- need this *after* simplecov
|
|
12
|
+
require 'pry'
|
|
13
|
+
require 'gce-host'
|
|
14
|
+
require 'dotenv'
|
|
15
|
+
Dotenv.load
|
|
16
|
+
|
|
17
|
+
# Requires supporting files with custom matchers and macros, etc,
|
|
18
|
+
# in ./support/ and its subdirectories.
|
|
19
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
20
|
+
|
|
21
|
+
RSpec.configure do |config|
|
|
22
|
+
end
|
data/terraform.tf
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
provider "google" {
|
|
2
|
+
credentials = "${file("terraform.json")}"
|
|
3
|
+
region = "asia-northeast1"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
resource "google_compute_instance" "gce-host-web" {
|
|
7
|
+
name = "gce-host-web"
|
|
8
|
+
machine_type = "n1-standard-1"
|
|
9
|
+
zone = "asia-northeast1-a"
|
|
10
|
+
|
|
11
|
+
disk {
|
|
12
|
+
image = "ubuntu-1404-trusty-v20161020"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
network_interface {
|
|
16
|
+
network = "default"
|
|
17
|
+
access_config {
|
|
18
|
+
# Ephemeral IP
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
metadata {
|
|
23
|
+
roles = "foo,web:test"
|
|
24
|
+
service = "gce-host"
|
|
25
|
+
status = "reserve"
|
|
26
|
+
tags = "standby"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
resource "google_compute_instance" "gce-host-db" {
|
|
31
|
+
name = "gce-host-db"
|
|
32
|
+
machine_type = "n1-standard-1"
|
|
33
|
+
zone = "asia-northeast1-a"
|
|
34
|
+
|
|
35
|
+
disk {
|
|
36
|
+
image = "ubuntu-1404-trusty-v20161020"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
network_interface {
|
|
40
|
+
network = "default"
|
|
41
|
+
access_config {
|
|
42
|
+
# Ephemeral IP
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
metadata {
|
|
47
|
+
roles = "foo,db:test"
|
|
48
|
+
service = "gce-host"
|
|
49
|
+
status = "active"
|
|
50
|
+
tags = "master"
|
|
51
|
+
}
|
|
52
|
+
}
|
metadata
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gce-host
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Naotoshi Seo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: google-api-client
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: dotenv
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: yard
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: simplecov
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: pry
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: pry-nav
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rake
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: bundler
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - ">="
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - ">="
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0'
|
|
139
|
+
description: Search hosts on GCP GCE
|
|
140
|
+
email:
|
|
141
|
+
- sonots@gmail.com
|
|
142
|
+
executables:
|
|
143
|
+
- gce-host
|
|
144
|
+
extensions: []
|
|
145
|
+
extra_rdoc_files: []
|
|
146
|
+
files:
|
|
147
|
+
- ".gitignore"
|
|
148
|
+
- ".yardopts"
|
|
149
|
+
- CHANGELOG.md
|
|
150
|
+
- Gemfile
|
|
151
|
+
- LICENSE
|
|
152
|
+
- README.md
|
|
153
|
+
- Rakefile
|
|
154
|
+
- bin/gce-host
|
|
155
|
+
- docs/GCE.html
|
|
156
|
+
- docs/GCE/Host.html
|
|
157
|
+
- docs/GCE/Host/CLI.html
|
|
158
|
+
- docs/GCE/Host/Config.html
|
|
159
|
+
- docs/GCE/Host/GCEClient.html
|
|
160
|
+
- docs/GCE/Host/GCEClient/Error.html
|
|
161
|
+
- docs/GCE/Host/GCEClient/NotFound.html
|
|
162
|
+
- docs/GCE/Host/HashUtil.html
|
|
163
|
+
- docs/GCE/Host/HostData.html
|
|
164
|
+
- docs/GCE/Host/RoleData.html
|
|
165
|
+
- docs/GCE/Host/StringUtil.html
|
|
166
|
+
- docs/_index.html
|
|
167
|
+
- docs/class_list.html
|
|
168
|
+
- docs/css/common.css
|
|
169
|
+
- docs/css/full_list.css
|
|
170
|
+
- docs/css/style.css
|
|
171
|
+
- docs/file.LICENSE.html
|
|
172
|
+
- docs/file.README.html
|
|
173
|
+
- docs/file_list.html
|
|
174
|
+
- docs/frames.html
|
|
175
|
+
- docs/index.html
|
|
176
|
+
- docs/js/app.js
|
|
177
|
+
- docs/js/full_list.js
|
|
178
|
+
- docs/js/jquery.js
|
|
179
|
+
- docs/method_list.html
|
|
180
|
+
- docs/top-level-namespace.html
|
|
181
|
+
- example/example.conf
|
|
182
|
+
- example/example.rb
|
|
183
|
+
- gce-host.gemspec
|
|
184
|
+
- lib/gce-host.rb
|
|
185
|
+
- lib/gce/host.rb
|
|
186
|
+
- lib/gce/host/cli.rb
|
|
187
|
+
- lib/gce/host/config.rb
|
|
188
|
+
- lib/gce/host/gce_client.rb
|
|
189
|
+
- lib/gce/host/hash_util.rb
|
|
190
|
+
- lib/gce/host/host_data.rb
|
|
191
|
+
- lib/gce/host/role_data.rb
|
|
192
|
+
- lib/gce/host/string_util.rb
|
|
193
|
+
- lib/gce/host/version.rb
|
|
194
|
+
- spec/gce_client_spec.rb
|
|
195
|
+
- spec/host_spec.rb
|
|
196
|
+
- spec/spec_helper.rb
|
|
197
|
+
- terraform.tf
|
|
198
|
+
homepage: https://github.com/sonots/gce-host
|
|
199
|
+
licenses:
|
|
200
|
+
- MIT
|
|
201
|
+
metadata: {}
|
|
202
|
+
post_install_message:
|
|
203
|
+
rdoc_options: []
|
|
204
|
+
require_paths:
|
|
205
|
+
- lib
|
|
206
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
|
+
requirements:
|
|
208
|
+
- - ">="
|
|
209
|
+
- !ruby/object:Gem::Version
|
|
210
|
+
version: '0'
|
|
211
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - ">="
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: '0'
|
|
216
|
+
requirements: []
|
|
217
|
+
rubyforge_project:
|
|
218
|
+
rubygems_version: 2.5.2
|
|
219
|
+
signing_key:
|
|
220
|
+
specification_version: 4
|
|
221
|
+
summary: Search hosts on GCP GCE
|
|
222
|
+
test_files:
|
|
223
|
+
- spec/gce_client_spec.rb
|
|
224
|
+
- spec/host_spec.rb
|
|
225
|
+
- spec/spec_helper.rb
|
|
226
|
+
has_rdoc:
|