mu 5.7.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/Mu_Gem.html +1591 -0
  2. data/bin/mu +11 -0
  3. data/lib/mu.rb +65 -0
  4. data/lib/mu/api/ddt.rb +233 -0
  5. data/lib/mu/api/homepage.rb +54 -0
  6. data/lib/mu/api/muapi.rb +231 -0
  7. data/lib/mu/api/netconfig.rb +233 -0
  8. data/lib/mu/api/scale.rb +199 -0
  9. data/lib/mu/api/system.rb +40 -0
  10. data/lib/mu/client.rb +31 -0
  11. data/lib/mu/command.rb +28 -0
  12. data/lib/mu/command/api.rb +95 -0
  13. data/lib/mu/command/cmd_appid.rb +486 -0
  14. data/lib/mu/command/cmd_cli.rb +151 -0
  15. data/lib/mu/command/cmd_ddt.rb +449 -0
  16. data/lib/mu/command/cmd_homepage.rb +146 -0
  17. data/lib/mu/command/cmd_muapi.rb +361 -0
  18. data/lib/mu/command/cmd_netconfig.rb +262 -0
  19. data/lib/mu/command/cmd_runscale.rb +533 -0
  20. data/lib/mu/command/cmd_runscenario.rb +258 -0
  21. data/lib/mu/command/cmd_runverify.rb +336 -0
  22. data/lib/mu/command/cmd_scale.rb +333 -0
  23. data/lib/mu/command/cmd_system.rb +127 -0
  24. data/lib/mu/command/curl.rb +246 -0
  25. data/lib/mu/command/help.rb +29 -0
  26. data/lib/mu/curl/error.rb +54 -0
  27. data/lib/mu/curl/verify.rb +137 -0
  28. data/lib/mu/helper.rb +55 -0
  29. data/lib/mu/http_helper.rb +232 -0
  30. data/rdoc/classes/Mu.html +305 -0
  31. data/rdoc/classes/Mu/Client.html +265 -0
  32. data/rdoc/classes/Mu/Command.html +208 -0
  33. data/rdoc/classes/Mu/Command/API.html +524 -0
  34. data/rdoc/classes/Mu/Command/Cmd_appid.html +934 -0
  35. data/rdoc/classes/Mu/Command/Cmd_cli.html +515 -0
  36. data/rdoc/classes/Mu/Command/Cmd_ddt.html +1169 -0
  37. data/rdoc/classes/Mu/Command/Cmd_homepage.html +489 -0
  38. data/rdoc/classes/Mu/Command/Cmd_muapi.html +968 -0
  39. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +743 -0
  40. data/rdoc/classes/Mu/Command/Cmd_runscale.html +970 -0
  41. data/rdoc/classes/Mu/Command/Cmd_runscenario.html +530 -0
  42. data/rdoc/classes/Mu/Command/Cmd_runverify.html +621 -0
  43. data/rdoc/classes/Mu/Command/Cmd_scale.html +939 -0
  44. data/rdoc/classes/Mu/Command/Cmd_system.html +426 -0
  45. data/rdoc/classes/Mu/Command/Curl.html +524 -0
  46. data/rdoc/classes/Mu/Command/Help.html +166 -0
  47. data/rdoc/classes/Mu/Curl.html +116 -0
  48. data/rdoc/classes/Mu/Curl/Error.html +157 -0
  49. data/rdoc/classes/Mu/Curl/Error/Authorize.html +178 -0
  50. data/rdoc/classes/Mu/Curl/Error/Connect.html +149 -0
  51. data/rdoc/classes/Mu/Curl/Error/DNS.html +113 -0
  52. data/rdoc/classes/Mu/Curl/Error/Region.html +160 -0
  53. data/rdoc/classes/Mu/Curl/Error/Status.html +149 -0
  54. data/rdoc/classes/Mu/Curl/Error/Timeout.html +149 -0
  55. data/rdoc/classes/Mu/Curl/Verify.html +282 -0
  56. data/rdoc/classes/Mu/Curl/Verify/Request.html +227 -0
  57. data/rdoc/classes/Mu/Curl/Verify/Response.html +187 -0
  58. data/rdoc/classes/Mu/Curl/Verify/Result.html +188 -0
  59. data/rdoc/classes/Mu/Ddt.html +914 -0
  60. data/rdoc/classes/Mu/Helper.html +308 -0
  61. data/rdoc/classes/Mu/Homepage.html +377 -0
  62. data/rdoc/classes/Mu/HttpHelper.html +639 -0
  63. data/rdoc/classes/Mu/Muapi.html +816 -0
  64. data/rdoc/classes/Mu/Netconfig.html +781 -0
  65. data/rdoc/classes/Mu/Scale.html +832 -0
  66. data/rdoc/classes/Mu/System.html +281 -0
  67. data/rdoc/classes/Object.html +148 -0
  68. data/rdoc/classes/TCTestMu.html +1793 -0
  69. data/rdoc/classes/Test.html +107 -0
  70. data/rdoc/classes/Test/Unit.html +107 -0
  71. data/rdoc/classes/Test/Unit/TestCase.html +113 -0
  72. data/rdoc/created.rid +1 -0
  73. data/rdoc/files/lib/mu/api/ddt_rb.html +101 -0
  74. data/rdoc/files/lib/mu/api/homepage_rb.html +101 -0
  75. data/rdoc/files/lib/mu/api/muapi_rb.html +101 -0
  76. data/rdoc/files/lib/mu/api/netconfig_rb.html +101 -0
  77. data/rdoc/files/lib/mu/api/scale_rb.html +101 -0
  78. data/rdoc/files/lib/mu/api/system_rb.html +101 -0
  79. data/rdoc/files/lib/mu/client_rb.html +101 -0
  80. data/rdoc/files/lib/mu/command/api_rb.html +101 -0
  81. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +119 -0
  82. data/rdoc/files/lib/mu/command/cmd_cli_rb.html +108 -0
  83. data/rdoc/files/lib/mu/command/cmd_ddt_rb.html +117 -0
  84. data/rdoc/files/lib/mu/command/cmd_homepage_rb.html +115 -0
  85. data/rdoc/files/lib/mu/command/cmd_muapi_rb.html +116 -0
  86. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +116 -0
  87. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +119 -0
  88. data/rdoc/files/lib/mu/command/cmd_runscenario_rb.html +115 -0
  89. data/rdoc/files/lib/mu/command/cmd_runverify_rb.html +117 -0
  90. data/rdoc/files/lib/mu/command/cmd_scale_rb.html +115 -0
  91. data/rdoc/files/lib/mu/command/cmd_system_rb.html +116 -0
  92. data/rdoc/files/lib/mu/command/curl_rb.html +101 -0
  93. data/rdoc/files/lib/mu/command/help_rb.html +101 -0
  94. data/rdoc/files/lib/mu/command_rb.html +107 -0
  95. data/rdoc/files/lib/mu/curl/error_rb.html +101 -0
  96. data/rdoc/files/lib/mu/curl/verify_rb.html +101 -0
  97. data/rdoc/files/lib/mu/helper_rb.html +101 -0
  98. data/rdoc/files/lib/mu/http_helper_rb.html +101 -0
  99. data/rdoc/files/lib/mu_rb.html +121 -0
  100. data/rdoc/files/test/helper_rb.html +112 -0
  101. data/rdoc/files/test/tc_test_mu_rb.html +111 -0
  102. data/rdoc/fr_class_index.html +68 -0
  103. data/rdoc/fr_file_index.html +55 -0
  104. data/rdoc/fr_method_index.html +374 -0
  105. data/rdoc/index.html +24 -0
  106. data/rdoc/rdoc-style.css +208 -0
  107. data/test/data/app_id_stats.csv +1 -0
  108. data/test/data/data_cgi.msl +94 -0
  109. data/test/data/data_cgi.xml +322 -0
  110. data/test/data/default_test.csv +3 -0
  111. data/test/data/ftp_with_channel.xml +1643 -0
  112. data/test/data/irc.xml +3837 -0
  113. data/test/data/scale_configuration.json +25 -0
  114. data/test/data/test_data_cgi_error.xml +35 -0
  115. data/test/helper.rb +18 -0
  116. data/test/tc_test_mu.rb +716 -0
  117. metadata +322 -0
