You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
This page describe how to execute <get> and <edit-config> operations about "target-output-power" XML node.
Environment Requirement
- Docker container that runs a Netconf server. This container is considered as simulated equipment and supports some OpenConfig models.
- netconf-console tool that is a simulation tool for Netconf client.
- "target-output-power" node defined in "openconfig-terminal-device.yang" as the operation target node.
Assume that we have started a Netconf server in docker as follows:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
00d7151855dc emulator_openconfig_cassini_2 "./entry.sh" 9 days ago Up 20 hours 0.0.0.0:11003->830/tcp emulator_openconfig_cassini_2_1
So we use the command listed below to send RPC request to the container:
netconf-console --host=127.0.0.1 --port=11003 -u admin -p admin --rpc={XML_FILE_NAME}
The root node of "openconfig-platform.yang" is "<components>" and its sublist "<component>" contains "<name>" node as its identity. Besides, "openconfig-terminal-device.yang" adds node "<optical-channel>" into "<component>" node. "<target-power-config>" is defined as a child node of "<optical-channel>".
<get> operation
- If you want to get the whole components, the content of XML_FILE_NAME file is:
<get>
<filter>
<components xmlns='http://openconfig.net/yang/platform'/>
</filter>
</get>
- If you want to get only the "<optical-channel>" of "<component>", the content is:
<get>
<filter>
<components xmlns="http://openconfig.net/yang/platform">
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device" />
</component>
</components>
</filter>
</get>
The output is :
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:c9220366-76bd-43ba-ad3c-13e1b7014e21">
<data>
<components xmlns="http://openconfig.net/yang/platform">
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>0</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe1</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>0</frequency>
<target-output-power>0.0</target-output-power>
<line-port>oe1</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe2</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>0</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe2</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>0</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe3</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>0</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe3</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe4</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194750000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe4</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe5</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194750000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe5</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe6</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194750000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe6</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe7</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194750000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe7</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194700000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe8</line-port>
</config>
</optical-channel>
</component>
<component>
<optical-channel xmlns="http://openconfig.net/yang/terminal-device">
<config>
<frequency>194750000</frequency>
<target-output-power>-10.0</target-output-power>
<line-port>oe8</line-port>
</config>
</optical-channel>
</component>
</components>
</data>
</rpc-reply>
<edit-config> operation