示例#1
0
	def __init__(self):
		Node.__init__(self)
		self.addContent("""<h2>Copy configuration</h2><p><ul>""")

		tmp = ModuleManager.getInstance().prefixes
		for key, value in tmp.items():
			self.addContent("<li>%s: %s</li>" %  (key, value))

		self.addContent("</ul><form method='POST' class='operation' enctype='multipart/form-data'>")
		self.addSourceForm()
		self.addContent("""<input type="radio" name="source" value="config"/>config (inline)
		<br/>Inline configuration:<br/> 
		<textarea name="inlineconfig" rows="20" cols="70"><ycp:netconf""")
		
		# Prepare textarea content to help people doing a subtree filtering request:
		attlist = ""
		for key, value in tmp.items():
			attlist = attlist + " xmlns:%s='%s'" %  (key, value)

		self.addContent(attlist)
		self.addContent(">\n\n")
		self.addContent("</ycp:netconf></textarea><br/>")
		self.addTargetForm()
		self.addOperationForm("copy-config")
		self.addContent("</form></p>")
示例#2
0
    def __init__(self, agent):

        Node.__init__(self)

        self.addContent("""
		<h2>Get the configuration</h2>
		<p>If you perform a get request, the source will be silently ignored. To write request more easily, you can use the following defined namespace prefixes:<ul>"""
                        )

        tmp = ModuleManager.getInstance().prefixes
        for key, value in tmp.items():
            if value in agent.getCapabilities():
                self.addContent("<li>%s: %s</li>" % (key, value))

        # Prepare textarea content to help people doing a subtree filtering request:
        attlist = ""
        for key, value in tmp.items():
            attlist = attlist + " xmlns:%s=\"%s\"" % (key, value)

        self.addContent(
            "</ul><form method='POST' class='operation' enctype='multipart/form-data'>"
        )
        self.addSourceForm()

        self.addContent("""Subtree filtering expression:<br/>
		<textarea name="filter" rows="20" cols="70"><ycp:netconf""" + attlist +
                        ">\n\n" + """</ycp:netconf></textarea><br/>
		<input type="hidden" name="type" value="subtree">
		<input type="submit" name="operation" value="get"/>
		<input type="submit" name="operation" value="get-config"/>
		</p>
		</form>
		""")
    def __init__(self):

        Node.__init__(self)

        self.addContent("<h2>Validate configuration</h2>")
        self.addContent(
            "<p>This page allows to validate a source datastore. If you select the inline config, you have to fill the text field. The namespace prefixes are there to make it easier to write the inline configuration. Otherwise, if you select another source, this text field will be ignored.<ul>"
        )

        tmp = ModuleManager.getInstance().prefixes
        for key, value in tmp.items():
            self.addContent("<li>%s: %s</li>" % (key, value))

        # Prepare textarea content to help people doing a subtree filtering request:
        attlist = ""
        for key, value in tmp.items():
            attlist = attlist + " xmlns:%s=\"%s\"" % (key, value)

        self.addContent(
            """</ul><form method='POST' class='operation' enctype='multipart/form-data'>"""
        )
        self.addSourceForm()
        self.addContent(
            """<input type="radio" name="source" value="config"/>config (inline)
		<br/>Inline configuration:<br/> 
		<textarea name="inlineconfig" rows="20" cols="70"><ycp:netconf""" + attlist +
            ">\n\n" + """</ycp:netconf></textarea><br/>""")
        self.addOperationForm("validate")
        self.addContent("</form></p>")
示例#4
0
    def __init__(self, agent):

        Node.__init__(self)

        self.addContent("""
		<h2>Get the configuration</h2>
		<p>If you perform a get request, the source will be silently ignored. To write request more easily, you can use the following defined namespace prefixes:<ul>"""
                        )

        tmp = ModuleManager.getInstance().prefixes
        for key, value in tmp.items():
            if value in agent.getCapabilities():
                self.addContent("<li>%s: %s</li>" % (key, value))

        self.addContent(
            "</ul><form method='POST' class='operation' enctype='multipart/form-data'>"
        )
        self.addSourceForm()
        self.addContent("""XPath expression:<br/>
		<input type="text" size="50" name="filter" value="/ycp:netconf"/><br/>
		<input type="hidden" name="type" value="xpath">
		<input type="submit" name="operation" value="get"/>
		<input type="submit" name="operation" value="get-config"/>
		</form>
		</p>""")
示例#5
0
    def __init__(self):

        Node.__init__(self)

        self.addContent(
            "<h2>Delete configuration</h2><p>Choose the target datastore that you want to delete.<form method='POST' class='operation' enctype='multipart/form-data'>"
        )
        self.addTargetForm()
        self.addOperationForm("delete-config")
        self.addContent("</form></p>")
示例#6
0
 def __init__(self, name, path, namespace, httpSessionId):
     Node.__init__(self)
     self.name = name
     self.path = path
     self.namespace = namespace
     self.httpSession = SessionManager.getInstance().getSessionHTTP(
         httpSessionId)
     self.netconfSession = self.httpSession.getCurrentNetconfSession()
     self.xsldocuri = "//%s/Components/Modules/%s/%s.xsl" % (
         C.YENCAP_MAN_HOME, self.name, self.name)
     self.title = "Module %s" % (self.name)