@@ -0,0 +1,968 @@
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_muapi</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_muapi</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_muapi_rb.html">
59
+ lib/mu/command/cmd_muapi.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="#M000222">cmd_archive</a>&nbsp;&nbsp;
90
+ <a href="#M000223">cmd_backup</a>&nbsp;&nbsp;
91
+ <a href="#M000224">cmd_capture</a>&nbsp;&nbsp;
92
+ <a href="#M000215">cmd_delete</a>&nbsp;&nbsp;
93
+ <a href="#M000220">cmd_export_by_type_and_name</a>&nbsp;&nbsp;
94
+ <a href="#M000221">cmd_export_by_uuid</a>&nbsp;&nbsp;
95
+ <a href="#M000216">cmd_get_faults</a>&nbsp;&nbsp;
96
+ <a href="#M000217">cmd_get_name</a>&nbsp;&nbsp;
97
+ <a href="#M000208">cmd_help</a>&nbsp;&nbsp;
98
+ <a href="#M000219">cmd_list</a>&nbsp;&nbsp;
99
+ <a href="#M000209">cmd_list_by_status</a>&nbsp;&nbsp;
100
+ <a href="#M000213">cmd_pause</a>&nbsp;&nbsp;
101
+ <a href="#M000214">cmd_resume</a>&nbsp;&nbsp;
102
+ <a href="#M000211">cmd_run</a>&nbsp;&nbsp;
103
+ <a href="#M000210">cmd_status</a>&nbsp;&nbsp;
104
+ <a href="#M000212">cmd_stop</a>&nbsp;&nbsp;
105
+ <a href="#M000218">cmd_types</a>&nbsp;&nbsp;
106
+ <a href="#M000227">help</a>&nbsp;&nbsp;
107
+ <a href="#M000226">parse_cli</a>&nbsp;&nbsp;
108
+ <a href="#M000225">setup</a>&nbsp;&nbsp;
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">&nbsp;[RW]&nbsp;</td>
131
+ <td class="context-item-desc"></td>
132
+ </tr>
133
+ <tr class="top-aligned-row context-row">
134
+ <td class="context-item-name">docroot</td>
135
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
136
+ <td class="context-item-desc"></td>
137
+ </tr>
138
+ <tr class="top-aligned-row context-row">
139
+ <td class="context-item-name">host</td>
140
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
141
+ <td class="context-item-desc"></td>
142
+ </tr>
143
+ <tr class="top-aligned-row context-row">
144
+ <td class="context-item-name">password</td>
145
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
146
+ <td class="context-item-desc"></td>
147
+ </tr>
148
+ <tr class="top-aligned-row context-row">
149
+ <td class="context-item-name">username</td>
150
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
151
+ <td class="context-item-desc"></td>
152
+ </tr>
153
+ </table>
154
+ </div>
155
+ </div>
156
+
157
+
158
+
159
+ <!-- if method_list -->
160
+ <div id="methods">
161
+ <h3 class="section-bar">Public Instance methods</h3>
162
+
163
+ <div id="method-M000222" class="method-detail">
164
+ <a name="M000222"></a>
165
+
166
+ <div class="method-heading">
167
+ <a href="#M000222" class="method-signature">
168
+ <span class="method-name">cmd_archive</span><span class="method-args">(argv)</span>
169
+ </a>
170
+ </div>
171
+
172
+ <div class="method-description">
173
+ <p>
174
+ archive has a set of three commands that are used to generate and download
175
+ an archive of all data produced by a particular test ex:
176
+ </p>
177
+ <pre>
178
+ * argv = command-line arguments, requires a command (-c) argument
179
+ * command=run returns the job_id
180
+ * command=status (called after 'run'), requires the job_id (-u) argument
181
+ * command=get (called when status returns &quot;Finished&quot;), requires the job_id (-u) argument
182
+ </pre>
183
+ <p><a class="source-toggle" href="#"
184
+ onclick="toggleCode('M000222-source');return false;">[Source]</a></p>
185
+ <div class="method-source-code" id="M000222-source">
186
+ <pre>
187
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 177</span>
188
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_archive</span> <span class="ruby-identifier">argv</span>
189
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
190
+ <span class="ruby-identifier">command</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'command'</span>]
191
+ <span class="ruby-identifier">job_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
192
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">archive</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">job_id</span>)
193
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
194
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
195
+ <span class="ruby-keyword kw">end</span>
196
+ </pre>
197
+ </div>
198
+ </div>
199
+ </div>
200
+
201
+ <div id="method-M000223" class="method-detail">
202
+ <a name="M000223"></a>
203
+
204
+ <div class="method-heading">
205
+ <a href="#M000223" class="method-signature">
206
+ <span class="method-name">cmd_backup</span><span class="method-args">(argv)</span>
207
+ </a>
208
+ </div>
209
+
210
+ <div class="method-description">
211
+ <p>
212
+ backup has a set of three commands that are used to generate, query and
213
+ retrieve a backup ex:
214
+ </p>
215
+ <pre>
216
+ * argv = command-line arguments, requires a command (-c) argument
217
+ * command=run returns the job_id
218
+ * command=status (called after 'run')
219
+ * command=get (called when status returns &quot;Finished&quot;), requires the name (-n) argument
220
+ * name = backup file name (will be given a .dat extension)
221
+ </pre>
222
+ <p><a class="source-toggle" href="#"
223
+ onclick="toggleCode('M000223-source');return false;">[Source]</a></p>
224
+ <div class="method-source-code" id="M000223-source">
225
+ <pre>
226
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 194</span>
227
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_backup</span> <span class="ruby-identifier">argv</span>
228
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
229
+ <span class="ruby-identifier">command</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'command'</span>]
230
+ <span class="ruby-identifier">name</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'name'</span>]
231
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">backup</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">name</span>)
232
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
233
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
234
+ <span class="ruby-keyword kw">end</span>
235
+ </pre>
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <div id="method-M000224" class="method-detail">
241
+ <a name="M000224"></a>
242
+
243
+ <div class="method-heading">
244
+ <a href="#M000224" class="method-signature">
245
+ <span class="method-name">cmd_capture</span><span class="method-args">(argv)</span>
246
+ </a>
247
+ </div>
248
+
249
+ <div class="method-description">
250
+ <p>
251
+ capture has a set of three commands that are used to generate packet
252
+ captures, poll the status and return the resulting file ex:
253
+ </p>
254
+ <pre>
255
+ * argv = command-line arguments, requires a command (-c) argument
256
+ * command=run returns the job_id
257
+ * command=status (called after 'run'), requires the job_id (-u) argument
258
+ * command=get (called when status returns &quot;Finished&quot;), requires the job_id (-u) argument
259
+ * port = the Mu interface on which to capture packets
260
+ </pre>
261
+ <p><a class="source-toggle" href="#"
262
+ onclick="toggleCode('M000224-source');return false;">[Source]</a></p>
263
+ <div class="method-source-code" id="M000224-source">
264
+ <pre>
265
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 211</span>
266
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_capture</span> <span class="ruby-identifier">argv</span>
267
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
268
+ <span class="ruby-identifier">command</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'command'</span>]
269
+ <span class="ruby-identifier">port</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'port'</span>]
270
+ <span class="ruby-identifier">job_id</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
271
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">capture</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">job_id</span>)
272
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
273
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
274
+ <span class="ruby-keyword kw">end</span>
275
+ </pre>
276
+ </div>
277
+ </div>
278
+ </div>
279
+
280
+ <div id="method-M000215" class="method-detail">
281
+ <a name="M000215"></a>
282
+
283
+ <div class="method-heading">
284
+ <a href="#M000215" class="method-signature">
285
+ <span class="method-name">cmd_delete</span><span class="method-args">(argv)</span>
286
+ </a>
287
+ </div>
288
+
289
+ <div class="method-description">
290
+ <p>
291
+ delets an analysis or template of any type
292
+ </p>
293
+ <pre>
294
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
295
+ </pre>
296
+ <p><a class="source-toggle" href="#"
297
+ onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
298
+ <div class="method-source-code" id="M000215-source">
299
+ <pre>
300
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 89</span>
301
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_delete</span> <span class="ruby-identifier">argv</span>
302
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
303
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
304
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">uuid</span>)
305
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
306
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
307
+ <span class="ruby-keyword kw">end</span>
308
+ </pre>
309
+ </div>
310
+ </div>
311
+ </div>
312
+
313
+ <div id="method-M000220" class="method-detail">
314
+ <a name="M000220"></a>
315
+
316
+ <div class="method-heading">
317
+ <a href="#M000220" class="method-signature">
318
+ <span class="method-name">cmd_export_by_type_and_name</span><span class="method-args">(argv)</span>
319
+ </a>
320
+ </div>
321
+
322
+ <div class="method-description">
323
+ <p>
324
+ exports a template by type and name
325
+ </p>
326
+ <pre>
327
+ * argv = command-line arguments, requires a template type (-t) and template name (-n) argument
328
+ </pre>
329
+ <p><a class="source-toggle" href="#"
330
+ onclick="toggleCode('M000220-source');return false;">[Source]</a></p>
331
+ <div class="method-source-code" id="M000220-source">
332
+ <pre>
333
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 150</span>
334
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_export_by_type_and_name</span> <span class="ruby-identifier">argv</span>
335
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
336
+ <span class="ruby-identifier">type</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'type'</span>]
337
+ <span class="ruby-identifier">name</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'name'</span>]
338
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">export_by_type_and_name</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span>)
339
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
340
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
341
+ <span class="ruby-keyword kw">end</span>
342
+ </pre>
343
+ </div>
344
+ </div>
345
+ </div>
346
+
347
+ <div id="method-M000221" class="method-detail">
348
+ <a name="M000221"></a>
349
+
350
+ <div class="method-heading">
351
+ <a href="#M000221" class="method-signature">
352
+ <span class="method-name">cmd_export_by_uuid</span><span class="method-args">(argv)</span>
353
+ </a>
354
+ </div>
355
+
356
+ <div class="method-description">
357
+ <p>
358
+ exports a template by uuid
359
+ </p>
360
+ <pre>
361
+ * argv = command-line arguments, requires a template uuid (-u) argument
362
+ </pre>
363
+ <p><a class="source-toggle" href="#"
364
+ onclick="toggleCode('M000221-source');return false;">[Source]</a></p>
365
+ <div class="method-source-code" id="M000221-source">
366
+ <pre>
367
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 161</span>
368
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_export_by_uuid</span> <span class="ruby-identifier">argv</span>
369
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
370
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
371
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">export_by_uuid</span>(<span class="ruby-identifier">uuid</span>)
372
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
373
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
374
+ <span class="ruby-keyword kw">end</span>
375
+ </pre>
376
+ </div>
377
+ </div>
378
+ </div>
379
+
380
+ <div id="method-M000216" class="method-detail">
381
+ <a name="M000216"></a>
382
+
383
+ <div class="method-heading">
384
+ <a href="#M000216" class="method-signature">
385
+ <span class="method-name">cmd_get_faults</span><span class="method-args">(argv)</span>
386
+ </a>
387
+ </div>
388
+
389
+ <div class="method-description">
390
+ <p>
391
+ returns a list of faults (if any) for the analysis
392
+ </p>
393
+ <pre>
394
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
395
+ </pre>
396
+ <p><a class="source-toggle" href="#"
397
+ onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
398
+ <div class="method-source-code" id="M000216-source">
399
+ <pre>
400
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 99</span>
401
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_get_faults</span> <span class="ruby-identifier">argv</span>
402
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
403
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
404
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">get_faults</span>(<span class="ruby-identifier">uuid</span>)
405
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
406
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">|</span>
407
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">r</span>
408
+ <span class="ruby-keyword kw">end</span>
409
+ <span class="ruby-keyword kw">else</span>
410
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
411
+ <span class="ruby-keyword kw">end</span>
412
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
413
+ <span class="ruby-keyword kw">end</span>
414
+ </pre>
415
+ </div>
416
+ </div>
417
+ </div>
418
+
419
+ <div id="method-M000217" class="method-detail">
420
+ <a name="M000217"></a>
421
+
422
+ <div class="method-heading">
423
+ <a href="#M000217" class="method-signature">
424
+ <span class="method-name">cmd_get_name</span><span class="method-args">(argv)</span>
425
+ </a>
426
+ </div>
427
+
428
+ <div class="method-description">
429
+ <p>
430
+ returns the name of a test referenced by uuid
431
+ </p>
432
+ <pre>
433
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
434
+ </pre>
435
+ <p><a class="source-toggle" href="#"
436
+ onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
437
+ <div class="method-source-code" id="M000217-source">
438
+ <pre>
439
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 115</span>
440
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_get_name</span> <span class="ruby-identifier">argv</span>
441
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
442
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
443
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">get_name</span>(<span class="ruby-identifier">uuid</span>)
444
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
445
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
446
+ <span class="ruby-keyword kw">end</span>
447
+ </pre>
448
+ </div>
449
+ </div>
450
+ </div>
451
+
452
+ <div id="method-M000208" class="method-detail">
453
+ <a name="M000208"></a>
454
+
455
+ <div class="method-heading">
456
+ <a href="#M000208" class="method-signature">
457
+ <span class="method-name">cmd_help</span><span class="method-args">(argv)</span>
458
+ </a>
459
+ </div>
460
+
461
+ <div class="method-description">
462
+ <p>
463
+ displays command-line <a href="Cmd_muapi.html#M000227">help</a>
464
+ </p>
465
+ <pre>
466
+ * argv = command-line arguments
467
+ </pre>
468
+ <p><a class="source-toggle" href="#"
469
+ onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
470
+ <div class="method-source-code" id="M000208-source">
471
+ <pre>
472
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 12</span>
473
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_help</span> <span class="ruby-identifier">argv</span>
474
+ <span class="ruby-identifier">help</span>
475
+ <span class="ruby-keyword kw">end</span>
476
+ </pre>
477
+ </div>
478
+ </div>
479
+ </div>
480
+
481
+ <div id="method-M000219" class="method-detail">
482
+ <a name="M000219"></a>
483
+
484
+ <div class="method-heading">
485
+ <a href="#M000219" class="method-signature">
486
+ <span class="method-name">cmd_list</span><span class="method-args">(argv)</span>
487
+ </a>
488
+ </div>
489
+
490
+ <div class="method-description">
491
+ <p>
492
+ lists all templates of the given type
493
+ </p>
494
+ <pre>
495
+ * argv = command-line arguments, requires a type (-t) argument, such as 'scenario'
496
+ </pre>
497
+ <p><a class="source-toggle" href="#"
498
+ onclick="toggleCode('M000219-source');return false;">[Source]</a></p>
499
+ <div class="method-source-code" id="M000219-source">
500
+ <pre>
501
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 134</span>
502
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_list</span> <span class="ruby-identifier">argv</span>
503
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
504
+ <span class="ruby-identifier">type</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'type'</span>]
505
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">list</span>(<span class="ruby-identifier">type</span>)
506
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
507
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">|</span>
508
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">r</span>
509
+ <span class="ruby-keyword kw">end</span>
510
+ <span class="ruby-keyword kw">else</span>
511
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
512
+ <span class="ruby-keyword kw">end</span>
513
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
514
+ <span class="ruby-keyword kw">end</span>
515
+ </pre>
516
+ </div>
517
+ </div>
518
+ </div>
519
+
520
+ <div id="method-M000209" class="method-detail">
521
+ <a name="M000209"></a>
522
+
523
+ <div class="method-heading">
524
+ <a href="#M000209" class="method-signature">
525
+ <span class="method-name">cmd_list_by_status</span><span class="method-args">(argv)</span>
526
+ </a>
527
+ </div>
528
+
529
+ <div class="method-description">
530
+ <p>
531
+ for any of the possible status values, returns a list of analysis
532
+ </p>
533
+ <pre>
534
+ * argv = command-line arguments, requires the status (-s) argument, specifying the values to query, such as 'running' or 'failed'
535
+ </pre>
536
+ <p><a class="source-toggle" href="#"
537
+ onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
538
+ <div class="method-source-code" id="M000209-source">
539
+ <pre>
540
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 18</span>
541
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_list_by_status</span> <span class="ruby-identifier">argv</span>
542
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
543
+ <span class="ruby-identifier">status</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'status'</span>]
544
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">list_by_status</span>(<span class="ruby-identifier">status</span>)
545
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
546
+ <span class="ruby-identifier">response</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">|</span>
547
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">r</span>
548
+ <span class="ruby-keyword kw">end</span>
549
+ <span class="ruby-keyword kw">else</span>
550
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
551
+ <span class="ruby-keyword kw">end</span>
552
+ <span class="ruby-keyword kw">end</span>
553
+ </pre>
554
+ </div>
555
+ </div>
556
+ </div>
557
+
558
+ <div id="method-M000213" class="method-detail">
559
+ <a name="M000213"></a>
560
+
561
+ <div class="method-heading">
562
+ <a href="#M000213" class="method-signature">
563
+ <span class="method-name">cmd_pause</span><span class="method-args">(argv)</span>
564
+ </a>
565
+ </div>
566
+
567
+ <div class="method-description">
568
+ <p>
569
+ pauses a running analysis. Note that any queued analysis will NOT begin
570
+ </p>
571
+ <pre>
572
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
573
+ </pre>
574
+ <p><a class="source-toggle" href="#"
575
+ onclick="toggleCode('M000213-source');return false;">[Source]</a></p>
576
+ <div class="method-source-code" id="M000213-source">
577
+ <pre>
578
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 69</span>
579
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_pause</span> <span class="ruby-identifier">argv</span>
580
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
581
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
582
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">pause</span>(<span class="ruby-identifier">uuid</span>)
583
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
584
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
585
+ <span class="ruby-keyword kw">end</span>
586
+ </pre>
587
+ </div>
588
+ </div>
589
+ </div>
590
+
591
+ <div id="method-M000214" class="method-detail">
592
+ <a name="M000214"></a>
593
+
594
+ <div class="method-heading">
595
+ <a href="#M000214" class="method-signature">
596
+ <span class="method-name">cmd_resume</span><span class="method-args">(argv)</span>
597
+ </a>
598
+ </div>
599
+
600
+ <div class="method-description">
601
+ <p>
602
+ resumes a paused analysis
603
+ </p>
604
+ <pre>
605
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
606
+ </pre>
607
+ <p><a class="source-toggle" href="#"
608
+ onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
609
+ <div class="method-source-code" id="M000214-source">
610
+ <pre>
611
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 79</span>
612
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_resume</span> <span class="ruby-identifier">argv</span>
613
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
614
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
615
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">resume</span>(<span class="ruby-identifier">uuid</span>)
616
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
617
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
618
+ <span class="ruby-keyword kw">end</span>
619
+ </pre>
620
+ </div>
621
+ </div>
622
+ </div>
623
+
624
+ <div id="method-M000211" class="method-detail">
625
+ <a name="M000211"></a>
626
+
627
+ <div class="method-heading">
628
+ <a href="#M000211" class="method-signature">
629
+ <span class="method-name">cmd_run</span><span class="method-args">(argv)</span>
630
+ </a>
631
+ </div>
632
+
633
+ <div class="method-description">
634
+ <p>
635
+ runs an analysis, reference is the posted uuid ex: run(1234-1234-1234-1234,
636
+ &quot;new_name&quot;)
637
+ </p>
638
+ <pre>
639
+ * argv = command-line arguments, requires a uuid (-u) and an optional name such that each successive run of the same uuid yields a new name
640
+ </pre>
641
+ <p><a class="source-toggle" href="#"
642
+ onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
643
+ <div class="method-source-code" id="M000211-source">
644
+ <pre>
645
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 44</span>
646
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">argv</span>
647
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
648
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
649
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'boolean'</span>].<span class="ruby-identifier">nil?</span>
650
+ <span class="ruby-identifier">rename</span> = <span class="ruby-value str">&quot;&quot;</span>
651
+ <span class="ruby-keyword kw">else</span>
652
+ <span class="ruby-identifier">rename</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'boolean'</span>]
653
+ <span class="ruby-keyword kw">end</span>
654
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">uuid</span>, <span class="ruby-identifier">rename</span>)
655
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
656
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
657
+ <span class="ruby-keyword kw">end</span>
658
+ </pre>
659
+ </div>
660
+ </div>
661
+ </div>
662
+
663
+ <div id="method-M000210" class="method-detail">
664
+ <a name="M000210"></a>
665
+
666
+ <div class="method-heading">
667
+ <a href="#M000210" class="method-signature">
668
+ <span class="method-name">cmd_status</span><span class="method-args">(argv)</span>
669
+ </a>
670
+ </div>
671
+
672
+ <div class="method-description">
673
+ <p>
674
+ returns the status of a particular analysis
675
+ </p>
676
+ <pre>
677
+ * argv = command-line argumentsm require a uuid (-u) argument, specifying a test on the Mu
678
+ </pre>
679
+ <p><a class="source-toggle" href="#"
680
+ onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
681
+ <div class="method-source-code" id="M000210-source">
682
+ <pre>
683
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 33</span>
684
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_status</span> <span class="ruby-identifier">argv</span>
685
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
686
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
687
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">status</span>(<span class="ruby-identifier">uuid</span>)
688
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
689
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
690
+ <span class="ruby-keyword kw">end</span>
691
+ </pre>
692
+ </div>
693
+ </div>
694
+ </div>
695
+
696
+ <div id="method-M000212" class="method-detail">
697
+ <a name="M000212"></a>
698
+
699
+ <div class="method-heading">
700
+ <a href="#M000212" class="method-signature">
701
+ <span class="method-name">cmd_stop</span><span class="method-args">(argv)</span>
702
+ </a>
703
+ </div>
704
+
705
+ <div class="method-description">
706
+ <p>
707
+ aborts a running analysis. the next queued analysis will start
708
+ </p>
709
+ <pre>
710
+ * argv = command-line arguments, requires a uuid (-u) argument specifying the test
711
+ </pre>
712
+ <p><a class="source-toggle" href="#"
713
+ onclick="toggleCode('M000212-source');return false;">[Source]</a></p>
714
+ <div class="method-source-code" id="M000212-source">
715
+ <pre>
716
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 59</span>
717
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_stop</span> <span class="ruby-identifier">argv</span>
718
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
719
+ <span class="ruby-identifier">uuid</span> = <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>]
720
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">stop</span>(<span class="ruby-identifier">uuid</span>)
721
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
722
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
723
+ <span class="ruby-keyword kw">end</span>
724
+ </pre>
725
+ </div>
726
+ </div>
727
+ </div>
728
+
729
+ <div id="method-M000218" class="method-detail">
730
+ <a name="M000218"></a>
731
+
732
+ <div class="method-heading">
733
+ <a href="#M000218" class="method-signature">
734
+ <span class="method-name">cmd_types</span><span class="method-args">(argv)</span>
735
+ </a>
736
+ </div>
737
+
738
+ <div class="method-description">
739
+ <p>
740
+ returns the types of templates on the <a href="../../Mu.html">Mu</a>
741
+ </p>
742
+ <pre>
743
+ * argv = command-line arguments
744
+ </pre>
745
+ <p><a class="source-toggle" href="#"
746
+ onclick="toggleCode('M000218-source');return false;">[Source]</a></p>
747
+ <div class="method-source-code" id="M000218-source">
748
+ <pre>
749
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 125</span>
750
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmd_types</span> <span class="ruby-identifier">argv</span>
751
+ <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
752
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@api</span>.<span class="ruby-identifier">types</span>
753
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>
754
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
755
+ <span class="ruby-keyword kw">end</span>
756
+ </pre>
757
+ </div>
758
+ </div>
759
+ </div>
760
+
761
+ <h3 class="section-bar">Private Instance methods</h3>
762
+
763
+ <div id="method-M000227" class="method-detail">
764
+ <a name="M000227"></a>
765
+
766
+ <div class="method-heading">
767
+ <a href="#M000227" class="method-signature">
768
+ <span class="method-name">help</span><span class="method-args">()</span>
769
+ </a>
770
+ </div>
771
+
772
+ <div class="method-description">
773
+ <p><a class="source-toggle" href="#"
774
+ onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
775
+ <div class="method-source-code" id="M000227-source">
776
+ <pre>
777
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 307</span>
778
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
779
+ <span class="ruby-identifier">helps</span> = [
780
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-b'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--boolean'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'boolean arg'</span> },
781
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-c'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--command'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'e.g. run|get|status'</span> },
782
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-h'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--help'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'help on command line options'</span> },
783
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-m'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--mu_string'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'user, password, mu_ip in the form of admin:admin@10.9.8.7'</span> },
784
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-n'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--name'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'name for filtering'</span> },
785
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-o'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--output'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'output logging to this file'</span> },
786
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-p'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--port'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'port name'</span> },
787
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-s'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--status'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'status, running|finished|aborted|queued|failed'</span> },
788
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-t'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--type'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'template type'</span> },
789
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-u'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--uuid'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;string&gt;'</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'template uuid'</span> },
790
+ { <span class="ruby-identifier">:short</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'-v'</span>, <span class="ruby-identifier">:long</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'--verbose'</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">:help</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'set Logger::DEBUG level'</span> }
791
+ ]
792
+
793
+ <span class="ruby-identifier">cmds</span> = [
794
+ <span class="ruby-value str">&quot;mu cmd_muapi:archive -c &lt;command&gt; -u &lt;uuid&gt;&quot;</span>,
795
+ <span class="ruby-value str">&quot;mu cmd_muapi:backup -c &lt;command&gt; [-n &lt;name&gt;]&quot;</span>,
796
+ <span class="ruby-value str">&quot;mu cmd_muapi:capture -c &lt;command&gt; -p &lt;port&gt; [-u &lt;uuid&gt;]&quot;</span>,
797
+ <span class="ruby-value str">&quot;mu cmd_muapi:delete -u &lt;uuid&gt;&quot;</span>,
798
+ <span class="ruby-value str">&quot;mu cmd_muapi:export_by_type_and_name -t &lt;type&gt; -n &lt;name&gt;&quot;</span>,
799
+ <span class="ruby-value str">&quot;mu cmd_muapi:export_by_uuid -u &lt;uuid&gt;&quot;</span>,
800
+ <span class="ruby-value str">&quot;mu cmd_muapi:get_faults -u &lt;uuid&gt;&quot;</span>,
801
+ <span class="ruby-value str">&quot;mu cmd_muapi:get_name -u &lt;uuid&gt;&quot;</span>,
802
+ <span class="ruby-value str">&quot;mu cmd_muapi:help&quot;</span>,
803
+ <span class="ruby-value str">&quot;mu cmd_muapi:list -t &lt;type&gt;&quot;</span>,
804
+ <span class="ruby-value str">&quot;mu cmd_muapi:list_by_status -s &lt;status&gt;&quot;</span>,
805
+ <span class="ruby-value str">&quot;mu cmd_muapi:pause -u &lt;uuid&gt;&quot;</span>,
806
+ <span class="ruby-value str">&quot;mu cmd_muapi:resume -u &lt;uuid&gt;&quot;</span>,
807
+ <span class="ruby-value str">&quot;mu cmd_muapi:run -u &lt;uuid&gt; [-b rename]&quot;</span>,
808
+ <span class="ruby-value str">&quot;mu cmd_muapi:status -u &lt;uuid&gt;&quot;</span>,
809
+ <span class="ruby-value str">&quot;mu cmd_muapi:stop -u &lt;uuid&gt;&quot;</span>,
810
+ <span class="ruby-value str">&quot;mu cmd_muapi:types&quot;</span>,
811
+ ]
812
+
813
+ <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> }
814
+ <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> }
815
+ <span class="ruby-identifier">puts</span>
816
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Usage: mu cmd_muapi &lt;options&gt;&quot;</span>
817
+ <span class="ruby-identifier">puts</span>
818
+ <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>
819
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;%-*s %*s %-*s %s&quot;</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>]]
820
+ <span class="ruby-keyword kw">end</span>
821
+ <span class="ruby-identifier">puts</span>
822
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Available Commands&quot;</span>
823
+ <span class="ruby-identifier">puts</span>
824
+ <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>
825
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">c</span>
826
+ <span class="ruby-keyword kw">end</span>
827
+ <span class="ruby-identifier">puts</span>
828
+ <span class="ruby-keyword kw">end</span>
829
+ </pre>
830
+ </div>
831
+ </div>
832
+ </div>
833
+
834
+ <div id="method-M000226" class="method-detail">
835
+ <a name="M000226"></a>
836
+
837
+ <div class="method-heading">
838
+ <a href="#M000226" class="method-signature">
839
+ <span class="method-name">parse_cli</span><span class="method-args">(argv)</span>
840
+ </a>
841
+ </div>
842
+
843
+ <div class="method-description">
844
+ <p><a class="source-toggle" href="#"
845
+ onclick="toggleCode('M000226-source');return false;">[Source]</a></p>
846
+ <div class="method-source-code" id="M000226-source">
847
+ <pre>
848
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 235</span>
849
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
850
+ <span class="ruby-identifier">args</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
851
+ <span class="ruby-ivar">@hash</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
852
+ <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>
853
+ <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</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>
854
+
855
+ <span class="ruby-identifier">k</span> = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">shift</span>
856
+
857
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-b'</span>, <span class="ruby-value str">'--boolean'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
858
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'boolean'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
859
+ <span class="ruby-keyword kw">next</span>
860
+ <span class="ruby-keyword kw">end</span>
861
+
862
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-c'</span>, <span class="ruby-value str">'--command'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
863
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'command'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
864
+ <span class="ruby-keyword kw">next</span>
865
+ <span class="ruby-keyword kw">end</span>
866
+
867
+ <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>
868
+ <span class="ruby-identifier">help</span>
869
+ <span class="ruby-identifier">exit</span>
870
+ <span class="ruby-keyword kw">end</span>
871
+
872
+ <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>
873
+ <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>)
874
+ <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>
875
+ <span class="ruby-ivar">@@mu_admin_user</span> = <span class="ruby-identifier">$1</span>
876
+ <span class="ruby-ivar">@@mu_admin_pass</span> = <span class="ruby-identifier">$2</span>
877
+ <span class="ruby-ivar">@@mu_ip</span> = <span class="ruby-identifier">$3</span>
878
+ <span class="ruby-keyword kw">end</span>
879
+ <span class="ruby-keyword kw">next</span>
880
+ <span class="ruby-keyword kw">end</span>
881
+
882
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-n'</span>, <span class="ruby-value str">'--name'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
883
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'name'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
884
+ <span class="ruby-keyword kw">next</span>
885
+ <span class="ruby-keyword kw">end</span>
886
+
887
+ <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>
888
+ <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">&quot;w&quot;</span>)
889
+ <span class="ruby-keyword kw">next</span>
890
+ <span class="ruby-keyword kw">end</span>
891
+
892
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-p'</span>, <span class="ruby-value str">'--port'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
893
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'port'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
894
+ <span class="ruby-keyword kw">next</span>
895
+ <span class="ruby-keyword kw">end</span>
896
+
897
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-s'</span>, <span class="ruby-value str">'--status'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
898
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'status'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
899
+ <span class="ruby-keyword kw">next</span>
900
+ <span class="ruby-keyword kw">end</span>
901
+
902
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-t'</span>, <span class="ruby-value str">'--type'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
903
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'type'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
904
+ <span class="ruby-keyword kw">next</span>
905
+ <span class="ruby-keyword kw">end</span>
906
+
907
+ <span class="ruby-keyword kw">if</span> [ <span class="ruby-value str">'-u'</span>, <span class="ruby-value str">'--uuid'</span> ].<span class="ruby-identifier">member?</span> <span class="ruby-identifier">k</span>
908
+ <span class="ruby-ivar">@hash</span>[<span class="ruby-value str">'uuid'</span>] = <span class="ruby-identifier">shift</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">argv</span>)
909
+ <span class="ruby-keyword kw">next</span>
910
+ <span class="ruby-keyword kw">end</span>
911
+
912
+ <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>
913
+ <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>
914
+ <span class="ruby-keyword kw">next</span>
915
+ <span class="ruby-keyword kw">end</span>
916
+ <span class="ruby-keyword kw">end</span>
917
+
918
+ <span class="ruby-identifier">args</span>
919
+ <span class="ruby-keyword kw">end</span>
920
+ </pre>
921
+ </div>
922
+ </div>
923
+ </div>
924
+
925
+ <div id="method-M000225" class="method-detail">
926
+ <a name="M000225"></a>
927
+
928
+ <div class="method-heading">
929
+ <a href="#M000225" class="method-signature">
930
+ <span class="method-name">setup</span><span class="method-args">(argv)</span>
931
+ </a>
932
+ </div>
933
+
934
+ <div class="method-description">
935
+ <p><a class="source-toggle" href="#"
936
+ onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
937
+ <div class="method-source-code" id="M000225-source">
938
+ <pre>
939
+ <span class="ruby-comment cmt"># File lib/mu/command/cmd_muapi.rb, line 223</span>
940
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span> <span class="ruby-identifier">argv</span>
941
+ <span class="ruby-identifier">parse_cli</span> <span class="ruby-identifier">argv</span>
942
+ <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">&quot;127.0.0.1&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_ip</span>
943
+ <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">&quot;admin&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_user</span>
944
+ <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">&quot;admin&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@@mu_admin_pass</span>
945
+ <span class="ruby-ivar">@docroot</span> = <span class="ruby-value str">&quot;/api/v3&quot;</span>
946
+ <span class="ruby-ivar">@params</span> = <span class="ruby-keyword kw">nil</span>
947
+ <span class="ruby-ivar">@expected_error</span> = <span class="ruby-keyword kw">nil</span>
948
+ <span class="ruby-ivar">@api</span> = <span class="ruby-constant">Muapi</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>)
949
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Created API object to :#{@host}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
950
+ <span class="ruby-keyword kw">end</span>
951
+ </pre>
952
+ </div>
953
+ </div>
954
+ </div>
955
+
956
+
957
+ </div>
958
+
959
+
960
+ </div>
961
+
962
+
963
+ <div id="validator-badges">
964
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
965
+ </div>
966
+
967
+ </body>
968
+ </html>