ec2-host 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.yardopts +6 -0
- data/CHANGELOG.md +8 -0
- data/README.md +42 -8
- data/docs/EC2.html +132 -0
- data/docs/EC2/Host.html +889 -0
- data/docs/EC2/Host/CLI.html +616 -0
- data/docs/EC2/Host/Config.html +1193 -0
- data/docs/EC2/Host/EC2Client.html +273 -0
- data/docs/EC2/Host/HashUtil.html +178 -0
- data/docs/EC2/Host/HostData.html +1772 -0
- data/docs/EC2/Host/RoleData.html +932 -0
- data/docs/EC2/Host/StringUtil.html +359 -0
- data/docs/_index.html +201 -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 +323 -0
- data/docs/file_list.html +63 -0
- data/docs/frames.html +26 -0
- data/docs/index.html +323 -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 +489 -0
- data/docs/top-level-namespace.html +112 -0
- data/ec2-host.gemspec +1 -2
- data/{sample.conf → example/example.conf} +1 -1
- data/lib/ec2-host.rb +1 -1
- data/lib/ec2/host.rb +12 -4
- data/lib/ec2/host/config.rb +13 -15
- data/lib/ec2/host/ec2_client.rb +60 -0
- data/lib/ec2/host/host_data.rb +156 -103
- data/lib/ec2/host/role_data.rb +11 -7
- data/spec/host_spec.rb +67 -42
- data/spec/spec_helper.rb +6 -6
- data/terraform.tf +39 -0
- metadata +31 -22
- data/doc.sh +0 -5
- data/lib/ec2/host/client_util.rb +0 -44
- data/spec/README.md +0 -35
@@ -0,0 +1,273 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: EC2::Host::EC2Client
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!EC2/Host/EC2Client.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (E)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../EC2.html" title="EC2 (class)">EC2</a></span></span> » <span class='title'><span class='object_link'><a href="../Host.html" title="EC2::Host (class)">Host</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">EC2Client</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: EC2::Host::EC2Client
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Object</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">EC2::Host::EC2Client</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/ec2/host/ec2_client.rb</dd>
|
98
|
+
|
99
|
+
</dl>
|
100
|
+
<div class="clear"></div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Instance Method Summary
|
112
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#instance_id-instance_method" title="#instance_id (instance method)">- (Object) <strong>instance_id</strong> </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#instances-instance_method" title="#instances (instance method)">- (Object) <strong>instances</strong>(condition) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<div id="instance_method_details" class="method_details_list">
|
167
|
+
<h2>Instance Method Details</h2>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method_details first">
|
171
|
+
<h3 class="signature first" id="instance_id-instance_method">
|
172
|
+
|
173
|
+
- (<tt>Object</tt>) <strong>instance_id</strong>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
</h3><table class="source_code">
|
180
|
+
<tr>
|
181
|
+
<td>
|
182
|
+
<pre class="lines">
|
183
|
+
|
184
|
+
|
185
|
+
20
|
186
|
+
21
|
187
|
+
22
|
188
|
+
23
|
189
|
+
24
|
190
|
+
25
|
191
|
+
26
|
192
|
+
27
|
193
|
+
28
|
194
|
+
29</pre>
|
195
|
+
</td>
|
196
|
+
<td>
|
197
|
+
<pre class="code"><span class="info file"># File 'lib/ec2/host/ec2_client.rb', line 20</span>
|
198
|
+
|
199
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_instance_id'>instance_id</span>
|
200
|
+
<span class='kw'>return</span> <span class='ivar'>@instance_id</span> <span class='kw'>if</span> <span class='ivar'>@instance_id</span>
|
201
|
+
<span class='kw'>begin</span>
|
202
|
+
<span class='id identifier rubyid_http_conn'>http_conn</span> <span class='op'>=</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>HTTP</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>169.254.169.254</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
203
|
+
<span class='id identifier rubyid_http_conn'>http_conn</span><span class='period'>.</span><span class='id identifier rubyid_open_timeout'>open_timeout</span> <span class='op'>=</span> <span class='int'>5</span>
|
204
|
+
<span class='ivar'>@instance_id</span> <span class='op'>=</span> <span class='id identifier rubyid_http_conn'>http_conn</span><span class='period'>.</span><span class='id identifier rubyid_start'>start</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_http'>http</span><span class='op'>|</span> <span class='id identifier rubyid_http'>http</span><span class='period'>.</span><span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/latest/meta-data/instance-id</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span> <span class='rbrace'>}</span>
|
205
|
+
<span class='kw'>rescue</span> <span class='const'>Net</span><span class='op'>::</span><span class='const'>OpenTimeout</span>
|
206
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>HTTP connection to 169.254.169.254 is timeout. Probably, not an EC2 instance?</span><span class='tstring_end'>"</span></span>
|
207
|
+
<span class='kw'>end</span>
|
208
|
+
<span class='kw'>end</span></pre>
|
209
|
+
</td>
|
210
|
+
</tr>
|
211
|
+
</table>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div class="method_details ">
|
215
|
+
<h3 class="signature " id="instances-instance_method">
|
216
|
+
|
217
|
+
- (<tt>Object</tt>) <strong>instances</strong>(condition)
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
</h3><table class="source_code">
|
224
|
+
<tr>
|
225
|
+
<td>
|
226
|
+
<pre class="lines">
|
227
|
+
|
228
|
+
|
229
|
+
7
|
230
|
+
8
|
231
|
+
9
|
232
|
+
10
|
233
|
+
11
|
234
|
+
12
|
235
|
+
13
|
236
|
+
14
|
237
|
+
15
|
238
|
+
16
|
239
|
+
17
|
240
|
+
18</pre>
|
241
|
+
</td>
|
242
|
+
<td>
|
243
|
+
<pre class="code"><span class="info file"># File 'lib/ec2/host/ec2_client.rb', line 7</span>
|
244
|
+
|
245
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_instances'>instances</span><span class='lparen'>(</span><span class='id identifier rubyid_condition'>condition</span><span class='rparen'>)</span>
|
246
|
+
<span class='id identifier rubyid_filters'>filters</span> <span class='op'>=</span> <span class='id identifier rubyid_build_filters'>build_filters</span><span class='lparen'>(</span><span class='id identifier rubyid_condition'>condition</span><span class='rparen'>)</span>
|
247
|
+
<span class='id identifier rubyid_instances'>instances</span> <span class='op'>=</span>
|
248
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_filters'>filters</span>
|
249
|
+
<span class='id identifier rubyid_ec2'>ec2</span><span class='period'>.</span><span class='id identifier rubyid_describe_instances'>describe_instances</span><span class='lparen'>(</span><span class='label'>filters:</span> <span class='id identifier rubyid_filters'>filters</span><span class='rparen'>)</span>
|
250
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_instance_id'>instance_id</span> <span class='op'>=</span> <span class='id identifier rubyid_condition'>condition</span><span class='lbracket'>[</span><span class='symbol'>:instance_id</span><span class='rbracket'>]</span>
|
251
|
+
<span class='id identifier rubyid_ec2'>ec2</span><span class='period'>.</span><span class='id identifier rubyid_describe_instances'>describe_instances</span><span class='lparen'>(</span><span class='label'>instance_ids:</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_instance_id'>instance_id</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
252
|
+
<span class='kw'>else</span>
|
253
|
+
<span class='id identifier rubyid_ec2'>ec2</span><span class='period'>.</span><span class='id identifier rubyid_describe_instances'>describe_instances</span>
|
254
|
+
<span class='kw'>end</span>
|
255
|
+
<span class='id identifier rubyid_instances'>instances</span><span class='period'>.</span><span class='id identifier rubyid_reservations'>reservations</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:instances</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span>
|
256
|
+
<span class='kw'>end</span></pre>
|
257
|
+
</td>
|
258
|
+
</tr>
|
259
|
+
</table>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div id="footer">
|
267
|
+
Generated on Thu Nov 24 10:25:37 2016 by
|
268
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
269
|
+
0.8.7.6 (ruby-2.3.2).
|
270
|
+
</div>
|
271
|
+
|
272
|
+
</body>
|
273
|
+
</html>
|
@@ -0,0 +1,178 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: EC2::Host::HashUtil
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!EC2/Host/HashUtil.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (H)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../EC2.html" title="EC2 (class)">EC2</a></span></span> » <span class='title'><span class='object_link'><a href="../Host.html" title="EC2::Host (class)">Host</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">HashUtil</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: EC2::Host::HashUtil
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/ec2/host/hash_util.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<h2>
|
96
|
+
Class Method Summary
|
97
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
98
|
+
</h2>
|
99
|
+
|
100
|
+
<ul class="summary">
|
101
|
+
|
102
|
+
<li class="public ">
|
103
|
+
<span class="summary_signature">
|
104
|
+
|
105
|
+
<a href="#except-class_method" title="except (class method)">+ (Object) <strong>except</strong>(hash, *keys) </a>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
</span>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
120
|
+
|
121
|
+
</li>
|
122
|
+
|
123
|
+
|
124
|
+
</ul>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<div id="class_method_details" class="method_details_list">
|
130
|
+
<h2>Class Method Details</h2>
|
131
|
+
|
132
|
+
|
133
|
+
<div class="method_details first">
|
134
|
+
<h3 class="signature first" id="except-class_method">
|
135
|
+
|
136
|
+
+ (<tt>Object</tt>) <strong>except</strong>(hash, *keys)
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</h3><table class="source_code">
|
143
|
+
<tr>
|
144
|
+
<td>
|
145
|
+
<pre class="lines">
|
146
|
+
|
147
|
+
|
148
|
+
4
|
149
|
+
5
|
150
|
+
6
|
151
|
+
7
|
152
|
+
8</pre>
|
153
|
+
</td>
|
154
|
+
<td>
|
155
|
+
<pre class="code"><span class="info file"># File 'lib/ec2/host/hash_util.rb', line 4</span>
|
156
|
+
|
157
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_except'>except</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span>
|
158
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
159
|
+
<span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
160
|
+
<span class='id identifier rubyid_hash'>hash</span>
|
161
|
+
<span class='kw'>end</span></pre>
|
162
|
+
</td>
|
163
|
+
</tr>
|
164
|
+
</table>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div id="footer">
|
172
|
+
Generated on Thu Nov 24 10:25:36 2016 by
|
173
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
174
|
+
0.8.7.6 (ruby-2.3.2).
|
175
|
+
</div>
|
176
|
+
|
177
|
+
</body>
|
178
|
+
</html>
|