示例#7
0
	def __init__(self):
		Node.__init__(self)
		self.addContent("""
		<h2>Kill a Netconf session on this agent</h2>
		<p>
		<form method="POST" class="operation" enctype="multipart/form-data">
		Session identifier:<br/>
		<input type="text" name="session-id" value=""/><br/>""")
		
		self.addOperationForm("kill-session")
		self.addContent("</form></p>")
示例#8
0
	def __init__(self):
		Node.__init__(self)
		self.addContent("""
		<h2>Candidate capabilities</h2>
		<p>From this page, commit or discard changes made to the Candidate configuration datastore.
		<form method="POST" class="operation" enctype="multipart/form-data">
		<input type="submit" name="operation" value="commit"/>
		<input type="submit" name="operation" value="discard-changes"/>
		</form>
		</p>
		""")
示例#9
0
    def __init__(self):
        Node.__init__(self)
        self.addContent("""
		<h2>Role activation</h2>
		<p>To be granted more privileges, please activate some roles.</p>
		<form method="POST" class="operation" enctype="multipart/form-data">
    	Choose Role: <input type="text" name="roleName" value="SuperManager"/>
		<input type="hidden" name="operation" value="rbac">
		<input type="submit" name="rbacOp" value="activate"/>
		<input type="submit" name="rbacOp" value="deactivate"/>
		</form>
		""")
示例#10
0
	def __init__(self, agent):
		Node.__init__(self)
		self.addContent("<ul><li><a href='/main'>Back to main menu</a></li><li><a href='/agent'>%s</a></li><li><a href='/role'>Role (de)activation</a></li><li><a href='/modules'>Modules</a></li><li><ul>" % agent.getIp())

		# Setup Module Menu
		mManager = ModuleManager.getInstance()
		dictio = mManager.modules
		for capability in agent.getCapabilities():
			for moduleName in dictio.keys():
				namespace = dictio[moduleName]["namespace"]
				if namespace == capability:
					self.addContent("<li><a href='/modules/%s'>%s</a></li>\n" % (moduleName,moduleName))

		self.addContent("""</ul>
          </li>
          <li><a href='#'>Standard operations</a></li>
          <li>
            <ul>""")
		
		# add manu 16/9/9
		
		if agent.isYangEnabled():
			self.addContent("""
              <li><a href='/yang'>Yang Browsing</a></li>
              """)
		
		# add manu 16/9/9
		
		self.addContent("""
              <li><a href='/lock'>Lock/Unlock</a></li>
              <li><a href='/copy'>Copy Configuration</a></li>
              <li><a href='/delete'>Delete Configuration</a></li>
              <li><a href='/kill'>Kill Session</a></li>
              <li><a href='/xpath'>XPath Filtering</a></li>
              <li><a href='/subtree'>Subtree Filtering</a></li>
              <li><a href='/edit'>Edit Configuration</a></li>
            </ul>
          </li>
          <li><a href='#'>Capabilities</a></li>
          <li>
            <ul>
              <li><a href='/candidate'>Candidate</a></li>
              <li><a href='/validate'>Validate</a></li>
            </ul>
          </li>
          <li><a href='/close'>Close Session</a></li>
        </ul>
		""")
示例#11
0
    def __init__(self, agent):

        Node.__init__(self)

        self.addContent("""
		<h2>Lock/Unlock configuration</h2>
		<p>Locking a configuration allows to avoid conflicts between different updates from multiple Netconf sessions.
		<form method="POST" class="operation" enctype="multipart/form-data">""")

        self.addTargetForm()
        self.addContent("""
		<input type="image" src="/Images/emblem-readonlyL.png" name="operation" value="lock" title="lock"/>
		<input type="image" src="/Images/dialog-passwordL.png" name="operation" value="unlock" title="unlock"/>
		</form>
		</p>
		""")
