meroku 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -5
  3. data/bin/meroku +1 -1
  4. data/circle.yml +23 -0
  5. data/frontend/Gemfile +5 -2
  6. data/frontend/Gemfile.lock +5 -2
  7. data/frontend/app/controllers/application_controller.rb +1 -0
  8. data/frontend/app/controllers/apps_controller.rb +46 -48
  9. data/frontend/app/controllers/publickeys_controller.rb +45 -46
  10. data/frontend/app/controllers/users/registrations_controller.rb +0 -15
  11. data/frontend/app/controllers/users/sessions_controller.rb +12 -3
  12. data/frontend/app/lib/cmd.rb +11 -0
  13. data/frontend/app/models/app.rb +18 -11
  14. data/frontend/app/models/publickey.rb +1 -1
  15. data/frontend/app/models/user.rb +5 -4
  16. data/frontend/app/policies/application_policy.rb +53 -0
  17. data/frontend/app/policies/publickey_policy.rb +7 -0
  18. data/frontend/app/serializable/serializable_user.rb +2 -1
  19. data/frontend/app/views/layouts/application.html.erb +1 -1
  20. data/frontend/config/database.yml +72 -10
  21. data/frontend/config/routes.rb +6 -14
  22. data/frontend/db/migrate/20171028150506_add_apisecret_to_users.rb +6 -0
  23. data/frontend/etc_nginx_sites-enabled_default +1 -1
  24. data/frontend/public/Meroku.html +140 -0
  25. data/frontend/public/Meroku/Api.html +129 -0
  26. data/frontend/public/Meroku/Api/Request.html +221 -0
  27. data/frontend/public/Meroku/Aws.html +212 -0
  28. data/frontend/public/Meroku/Aws/Ec2.html +477 -0
  29. data/frontend/public/Meroku/CLI.html +784 -0
  30. data/frontend/public/Meroku/CLI/AdminUser.html +192 -0
  31. data/frontend/public/Meroku/CLI/Help.html +224 -0
  32. data/frontend/public/Meroku/CLI/Secrets.html +191 -0
  33. data/frontend/public/Meroku/CLI/Session.html +460 -0
  34. data/frontend/public/Meroku/CLI/User.html +182 -0
  35. data/frontend/public/Meroku/Extensions.html +405 -0
  36. data/frontend/public/Meroku/Infrastructure.html +279 -0
  37. data/frontend/public/Meroku/Infrastructure/Node.html +785 -0
  38. data/frontend/public/Meroku/Infrastructure/Server.html +373 -0
  39. data/frontend/public/Meroku/Node.html +845 -0
  40. data/frontend/public/Meroku/Tunnel.html +701 -0
  41. data/frontend/public/Meroku/Tunnelable.html +243 -0
  42. data/frontend/public/_index.html +273 -0
  43. data/frontend/public/class_list.html +51 -0
  44. data/frontend/public/css/common.css +1 -0
  45. data/frontend/public/css/full_list.css +58 -0
  46. data/frontend/public/css/style.css +492 -0
  47. data/frontend/public/file.README.html +181 -0
  48. data/frontend/public/file_list.html +56 -0
  49. data/frontend/public/frames.html +17 -0
  50. data/frontend/public/index.html +181 -0
  51. data/frontend/public/js/app.js +248 -0
  52. data/frontend/public/js/full_list.js +216 -0
  53. data/frontend/public/js/jquery.js +4 -0
  54. data/frontend/public/method_list.html +395 -0
  55. data/frontend/public/robots.txt +2 -1
  56. data/frontend/public/top-level-namespace.html +110 -0
  57. data/frontend/test/policies/publickey_policy_test.rb +19 -0
  58. data/lib/meroku.rb +9 -7
  59. data/lib/meroku/api.rb +8 -0
  60. data/lib/meroku/api/request.rb +17 -0
  61. data/lib/meroku/aws.rb +14 -0
  62. data/lib/meroku/aws/ec2.rb +59 -0
  63. data/lib/meroku/cli.rb +80 -81
  64. data/lib/meroku/cli/help.rb +27 -0
  65. data/lib/meroku/cli/secrets.rb +13 -0
  66. data/lib/meroku/cli/session.rb +32 -51
  67. data/lib/meroku/extensions.rb +32 -0
  68. data/lib/meroku/infrastructure.rb +14 -17
  69. data/lib/meroku/infrastructure/server.rb +20 -0
  70. data/lib/meroku/node.rb +113 -0
  71. data/lib/meroku/tunnelable.rb +31 -0
  72. data/lib/meroku/version.rb +1 -1
  73. data/modified-cedar-14.sh +0 -4
  74. metadata +50 -9
  75. data/frontend/app/controllers/pages_controller.rb +0 -4
  76. data/frontend/app/views/pages/landing.html.erb +0 -2
  77. data/frontend/db/migrate/20171025193627_add_token_to_users.rb +0 -5
  78. data/lib/meroku/cli/admin_user.rb +0 -20
  79. data/lib/meroku/cli/user.rb +0 -14
  80. data/lib/meroku/infrastructure/node.rb +0 -102
  81. data/lib/meroku/tunnel.rb +0 -56
