mu 5.7.2.5 → 5.7.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/lib/mu/command/cmd_appid.rb +10 -0
  2. data/lib/mu/command/cmd_runscale.rb +48 -2
  3. data/rdoc/classes/Mu.html +13 -68
  4. data/rdoc/classes/Mu/Command.html +13 -1
  5. data/rdoc/classes/Mu/Command/Cmd_appid.html +23 -23
  6. data/rdoc/classes/Mu/Command/Cmd_appid.src/M000053.html +18 -0
  7. data/rdoc/classes/Mu/Command/Cmd_appid.src/M000054.html +30 -0
  8. data/rdoc/classes/Mu/Command/Cmd_appid.src/M000055.html +39 -0
  9. data/rdoc/classes/Mu/Command/Cmd_appid.src/M000056.html +50 -0
  10. data/rdoc/classes/Mu/Command/Cmd_netconfig.html +60 -60
  11. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000060.html +18 -0
  12. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000061.html +22 -0
  13. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000062.html +23 -0
  14. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000063.html +23 -0
  15. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000064.html +22 -0
  16. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000065.html +23 -0
  17. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000066.html +21 -0
  18. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000067.html +22 -0
  19. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000068.html +22 -0
  20. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000069.html +21 -0
  21. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000070.html +21 -0
  22. data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000071.html +23 -0
  23. data/rdoc/classes/Mu/Command/Cmd_runscale.html +18 -19
  24. data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000057.html +18 -0
  25. data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000058.html +51 -0
  26. data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000059.html +50 -0
  27. data/rdoc/classes/Mu/Netconfig.html +78 -78
  28. data/rdoc/classes/Mu/Netconfig.src/M000072.html +25 -0
  29. data/rdoc/classes/Mu/Netconfig.src/M000073.html +20 -0
  30. data/rdoc/classes/Mu/Netconfig.src/M000074.html +21 -0
  31. data/rdoc/classes/Mu/Netconfig.src/M000075.html +24 -0
  32. data/rdoc/classes/Mu/Netconfig.src/M000076.html +20 -0
  33. data/rdoc/classes/Mu/Netconfig.src/M000077.html +36 -0
  34. data/rdoc/classes/Mu/Netconfig.src/M000078.html +22 -0
  35. data/rdoc/classes/Mu/Netconfig.src/M000079.html +22 -0
  36. data/rdoc/classes/Mu/Netconfig.src/M000080.html +39 -0
  37. data/rdoc/classes/Mu/Netconfig.src/M000081.html +21 -0
  38. data/rdoc/classes/Mu/Netconfig.src/M000082.html +23 -0
  39. data/rdoc/classes/Mu/Netconfig.src/M000083.html +26 -0
  40. data/rdoc/classes/Mu/Netconfig.src/M000084.html +23 -0
  41. data/rdoc/classes/Mu/Netconfig.src/M000085.html +22 -0
  42. data/rdoc/classes/Mu/Netconfig.src/M000086.html +19 -0
  43. data/rdoc/classes/TCTestMu.src/M000043.html +1 -1
  44. data/rdoc/created.rid +1 -1
  45. data/rdoc/files/lib/mu/api/netconfig_rb.html +1 -1
  46. data/rdoc/files/lib/mu/command/cmd_appid_rb.html +1 -1
  47. data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +1 -1
  48. data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +1 -1
  49. data/rdoc/files/test/tc_test_mu_rb.html +2 -2
  50. data/rdoc/fr_class_index.html +5 -1
  51. data/rdoc/fr_file_index.html +4 -2
  52. data/rdoc/fr_method_index.html +86 -25
  53. data/rdoc/index.html +1 -1
  54. data/test/data/app_id_stats.csv +1 -1
  55. data/test/data/app_id_status.json +43 -43
  56. data/test/tc_test_mu.rb +5 -1
  57. metadata +38 -4