示例#12
0
    def __init__(self):
        Node.__init__(self)

        self.addContent("""
		<h2>Welcome to YencaPManager.</h2>
		<p><br/>Please fill the login information.<br/><br/>
		<form method="POST" class="operation" enctype="multipart/form-data">
		<table border="0">
		<tr><td align="right" width="30%">Login</td><td align="left"><input type="text" name="login" value=""/></td><tr/>
		<tr><td align="right" width="30%">Password</td><td align="left"><input type="password" name="password" value=""/></td><tr/>
		<tr><td align="right" width="30%">&nbsp;</td><td align="left"><input type="hidden" name="operation" value="login">
		<input type="reset" value="reset"/>
		<input type="submit" value="login"/></td><tr/>
		</table>
		</form>
		</p>
		""")
	def __init__(self):
		Node.__init__(self)

		self.addContent("""
		
		<h2>Deploy/Undeploy module</h2>
		<p>
			<ul>
				<li><i>Deploy</i> installs the module in the Netconf agent.</li>
				<li><i>Undeploy</i> uninstalls the module in the Netconf agent.</li>
			</ul>
		<form method="POST" class="operation" enctype="multipart/form-data">
		Please set the module parameters:<br/>
		<table>
    	<tr><td align="right">Name:</td><td align="left"><input type="text" name="name" value="Foo"/></td></tr>
		<tr><td align="right">Xpath:</td><td><input type="text" name="xpath" value="/ycp:netconf/fp:foo"/></td></tr>
		<tr><td align="right">Namespace:</td><td><input type="text" name="namespace" value="urn:loria:madynes:ensuite:yencap:module:Foo:1.0"/></td></tr>
		<tr><td align="right">Prefered prefix:</td><td><input type="text" name="pref" value="fp"/></td></tr>
		<tr><td align="right">Cache lifetime</td><td><input type="text" name="cachelifetime" value="100"/></td></tr>
		<tr><td align="right">Upload module file (tar.gz):</td><td><input type="file" name="file"/></td></tr>
		</table>
		<input type="hidden" name="operation" value="manage-mib-modules">
		<input type="submit" name="mmOp" value="deploy"/>
		<input type="submit" name="mmOp" value="undeploy"/>
		</form>
		</p>

		<h2>Load/Unload module</h2>
		<p>
			<ul>
				<li><i>Load</i> will load the module in the Netconf agent. The module must exist in the agent.</li>
				<li><i>Unload</i> will unload the module from the Netconf agent. But the module still exist.</li>
			</ul>
		Please set the module parameters:<br/>
		<form method="POST" class="operation" enctype="multipart/form-data">
    	<input type="text" name="name" value="Foo"/><br/>
		<input type="hidden" name="operation" value="manage-mib-modules">
		<input type="image" src="/Images/edit-redoL.png" name="mmOp" value="load" title="load"/>
		<input type="image" src="/Images/edit-undoL.png" name="mmOp" value="unload" title="unload"/>
		</form>
		</p>
		""")
示例#14
0
    def __init__(self,
                 filter_ip="Not filtered",
                 filter_function="Not filtered",
                 filter_status="Not filtered",
                 filter_capabilities="Not filtered"):
        Node.__init__(self)

        self.addContent(
            "<form method='POST' class='operation' enctype='multipart/form-data'><ul>"
        )

        self.addContent(self.getIPPart(filter_ip))
        self.addContent(self.getFunctionPart(filter_function))
        self.addContent(self.getStatusPart(filter_status))
        self.addContent(self.getCapabilitiesPart(filter_capabilities))

        self.addContent("""
		<li><br/><center><input type="image" src="/Images/system-searchL.png" name="operation" value="filter" title="filter"/></center></li>
		<li><p><strong>HELP</strong><br/>Apply filters to choose the Netconf devices that fit your management requirements. (Ex: 192.*.0.*)</p></li>
		</ul>
		<input type="hidden" name="page" value="1">
		</form>""")
示例#15
0
    def __init__(self):
        Node.__init__(self)

        # Prepare textarea content to help people doing a subtree filtering request:
        attlist = ""
        tmp = ModuleManager.getInstance().prefixes
        for key, value in tmp.items():
            attlist = attlist + " xmlns:%s=\"%s\"" % (key, value)

        attlist = attlist + " xmlns:xc=\"urn:ietf:params:xml:ns:netconf:base:1.0\""

        self.addContent("""
		<h2>Edit the configuration</h2>
		<p>This form allows to build a customized edit-config operation with all possible options.
		<form method="POST" class="operation" enctype="multipart/form-data">
		Target:<br/>
		<input type="radio" name="target" value="running" checked/>running
		<input type="radio" name="target" value="candidate"/>candidate
		<input type="radio" name="target" value="startup"/>startup<br/>
		Default operation:<br/>
		<input type="radio" name="default-operation" value="merge" checked/>merge
		<input type="radio" name="default-operation" value="replace"/>replace
		<input type="radio" name="default-operation" value="none"/>none<br/>
		Error option:<br/>
		<input type="radio" name="error-option" value="stop-on-error" checked/>Stop on error
		<input type="radio" name="error-option" value="continue-on-error"/>Continue on error
		<input type="radio" name="error-option" value="rollback-on-error"/>Rollback on error<br/>
		Error option:<br/>
		<input type="radio" name="test-option" value="test-then-set" checked/>Test then set
		<input type="radio" name="test-option" value="set"/>Set<br/>
		Edit config subtree:<br/>
		<textarea name="subtree" rows="20" cols="70"><ycp:netconf""" + attlist +
                        ">\n\n" + """</ycp:netconf></textarea><br/>
		<input type="hidden" name="operation" value="edit-config">
		<input type="submit" value="edit-config"/>
		</form>
		</p>
		""")
示例#16
0
 def __init__(self, agent):
     Node.__init__(self)
     self.addContent(
         "<ul><li><a href='main'>Back to main menu</a></li><li><a href='#'>%s</a></li></ul>"
         % agent.getIp())