@@ -0,0 +1,221 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Meroku::Api::Request
8
+
9
+ &mdash; Documentation by YARD 0.9.9
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
+ pathId = "Meroku::Api::Request";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Meroku.html" title="Meroku (module)">Meroku</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Api.html" title="Meroku::Api (module)">Api</a></span></span>
41
+ &raquo;
42
+ <span class="title">Request</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Meroku::Api::Request
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/meroku/api/request.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+ <h2>Overview</h2><div class="docstring">
87
+ <div class="discussion">
88
+
89
+ <p>Wrapper around RestClient.post</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ <h2>
106
+ Class Method Summary
107
+ <small><a href="#" class="summary_toggle">collapse</a></small>
108
+ </h2>
109
+
110
+ <ul class="summary">
111
+
112
+ <li class="public ">
113
+ <span class="summary_signature">
114
+
115
+ <a href="#post-class_method" title="post (class method)">.<strong>post</strong>(url, data) {|r[&quot;data&quot;]| ... } &#x21d2; Object </a>
116
+
117
+
118
+
119
+ </span>
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <span class="summary_desc"><div class='inline'></div></span>
130
+
131
+ </li>
132
+
133
+
134
+ </ul>
135
+
136
+
137
+
138
+
139
+ <div id="class_method_details" class="method_details_list">
140
+ <h2>Class Method Details</h2>
141
+
142
+
143
+ <div class="method_details first">
144
+ <h3 class="signature first" id="post-class_method">
145
+
146
+ .<strong>post</strong>(url, data) {|r[&quot;data&quot;]| ... } &#x21d2; <tt>Object</tt>
147
+
148
+
149
+
150
+
151
+
152
+ </h3><div class="docstring">
153
+ <div class="discussion">
154
+
155
+
156
+ </div>
157
+ </div>
158
+ <div class="tags">
159
+
160
+ <p class="tag_title">Yields:</p>
161
+ <ul class="yield">
162
+
163
+ <li>
164
+
165
+
166
+ <span class='type'>(<tt>r["data"]</tt>)</span>
167
+
168
+
169
+
170
+ </li>
171
+
172
+ </ul>
173
+
174
+ </div><table class="source_code">
175
+ <tr>
176
+ <td>
177
+ <pre class="lines">
178
+
179
+
180
+ 5
181
+ 6
182
+ 7
183
+ 8
184
+ 9
185
+ 10
186
+ 11
187
+ 12
188
+ 13
189
+ 14</pre>
190
+ </td>
191
+ <td>
192
+ <pre class="code"><span class="info file"># File 'lib/meroku/api/request.rb', line 5</span>
193
+
194
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
195
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>RestClient</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='comma'>,</span>
196
+ <span class='label'>timeout:</span> <span class='int'>1</span><span class='comma'>,</span>
197
+ <span class='label'>content_type:</span> <span class='symbol'>:json</span><span class='comma'>,</span>
198
+ <span class='label'>accept:</span> <span class='symbol'>:json</span><span class='rparen'>)</span>
199
+ <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
200
+ <span class='kw'>yield</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>data</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
201
+ <span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>errors</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>errors</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
202
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>error: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>errors</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid_x'>x</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>detail</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>. </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
203
+ <span class='kw'>end</span></pre>
204
+ </td>
205
+ </tr>
206
+ </table>
207
+ </div>
208
+
209
+ </div>
210
+
211
+ </div>
212
+
213
+ <div id="footer">
214
+ Generated on Tue Oct 31 19:39:54 2017 by
215
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
216
+ 0.9.9 (ruby-2.4.2).
217
+ </div>
218
+
219
+ </div>
220
+ </body>
221
+ </html>
@@ -0,0 +1,212 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Meroku::Aws
8
+
9
+ &mdash; Documentation by YARD 0.9.9
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
+ pathId = "Meroku::Aws";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (A)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../Meroku.html" title="Meroku (module)">Meroku</a></span></span>
41
+ &raquo;
42
+ <span class="title">Aws</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Meroku::Aws
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/meroku/aws.rb<span class="defines">,<br />
82
+ lib/meroku/aws/ec2.rb</span>
83
+ </dd>
84
+ </dl>
85
+
86
+ </div>
87
+
88
+ <h2>Overview</h2><div class="docstring">
89
+ <div class="discussion">
90
+
91
+ <p>Stuff related to Amazon Web Services</p>
92
+
93
+
94
+ </div>
95
+ </div>
96
+ <div class="tags">
97
+
98
+
99
+ </div><h2>Defined Under Namespace</h2>
100
+ <p class="children">
101
+
102
+
103
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Aws/Ec2.html" title="Meroku::Aws::Ec2 (module)">Ec2</a></span>
104
+
105
+
106
+
107
+
108
+ </p>
109
+
110
+ <h2>Constant Summary</h2>
111
+ <dl class="constants">
112
+
113
+ <dt id="IP-constant" class="">IP =
114
+
115
+ </dt>
116
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>34.239.241.218</span><span class='tstring_end'>&#39;</span></span></pre></dd>
117
+
118
+ <dt id="KEY_NAME-constant" class="">KEY_NAME =
119
+
120
+ </dt>
121
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>~/crypto/meroku/meroku.id_rsa</span><span class='tstring_end'>&#39;</span></span></pre></dd>
122
+
123
+ </dl>
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+ <h2>
133
+ Class Method Summary
134
+ <small><a href="#" class="summary_toggle">collapse</a></small>
135
+ </h2>
136
+
137
+ <ul class="summary">
138
+
139
+ <li class="public ">
140
+ <span class="summary_signature">
141
+
142
+ <a href="#bucket_url-class_method" title="bucket_url (class method)">.<strong>bucket_url</strong> &#x21d2; Object </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="class_method_details" class="method_details_list">
167
+ <h2>Class Method Details</h2>
168
+
169
+
170
+ <div class="method_details first">
171
+ <h3 class="signature first" id="bucket_url-class_method">
172
+
173
+ .<strong>bucket_url</strong> &#x21d2; <tt>Object</tt>
174
+
175
+
176
+
177
+
178
+
179
+ </h3><table class="source_code">
180
+ <tr>
181
+ <td>
182
+ <pre class="lines">
183
+
184
+
185
+ 10
186
+ 11
187
+ 12</pre>
188
+ </td>
189
+ <td>
190
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws.rb', line 10</span>
191
+
192
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_bucket_url'>bucket_url</span>
193
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>http://www.sam-we.com/dropbox/meroku-</span><span class='embexpr_beg'>#{</span><span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>SECRET</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
194
+ <span class='kw'>end</span></pre>
195
+ </td>
196
+ </tr>
197
+ </table>
198
+ </div>
199
+
200
+ </div>
201
+
202
+ </div>
203
+
204
+ <div id="footer">
205
+ Generated on Tue Oct 31 19:39:54 2017 by
206
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
207
+ 0.9.9 (ruby-2.4.2).
208
+ </div>
209
+
210
+ </div>
211
+ </body>
212
+ </html>
@@ -0,0 +1,477 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Meroku::Aws::Ec2
8
+
9
+ &mdash; Documentation by YARD 0.9.9
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
+ pathId = "Meroku::Aws::Ec2";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (E)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Meroku.html" title="Meroku (module)">Meroku</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Aws.html" title="Meroku::Aws (module)">Aws</a></span></span>
41
+ &raquo;
42
+ <span class="title">Ec2</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Meroku::Aws::Ec2
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="../CLI.html" title="Meroku::CLI (module)">CLI</a></span>, <span class='object_link'><a href="../Infrastructure.html" title="Meroku::Infrastructure (module)">Infrastructure</a></span>, <span class='object_link'><a href="../Infrastructure/Server.html" title="Meroku::Infrastructure::Server (class)">Infrastructure::Server</a></span>, <span class='object_link'><a href="../Node.html" title="Meroku::Node (class)">Node</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/meroku/aws/ec2.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+
94
+ <p>Logic related to the ec2 instances we use as servers</p>
95
+
96
+
97
+ </div>
98
+ </div>
99
+ <div class="tags">
100
+
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Class 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="#associate_address-class_method" title="associate_address (class method)">.<strong>associate_address</strong>(eipalloc, id) &#x21d2; Object </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="#ec2_client-class_method" title="ec2_client (class method)">.<strong>ec2_client</strong> &#x21d2; Object </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
+ <h2>
164
+ Instance Method Summary
165
+ <small><a href="#" class="summary_toggle">collapse</a></small>
166
+ </h2>
167
+
168
+ <ul class="summary">
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#ec2_client-instance_method" title="#ec2_client (instance method)">#<strong>ec2_client</strong> &#x21d2; Object </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ <span class="summary_desc"><div class='inline'></div></span>
188
+
189
+ </li>
190
+
191
+
192
+ <li class="public ">
193
+ <span class="summary_signature">
194
+
195
+ <a href="#make_instance-instance_method" title="#make_instance (instance method)">#<strong>make_instance</strong> &#x21d2; Object </a>
196
+
197
+
198
+
199
+ </span>
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'></div></span>
210
+
211
+ </li>
212
+
213
+
214
+ <li class="public ">
215
+ <span class="summary_signature">
216
+
217
+ <a href="#tag-instance_method" title="#tag (instance method)">#<strong>tag</strong> &#x21d2; Object </a>
218
+
219
+
220
+
221
+ </span>
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ <span class="summary_desc"><div class='inline'></div></span>
232
+
233
+ </li>
234
+
235
+
236
+ </ul>
237
+
238
+
239
+
240
+
241
+ <div id="class_method_details" class="method_details_list">
242
+ <h2>Class Method Details</h2>
243
+
244
+
245
+ <div class="method_details first">
246
+ <h3 class="signature first" id="associate_address-class_method">
247
+
248
+ .<strong>associate_address</strong>(eipalloc, id) &#x21d2; <tt>Object</tt>
249
+
250
+
251
+
252
+
253
+
254
+ </h3><table class="source_code">
255
+ <tr>
256
+ <td>
257
+ <pre class="lines">
258
+
259
+
260
+ 49
261
+ 50
262
+ 51
263
+ 52
264
+ 53
265
+ 54
266
+ 55
267
+ 56</pre>
268
+ </td>
269
+ <td>
270
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws/ec2.rb', line 49</span>
271
+
272
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_associate_address'>associate_address</span><span class='lparen'>(</span><span class='id identifier rubyid_eipalloc'>eipalloc</span><span class='comma'>,</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
273
+ <span class='id identifier rubyid_retries'>retries</span> <span class='op'>||=</span> <span class='int'>0</span>
274
+ <span class='id identifier rubyid_ec2_client'>ec2_client</span><span class='period'>.</span><span class='id identifier rubyid_associate_address'>associate_address</span><span class='lparen'>(</span><span class='label'>allocation_id:</span> <span class='id identifier rubyid_eipalloc'>eipalloc</span><span class='comma'>,</span> <span class='label'>instance_id:</span> <span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
275
+ <span class='kw'>rescue</span> <span class='op'>::</span><span class='const'>Aws</span><span class='op'>::</span><span class='const'>EC2</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>InvalidInstanceID</span>
276
+ <span class='id identifier rubyid_sleep'>sleep</span> <span class='int'>1</span>
277
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>retrying associate_address()</span><span class='tstring_end'>&#39;</span></span>
278
+ <span class='kw'>retry</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_retries'>retries</span> <span class='op'>+=</span> <span class='int'>1</span><span class='rparen'>)</span> <span class='op'>&lt;</span> <span class='int'>15</span>
279
+ <span class='kw'>end</span></pre>
280
+ </td>
281
+ </tr>
282
+ </table>
283
+ </div>
284
+
285
+ <div class="method_details ">
286
+ <h3 class="signature " id="ec2_client-class_method">
287
+
288
+ .<strong>ec2_client</strong> &#x21d2; <tt>Object</tt>
289
+
290
+
291
+
292
+
293
+
294
+ </h3><table class="source_code">
295
+ <tr>
296
+ <td>
297
+ <pre class="lines">
298
+
299
+
300
+ 39
301
+ 40
302
+ 41
303
+ 42
304
+ 43
305
+ 44
306
+ 45
307
+ 46
308
+ 47</pre>
309
+ </td>
310
+ <td>
311
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws/ec2.rb', line 39</span>
312
+
313
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ec2_client'>ec2_client</span>
314
+ <span class='op'>::</span><span class='const'>Aws</span><span class='op'>::</span><span class='const'>EC2</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
315
+ <span class='label'>region:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>us-east-1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
316
+ <span class='label'>credentials:</span> <span class='op'>::</span><span class='const'>Aws</span><span class='op'>::</span><span class='const'>Credentials</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
317
+ <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>AWS_ACCESS_KEY</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
318
+ <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>AWS_SECRET</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
319
+ <span class='rparen'>)</span>
320
+ <span class='rparen'>)</span>
321
+ <span class='kw'>end</span></pre>
322
+ </td>
323
+ </tr>
324
+ </table>
325
+ </div>
326
+
327
+ </div>
328
+
329
+ <div id="instance_method_details" class="method_details_list">
330
+ <h2>Instance Method Details</h2>
331
+
332
+
333
+ <div class="method_details first">
334
+ <h3 class="signature first" id="ec2_client-instance_method">
335
+
336
+ #<strong>ec2_client</strong> &#x21d2; <tt>Object</tt>
337
+
338
+
339
+
340
+
341
+
342
+ </h3><table class="source_code">
343
+ <tr>
344
+ <td>
345
+ <pre class="lines">
346
+
347
+
348
+ 29
349
+ 30
350
+ 31
351
+ 32
352
+ 33
353
+ 34
354
+ 35
355
+ 36
356
+ 37</pre>
357
+ </td>
358
+ <td>
359
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws/ec2.rb', line 29</span>
360
+
361
+ <span class='kw'>def</span> <span class='id identifier rubyid_ec2_client'>ec2_client</span>
362
+ <span class='op'>::</span><span class='const'>Aws</span><span class='op'>::</span><span class='const'>EC2</span><span class='op'>::</span><span class='const'>Client</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
363
+ <span class='label'>region:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>us-east-1</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
364
+ <span class='label'>credentials:</span> <span class='op'>::</span><span class='const'>Aws</span><span class='op'>::</span><span class='const'>Credentials</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
365
+ <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>AWS_ACCESS_KEY</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
366
+ <span class='const'>ENV</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>AWS_SECRET</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span>
367
+ <span class='rparen'>)</span>
368
+ <span class='rparen'>)</span>
369
+ <span class='kw'>end</span></pre>
370
+ </td>
371
+ </tr>
372
+ </table>
373
+ </div>
374
+
375
+ <div class="method_details ">
376
+ <h3 class="signature " id="make_instance-instance_method">
377
+
378
+ #<strong>make_instance</strong> &#x21d2; <tt>Object</tt>
379
+
380
+
381
+
382
+
383
+
384
+ </h3><table class="source_code">
385
+ <tr>
386
+ <td>
387
+ <pre class="lines">
388
+
389
+
390
+ 18
391
+ 19
392
+ 20
393
+ 21
394
+ 22
395
+ 23
396
+ 24
397
+ 25
398
+ 26
399
+ 27</pre>
400
+ </td>
401
+ <td>
402
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws/ec2.rb', line 18</span>
403
+
404
+ <span class='kw'>def</span> <span class='id identifier rubyid_make_instance'>make_instance</span>
405
+ <span class='id identifier rubyid_ec2_client'>ec2_client</span><span class='period'>.</span><span class='id identifier rubyid_run_instances'>run_instances</span><span class='lparen'>(</span>
406
+ <span class='label'>image_id:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>ami-841f46ff</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
407
+ <span class='label'>min_count:</span> <span class='int'>1</span><span class='comma'>,</span>
408
+ <span class='label'>max_count:</span> <span class='int'>1</span><span class='comma'>,</span>
409
+ <span class='label'>key_name:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>meroku.id_rsa</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
410
+ <span class='label'>instance_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>t2.micro</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
411
+ <span class='label'>tag_specifications:</span> <span class='lbracket'>[</span><span class='const'>TAG</span><span class='rbracket'>]</span>
412
+ <span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_instances'>instances</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
413
+ <span class='kw'>end</span></pre>
414
+ </td>
415
+ </tr>
416
+ </table>
417
+ </div>
418
+
419
+ <div class="method_details ">
420
+ <h3 class="signature " id="tag-instance_method">
421
+
422
+ #<strong>tag</strong> &#x21d2; <tt>Object</tt>
423
+
424
+
425
+
426
+
427
+
428
+ </h3><table class="source_code">
429
+ <tr>
430
+ <td>
431
+ <pre class="lines">
432
+
433
+
434
+ 6
435
+ 7
436
+ 8
437
+ 9
438
+ 10
439
+ 11
440
+ 12
441
+ 13
442
+ 14
443
+ 15
444
+ 16</pre>
445
+ </td>
446
+ <td>
447
+ <pre class="code"><span class="info file"># File 'lib/meroku/aws/ec2.rb', line 6</span>
448
+
449
+ <span class='kw'>def</span> <span class='id identifier rubyid_tag'>tag</span>
450
+ <span class='lbrace'>{</span>
451
+ <span class='label'>resource_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>instance</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
452
+ <span class='label'>tags:</span> <span class='lbracket'>[</span>
453
+ <span class='lbrace'>{</span>
454
+ <span class='label'>key:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Name</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
455
+ <span class='label'>value:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>node</span><span class='tstring_end'>&#39;</span></span>
456
+ <span class='rbrace'>}</span>
457
+ <span class='rbracket'>]</span>
458
+ <span class='rbrace'>}</span>
459
+ <span class='kw'>end</span></pre>
460
+ </td>
461
+ </tr>
462
+ </table>
463
+ </div>
464
+
465
+ </div>
466
+
467
+ </div>
468
+
469
+ <div id="footer">
470
+ Generated on Tue Oct 31 19:39:54 2017 by
471
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
472
+ 0.9.9 (ruby-2.4.2).
473
+ </div>
474
+
475
+ </div>
476
+ </body>
477
+ </html>