mu 5.7.2.5 → 5.7.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mu/command/cmd_appid.rb +10 -0
- data/lib/mu/command/cmd_runscale.rb +48 -2
- data/rdoc/classes/Mu.html +13 -68
- data/rdoc/classes/Mu/Command.html +13 -1
- data/rdoc/classes/Mu/Command/Cmd_appid.html +23 -23
- data/rdoc/classes/Mu/Command/Cmd_appid.src/M000053.html +18 -0
- data/rdoc/classes/Mu/Command/Cmd_appid.src/M000054.html +30 -0
- data/rdoc/classes/Mu/Command/Cmd_appid.src/M000055.html +39 -0
- data/rdoc/classes/Mu/Command/Cmd_appid.src/M000056.html +50 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.html +60 -60
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000060.html +18 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000061.html +22 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000062.html +23 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000063.html +23 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000064.html +22 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000065.html +23 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000066.html +21 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000067.html +22 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000068.html +22 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000069.html +21 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000070.html +21 -0
- data/rdoc/classes/Mu/Command/Cmd_netconfig.src/M000071.html +23 -0
- data/rdoc/classes/Mu/Command/Cmd_runscale.html +18 -19
- data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000057.html +18 -0
- data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000058.html +51 -0
- data/rdoc/classes/Mu/Command/Cmd_runscale.src/M000059.html +50 -0
- data/rdoc/classes/Mu/Netconfig.html +78 -78
- data/rdoc/classes/Mu/Netconfig.src/M000072.html +25 -0
- data/rdoc/classes/Mu/Netconfig.src/M000073.html +20 -0
- data/rdoc/classes/Mu/Netconfig.src/M000074.html +21 -0
- data/rdoc/classes/Mu/Netconfig.src/M000075.html +24 -0
- data/rdoc/classes/Mu/Netconfig.src/M000076.html +20 -0
- data/rdoc/classes/Mu/Netconfig.src/M000077.html +36 -0
- data/rdoc/classes/Mu/Netconfig.src/M000078.html +22 -0
- data/rdoc/classes/Mu/Netconfig.src/M000079.html +22 -0
- data/rdoc/classes/Mu/Netconfig.src/M000080.html +39 -0
- data/rdoc/classes/Mu/Netconfig.src/M000081.html +21 -0
- data/rdoc/classes/Mu/Netconfig.src/M000082.html +23 -0
- data/rdoc/classes/Mu/Netconfig.src/M000083.html +26 -0
- data/rdoc/classes/Mu/Netconfig.src/M000084.html +23 -0
- data/rdoc/classes/Mu/Netconfig.src/M000085.html +22 -0
- data/rdoc/classes/Mu/Netconfig.src/M000086.html +19 -0
- data/rdoc/classes/TCTestMu.src/M000043.html +1 -1
- data/rdoc/created.rid +1 -1
- data/rdoc/files/lib/mu/api/netconfig_rb.html +1 -1
- data/rdoc/files/lib/mu/command/cmd_appid_rb.html +1 -1
- data/rdoc/files/lib/mu/command/cmd_netconfig_rb.html +1 -1
- data/rdoc/files/lib/mu/command/cmd_runscale_rb.html +1 -1
- data/rdoc/files/test/tc_test_mu_rb.html +2 -2
- data/rdoc/fr_class_index.html +5 -1
- data/rdoc/fr_file_index.html +4 -2
- data/rdoc/fr_method_index.html +86 -25
- data/rdoc/index.html +1 -1
- data/test/data/app_id_stats.csv +1 -1
- data/test/data/app_id_status.json +43 -43
- data/test/tc_test_mu.rb +5 -1
- 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">"/restlet/netconfig/"</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">""</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">"Created Netconfig API object to :#{@host}"</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">"hosts"</span>
|
21
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-value str">"RESTORE HOSTS"</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">"hosts"</span>]
|
24
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">"routes"</span>
|
25
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-value str">"RESTORE ROUTES"</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">"routes"</span>]
|
28
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">"interfaces"</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">"RESTORE INTERFACES"</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">"interfaces"</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">"hosts"</span>)
|
16
|
+
<span class="ruby-identifier">h</span>[<span class="ruby-value str">"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>
|
17
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-node">"Clear host: #{h['name']}"</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">"hosts/#{h['name']}"</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">"create host: #{h['name']}"</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">"hosts/#{h['name']}"</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">"hosts"</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">""</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">"hosts"</span>
|
19
|
+
<span class="ruby-identifier">hst</span>[<span class="ruby-value str">"hosts"</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"><<</span> <span class="ruby-identifier">h</span>[<span class="ruby-value str">"name"</span>]}
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-identifier">hosts</span> <span class="ruby-operator"><<</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">"resolve host: #{h}"</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">"CCCC"</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">"."</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">"hosts/#{h}"</span>
|
28
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">json</span>[<span class="ruby-value str">"name"</span>].<span class="ruby-identifier">nil?</span>
|
29
|
+
<span class="ruby-identifier">json</span> = {<span class="ruby-value str">"name"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">h</span>, <span class="ruby-value str">"v4_addr"</span> =<span class="ruby-operator">></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">"hosts"</span>
|
31
|
+
<span class="ruby-keyword kw">else</span>
|
32
|
+
<span class="ruby-identifier">json</span>[<span class="ruby-value str">"v4_addr"</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">"hosts/#{h}"</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">"v4_addrs"</span>=<span class="ruby-operator">></span>[], <span class="ruby-value str">"v4_mask"</span>=<span class="ruby-operator">></span><span class="ruby-value str">""</span>, <span class="ruby-value str">"v4_dhcp"</span>=<span class="ruby-operator">></span><span class="ruby-keyword kw">false</span>,
|
17
|
+
<span class="ruby-value str">"v6_global_addrs"</span>=<span class="ruby-operator">></span>[], <span class="ruby-value str">"v6_global_mask"</span>=<span class="ruby-operator">></span><span class="ruby-value str">""</span>}
|
18
|
+
<span class="ruby-identifier">modify</span> <span class="ruby-identifier">json</span>,<span class="ruby-node">"interfaces/#{interface}"</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">"interfaces"</span>
|
16
|
+
<span class="ruby-identifier">i</span>[<span class="ruby-value str">"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>
|
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">""</span>
|
18
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-node">"Clear vlan: #{i['name']}"</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">"interfaces/#{i['name']}"</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">"eth"</span> <span class="ruby-comment cmt"># don't do eth0 or eth1</span>
|
17
|
+
<span class="ruby-identifier">msg</span> <span class="ruby-node">"configure interface: #{i['name']}"</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">""</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">"."</span>)
|
20
|
+
<span class="ruby-identifier">create</span> [{<span class="ruby-value str">"name"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">interface</span>,<span class="ruby-value str">"vlan"</span>=<span class="ruby-operator">></span><span class="ruby-identifier">vlan</span>},<span class="ruby-value str">"interfaces"</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">"interfaces/#{i['name']}"</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">"routes"</span>
|
16
|
+
<span class="ruby-identifier">routes</span>[<span class="ruby-value str">"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>
|
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">"Clear route: #{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}"</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">"routes/#{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}"</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">"configure route: #{r['dst']}-#{r['gateway']}-#{r['interface_display_name'].downcase}"</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">"routes"</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">"all"</span>, <span class="ruby-identifier">filepath</span>=<span class="ruby-value str">"config.json"</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"><<</span> <span class="ruby-value str">"b1,b2"</span>
|
23
23
|
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"-v"</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"
|
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">"expected 0 errors but got #{app.errors.size}"</span>)
|
26
26
|
<span class="ruby-keyword kw">end</span></pre>
|
27
27
|
</body>
|
28
28
|
</html>
|
data/rdoc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
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
|
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
|
77
77
|
test/unit
|
78
|
-
|
78
|
+
lib/mu
|
79
79
|
json
|
80
80
|
</div>
|
81
81
|
</div>
|