mu 5.7.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Mu_Gem.html +1591 -0
- data/bin/mu +11 -0
- data/lib/mu.rb +65 -0
- data/lib/mu/api/ddt.rb +233 -0
- data/lib/mu/api/homepage.rb +54 -0
- data/lib/mu/api/muapi.rb +231 -0
- data/lib/mu/api/netconfig.rb +233 -0
- data/lib/mu/api/scale.rb +199 -0
- data/lib/mu/api/system.rb +40 -0
- data/lib/mu/client.rb +31 -0
- data/lib/mu/command.rb +28 -0
- data/lib/mu/command/api.rb +95 -0
- data/lib/mu/command/cmd_appid.rb +486 -0
- data/lib/mu/command/cmd_cli.rb +151 -0
- data/lib/mu/command/cmd_ddt.rb +449 -0
- data/lib/mu/command/cmd_homepage.rb +146 -0
- data/lib/mu/command/cmd_muapi.rb +361 -0
- data/lib/mu/command/cmd_netconfig.rb +262 -0
- data/lib/mu/command/cmd_runscale.rb +533 -0
- data/lib/mu/command/cmd_runscenario.rb +258 -0
- data/lib/mu/command/cmd_runverify.rb +336 -0
- data/lib/mu/command/cmd_scale.rb +333 -0
- data/lib/mu/command/cmd_system.rb +127 -0
- data/lib/mu/command/curl.rb +246 -0
- data/lib/mu/command/help.rb +29 -0
- data/lib/mu/curl/error.rb +54 -0
- data/lib/mu/curl/verify.rb +137 -0
- data/lib/mu/helper.rb +55 -0
- data/lib/mu/http_helper.rb +232 -0
- data/rdoc/classes/Mu.html +305 -0
- data/rdoc/classes/Mu/Client.html +265 -0
- data/rdoc/classes/Mu/Command.html +208 -0
- data/rdoc/classes/Mu/Command/API.html +524 -0
- data/rdoc/classes/Mu/Command/Cmd_appid.html +934 -0
- data/rdoc/classes/Mu/Command/Cmd_cli.html +515 -0
- data/rdoc/classes/Mu/Command/Cmd_ddt.html +1169 -0
- data/rdoc/classes/Mu/Command/Cmd_homepage.html +489 -0
- data/rdoc/classes/Mu/Command/Cmd_muapi.html +968 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.html +743 -0
- data/rdoc/classes/Mu/Command/Cmd_runscale.html +970 -0
- data/rdoc/classes/Mu/Command/Cmd_runscenario.html +530 -0
- data/rdoc/classes/Mu/Command/Cmd_runverify.html +621 -0
- data/rdoc/classes/Mu/Command/Cmd_scale.html +939 -0
- data/rdoc/classes/Mu/Command/Cmd_system.html +426 -0
- data/rdoc/classes/Mu/Command/Curl.html +524 -0
- data/rdoc/classes/Mu/Command/Help.html +166 -0
- data/rdoc/classes/Mu/Curl.html +116 -0
- data/rdoc/classes/Mu/Curl/Error.html +157 -0
- data/rdoc/classes/Mu/Curl/Error/Authorize.html +178 -0
- data/rdoc/classes/Mu/Curl/Error/Connect.html +149 -0
- data/rdoc/classes/Mu/Curl/Error/DNS.html +113 -0
- data/rdoc/classes/Mu/Curl/Error/Region.html +160 -0
- data/rdoc/classes/Mu/Curl/Error/Status.html +149 -0
- data/rdoc/classes/Mu/Curl/Error/Timeout.html +149 -0
- data/rdoc/classes/Mu/Curl/Verify.html +282 -0
- data/rdoc/classes/Mu/Curl/Verify/Request.html +227 -0
- data/rdoc/classes/Mu/Curl/Verify/Response.html +187 -0
- data/rdoc/classes/Mu/Curl/Verify/Result.html +188 -0
- data/rdoc/classes/Mu/Ddt.html +914 -0
- data/rdoc/classes/Mu/Helper.html +308 -0
- data/rdoc/classes/Mu/Homepage.html +377 -0
- data/rdoc/classes/Mu/HttpHelper.html +639 -0
- data/rdoc/classes/Mu/Muapi.html +816 -0
- data/rdoc/classes/Mu/Netconfig.html +781 -0
- data/rdoc/classes/Mu/Scale.html +832 -0
- data/rdoc/classes/Mu/System.html +281 -0
- data/rdoc/classes/Object.html +148 -0
- data/rdoc/classes/TCTestMu.html +1793 -0
- data/rdoc/classes/Test.html +107 -0
- data/rdoc/classes/Test/Unit.html +107 -0
- data/rdoc/classes/Test/Unit/TestCase.html +113 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/lib/mu/api/ddt_rb.html +101 -0
- data/rdoc/files/lib/mu/api/homepage_rb.html +101 -0
- data/rdoc/files/lib/mu/api/muapi_rb.html +101 -0
- data/rdoc/files/lib/mu/api/netconfig_rb.html +101 -0
- data/rdoc/files/lib/mu/api/scale_rb.html +101 -0
- data/rdoc/files/lib/mu/api/system_rb.html +101 -0
- data/rdoc/files/lib/mu/client_rb.html +101 -0
- data/rdoc/files/lib/mu/command/api_rb.html +101 -0
- data/rdoc/files/lib/mu/command/cmd_appid_rb.html +119 -0
- data/rdoc/files/lib/mu/command/cmd_cli_rb.html +108 -0
- data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +117 -0
- data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +116 -0
- data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +116 -0
- data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +119 -0
- data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +117 -0
- data/rdoc/files/lib/mu/command/cmd_scale_rb.html +115 -0
- data/rdoc/files/lib/mu/command/cmd_system_rb.html +116 -0
- data/rdoc/files/lib/mu/command/curl_rb.html +101 -0
- data/rdoc/files/lib/mu/command/help_rb.html +101 -0
- data/rdoc/files/lib/mu/command_rb.html +107 -0
- data/rdoc/files/lib/mu/curl/error_rb.html +101 -0
- data/rdoc/files/lib/mu/curl/verify_rb.html +101 -0
- data/rdoc/files/lib/mu/helper_rb.html +101 -0
- data/rdoc/files/lib/mu/http_helper_rb.html +101 -0
- data/rdoc/files/lib/mu_rb.html +121 -0
- data/rdoc/files/test/helper_rb.html +112 -0
- data/rdoc/files/test/tc_test_mu_rb.html +111 -0
- data/rdoc/fr_class_index.html +68 -0
- data/rdoc/fr_file_index.html +55 -0
- data/rdoc/fr_method_index.html +374 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/test/data/app_id_stats.csv +1 -0
- data/test/data/data_cgi.msl +94 -0
- data/test/data/data_cgi.xml +322 -0
- data/test/data/default_test.csv +3 -0
- data/test/data/ftp_with_channel.xml +1643 -0
- data/test/data/irc.xml +3837 -0
- data/test/data/scale_configuration.json +25 -0
- data/test/data/test_data_cgi_error.xml +35 -0
- data/test/helper.rb +18 -0
- data/test/tc_test_mu.rb +716 -0
- metadata +322 -0
@@ -0,0 +1,524 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Mu::Command::API</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mu::Command::API</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/mu/command/api_rb.html">
|
59
|
+
lib/mu/command/api.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Command
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000156">ask_for_credentials</a>
|
90
|
+
<a href="#M000149">client</a>
|
91
|
+
<a href="#M000161">client</a>
|
92
|
+
<a href="#M000148">cmd_init</a>
|
93
|
+
<a href="#M000153">credentials_file</a>
|
94
|
+
<a href="#M000154">get_credentials</a>
|
95
|
+
<a href="#M000152">host</a>
|
96
|
+
<a href="#M000160">instance</a>
|
97
|
+
<a href="#M000162">new</a>
|
98
|
+
<a href="#M000151">password</a>
|
99
|
+
<a href="#M000155">read_credentials</a>
|
100
|
+
<a href="#M000157">save_credentials</a>
|
101
|
+
<a href="#M000159">set_credentials_permissions</a>
|
102
|
+
<a href="#M000150">user</a>
|
103
|
+
<a href="#M000158">write_credentials</a>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
<!-- if includes -->
|
111
|
+
|
112
|
+
<div id="section">
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<div id="attribute-list">
|
119
|
+
<h3 class="section-bar">Attributes</h3>
|
120
|
+
|
121
|
+
<div class="name-list">
|
122
|
+
<table>
|
123
|
+
<tr class="top-aligned-row context-row">
|
124
|
+
<td class="context-item-name">credentials</td>
|
125
|
+
<td class="context-item-value"> [RW] </td>
|
126
|
+
<td class="context-item-desc"></td>
|
127
|
+
</tr>
|
128
|
+
</table>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<!-- if method_list -->
|
135
|
+
<div id="methods">
|
136
|
+
<h3 class="section-bar">Public Class methods</h3>
|
137
|
+
|
138
|
+
<div id="method-M000161" class="method-detail">
|
139
|
+
<a name="M000161"></a>
|
140
|
+
|
141
|
+
<div class="method-heading">
|
142
|
+
<a href="#M000161" class="method-signature">
|
143
|
+
<span class="method-name">client</span><span class="method-args">()</span>
|
144
|
+
</a>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<div class="method-description">
|
148
|
+
<p><a class="source-toggle" href="#"
|
149
|
+
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000161-source">
|
151
|
+
<pre>
|
152
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 86</span>
|
153
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">client</span>
|
154
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">client</span>
|
155
|
+
<span class="ruby-keyword kw">end</span>
|
156
|
+
</pre>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div id="method-M000160" class="method-detail">
|
162
|
+
<a name="M000160"></a>
|
163
|
+
|
164
|
+
<div class="method-heading">
|
165
|
+
<a href="#M000160" class="method-signature">
|
166
|
+
<span class="method-name">instance</span><span class="method-args">()</span>
|
167
|
+
</a>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
<p><a class="source-toggle" href="#"
|
172
|
+
onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000160-source">
|
174
|
+
<pre>
|
175
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 82</span>
|
176
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance</span>
|
177
|
+
<span class="ruby-ivar">@instance</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">API</span>.<span class="ruby-identifier">new</span>
|
178
|
+
<span class="ruby-keyword kw">end</span>
|
179
|
+
</pre>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div id="method-M000162" class="method-detail">
|
185
|
+
<a name="M000162"></a>
|
186
|
+
|
187
|
+
<div class="method-heading">
|
188
|
+
<a href="#M000162" class="method-signature">
|
189
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
190
|
+
</a>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
<p><a class="source-toggle" href="#"
|
195
|
+
onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
|
196
|
+
<div class="method-source-code" id="M000162-source">
|
197
|
+
<pre>
|
198
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 91</span>
|
199
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
200
|
+
<span class="ruby-keyword kw">end</span>
|
201
|
+
</pre>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
207
|
+
|
208
|
+
<div id="method-M000156" class="method-detail">
|
209
|
+
<a name="M000156"></a>
|
210
|
+
|
211
|
+
<div class="method-heading">
|
212
|
+
<a href="#M000156" class="method-signature">
|
213
|
+
<span class="method-name">ask_for_credentials</span><span class="method-args">()</span>
|
214
|
+
</a>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div class="method-description">
|
218
|
+
<p><a class="source-toggle" href="#"
|
219
|
+
onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
|
220
|
+
<div class="method-source-code" id="M000156-source">
|
221
|
+
<pre>
|
222
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 50</span>
|
223
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ask_for_credentials</span>
|
224
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-value str">"Enter your escale credentials."</span>
|
225
|
+
<span class="ruby-identifier">print</span> <span class="ruby-value str">"User-ID: "</span>
|
226
|
+
<span class="ruby-identifier">user</span> = <span class="ruby-identifier">ask</span>
|
227
|
+
<span class="ruby-identifier">print</span> <span class="ruby-value str">"API-Key: "</span>
|
228
|
+
<span class="ruby-identifier">apik</span> = <span class="ruby-identifier">ask</span>
|
229
|
+
<span class="ruby-identifier">apik2</span> = <span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">apik</span>, <span class="ruby-identifier">host</span>).<span class="ruby-identifier">login</span>[<span class="ruby-value str">'api_key'</span>]
|
230
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">apik2</span>
|
231
|
+
<span class="ruby-identifier">error</span> <span class="ruby-value str">"Authentication failed"</span>
|
232
|
+
<span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
|
233
|
+
<span class="ruby-keyword kw">end</span>
|
234
|
+
|
235
|
+
[ <span class="ruby-identifier">user</span>, <span class="ruby-identifier">apik2</span> ]
|
236
|
+
<span class="ruby-keyword kw">end</span>
|
237
|
+
</pre>
|
238
|
+
</div>
|
239
|
+
</div>
|
240
|
+
</div>
|
241
|
+
|
242
|
+
<div id="method-M000149" class="method-detail">
|
243
|
+
<a name="M000149"></a>
|
244
|
+
|
245
|
+
<div class="method-heading">
|
246
|
+
<a href="#M000149" class="method-signature">
|
247
|
+
<span class="method-name">client</span><span class="method-args">()</span>
|
248
|
+
</a>
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div class="method-description">
|
252
|
+
<p><a class="source-toggle" href="#"
|
253
|
+
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
|
254
|
+
<div class="method-source-code" id="M000149-source">
|
255
|
+
<pre>
|
256
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 14</span>
|
257
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client</span>
|
258
|
+
<span class="ruby-identifier">get_credentials</span>
|
259
|
+
<span class="ruby-constant">Mu</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">user</span>, <span class="ruby-identifier">password</span>, <span class="ruby-identifier">host</span>)
|
260
|
+
<span class="ruby-keyword kw">end</span>
|
261
|
+
</pre>
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div id="method-M000148" class="method-detail">
|
267
|
+
<a name="M000148"></a>
|
268
|
+
|
269
|
+
<div class="method-heading">
|
270
|
+
<a href="#M000148" class="method-signature">
|
271
|
+
<span class="method-name">cmd_init</span><span class="method-args">(argv)</span>
|
272
|
+
</a>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
<div class="method-description">
|
276
|
+
<p><a class="source-toggle" href="#"
|
277
|
+
onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
|
278
|
+
<div class="method-source-code" id="M000148-source">
|
279
|
+
<pre>
|
280
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 6</span>
|
281
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_init</span> <span class="ruby-identifier">argv</span>
|
282
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span> <span class="ruby-identifier">credentials_file</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
283
|
+
<span class="ruby-constant">API</span>.<span class="ruby-identifier">client</span>
|
284
|
+
|
285
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-value str">"You are now ready to use mu!"</span>
|
286
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-value str">"Try mu help to learn more about the commands."</span>
|
287
|
+
<span class="ruby-keyword kw">end</span>
|
288
|
+
</pre>
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
<div id="method-M000153" class="method-detail">
|
294
|
+
<a name="M000153"></a>
|
295
|
+
|
296
|
+
<div class="method-heading">
|
297
|
+
<a href="#M000153" class="method-signature">
|
298
|
+
<span class="method-name">credentials_file</span><span class="method-args">()</span>
|
299
|
+
</a>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
<div class="method-description">
|
303
|
+
<p><a class="source-toggle" href="#"
|
304
|
+
onclick="toggleCode('M000153-source');return false;">[Source]</a></p>
|
305
|
+
<div class="method-source-code" id="M000153-source">
|
306
|
+
<pre>
|
307
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 33</span>
|
308
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">credentials_file</span>
|
309
|
+
<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HOME'</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">'/.escale/credentials'</span>
|
310
|
+
<span class="ruby-keyword kw">end</span>
|
311
|
+
</pre>
|
312
|
+
</div>
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
|
316
|
+
<div id="method-M000154" class="method-detail">
|
317
|
+
<a name="M000154"></a>
|
318
|
+
|
319
|
+
<div class="method-heading">
|
320
|
+
<a href="#M000154" class="method-signature">
|
321
|
+
<span class="method-name">get_credentials</span><span class="method-args">()</span>
|
322
|
+
</a>
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="method-description">
|
326
|
+
<p><a class="source-toggle" href="#"
|
327
|
+
onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
|
328
|
+
<div class="method-source-code" id="M000154-source">
|
329
|
+
<pre>
|
330
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 37</span>
|
331
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_credentials</span>
|
332
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@credentials</span>
|
333
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@credentials</span> = <span class="ruby-identifier">read_credentials</span>
|
334
|
+
<span class="ruby-ivar">@credentials</span> = <span class="ruby-identifier">ask_for_credentials</span>
|
335
|
+
<span class="ruby-identifier">save_credentials</span>
|
336
|
+
<span class="ruby-keyword kw">end</span>
|
337
|
+
<span class="ruby-ivar">@credentials</span>
|
338
|
+
<span class="ruby-keyword kw">end</span>
|
339
|
+
</pre>
|
340
|
+
</div>
|
341
|
+
</div>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
<div id="method-M000152" class="method-detail">
|
345
|
+
<a name="M000152"></a>
|
346
|
+
|
347
|
+
<div class="method-heading">
|
348
|
+
<a href="#M000152" class="method-signature">
|
349
|
+
<span class="method-name">host</span><span class="method-args">()</span>
|
350
|
+
</a>
|
351
|
+
</div>
|
352
|
+
|
353
|
+
<div class="method-description">
|
354
|
+
<p><a class="source-toggle" href="#"
|
355
|
+
onclick="toggleCode('M000152-source');return false;">[Source]</a></p>
|
356
|
+
<div class="method-source-code" id="M000152-source">
|
357
|
+
<pre>
|
358
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 29</span>
|
359
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host</span>
|
360
|
+
<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'ESCALE_HOST'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'escale.mudynamics.com'</span>
|
361
|
+
<span class="ruby-keyword kw">end</span>
|
362
|
+
</pre>
|
363
|
+
</div>
|
364
|
+
</div>
|
365
|
+
</div>
|
366
|
+
|
367
|
+
<div id="method-M000151" class="method-detail">
|
368
|
+
<a name="M000151"></a>
|
369
|
+
|
370
|
+
<div class="method-heading">
|
371
|
+
<a href="#M000151" class="method-signature">
|
372
|
+
<span class="method-name">password</span><span class="method-args">()</span>
|
373
|
+
</a>
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div class="method-description">
|
377
|
+
<p><a class="source-toggle" href="#"
|
378
|
+
onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
|
379
|
+
<div class="method-source-code" id="M000151-source">
|
380
|
+
<pre>
|
381
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 24</span>
|
382
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password</span>
|
383
|
+
<span class="ruby-identifier">get_credentials</span>
|
384
|
+
<span class="ruby-ivar">@credentials</span>[<span class="ruby-value">1</span>]
|
385
|
+
<span class="ruby-keyword kw">end</span>
|
386
|
+
</pre>
|
387
|
+
</div>
|
388
|
+
</div>
|
389
|
+
</div>
|
390
|
+
|
391
|
+
<div id="method-M000155" class="method-detail">
|
392
|
+
<a name="M000155"></a>
|
393
|
+
|
394
|
+
<div class="method-heading">
|
395
|
+
<a href="#M000155" class="method-signature">
|
396
|
+
<span class="method-name">read_credentials</span><span class="method-args">()</span>
|
397
|
+
</a>
|
398
|
+
</div>
|
399
|
+
|
400
|
+
<div class="method-description">
|
401
|
+
<p><a class="source-toggle" href="#"
|
402
|
+
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
|
403
|
+
<div class="method-source-code" id="M000155-source">
|
404
|
+
<pre>
|
405
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 46</span>
|
406
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_credentials</span>
|
407
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">credentials_file</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">credentials_file</span>).<span class="ruby-identifier">split</span>(<span class="ruby-value str">"\n"</span>)
|
408
|
+
<span class="ruby-keyword kw">end</span>
|
409
|
+
</pre>
|
410
|
+
</div>
|
411
|
+
</div>
|
412
|
+
</div>
|
413
|
+
|
414
|
+
<div id="method-M000157" class="method-detail">
|
415
|
+
<a name="M000157"></a>
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<a href="#M000157" class="method-signature">
|
419
|
+
<span class="method-name">save_credentials</span><span class="method-args">()</span>
|
420
|
+
</a>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div class="method-description">
|
424
|
+
<p><a class="source-toggle" href="#"
|
425
|
+
onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
|
426
|
+
<div class="method-source-code" id="M000157-source">
|
427
|
+
<pre>
|
428
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 65</span>
|
429
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save_credentials</span>
|
430
|
+
<span class="ruby-identifier">write_credentials</span>
|
431
|
+
<span class="ruby-keyword kw">end</span>
|
432
|
+
</pre>
|
433
|
+
</div>
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div id="method-M000159" class="method-detail">
|
438
|
+
<a name="M000159"></a>
|
439
|
+
|
440
|
+
<div class="method-heading">
|
441
|
+
<a href="#M000159" class="method-signature">
|
442
|
+
<span class="method-name">set_credentials_permissions</span><span class="method-args">()</span>
|
443
|
+
</a>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div class="method-description">
|
447
|
+
<p><a class="source-toggle" href="#"
|
448
|
+
onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
|
449
|
+
<div class="method-source-code" id="M000159-source">
|
450
|
+
<pre>
|
451
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 77</span>
|
452
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_credentials_permissions</span>
|
453
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">chmod</span> <span class="ruby-value">0700</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">credentials_file</span>)
|
454
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">chmod</span> <span class="ruby-value">0600</span>, <span class="ruby-identifier">credentials_file</span>
|
455
|
+
<span class="ruby-keyword kw">end</span>
|
456
|
+
</pre>
|
457
|
+
</div>
|
458
|
+
</div>
|
459
|
+
</div>
|
460
|
+
|
461
|
+
<div id="method-M000150" class="method-detail">
|
462
|
+
<a name="M000150"></a>
|
463
|
+
|
464
|
+
<div class="method-heading">
|
465
|
+
<a href="#M000150" class="method-signature">
|
466
|
+
<span class="method-name">user</span><span class="method-args">()</span>
|
467
|
+
</a>
|
468
|
+
</div>
|
469
|
+
|
470
|
+
<div class="method-description">
|
471
|
+
<p><a class="source-toggle" href="#"
|
472
|
+
onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
|
473
|
+
<div class="method-source-code" id="M000150-source">
|
474
|
+
<pre>
|
475
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 19</span>
|
476
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user</span>
|
477
|
+
<span class="ruby-identifier">get_credentials</span>
|
478
|
+
<span class="ruby-ivar">@credentials</span>[<span class="ruby-value">0</span>]
|
479
|
+
<span class="ruby-keyword kw">end</span>
|
480
|
+
</pre>
|
481
|
+
</div>
|
482
|
+
</div>
|
483
|
+
</div>
|
484
|
+
|
485
|
+
<div id="method-M000158" class="method-detail">
|
486
|
+
<a name="M000158"></a>
|
487
|
+
|
488
|
+
<div class="method-heading">
|
489
|
+
<a href="#M000158" class="method-signature">
|
490
|
+
<span class="method-name">write_credentials</span><span class="method-args">()</span>
|
491
|
+
</a>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
<div class="method-description">
|
495
|
+
<p><a class="source-toggle" href="#"
|
496
|
+
onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
|
497
|
+
<div class="method-source-code" id="M000158-source">
|
498
|
+
<pre>
|
499
|
+
<span class="ruby-comment cmt"># File lib/mu/command/api.rb, line 69</span>
|
500
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_credentials</span>
|
501
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">credentials_file</span>))
|
502
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">credentials_file</span>, <span class="ruby-value str">'w'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
503
|
+
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">credentials</span>
|
504
|
+
<span class="ruby-keyword kw">end</span>
|
505
|
+
<span class="ruby-identifier">set_credentials_permissions</span>
|
506
|
+
<span class="ruby-keyword kw">end</span>
|
507
|
+
</pre>
|
508
|
+
</div>
|
509
|
+
</div>
|
510
|
+
</div>
|
511
|
+
|
512
|
+
|
513
|
+
</div>
|
514
|
+
|
515
|
+
|
516
|
+
</div>
|
517
|
+
|
518
|
+
|
519
|
+
<div id="validator-badges">
|
520
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
521
|
+
</div>
|
522
|
+
|
523
|
+
</body>
|
524
|
+
</html>
|