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,939 @@
|
|
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::Cmd_scale</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::Cmd_scale</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/mu/command/cmd_scale_rb.html">
|
59
|
+
lib/mu/command/cmd_scale.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="#M000235">cmd_about</a>
|
90
|
+
<a href="#M000229">cmd_configure</a>
|
91
|
+
<a href="#M000238">cmd_data</a>
|
92
|
+
<a href="#M000244">cmd_delete_scale_engine</a>
|
93
|
+
<a href="#M000228">cmd_help</a>
|
94
|
+
<a href="#M000234">cmd_list</a>
|
95
|
+
<a href="#M000239">cmd_pattern</a>
|
96
|
+
<a href="#M000236">cmd_pcap</a>
|
97
|
+
<a href="#M000241">cmd_release</a>
|
98
|
+
<a href="#M000243">cmd_release_scale_engine</a>
|
99
|
+
<a href="#M000242">cmd_reserve_scale_engine</a>
|
100
|
+
<a href="#M000230">cmd_start</a>
|
101
|
+
<a href="#M000233">cmd_status</a>
|
102
|
+
<a href="#M000237">cmd_statuses</a>
|
103
|
+
<a href="#M000240">cmd_stop</a>
|
104
|
+
<a href="#M000232">cmd_update</a>
|
105
|
+
<a href="#M000231">cmd_verify</a>
|
106
|
+
<a href="#M000247">help</a>
|
107
|
+
<a href="#M000246">parse_cli</a>
|
108
|
+
<a href="#M000245">setup</a>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if includes -->
|
116
|
+
|
117
|
+
<div id="section">
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<div id="attribute-list">
|
124
|
+
<h3 class="section-bar">Attributes</h3>
|
125
|
+
|
126
|
+
<div class="name-list">
|
127
|
+
<table>
|
128
|
+
<tr class="top-aligned-row context-row">
|
129
|
+
<td class="context-item-name">api</td>
|
130
|
+
<td class="context-item-value"> [RW] </td>
|
131
|
+
<td class="context-item-desc"></td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">host</td>
|
135
|
+
<td class="context-item-value"> [RW] </td>
|
136
|
+
<td class="context-item-desc"></td>
|
137
|
+
</tr>
|
138
|
+
<tr class="top-aligned-row context-row">
|
139
|
+
<td class="context-item-name">password</td>
|
140
|
+
<td class="context-item-value"> [RW] </td>
|
141
|
+
<td class="context-item-desc"></td>
|
142
|
+
</tr>
|
143
|
+
<tr class="top-aligned-row context-row">
|
144
|
+
<td class="context-item-name">username</td>
|
145
|
+
<td class="context-item-value"> [RW] </td>
|
146
|
+
<td class="context-item-desc"></td>
|
147
|
+
</tr>
|
148
|
+
</table>
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<!-- if method_list -->
|
155
|
+
<div id="methods">
|
156
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
157
|
+
|
158
|
+
<div id="method-M000235" class="method-detail">
|
159
|
+
<a name="M000235"></a>
|
160
|
+
|
161
|
+
<div class="method-heading">
|
162
|
+
<a href="#M000235" class="method-signature">
|
163
|
+
<span class="method-name">cmd_about</span><span class="method-args">(argv)</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
returns scale engine configuration information
|
170
|
+
</p>
|
171
|
+
<pre>
|
172
|
+
* argv = command-line arguments
|
173
|
+
</pre>
|
174
|
+
<p><a class="source-toggle" href="#"
|
175
|
+
onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
|
176
|
+
<div class="method-source-code" id="M000235-source">
|
177
|
+
<pre>
|
178
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 73</span>
|
179
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_about</span> <span class="ruby-identifier">argv</span>
|
180
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
181
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">about</span>
|
182
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
183
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
184
|
+
<span class="ruby-keyword kw">end</span>
|
185
|
+
</pre>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div id="method-M000229" class="method-detail">
|
191
|
+
<a name="M000229"></a>
|
192
|
+
|
193
|
+
<div class="method-heading">
|
194
|
+
<a href="#M000229" class="method-signature">
|
195
|
+
<span class="method-name">cmd_configure</span><span class="method-args">(argv)</span>
|
196
|
+
</a>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
<p>
|
201
|
+
configures the scale json object
|
202
|
+
</p>
|
203
|
+
<pre>
|
204
|
+
* argv = command-line arguments, requires a params (-p) and params value (-pv) argument, such as -p volume -pv 100
|
205
|
+
</pre>
|
206
|
+
<p><a class="source-toggle" href="#"
|
207
|
+
onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
|
208
|
+
<div class="method-source-code" id="M000229-source">
|
209
|
+
<pre>
|
210
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 16</span>
|
211
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_configure</span> <span class="ruby-identifier">argv</span>
|
212
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
213
|
+
<span class="ruby-identifier">param</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'params'</span>]
|
214
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'param_value'</span>]
|
215
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">configure</span>(<span class="ruby-identifier">param</span>, <span class="ruby-identifier">value</span>)
|
216
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
217
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
</pre>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div id="method-M000238" class="method-detail">
|
225
|
+
<a name="M000238"></a>
|
226
|
+
|
227
|
+
<div class="method-heading">
|
228
|
+
<a href="#M000238" class="method-signature">
|
229
|
+
<span class="method-name">cmd_data</span><span class="method-args">(argv)</span>
|
230
|
+
</a>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
<p>
|
235
|
+
returns scale test data for charting
|
236
|
+
</p>
|
237
|
+
<pre>
|
238
|
+
* argv = command-line arguments, requires:
|
239
|
+
* view (-w), which specifies the TIMELINE or CALLGRAPH chart.
|
240
|
+
* zoom (-z), which specifies the zoom level (0 to 1). 1 returns data for 100% of the time range, 0.5 returns data for 50% of the time range, and 0 returns only the last minute of data
|
241
|
+
* position (-p), which must be 0.
|
242
|
+
* scale engine id (-b)
|
243
|
+
</pre>
|
244
|
+
<p><a class="source-toggle" href="#"
|
245
|
+
onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000238-source">
|
247
|
+
<pre>
|
248
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 106</span>
|
249
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_data</span> <span class="ruby-identifier">argv</span>
|
250
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
251
|
+
<span class="ruby-keyword kw">begin</span>
|
252
|
+
<span class="ruby-identifier">view</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'view'</span>]
|
253
|
+
<span class="ruby-identifier">zoom</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'zoom'</span>]
|
254
|
+
<span class="ruby-identifier">position</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'view_position'</span>]
|
255
|
+
<span class="ruby-identifier">bot_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>]
|
256
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">data</span>(<span class="ruby-identifier">view</span>, <span class="ruby-identifier">zoom</span>, <span class="ruby-identifier">position</span>, <span class="ruby-identifier">bot_id</span>)
|
257
|
+
<span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
258
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">e</span>
|
259
|
+
<span class="ruby-keyword kw">end</span>
|
260
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
261
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
262
|
+
<span class="ruby-keyword kw">end</span>
|
263
|
+
</pre>
|
264
|
+
</div>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div id="method-M000244" class="method-detail">
|
269
|
+
<a name="M000244"></a>
|
270
|
+
|
271
|
+
<div class="method-heading">
|
272
|
+
<a href="#M000244" class="method-signature">
|
273
|
+
<span class="method-name">cmd_delete_scale_engine</span><span class="method-args">(argv)</span>
|
274
|
+
</a>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div class="method-description">
|
278
|
+
<p>
|
279
|
+
deletes a scale engine
|
280
|
+
</p>
|
281
|
+
<pre>
|
282
|
+
* argv = command-line arguments, require a scale engine id (-b) argument
|
283
|
+
</pre>
|
284
|
+
<p><a class="source-toggle" href="#"
|
285
|
+
onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
|
286
|
+
<div class="method-source-code" id="M000244-source">
|
287
|
+
<pre>
|
288
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 178</span>
|
289
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_delete_scale_engine</span> <span class="ruby-identifier">argv</span>
|
290
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
291
|
+
<span class="ruby-identifier">bot_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>]
|
292
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">delete_scale_engine</span>(<span class="ruby-identifier">bot_id</span>)
|
293
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
294
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
295
|
+
<span class="ruby-keyword kw">end</span>
|
296
|
+
</pre>
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div id="method-M000228" class="method-detail">
|
302
|
+
<a name="M000228"></a>
|
303
|
+
|
304
|
+
<div class="method-heading">
|
305
|
+
<a href="#M000228" class="method-signature">
|
306
|
+
<span class="method-name">cmd_help</span><span class="method-args">(argv)</span>
|
307
|
+
</a>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div class="method-description">
|
311
|
+
<p>
|
312
|
+
outputs <a href="Cmd_scale.html#M000247">help</a> for this command
|
313
|
+
</p>
|
314
|
+
<p><a class="source-toggle" href="#"
|
315
|
+
onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
|
316
|
+
<div class="method-source-code" id="M000228-source">
|
317
|
+
<pre>
|
318
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 10</span>
|
319
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
|
320
|
+
<span class="ruby-identifier">help</span>
|
321
|
+
<span class="ruby-keyword kw">end</span>
|
322
|
+
</pre>
|
323
|
+
</div>
|
324
|
+
</div>
|
325
|
+
</div>
|
326
|
+
|
327
|
+
<div id="method-M000234" class="method-detail">
|
328
|
+
<a name="M000234"></a>
|
329
|
+
|
330
|
+
<div class="method-heading">
|
331
|
+
<a href="#M000234" class="method-signature">
|
332
|
+
<span class="method-name">cmd_list</span><span class="method-args">(argv)</span>
|
333
|
+
</a>
|
334
|
+
</div>
|
335
|
+
|
336
|
+
<div class="method-description">
|
337
|
+
<p>
|
338
|
+
returns an array of currently reserved scale engines
|
339
|
+
</p>
|
340
|
+
<pre>
|
341
|
+
* argv = command-line arguments
|
342
|
+
</pre>
|
343
|
+
<p><a class="source-toggle" href="#"
|
344
|
+
onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
|
345
|
+
<div class="method-source-code" id="M000234-source">
|
346
|
+
<pre>
|
347
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 64</span>
|
348
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_list</span> <span class="ruby-identifier">argv</span>
|
349
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
350
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">list</span>
|
351
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
352
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
353
|
+
<span class="ruby-keyword kw">end</span>
|
354
|
+
</pre>
|
355
|
+
</div>
|
356
|
+
</div>
|
357
|
+
</div>
|
358
|
+
|
359
|
+
<div id="method-M000239" class="method-detail">
|
360
|
+
<a name="M000239"></a>
|
361
|
+
|
362
|
+
<div class="method-heading">
|
363
|
+
<a href="#M000239" class="method-signature">
|
364
|
+
<span class="method-name">cmd_pattern</span><span class="method-args">(argv)</span>
|
365
|
+
</a>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
<div class="method-description">
|
369
|
+
<p>
|
370
|
+
returns scale test data for charting
|
371
|
+
</p>
|
372
|
+
<pre>
|
373
|
+
* argv = command-line arguments, requires:
|
374
|
+
* zoom (z) level
|
375
|
+
* position(-p 0)
|
376
|
+
</pre>
|
377
|
+
<p><a class="source-toggle" href="#"
|
378
|
+
onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
|
379
|
+
<div class="method-source-code" id="M000239-source">
|
380
|
+
<pre>
|
381
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 125</span>
|
382
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_pattern</span> <span class="ruby-identifier">argv</span>
|
383
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
384
|
+
<span class="ruby-keyword kw">begin</span>
|
385
|
+
<span class="ruby-identifier">zoom</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'zoom'</span>]
|
386
|
+
<span class="ruby-identifier">position</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'view_position'</span>]
|
387
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">pattern</span>(<span class="ruby-identifier">zoom</span>, <span class="ruby-identifier">position</span>)
|
388
|
+
<span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
389
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">e</span>
|
390
|
+
<span class="ruby-keyword kw">end</span>
|
391
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
392
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
393
|
+
<span class="ruby-keyword kw">end</span>
|
394
|
+
</pre>
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div id="method-M000236" class="method-detail">
|
400
|
+
<a name="M000236"></a>
|
401
|
+
|
402
|
+
<div class="method-heading">
|
403
|
+
<a href="#M000236" class="method-signature">
|
404
|
+
<span class="method-name">cmd_pcap</span><span class="method-args">(argv)</span>
|
405
|
+
</a>
|
406
|
+
</div>
|
407
|
+
|
408
|
+
<div class="method-description">
|
409
|
+
<p>
|
410
|
+
returns a packet capture file from scale verify
|
411
|
+
</p>
|
412
|
+
<pre>
|
413
|
+
* argv = command-line arguments, requires a scale engine id (-b) and the pcap filename (-f) argument
|
414
|
+
</pre>
|
415
|
+
<p><a class="source-toggle" href="#"
|
416
|
+
onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
|
417
|
+
<div class="method-source-code" id="M000236-source">
|
418
|
+
<pre>
|
419
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 82</span>
|
420
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_pcap</span> <span class="ruby-identifier">argv</span>
|
421
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
422
|
+
<span class="ruby-identifier">bot_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>]
|
423
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'filename'</span>]
|
424
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">pcap</span>(<span class="ruby-identifier">bot_id</span>, <span class="ruby-identifier">file</span>)
|
425
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
426
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
427
|
+
<span class="ruby-keyword kw">end</span>
|
428
|
+
</pre>
|
429
|
+
</div>
|
430
|
+
</div>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
<div id="method-M000241" class="method-detail">
|
434
|
+
<a name="M000241"></a>
|
435
|
+
|
436
|
+
<div class="method-heading">
|
437
|
+
<a href="#M000241" class="method-signature">
|
438
|
+
<span class="method-name">cmd_release</span><span class="method-args">(argv)</span>
|
439
|
+
</a>
|
440
|
+
</div>
|
441
|
+
|
442
|
+
<div class="method-description">
|
443
|
+
<p>
|
444
|
+
releases the currently reserved scale engine
|
445
|
+
</p>
|
446
|
+
<pre>
|
447
|
+
* argv = command-line arguments
|
448
|
+
</pre>
|
449
|
+
<p><a class="source-toggle" href="#"
|
450
|
+
onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
|
451
|
+
<div class="method-source-code" id="M000241-source">
|
452
|
+
<pre>
|
453
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 149</span>
|
454
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_release</span> <span class="ruby-identifier">argv</span>
|
455
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
456
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release</span>
|
457
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
458
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
459
|
+
<span class="ruby-keyword kw">end</span>
|
460
|
+
</pre>
|
461
|
+
</div>
|
462
|
+
</div>
|
463
|
+
</div>
|
464
|
+
|
465
|
+
<div id="method-M000243" class="method-detail">
|
466
|
+
<a name="M000243"></a>
|
467
|
+
|
468
|
+
<div class="method-heading">
|
469
|
+
<a href="#M000243" class="method-signature">
|
470
|
+
<span class="method-name">cmd_release_scale_engine</span><span class="method-args">(argv)</span>
|
471
|
+
</a>
|
472
|
+
</div>
|
473
|
+
|
474
|
+
<div class="method-description">
|
475
|
+
<p>
|
476
|
+
releases a scale engine
|
477
|
+
</p>
|
478
|
+
<pre>
|
479
|
+
* argv = command-line arguments, require a scale engine id (-b) argument
|
480
|
+
</pre>
|
481
|
+
<p><a class="source-toggle" href="#"
|
482
|
+
onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
|
483
|
+
<div class="method-source-code" id="M000243-source">
|
484
|
+
<pre>
|
485
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 168</span>
|
486
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_release_scale_engine</span> <span class="ruby-identifier">argv</span>
|
487
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
488
|
+
<span class="ruby-identifier">bot_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>]
|
489
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">release_scale_engine</span>(<span class="ruby-identifier">bot_id</span>)
|
490
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
491
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
492
|
+
<span class="ruby-keyword kw">end</span>
|
493
|
+
</pre>
|
494
|
+
</div>
|
495
|
+
</div>
|
496
|
+
</div>
|
497
|
+
|
498
|
+
<div id="method-M000242" class="method-detail">
|
499
|
+
<a name="M000242"></a>
|
500
|
+
|
501
|
+
<div class="method-heading">
|
502
|
+
<a href="#M000242" class="method-signature">
|
503
|
+
<span class="method-name">cmd_reserve_scale_engine</span><span class="method-args">(argv)</span>
|
504
|
+
</a>
|
505
|
+
</div>
|
506
|
+
|
507
|
+
<div class="method-description">
|
508
|
+
<p>
|
509
|
+
reserves a scale engine
|
510
|
+
</p>
|
511
|
+
<pre>
|
512
|
+
* argv = command-line arguments, require a scale engine id (-b) argument
|
513
|
+
</pre>
|
514
|
+
<p><a class="source-toggle" href="#"
|
515
|
+
onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
|
516
|
+
<div class="method-source-code" id="M000242-source">
|
517
|
+
<pre>
|
518
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 158</span>
|
519
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_reserve_scale_engine</span> <span class="ruby-identifier">argv</span>
|
520
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
521
|
+
<span class="ruby-identifier">bot_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>]
|
522
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">reserve_scale_engine</span>(<span class="ruby-identifier">bot_id</span>)
|
523
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
524
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
525
|
+
<span class="ruby-keyword kw">end</span>
|
526
|
+
</pre>
|
527
|
+
</div>
|
528
|
+
</div>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
<div id="method-M000230" class="method-detail">
|
532
|
+
<a name="M000230"></a>
|
533
|
+
|
534
|
+
<div class="method-heading">
|
535
|
+
<a href="#M000230" class="method-signature">
|
536
|
+
<span class="method-name">cmd_start</span><span class="method-args">(argv)</span>
|
537
|
+
</a>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
<div class="method-description">
|
541
|
+
<p>
|
542
|
+
starts a scale test
|
543
|
+
</p>
|
544
|
+
<pre>
|
545
|
+
* argv = command-line arguments, requires a scale json object to have been configured
|
546
|
+
</pre>
|
547
|
+
<p><a class="source-toggle" href="#"
|
548
|
+
onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
|
549
|
+
<div class="method-source-code" id="M000230-source">
|
550
|
+
<pre>
|
551
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 27</span>
|
552
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_start</span> <span class="ruby-identifier">argv</span>
|
553
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
554
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">start</span>
|
555
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
556
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
557
|
+
<span class="ruby-keyword kw">end</span>
|
558
|
+
</pre>
|
559
|
+
</div>
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
|
563
|
+
<div id="method-M000233" class="method-detail">
|
564
|
+
<a name="M000233"></a>
|
565
|
+
|
566
|
+
<div class="method-heading">
|
567
|
+
<a href="#M000233" class="method-signature">
|
568
|
+
<span class="method-name">cmd_status</span><span class="method-args">(argv)</span>
|
569
|
+
</a>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
<div class="method-description">
|
573
|
+
<p>
|
574
|
+
returns status from a scale test
|
575
|
+
</p>
|
576
|
+
<pre>
|
577
|
+
* argv = command-line arguments
|
578
|
+
</pre>
|
579
|
+
<p><a class="source-toggle" href="#"
|
580
|
+
onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
|
581
|
+
<div class="method-source-code" id="M000233-source">
|
582
|
+
<pre>
|
583
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 55</span>
|
584
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">argv</span>
|
585
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
586
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>
|
587
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
588
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
589
|
+
<span class="ruby-keyword kw">end</span>
|
590
|
+
</pre>
|
591
|
+
</div>
|
592
|
+
</div>
|
593
|
+
</div>
|
594
|
+
|
595
|
+
<div id="method-M000237" class="method-detail">
|
596
|
+
<a name="M000237"></a>
|
597
|
+
|
598
|
+
<div class="method-heading">
|
599
|
+
<a href="#M000237" class="method-signature">
|
600
|
+
<span class="method-name">cmd_statuses</span><span class="method-args">(argv)</span>
|
601
|
+
</a>
|
602
|
+
</div>
|
603
|
+
|
604
|
+
<div class="method-description">
|
605
|
+
<p>
|
606
|
+
returns the status of all reserved scale engines
|
607
|
+
</p>
|
608
|
+
<pre>
|
609
|
+
* argv = command-line arguments
|
610
|
+
</pre>
|
611
|
+
<p><a class="source-toggle" href="#"
|
612
|
+
onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
|
613
|
+
<div class="method-source-code" id="M000237-source">
|
614
|
+
<pre>
|
615
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 93</span>
|
616
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_statuses</span> <span class="ruby-identifier">argv</span>
|
617
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
618
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">statuses</span>
|
619
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
620
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
621
|
+
<span class="ruby-keyword kw">end</span>
|
622
|
+
</pre>
|
623
|
+
</div>
|
624
|
+
</div>
|
625
|
+
</div>
|
626
|
+
|
627
|
+
<div id="method-M000240" class="method-detail">
|
628
|
+
<a name="M000240"></a>
|
629
|
+
|
630
|
+
<div class="method-heading">
|
631
|
+
<a href="#M000240" class="method-signature">
|
632
|
+
<span class="method-name">cmd_stop</span><span class="method-args">(argv)</span>
|
633
|
+
</a>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div class="method-description">
|
637
|
+
<p>
|
638
|
+
stops a scale test
|
639
|
+
</p>
|
640
|
+
<pre>
|
641
|
+
* argv = command-line arguments
|
642
|
+
</pre>
|
643
|
+
<p><a class="source-toggle" href="#"
|
644
|
+
onclick="toggleCode('M000240-source');return false;">[Source]</a></p>
|
645
|
+
<div class="method-source-code" id="M000240-source">
|
646
|
+
<pre>
|
647
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 140</span>
|
648
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_stop</span> <span class="ruby-identifier">argv</span>
|
649
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
650
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">stop</span>
|
651
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
652
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
653
|
+
<span class="ruby-keyword kw">end</span>
|
654
|
+
</pre>
|
655
|
+
</div>
|
656
|
+
</div>
|
657
|
+
</div>
|
658
|
+
|
659
|
+
<div id="method-M000232" class="method-detail">
|
660
|
+
<a name="M000232"></a>
|
661
|
+
|
662
|
+
<div class="method-heading">
|
663
|
+
<a href="#M000232" class="method-signature">
|
664
|
+
<span class="method-name">cmd_update</span><span class="method-args">(argv)</span>
|
665
|
+
</a>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div class="method-description">
|
669
|
+
<p>
|
670
|
+
updates a running scale test (valid only if the test is running with no
|
671
|
+
pattern)
|
672
|
+
</p>
|
673
|
+
<pre>
|
674
|
+
* argv = command-line arguments, requires a json params object (-p) such as '{ "volume": 100 }'
|
675
|
+
</pre>
|
676
|
+
<p><a class="source-toggle" href="#"
|
677
|
+
onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
|
678
|
+
<div class="method-source-code" id="M000232-source">
|
679
|
+
<pre>
|
680
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 45</span>
|
681
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_update</span> <span class="ruby-identifier">argv</span>
|
682
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
683
|
+
<span class="ruby-identifier">params</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'params'</span>]
|
684
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">params</span>)
|
685
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
686
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
687
|
+
<span class="ruby-keyword kw">end</span>
|
688
|
+
</pre>
|
689
|
+
</div>
|
690
|
+
</div>
|
691
|
+
</div>
|
692
|
+
|
693
|
+
<div id="method-M000231" class="method-detail">
|
694
|
+
<a name="M000231"></a>
|
695
|
+
|
696
|
+
<div class="method-heading">
|
697
|
+
<a href="#M000231" class="method-signature">
|
698
|
+
<span class="method-name">cmd_verify</span><span class="method-args">(argv)</span>
|
699
|
+
</a>
|
700
|
+
</div>
|
701
|
+
|
702
|
+
<div class="method-description">
|
703
|
+
<p>
|
704
|
+
verifies a scale test
|
705
|
+
</p>
|
706
|
+
<pre>
|
707
|
+
* argv = command-line arguments, requires a scale json object to have been configured
|
708
|
+
</pre>
|
709
|
+
<p><a class="source-toggle" href="#"
|
710
|
+
onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
|
711
|
+
<div class="method-source-code" id="M000231-source">
|
712
|
+
<pre>
|
713
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 36</span>
|
714
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_verify</span> <span class="ruby-identifier">argv</span>
|
715
|
+
<span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
716
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">verify</span>
|
717
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
718
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
719
|
+
<span class="ruby-keyword kw">end</span>
|
720
|
+
</pre>
|
721
|
+
</div>
|
722
|
+
</div>
|
723
|
+
</div>
|
724
|
+
|
725
|
+
<h3 class="section-bar">Private Instance methods</h3>
|
726
|
+
|
727
|
+
<div id="method-M000247" class="method-detail">
|
728
|
+
<a name="M000247"></a>
|
729
|
+
|
730
|
+
<div class="method-heading">
|
731
|
+
<a href="#M000247" class="method-signature">
|
732
|
+
<span class="method-name">help</span><span class="method-args">()</span>
|
733
|
+
</a>
|
734
|
+
</div>
|
735
|
+
|
736
|
+
<div class="method-description">
|
737
|
+
<p><a class="source-toggle" href="#"
|
738
|
+
onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
|
739
|
+
<div class="method-source-code" id="M000247-source">
|
740
|
+
<pre>
|
741
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 277</span>
|
742
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
|
743
|
+
<span class="ruby-identifier">helps</span> = [
|
744
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-b'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--bot_id'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'scale engine identifier'</span> },
|
745
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-c'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--config_file'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'change json config_file'</span> },
|
746
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-f'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--filename'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'pcap filename'</span> },
|
747
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-h'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--help'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'help on command line options'</span> },
|
748
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-m'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--mu_string'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'user, password, mu_ip in the form of admin:admin@10.9.8.7'</span> },
|
749
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-o'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--output'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'output logging to this file'</span> },
|
750
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-p'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--params'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'param(s) for configure or update'</span> },
|
751
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-ps'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--view_position'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'view position for data calls'</span> },
|
752
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-pv'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--param_value'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'param value for configure'</span> },
|
753
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-v'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--verbose'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'set Logger::DEBUG level'</span> },
|
754
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-w'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--view'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'view (RUNTIME|CALLGRAPH) for data calls'</span> },
|
755
|
+
{ <span class="ruby-identifier">:short</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'-z'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'--zoom'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'<string>'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'zoom value for data calls'</span> }
|
756
|
+
]
|
757
|
+
|
758
|
+
<span class="ruby-identifier">cmds</span> = [
|
759
|
+
<span class="ruby-value str">"mu cmd_scale:about"</span>,
|
760
|
+
<span class="ruby-value str">"mu cmd_scale:configure -p <param> -pv <value>"</span>,
|
761
|
+
<span class="ruby-value str">"mu cmd_scale:data -w <view> -z <zoom> -ps <position> -b <bot_id>"</span>,
|
762
|
+
<span class="ruby-value str">"mu cmd_scale:delete_scale_engine -b <bot_id>"</span>,
|
763
|
+
<span class="ruby-value str">"mu cmd_scale:help"</span>,
|
764
|
+
<span class="ruby-value str">"mu cmd_scale:list"</span>,
|
765
|
+
<span class="ruby-value str">"mu cmd_scale:pattern -z <zoom> -ps <position> "</span>,
|
766
|
+
<span class="ruby-value str">"mu cmd_scale:pcap -b <bot_id> -f <filename>"</span>,
|
767
|
+
<span class="ruby-value str">"mu cmd_scale:release"</span>,
|
768
|
+
<span class="ruby-value str">"mu cmd_scale:release_scale_engine -b <bot_id>"</span>,
|
769
|
+
<span class="ruby-value str">"mu cmd_scale:reserve_scale_engine -b <bot_id>"</span>,
|
770
|
+
<span class="ruby-value str">"mu cmd_scale:session (a.k.a. /new)"</span>, <span class="ruby-comment cmt"># new</span>
|
771
|
+
<span class="ruby-value str">"mu cmd_scale:start"</span>,
|
772
|
+
<span class="ruby-value str">"mu cmd_scale:status"</span>,
|
773
|
+
<span class="ruby-value str">"mu cmd_scale:statuses"</span>,
|
774
|
+
<span class="ruby-value str">"mu cmd_scale:stop"</span>,
|
775
|
+
<span class="ruby-value str">"mu cmd_scale:update -p <params>"</span>,
|
776
|
+
<span class="ruby-value str">"mu cmd_scale:verify"</span>
|
777
|
+
]
|
778
|
+
|
779
|
+
<span class="ruby-identifier">max_long_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:long</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
|
780
|
+
<span class="ruby-identifier">max_value_size</span> = <span class="ruby-identifier">helps</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">memo</span>, <span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> [ <span class="ruby-identifier">obj</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">size</span>, <span class="ruby-identifier">memo</span> ].<span class="ruby-identifier">max</span> }
|
781
|
+
<span class="ruby-identifier">puts</span>
|
782
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Usage: mu cmd_scale <options>"</span>
|
783
|
+
<span class="ruby-identifier">puts</span>
|
784
|
+
<span class="ruby-identifier">helps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
|
785
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"%-*s %*s %-*s %s"</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">max_long_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:long</span>], <span class="ruby-value">2</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:short</span>], <span class="ruby-identifier">max_value_size</span>, <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:value</span>], <span class="ruby-identifier">h</span>[<span class="ruby-identifier">:help</span>]]
|
786
|
+
<span class="ruby-keyword kw">end</span>
|
787
|
+
<span class="ruby-identifier">puts</span>
|
788
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Available Commands"</span>
|
789
|
+
<span class="ruby-identifier">puts</span>
|
790
|
+
<span class="ruby-identifier">cmds</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">|</span>
|
791
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">c</span>
|
792
|
+
<span class="ruby-keyword kw">end</span>
|
793
|
+
<span class="ruby-identifier">puts</span>
|
794
|
+
<span class="ruby-keyword kw">end</span>
|
795
|
+
</pre>
|
796
|
+
</div>
|
797
|
+
</div>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
<div id="method-M000246" class="method-detail">
|
801
|
+
<a name="M000246"></a>
|
802
|
+
|
803
|
+
<div class="method-heading">
|
804
|
+
<a href="#M000246" class="method-signature">
|
805
|
+
<span class="method-name">parse_cli</span><span class="method-args">(argv)</span>
|
806
|
+
</a>
|
807
|
+
</div>
|
808
|
+
|
809
|
+
<div class="method-description">
|
810
|
+
<p><a class="source-toggle" href="#"
|
811
|
+
onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
|
812
|
+
<div class="method-source-code" id="M000246-source">
|
813
|
+
<pre>
|
814
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 199</span>
|
815
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
|
816
|
+
<span class="ruby-ivar">@hash</span> = {}
|
817
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
818
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">empty?</span>
|
819
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value str">'-'</span>
|
820
|
+
|
821
|
+
<span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
|
822
|
+
|
823
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-b'</span>, <span class="ruby-value str">'--bot_id'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
824
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'bot_id'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
825
|
+
<span class="ruby-keyword kw">next</span>
|
826
|
+
<span class="ruby-keyword kw">end</span>
|
827
|
+
|
828
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-c'</span>, <span class="ruby-value str">'--config_file'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
829
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-value str">"process -c"</span>
|
830
|
+
<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'SCALE_CONFIG_FILE'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
831
|
+
<span class="ruby-keyword kw">next</span>
|
832
|
+
<span class="ruby-keyword kw">end</span>
|
833
|
+
|
834
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-f'</span>, <span class="ruby-value str">'--filename'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
835
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'filename'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
836
|
+
<span class="ruby-keyword kw">next</span>
|
837
|
+
<span class="ruby-keyword kw">end</span>
|
838
|
+
|
839
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-h'</span>, <span class="ruby-value str">'--help'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
840
|
+
<span class="ruby-identifier">help</span>
|
841
|
+
<span class="ruby-identifier">exit</span>
|
842
|
+
<span class="ruby-keyword kw">end</span>
|
843
|
+
|
844
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-m'</span>, <span class="ruby-value str">'--mu_string'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
845
|
+
<span class="ruby-identifier">mu_string</span> = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
846
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mu_string</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?):(.+?)@(.*)/</span>
|
847
|
+
<span class="ruby-ivar">@@mu_admin_user</span> = <span class="ruby-identifier">$1</span>
|
848
|
+
<span class="ruby-ivar">@@mu_admin_pass</span> = <span class="ruby-identifier">$2</span>
|
849
|
+
<span class="ruby-ivar">@@mu_ip</span> = <span class="ruby-identifier">$3</span>
|
850
|
+
<span class="ruby-keyword kw">end</span>
|
851
|
+
<span class="ruby-keyword kw">next</span>
|
852
|
+
<span class="ruby-keyword kw">end</span>
|
853
|
+
|
854
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-o'</span>, <span class="ruby-value str">'--output'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
855
|
+
<span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>), <span class="ruby-value str">"w"</span>)
|
856
|
+
<span class="ruby-keyword kw">next</span>
|
857
|
+
<span class="ruby-keyword kw">end</span>
|
858
|
+
|
859
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--params'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
860
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'params'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
861
|
+
<span class="ruby-keyword kw">next</span>
|
862
|
+
<span class="ruby-keyword kw">end</span>
|
863
|
+
|
864
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-ps'</span>, <span class="ruby-value str">'--view_position'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
865
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'view_position'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
866
|
+
<span class="ruby-keyword kw">next</span>
|
867
|
+
<span class="ruby-keyword kw">end</span>
|
868
|
+
|
869
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-pv'</span>, <span class="ruby-value str">'--param_value'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
870
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'param_value'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
871
|
+
<span class="ruby-keyword kw">next</span>
|
872
|
+
<span class="ruby-keyword kw">end</span>
|
873
|
+
|
874
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-v'</span>, <span class="ruby-value str">'--verbose'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
875
|
+
<span class="ruby-identifier">$log</span>.<span class="ruby-identifier">level</span> = <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
|
876
|
+
<span class="ruby-keyword kw">next</span>
|
877
|
+
<span class="ruby-keyword kw">end</span>
|
878
|
+
|
879
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-w'</span>, <span class="ruby-value str">'--view'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
880
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'view'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
881
|
+
<span class="ruby-keyword kw">next</span>
|
882
|
+
<span class="ruby-keyword kw">end</span>
|
883
|
+
|
884
|
+
<span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-z'</span>, <span class="ruby-value str">'--zoom'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
|
885
|
+
<span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'zoom'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
|
886
|
+
<span class="ruby-keyword kw">next</span>
|
887
|
+
<span class="ruby-keyword kw">end</span>
|
888
|
+
<span class="ruby-keyword kw">end</span>
|
889
|
+
|
890
|
+
<span class="ruby-identifier">args</span>
|
891
|
+
<span class="ruby-keyword kw">end</span>
|
892
|
+
</pre>
|
893
|
+
</div>
|
894
|
+
</div>
|
895
|
+
</div>
|
896
|
+
|
897
|
+
<div id="method-M000245" class="method-detail">
|
898
|
+
<a name="M000245"></a>
|
899
|
+
|
900
|
+
<div class="method-heading">
|
901
|
+
<a href="#M000245" class="method-signature">
|
902
|
+
<span class="method-name">setup</span><span class="method-args">(argv)</span>
|
903
|
+
</a>
|
904
|
+
</div>
|
905
|
+
|
906
|
+
<div class="method-description">
|
907
|
+
<p><a class="source-toggle" href="#"
|
908
|
+
onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
|
909
|
+
<div class="method-source-code" id="M000245-source">
|
910
|
+
<pre>
|
911
|
+
<span class="ruby-comment cmt"># File lib/mu/command/cmd_scale.rb, line 188</span>
|
912
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
|
913
|
+
<span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
|
914
|
+
<span class="ruby-ivar">@host</span> = (<span class="ruby-ivar">@@mu_ip</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">"127.0.0.1"</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_ip</span>
|
915
|
+
<span class="ruby-ivar">@username</span> = (<span class="ruby-ivar">@@mu_admin_user</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">"admin"</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_user</span>
|
916
|
+
<span class="ruby-ivar">@password</span> = (<span class="ruby-ivar">@@mu_admin_pass</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">"admin"</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_pass</span>
|
917
|
+
<span class="ruby-ivar">@api</span> = <span class="ruby-constant">Scale</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@username</span>, <span class="ruby-ivar">@password</span>)
|
918
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">session</span>
|
919
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
|
920
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
|
921
|
+
<span class="ruby-keyword kw">end</span>
|
922
|
+
</pre>
|
923
|
+
</div>
|
924
|
+
</div>
|
925
|
+
</div>
|
926
|
+
|
927
|
+
|
928
|
+
</div>
|
929
|
+
|
930
|
+
|
931
|
+
</div>
|
932
|
+
|
933
|
+
|
934
|
+
<div id="validator-badges">
|
935
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
936
|
+
</div>
|
937
|
+
|
938
|
+
</body>
|
939
|
+
</html>
|