@@ -0,0 +1,25 @@
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>
7
+ <head>
8
+ <title>new (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 7</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_IP'</span>], <span class="ruby-identifier">username</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_USER'</span>], <span class="ruby-identifier">password</span>=<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'MU_ADMIN_PASS'</span>])
15
+ <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
16
+ <span class="ruby-ivar">@username</span> = <span class="ruby-identifier">username</span>
17
+ <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
18
+ <span class="ruby-ivar">@docroot</span> = <span class="ruby-value str">&quot;/restlet/netconfig/&quot;</span>
19
+ <span class="ruby-ivar">@response</span> = <span class="ruby-keyword kw">nil</span>
20
+ <span class="ruby-ivar">@http</span> = <span class="ruby-constant">HttpHelper</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>, <span class="ruby-ivar">@docroot</span>)
21
+ <span class="ruby-ivar">@element</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-comment cmt"># sticky variable will hold a default element, the last element specified</span>
22
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Created Netconfig API object to :#{@host}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,20 @@
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>
7
+ <head>
8
+ <title>get (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 20</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">e</span>)
15
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">get_json</span>(<span class="ruby-identifier">e</span>)
16
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,21 @@
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>
7
+ <head>
8
+ <title>modify (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 29</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">modify</span>(<span class="ruby-identifier">json</span>, <span class="ruby-identifier">e</span>)
15
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">do_modify</span>(<span class="ruby-identifier">json</span>, <span class="ruby-identifier">e</span>)
16
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
18
+ ??
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,24 @@
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>
7
+ <head>
8
+ <title>create (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 48</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-identifier">json</span>, <span class="ruby-identifier">e</span>)
15
+ <span class="ruby-identifier">jstring</span> = <span class="ruby-identifier">json</span>
16
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">json</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
17
+ <span class="ruby-identifier">jstring</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">generate</span> <span class="ruby-identifier">json</span>
18
+ <span class="ruby-keyword kw">end</span>
19
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">post_json</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">jstring</span>)
20
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
21
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,20 @@
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>
7
+ <head>
8
+ <title>delete (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 60</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">e</span>)
15
+ <span class="ruby-identifier">response</span> = <span class="ruby-ivar">@http</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">e</span>)
16
+ <span class="ruby-identifier">msg</span> <span class="ruby-identifier">response</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,36 @@
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>
7
+ <head>
8
+ <title>restore (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 69</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore</span>(<span class="ruby-identifier">filepath</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">clear_existing</span>=<span class="ruby-keyword kw">false</span>)
15
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filepath</span>.<span class="ruby-identifier">nil?</span>
16
+ <span class="ruby-ivar">@config</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filepath</span>))
17
+ <span class="ruby-keyword kw">end</span>
18
+ <span class="ruby-ivar">@config</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>
19
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">keys</span>[<span class="ruby-value">0</span>]
20
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;hosts&quot;</span>
21
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;RESTORE HOSTS&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
22
+ <span class="ruby-identifier">clear_existing</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">clear_hosts</span>
23
+ <span class="ruby-identifier">restore_hosts</span> <span class="ruby-identifier">c</span>[<span class="ruby-value str">&quot;hosts&quot;</span>]
24
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;routes&quot;</span>
25
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;RESTORE ROUTES&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
26
+ <span class="ruby-identifier">clear_existing</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">clear_routes</span>
27
+ <span class="ruby-identifier">restore_routes</span> <span class="ruby-identifier">c</span>[<span class="ruby-value str">&quot;routes&quot;</span>]
28
+ <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;interfaces&quot;</span>
29
+ <span class="ruby-identifier">clear_existing</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">clear_vlans</span>
30
+ <span class="ruby-identifier">msg</span> <span class="ruby-value str">&quot;RESTORE INTERFACES&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
31
+ <span class="ruby-identifier">restore_interfaces</span> <span class="ruby-identifier">c</span>[<span class="ruby-value str">&quot;interfaces&quot;</span>]
32
+ <span class="ruby-keyword kw">end</span>
33
+ <span class="ruby-keyword kw">end</span>
34
+ <span class="ruby-keyword kw">end</span></pre>
35
+ </body>
36
+ </html>
@@ -0,0 +1,22 @@
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>
7
+ <head>
8
+ <title>clear_hosts (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 92</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_hosts</span>
15
+ <span class="ruby-identifier">h</span> = <span class="ruby-identifier">get</span>(<span class="ruby-value str">&quot;hosts&quot;</span>)
16
+ <span class="ruby-identifier">h</span>[<span class="ruby-value str">&quot;hosts&quot;</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>
17
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Clear host: #{h['name']}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
18
+ <span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;hosts/#{h['name']}&quot;</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,22 @@
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>
7
+ <head>
8
+ <title>restore_hosts (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 101</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_hosts</span>(<span class="ruby-identifier">hosts</span>)
15
+ <span class="ruby-identifier">hosts</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>
16
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;create host: #{h['name']}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
17
+ <span class="ruby-identifier">delete</span> <span class="ruby-node">&quot;hosts/#{h['name']}&quot;</span> <span class="ruby-comment cmt"># harmlessly fails when host does not exist</span>
18
+ <span class="ruby-identifier">create</span>(<span class="ruby-identifier">h</span>,<span class="ruby-value str">&quot;hosts&quot;</span>)
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,39 @@
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>
7
+ <head>
8
+ <title>resolve_hosts (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 112</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resolve_hosts</span>(<span class="ruby-identifier">name</span>=<span class="ruby-keyword kw">nil</span>)
15
+ <span class="ruby-identifier">response</span> = <span class="ruby-value str">&quot;&quot;</span>
16
+ <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
17
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
18
+ <span class="ruby-identifier">hst</span> = <span class="ruby-identifier">get</span> <span class="ruby-value str">&quot;hosts&quot;</span>
19
+ <span class="ruby-identifier">hst</span>[<span class="ruby-value str">&quot;hosts&quot;</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>[<span class="ruby-value str">&quot;name&quot;</span>]}
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-identifier">hosts</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-identifier">hosts</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>
24
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;resolve host: #{h}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
25
+ <span class="ruby-identifier">v4_addr</span> = <span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-identifier">gethostbyname</span>(<span class="ruby-identifier">h</span>)[<span class="ruby-value">3</span>].<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;CCCC&quot;</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;.&quot;</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
26
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v4_addr</span>.<span class="ruby-identifier">nil?</span>
27
+ <span class="ruby-identifier">json</span> = <span class="ruby-identifier">get</span> <span class="ruby-node">&quot;hosts/#{h}&quot;</span>
28
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">json</span>[<span class="ruby-value str">&quot;name&quot;</span>].<span class="ruby-identifier">nil?</span>
29
+ <span class="ruby-identifier">json</span> = {<span class="ruby-value str">&quot;name&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">h</span>, <span class="ruby-value str">&quot;v4_addr&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">v4_addr</span>}
30
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">create</span> <span class="ruby-identifier">json</span>, <span class="ruby-value str">&quot;hosts&quot;</span>
31
+ <span class="ruby-keyword kw">else</span>
32
+ <span class="ruby-identifier">json</span>[<span class="ruby-value str">&quot;v4_addr&quot;</span>] = <span class="ruby-identifier">v4_addr</span>
33
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">modify</span> <span class="ruby-identifier">json</span>, <span class="ruby-node">&quot;hosts/#{h}&quot;</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+ <span class="ruby-keyword kw">end</span>
36
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
37
+ <span class="ruby-keyword kw">end</span></pre>
38
+ </body>
39
+ </html>
@@ -0,0 +1,21 @@
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>
7
+ <head>
8
+ <title>clear_interface (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 139</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_interface</span>(<span class="ruby-identifier">interface</span>)
15
+ <span class="ruby-identifier">interface</span> = <span class="ruby-identifier">interface</span>
16
+ <span class="ruby-identifier">json</span> = { <span class="ruby-value str">&quot;v4_addrs&quot;</span>=<span class="ruby-operator">&gt;</span>[], <span class="ruby-value str">&quot;v4_mask&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-value str">&quot;v4_dhcp&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-keyword kw">false</span>,
17
+ <span class="ruby-value str">&quot;v6_global_addrs&quot;</span>=<span class="ruby-operator">&gt;</span>[], <span class="ruby-value str">&quot;v6_global_mask&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;&quot;</span>}
18
+ <span class="ruby-identifier">modify</span> <span class="ruby-identifier">json</span>,<span class="ruby-node">&quot;interfaces/#{interface}&quot;</span>
19
+ <span class="ruby-keyword kw">end</span></pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,23 @@
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>
7
+ <head>
8
+ <title>clear_vlans (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 147</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_vlans</span>
15
+ <span class="ruby-identifier">i</span> = <span class="ruby-identifier">get</span> <span class="ruby-value str">&quot;interfaces&quot;</span>
16
+ <span class="ruby-identifier">i</span>[<span class="ruby-value str">&quot;interfaces&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span>[<span class="ruby-value str">'vlan'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
18
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Clear vlan: #{i['name']}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
19
+ <span class="ruby-identifier">delete</span> <span class="ruby-node">&quot;interfaces/#{i['name']}&quot;</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,26 @@
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>
7
+ <head>
8
+ <title>restore_interfaces (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 158</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_interfaces</span>(<span class="ruby-identifier">interfaces</span>)
15
+ <span class="ruby-identifier">interfaces</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
16
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span>[<span class="ruby-value str">'name'</span>].<span class="ruby-identifier">include?</span> <span class="ruby-value str">&quot;eth&quot;</span> <span class="ruby-comment cmt"># don't do eth0 or eth1</span>
17
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;configure interface: #{i['name']}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
18
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">i</span>[<span class="ruby-value str">'vlan'</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
19
+ <span class="ruby-identifier">interface</span>,<span class="ruby-identifier">vlan</span> = <span class="ruby-identifier">i</span>[<span class="ruby-value str">'name'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>)
20
+ <span class="ruby-identifier">create</span> [{<span class="ruby-value str">&quot;name&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">interface</span>,<span class="ruby-value str">&quot;vlan&quot;</span>=<span class="ruby-operator">&gt;</span><span class="ruby-identifier">vlan</span>},<span class="ruby-value str">&quot;interfaces&quot;</span>]
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-identifier">modify</span> [<span class="ruby-identifier">i</span>,<span class="ruby-node">&quot;interfaces/#{i['name']}&quot;</span>]
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,23 @@
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>
7
+ <head>
8
+ <title>clear_routes (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 171</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_routes</span>
15
+ <span class="ruby-identifier">routes</span> = <span class="ruby-identifier">get</span> <span class="ruby-value str">&quot;routes&quot;</span>
16
+ <span class="ruby-identifier">routes</span>[<span class="ruby-value str">&quot;routes&quot;</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>
17
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>[<span class="ruby-value str">'readonly'</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
18
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;Clear route: #{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
19
+ <span class="ruby-identifier">delete</span> <span class="ruby-node">&quot;routes/#{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}&quot;</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,22 @@
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>
7
+ <head>
8
+ <title>restore_routes (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 181</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_routes</span>(<span class="ruby-identifier">routes</span>)
15
+ <span class="ruby-identifier">routes</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>
16
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>[<span class="ruby-value str">'readonly'</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span>
17
+ <span class="ruby-identifier">msg</span> <span class="ruby-node">&quot;configure route: #{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}&quot;</span>, <span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
18
+ <span class="ruby-identifier">create</span> <span class="ruby-identifier">r</span>,<span class="ruby-value str">&quot;routes&quot;</span>
19
+ <span class="ruby-keyword kw">end</span>
20
+ <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
@@ -0,0 +1,19 @@
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>
7
+ <head>
8
+ <title>save (Mu::Netconfig)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/mu/api/netconfig.rb, line 192</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">e</span>=<span class="ruby-value str">&quot;all&quot;</span>, <span class="ruby-identifier">filepath</span>=<span class="ruby-value str">&quot;config.json&quot;</span>)
15
+ <span class="ruby-identifier">json</span> = <span class="ruby-identifier">get</span> <span class="ruby-identifier">e</span>
16
+ <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filepath</span>,<span class="ruby-value str">'w'</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">json</span>))}
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -22,7 +22,7 @@
22
22
  <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;b1,b2&quot;</span>
23
23
  <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;-v&quot;</span>
24
24
  <span class="ruby-identifier">app</span>.<span class="ruby-identifier">cmd_run</span> <span class="ruby-identifier">args</span>
25
- <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>, <span class="ruby-value str">&quot;expected errors but got none&quot;</span>)
25
+ <span class="ruby-identifier">assert</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>, <span class="ruby-node">&quot;expected 0 errors but got #{app.errors.size}&quot;</span>)
26
26
  <span class="ruby-keyword kw">end</span></pre>
27
27
  </body>
28
28
  </html>
@@ -1 +1 @@
1
- Thu, 10 Feb 2011 09:14:15 -0800
1
+ Mon, 14 Feb 2011 11:03:23 -0800
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Feb 03 15:39:10 -0800 2011</td>
59
+ <td>Fri Feb 11 09:28:20 -0800 2011</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri Feb 04 14:54:22 -0800 2011</td>
59
+ <td>Mon Feb 14 10:51:54 -0800 2011</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Feb 03 15:39:10 -0800 2011</td>
59
+ <td>Fri Feb 11 09:27:45 -0800 2011</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Feb 08 09:55:03 -0800 2011</td>
59
+ <td>Mon Feb 14 10:57:00 -0800 2011</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu Feb 03 15:27:22 -0800 2011</td>
59
+ <td>Thu Feb 10 13:22:33 -0800 2011</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -75,7 +75,7 @@
75
75
  <div class="name-list">
76
76
  rubygems&nbsp;&nbsp;
77
77
  test/unit&nbsp;&nbsp;
78
- <a href="../lib/mu_rb.html">lib/mu</a>&nbsp;&nbsp;
78
+ lib/mu&nbsp;&nbsp;
79
79
  json&nbsp;&nbsp;
80
80
  </div>
81
81
  </div>