summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2014-02-23 20:10:48 +0100
committerMichal Minar <miminar@redhat.com>2014-02-24 10:04:05 +0100
commit9b283ef352269e794e592964ab874a31e5d225a4 (patch)
treed16ee0b40bf6fd58ac00fd3a4df89cff77da17c9 /doc
parent905b9b7c3a5651ada99f3e65addc6f0fa9aa7816 (diff)
downloadopenlmi-scripts-9b283ef352269e794e592964ab874a31e5d225a4.tar.gz
openlmi-scripts-9b283ef352269e794e592964ab874a31e5d225a4.tar.xz
openlmi-scripts-9b283ef352269e794e592964ab874a31e5d225a4.zip
updated documentation
Diffstat (limited to 'doc')
-rw-r--r--doc/_static/imode-tree.svg605
-rw-r--r--doc/command-properties.rst46
-rw-r--r--doc/configuration.rst72
-rw-r--r--doc/script-development.rst62
-rw-r--r--doc/usage.rst85
5 files changed, 842 insertions, 28 deletions
diff --git a/doc/_static/imode-tree.svg b/doc/_static/imode-tree.svg
new file mode 100644
index 0000000..91c1614
--- /dev/null
+++ b/doc/_static/imode-tree.svg
@@ -0,0 +1,605 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="678.85718"
+ height="399.14285"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="imode-tree.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="524.19771"
+ inkscape:cy="224.52211"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1058"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-14.499999,-184.21933)">
+ <path
+ style="fill:none;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:4, 4;stroke-dashoffset:0"
+ d="m 162.85714,185.21933 0,397.14285"
+ id="path4052"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:#800000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ id="path4042"
+ sodipodi:cx="122.5"
+ sodipodi:cy="410.57648"
+ sodipodi:rx="69.64286"
+ sodipodi:ry="35.357143"
+ d="m 192.14286,410.57648 c 0,19.52721 -31.18017,35.35714 -69.64286,35.35714 -38.46269,0 -69.64286,-15.82993 -69.64286,-35.35714 0,-19.52721 31.18017,-35.35715 69.64286,-35.35715 38.46269,0 69.64286,15.82994 69.64286,35.35715 z"
+ transform="translate(35.714286,-14.285714)" />
+ <g
+ id="g3003"
+ transform="translate(0,0.71427917)">
+ <rect
+ ry="17.857143"
+ y="230.21933"
+ x="14.999999"
+ height="35.714287"
+ width="137.85715"
+ id="rect2985"
+ style="fill:#ffe680;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text2999"
+ y="253.59406"
+ x="41.628769"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ xml:space="preserve"><tspan
+ y="253.59406"
+ x="41.628769"
+ id="tspan3001"
+ sodipodi:role="line">TopLevel</tspan></text>
+ </g>
+ <g
+ id="g3033"
+ transform="translate(-41.20703,-4.2857208)">
+ <rect
+ style="fill:#ffaaaa;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3024"
+ width="137.85715"
+ height="35.714287"
+ x="215"
+ y="235.21933"
+ ry="17.857143" />
+ <text
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="244.661"
+ y="258.41827"
+ id="text3026"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3028"
+ x="244.661"
+ y="258.41827">Storage</tspan></text>
+ </g>
+ <g
+ id="g4032"
+ transform="translate(0.22154353,20)">
+ <rect
+ ry="17.857143"
+ y="463.07648"
+ x="173.57143"
+ height="35.714287"
+ width="137.85715"
+ id="rect3040"
+ style="fill:#ffaaaa;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3042"
+ y="488.38968"
+ x="198.27148"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ xml:space="preserve"><tspan
+ y="488.38968"
+ x="198.27148"
+ id="tspan3044"
+ sodipodi:role="line">Software</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ x="46.047226"
+ y="290.93359"
+ id="text3049"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3051"
+ x="46.047226"
+ y="290.93359">lmi&gt; :pwd</tspan><tspan
+ sodipodi:role="line"
+ x="46.047226"
+ y="308.43359"
+ id="tspan3053">/lmi</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text3055"
+ y="290.93359"
+ x="183.97691"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ xml:space="preserve"><tspan
+ y="290.93359"
+ x="183.97691"
+ id="tspan3057"
+ sodipodi:role="line"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">&gt;storage&gt; :pwd</tspan><tspan
+ id="tspan3059"
+ y="308.43359"
+ x="183.97691"
+ sodipodi:role="line"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">/lmi/storage</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ x="183.97691"
+ y="542.18982"
+ id="text3061"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3063"
+ x="183.97691"
+ y="542.18982">&gt;sw&gt; :pwd</tspan><tspan
+ sodipodi:role="line"
+ x="183.97691"
+ y="559.68982"
+ id="tspan3065">/lmi/sw</tspan></text>
+ <g
+ id="g3078"
+ transform="translate(-71.821487,-5)">
+ <rect
+ ry="17.857143"
+ y="235.93361"
+ x="415.71426"
+ height="35.714287"
+ width="137.85715"
+ id="rect3069"
+ style="fill:#ffaaaa;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3071"
+ y="261.2468"
+ x="450.17505"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ xml:space="preserve"><tspan
+ y="261.2468"
+ x="450.17505"
+ id="tspan3073"
+ sodipodi:role="line">LVCmd</tspan></text>
+ </g>
+ <g
+ id="g4037"
+ transform="translate(-8.9643402,2.1428265)">
+ <rect
+ style="fill:#ffaaaa;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3085"
+ width="137.85715"
+ height="35.714287"
+ x="352.85712"
+ y="320.93362"
+ ry="17.857143" />
+ <text
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="374.60309"
+ y="346.24683"
+ id="text3087"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3089"
+ x="374.60309"
+ y="346.24683">RAIDCmd</tspan></text>
+ </g>
+ <g
+ id="g4027"
+ transform="translate(-7.5357819,0)">
+ <rect
+ ry="17.857143"
+ y="422.36218"
+ x="351.42856"
+ height="35.714287"
+ width="137.85715"
+ id="rect3101"
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3103"
+ y="447.67538"
+ x="377.3493"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ xml:space="preserve"><tspan
+ y="447.67538"
+ x="377.3493"
+ id="tspan3105"
+ sodipodi:role="line">TreeCmd</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ x="65.21373"
+ y="198.29857"
+ id="text3886"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3888"
+ x="65.21373"
+ y="198.29857">Root</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ x="198.54967"
+ y="198.79076"
+ id="text3890"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3892"
+ x="198.54967"
+ y="198.79076">Registered</tspan><tspan
+ sodipodi:role="line"
+ x="198.54967"
+ y="218.79076"
+ id="tspan3894">commands</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ x="350.43854"
+ y="198.79076"
+ id="text3896"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3898"
+ x="350.43854"
+ y="198.79076">Sub-commands</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ x="337.14752"
+ y="290.93359"
+ id="text3900"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3902"
+ x="337.14752"
+ y="290.93359">&gt;&gt;lv&gt; :pwd</tspan><tspan
+ sodipodi:role="line"
+ x="337.14752"
+ y="308.43359"
+ id="tspan3904">/lmi/storage/lv</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ x="337.14752"
+ y="385.93359"
+ id="text3906"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3908"
+ x="337.14752"
+ y="385.93359">&gt;&gt;raid&gt; :pwd</tspan><tspan
+ sodipodi:role="line"
+ x="337.14752"
+ y="403.43359"
+ id="tspan3910">/lmi/storage/raid</tspan></text>
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="M 245.57868,275.21932 194.8644,359.50503"
+ id="path3916"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="M 362.85714,273.79075 C 360,275.93361 221.42858,372.36218 221.42858,372.36218"
+ id="path3918"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="m 349.28571,350.21932 c -1.42857,2.85715 -117.85714,33.57144 -117.85714,33.57144"
+ id="path3920"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="M 225.57868,478.79076 194.8644,432.36217"
+ id="path3924"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <g
+ id="g3992"
+ transform="translate(-41.428572,0)">
+ <rect
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3878"
+ width="137.85715"
+ height="35.714287"
+ x="546.42859"
+ y="230.93361"
+ ry="17.857143" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3929"
+ y="256.2468"
+ x="597.1394"
+ style="font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ xml:space="preserve"><tspan
+ y="256.2468"
+ x="597.1394"
+ id="tspan3931"
+ sodipodi:role="line">List</tspan></text>
+ </g>
+ <g
+ id="g3997"
+ transform="translate(-40.000044,1.4285889)">
+ <rect
+ ry="17.857143"
+ y="275.21933"
+ x="545.00006"
+ height="35.714287"
+ width="137.85715"
+ id="rect3880"
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3933"
+ y="300.35675"
+ x="580.63763"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ style="font-size:20px"
+ y="300.35675"
+ x="580.63763"
+ id="tspan3935"
+ sodipodi:role="line">Create</tspan></text>
+ </g>
+ <g
+ id="g4002"
+ transform="translate(-38.571455,2.1428265)">
+ <rect
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3882"
+ width="137.85715"
+ height="35.714287"
+ x="543.57147"
+ y="320.93362"
+ ry="17.857143" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3937"
+ y="346.24683"
+ x="594.28229"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ style="font-size:20px"
+ y="346.24683"
+ x="594.28229"
+ id="tspan3939"
+ sodipodi:role="line">List</tspan></text>
+ </g>
+ <g
+ id="g4007"
+ transform="translate(-38.571455,0)">
+ <rect
+ ry="17.857143"
+ y="368.07648"
+ x="543.57147"
+ height="35.714287"
+ width="137.85715"
+ id="rect3884"
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3941"
+ y="393.38968"
+ x="579.19928"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ style="font-size:20px"
+ y="393.38968"
+ x="579.19928"
+ id="tspan3943"
+ sodipodi:role="line">Delete</tspan></text>
+ </g>
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="m 491.42857,441.64789 56.42857,0"
+ id="path3968"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <g
+ id="g4022"
+ transform="translate(-14.100082,20)">
+ <rect
+ style="fill:#ffaaaa;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3972"
+ width="137.85715"
+ height="35.714287"
+ x="357.99286"
+ y="463.07648"
+ ry="17.857143" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3974"
+ y="486.4512"
+ x="373.05426"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ y="486.4512"
+ x="373.05426"
+ id="tspan3976"
+ sodipodi:role="line">Repository</tspan></text>
+ </g>
+ <g
+ id="g4012"
+ transform="translate(-36.428572,1.4285579)">
+ <rect
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect3980"
+ width="137.85715"
+ height="35.714287"
+ x="541.42859"
+ y="481.64792"
+ ry="17.857143" />
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ x="575.82593"
+ y="506.96112"
+ id="text3982"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3984"
+ x="575.82593"
+ y="506.96112"
+ style="font-size:20px">Enable</tspan></text>
+ </g>
+ <g
+ id="g4017"
+ transform="translate(-36.428572,2.1428571)">
+ <rect
+ ry="17.857143"
+ y="528.79077"
+ x="541.42859"
+ height="35.714287"
+ width="137.85715"
+ id="rect3986"
+ style="fill:#a8dbff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3988"
+ y="554.10394"
+ x="572.81812"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ style="font-size:20px"
+ y="554.10394"
+ x="572.81812"
+ id="tspan3990"
+ sodipodi:role="line">Disable</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ x="101.7055"
+ y="401.48608"
+ id="text3912"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3914"
+ x="101.7055"
+ y="401.48608"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Droid Sans;-inkscape-font-specification:Droid Sans">multiplexers</tspan></text>
+ <path
+ inkscape:connector-curvature="0"
+ id="path4054"
+ d="m 327.85714,185.21933 0,397.14285"
+ style="fill:none;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:4, 4;stroke-dashoffset:0"
+ sodipodi:nodetypes="cc" />
+ <g
+ id="g4058">
+ <path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:#800000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ id="path4056"
+ sodipodi:cx="122.5"
+ sodipodi:cy="410.57648"
+ sodipodi:rx="69.64286"
+ sodipodi:ry="35.357143"
+ d="m 192.14286,410.57648 c 0,19.52721 -31.18017,35.35714 -69.64286,35.35714 -38.46269,0 -69.64286,-15.82993 -69.64286,-35.35714 0,-19.52721 31.18017,-35.35715 69.64286,-35.35715 38.46269,0 69.64286,15.82994 69.64286,35.35715 z"
+ transform="translate(500.71429,32.857143)" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text3912-0"
+ y="438.43362"
+ x="573.19476"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Terminus"
+ xml:space="preserve"><tspan
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
+ y="438.43362"
+ x="573.19476"
+ id="tspan3914-9"
+ sodipodi:role="line">end point</tspan><tspan
+ id="tspan3966"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Droid Sans;-inkscape-font-specification:Droid Sans"
+ y="463.43362"
+ x="573.19476"
+ sodipodi:role="line">commands</tspan></text>
+ </g>
+ <path
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4064"
+ d="M 542.14286,407.36217 555,423.07646"
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0" />
+ <path
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0"
+ d="m 545.00001,478.79074 13.57142,-13.57143"
+ id="path4066"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cc" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text4068"
+ y="540.57654"
+ x="337.14752"
+ style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono"
+ xml:space="preserve"><tspan
+ y="540.57654"
+ x="337.14752"
+ id="tspan4070"
+ sodipodi:role="line">&gt;&gt;repo&gt; :pwd</tspan><tspan
+ id="tspan4072"
+ y="558.07654"
+ x="337.14752"
+ sodipodi:role="line">/lmi/software/repo</tspan></text>
+ <path
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4074"
+ d="M 337.00725,484.50505 228.43583,416.64789"
+ style="fill:none;stroke:#808080;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 1;stroke-dashoffset:0" />
+ </g>
+</svg>
diff --git a/doc/command-properties.rst b/doc/command-properties.rst
index d89d18a..cfba558 100644
--- a/doc/command-properties.rst
+++ b/doc/command-properties.rst
@@ -150,7 +150,7 @@ Property descriptions
EXPECT = 0
.. note::
-
+
Using own usage strings in subcommands of top-level commands is not
recommended. It brings a lot of redundancy and may prove problematic
to modify while keeping consistency among hierarchically nested
@@ -259,6 +259,35 @@ Property descriptions
Namespace can also be overriden globally in a configuration file or with
an option on command line.
+
+Output rendering
+----------------
+All these options begin with ``FMT_`` which is a shortcut for *formatter* as
+they become options to formatter objects. These can be defined not only in
+end-point commands but also in multiplexers. In the latter case they set the
+defaults for all their direct and indirect child commands.
+
+.. note::
+ These options override configuration settings and command line options.
+ Therefor use them with care.
+
+They are:
+
+.. _fmt_no_headings:
+
+``FMT_NO_HEADINGS`` : ``bool`` (defaults to ``False``)
+ Allows to suppress headings (column or row names) in the output.
+
+ .. note::
+ With :ref:`lmi_lister` command it's preferable to set the *COLUMNS*
+ property to empty list instead. Otherwise associated function is
+ expected to return column headers as a first row in its result.
+
+.. _fmt_human_friendly:
+
+``FMT_HUMAN_FRIENDLY`` : ``bool`` (defaults to ``False``)
+ Forces the output to be more pleasant to read by human beings.
+
Command specific properties
---------------------------
Each command class can have its own specific properties. Let's take a look on
@@ -295,7 +324,6 @@ them.
Take for example this usage string: ::
-
"""
Display hardware information.
@@ -328,7 +356,7 @@ them.
~~~~~~~~~~~~~~~~~~~~~~~~
.. _columns:
-``COLUMNS`` : ``tuple`` (mandatory)
+``COLUMNS`` : ``tuple``
Column names. It's a tuple with name for each column. Each row of data
shall then contain the same number of items as this tuple. If omitted,
associated function is expected to provide them in the first row of
@@ -336,6 +364,11 @@ them.
:py:meth:`~lmi.scripts.common.command.lister.LmiBaseListerCommand.get_columns`
class method.
+ If set to empty list, no column headers will be printed. Every item of
+ returned list of associated function will be treated as data. Note that
+ setting this to empty list makes the *FMT_NO_HEADINGS* property
+ redundant.
+
.. _lmi_instance_commands_properties:
.. _lmi_show_instance_properties:
.. _lmi_instance_lister_properties:
@@ -345,7 +378,7 @@ them.
These two classes expect, as a result of their associated function, an instance
or a list of instances of some CIM class. They take care of rendering them to
standard output. Thus their properties affect the way how their properties
-are rendered.
+are rendered.
.. _properties:
@@ -477,12 +510,13 @@ method.
.. seealso::
Docopt_ home page and its git: http://github.org/docopt/docopt.
-
+
-------------------------------------------------------------------------------
.. [#] Angle brackets here just mark the boundaries of name components. They
have nothing to do with arguments.
-.. [#] Application object is accessible through ``app`` property of each command instance.
+.. [#] Application object is accessible through ``app`` property of each
+ command instance.
.. ****************************************************************************
diff --git a/doc/configuration.rst b/doc/configuration.rst
index 76ac368..3c56ee9 100644
--- a/doc/configuration.rst
+++ b/doc/configuration.rst
@@ -6,8 +6,9 @@ Configuration
/etc/openlmi/scripts/lmi.conf
-User can have his own configuration file overriding anything in global one above: ::
-
+User can have his own configuration file taking precedence over anything in
+global one above: ::
+
$HOME/.lmirc
Configuration is written in MS Windows INI files fashion. Please refer to
@@ -15,11 +16,13 @@ corresponding `RFC 822`_ and to `ConfigParser`_ for python specific
interpretation language.
Follows a list of sections with their list of options. Most of the options
-listed here can be overriden with command line parameters.
+listed here can be overridden with command line parameters.
.. seealso::
:py:mod:`~lmi.scripts.common.configuration`
+.. _sect_main:
+
Section [Main]
--------------
.. _main_command_namespace:
@@ -36,16 +39,27 @@ Trace : ``boolean``
Defaults to ``False``.
+ Can be overridden with ``--trace`` and ``--notrace`` options on
+ command-line.
+
+ .. note::
+ For most exceptions generated by scripts a *Verbosity* option
+ needs to be highest as well for tracebacks to be printed.
+
.. _main_verbosity:
Verbosity: ``integer``
- A number within 0-2 range saying, how verbosive the output
- shall be. This differs from `log_level`_, which controls the logging
- messages. This option is recognized by commands alone making them
- print more information on stdout.
+ A number within 0-2 range saying, how verbose the output shall be. This
+ differs from `log_level`_, which controls the logging messages written to
+ file. If logging to console is enabled it sets the minimum severity level.
+ -1 Suppresses all messages except for errors. 0 shows warnings, 1 info
+ messages and 2 enables debug messages. This option also affects the
+ verbosity of commands, making them print more information to stdout.
Defaults to 0.
+ Can be overridden with ``-v`` and ``-q`` flags on command-line.
+
Section [CIM]
-------------
.. _cim_namespace:
@@ -66,6 +80,7 @@ VerifyServerCertificate : ``boolean``
Defaults to ``True``.
+ Can be overridden with ``-n | --noverify`` flag on command-line.
Section [Format]
----------------
@@ -76,6 +91,8 @@ HumanFriendly : ``boolean``
Defaults to ``False``.
+ Can be overridden with ``-H | --human-frienly`` flag on command-line.
+
.. _format_lister_format:
ListerFormat : one of {``csv``, ``table``}
@@ -84,6 +101,8 @@ ListerFormat : one of {``csv``, ``table``}
Defaults to ``table``.
+ Can be overridden with ``-L | --lister-format`` option on command line.
+
.. _format_no_headings:
NoHeadings : ``boolean``
@@ -91,30 +110,52 @@ NoHeadings : ``boolean``
Defaults to ``False``.
+ Can be overridden with ``-N | --no-headings`` option on command line.
+
Section [Log]
-------------
.. _log_level:
Level : one of {``DEBUG``, ``INFO``, ``WARNING``, ``ERROR``, ``CRITICAL``}
- Minimal serverity level of messages to log. Affects only logging to a
- file.
+ Minimal severity level of messages to log. Affects only logging to a
+ file. See the `main_verbosity`_ option controlling console logging level.
Defaults to ``ERROR``.
+LogToConsole : ``boolean``
+ Whether the logging to console is enabled.
+
+ Defaults to ``True``
+
+ On command-line the same could be achieved by redirecting *stderr* to
+ ``/dev/null``.
+
.. _log_console_format:
ConsoleFormat : ``string``
- Format string used when logging to a console.
+ Format string used when logging to a console. This applies to warnings and
+ more severe messages. Refer to `Format String` in python's documentation for
+ details.
Defaults to ``%(levelname)s: %(message)s``.
+.. _log_console_info_format:
+
+ConsoleInfoFormat : ``string``
+ Format string used when logging to a console. Applies to info and debug
+ messages. Refer to `Format String` in python's documentation for details.
+
+
+ Defaults to ``%(message)s``.
+
.. _log_file_format:
FileFormat : ``string``
Format string used, when logging to a console. This applies only when
- *OutputFile* is set (see below).
+ *OutputFile* is set (see below). Refer to `Format String` in python's
+ documentation for details.
- Defaults to
+ Defaults to
``%(asctime)s:%(levelname)-8s:%(name)s:%(lineno)d - %(message)s``
.. _log_output_file:
@@ -125,7 +166,10 @@ OutputFile : ``string``
Defaults to empty string.
+ Can be overridden on command line with ``--log-file`` option.
+
.. ****************************************************************************
-.. _`RFC 822`: http://tools.ietf.org/html/rfc822.html
-.. _`ConfigParser`: http://docs.python.org/2/library/configparser.html
+.. _`RFC 822`: http://tools.ietf.org/html/rfc822.html
+.. _`ConfigParser`: http://docs.python.org/2/library/configparser.html
+.. _`Format String`: http://docs.python.org/2/library/logging.html#logrecord-attributes
diff --git a/doc/script-development.rst b/doc/script-development.rst
index 3b4a107..5871aa1 100644
--- a/doc/script-development.rst
+++ b/doc/script-development.rst
@@ -437,6 +437,68 @@ Next example shows setup with more top-level commands
],
},
+Conventions
+-----------
+There are several conventions you should try to follow in your shiny scripts.
+
+Logging messages
+~~~~~~~~~~~~~~~~
+In each module where logging facilities are going to be used, define global
+varibale ``LOG`` like this: ::
+
+ from lmi.scripts.common import get_logger
+
+ LOG = get_logger(__name__)
+
+It's a callable used throughout particular module in this way: ::
+
+ LOG().warn('All the data of "%s" will be lost!', partition)
+
+Each message should be a whole sentence. It shall begin with an upper case
+letter and end with a dot or other sentence terminator.
+
+Bad example: ::
+
+ LOG().info('processing %s', card)
+
+Exceptions
+~~~~~~~~~~
+Again all the exceptions should be initialized with messages forming
+a whole sentence.
+
+They will be catched and printed on *stderr* by lmi meta-command. If the
+*Trace* option in :ref:`sect_main` is on, traceback will be printed. There is
+just one exception. If the exception inherits from
+:py:class:`~lmi.scripts.common.errors.LmiError`, traceback won't be printed
+unless verbosity level is highest: ::
+
+ # self refers to some command
+ self.app.config.verbosity == self.app.config.OUTPUT_DEBUG
+
+This is a feature allowing for common error use-cases to be gracefully
+handled. In your scripts you should stick to using
+:py:class:`~lmi.scripts.common.errors.LmiFailed` for such exceptions.
+
+Following is an example of such a common error-case, where printing traceback
+does not add any interesting information: ::
+
+ iname = ns.LMI_Service.new_instance_name({
+ "Name": service,
+ "CreationClassName" : "LMI_Service",
+ "SystemName" : cs.Name,
+ "SystemCreationClassName" : cs.CreationClassName
+ })
+ inst = iname.to_instance()
+ if inst is None:
+ raise errors.LmiFailed('No such service "%s".' % service)
+ # process the service instance
+
+``service`` is a name provided by user. If such a service is not found,
+``inst`` will be assigned ``None``. In this case we don't want to continue in
+script's execution thus we raise an exception. We provide very clear message
+that needs no other comment. We don't want any traceback to be printed, thus
+the use of :py:class:`~lmi.scripts.common.errors.LmiFailed`.
+
Detailed description
--------------------
These pages provide more details of some aspects:
diff --git a/doc/usage.rst b/doc/usage.rst
index fbfab75..58c5a5d 100644
--- a/doc/usage.rst
+++ b/doc/usage.rst
@@ -11,28 +11,97 @@ It can run single command given on command line like this: ::
lmi -h ${hostname} service list --all
+Getting help
+------------
+For detailed help run: ::
+
+ lmi --help
+
+To get a list of available commands with short descriptions: ::
+
+ lmi help
+
+For help on a particular registered command: ::
+
+ lmi help service
+
Running in interactive mode
---------------------------
Or it can be run in interactive mode when command is omitted: ::
lmi -h ${hostname}
+ lmi> help
+ ...
lmi> sw search django
...
lmi> sw install python-django
...
lmi> exit
-Getting help
-------------
-For detailed help run: ::
+The most important command is ``help`` which shows you possible commands.
+It also accepts arguments: ::
- lmi --help
+ lmi> help storage raid
-To get a list of available commands with short descriptions: ::
+prints help for raid subcommand of storage command. The same behaviour is achieved
+with: ::
- lmi help
+ lmi> storage raid --help
-For help on a particular registered command: ::
+Built-in commands
+~~~~~~~~~~~~~~~~~
+Interactive mode comes with few special commands. To get their list together
+with help, type: ::
+
+ lmi> : help
+
+They are prefixed with ``:`` and optional space. Currently only namespace nesting
+commands are supported. Those are ``:cd``, ``:..`` and ``:pwd``.
+
+Command namespaces
+~~~~~~~~~~~~~~~~~~
+Most end-point commands (also known as multiplexers) have one or more subcommands
+assigned. Namespace of such multiplexer is comprised of these subcommand's names.
+The root multiplexer (also known as top-level command) has namespace comprised of
+registered commands.
+
+.. figure:: _static/imode-tree.svg
+ :align: center
+ :alt: Command namespaces.
+ :width: 600px
+
+Above figure depicts command tree. On the left side is a top-level command. It
+has two registered commands (``Storage`` and ``Software``) that creates its
+namespace. Each of them has their own sub-commands -- either another
+multiplexer (``LVCmd``, ``Repository``, etc.) or an end-point command.
+
+Under each multiplexer or top-level command is corresponding prompt with path.
+This prompt becomes active when ``:cd`` command is used to nest into particular
+command's namespace. Such a namespace begins an active one. Just one namespace
+can be active at a moment. Commands from non-active namespaces are not
+available. For example if ``RAIDCmd`` is currently active -- current command
+path is ``/lmi/storage/raid``, just ``list`` and ``delete`` commands are
+available ( note that in reality ``RAIDCMD`` has a lot more subcommands). Thus
+one can not write ``enable`` or ``disable`` which belongs to ``Repository``
+command's namespace.
+
+There is also something like global namespace containing static commands and
+built-ins. Commands from global namespace are accessible from any active
+namespace.
+
+Static commands
++++++++++++++++
+
+ +------+------------------------------------------------------------------+
+ | EOF | Same as hitting ``^D``. If some nested into some subcommand's |
+ | | namespace, it will map to ``:cd ..`` and parent namespace will |
+ | | become active. If the top-level namespace is active, program |
+ | | will exit. |
+ +------+------------------------------------------------------------------+
+ | exit | Exits immediately. It accepts optional exit code as an argument. |
+ +------+------------------------------------------------------------------+
+ | help | Lists available commands. Accepts command path as an optional |
+ | | argument. |
+ +------+------------------------------------------------------------------+
- lmi help service