Automation

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  Netconf commit-result

    Posted 08-26-2021 09:06

    Hello.
    I am trying to get revision number when I commit using netconf. I have read that this should be possible when my client send http://xml.juniper.net/netconf/junos/1.0  in capability exchange (| NETCONF XML Management Protocol Developer Guide | Juniper Networks TechLibrary

    Juniper remove preview
    | NETCONF XML Management Protocol Developer Guide | Juniper Networks TechLibrary
    Tag element returned by the Junos XML protocol server in response to a request by a client application. The element contains information about the requested commit operation performed by the server on a particular Routing Engine.
    View this on Juniper >

    )
    I didn't managed when I have tested on a vSRX using 20.3R1.8

    This is an example netconf session


    # ssh root@srx0 -s netconf
    <!-- No zombies were killed during the creation of this user interface -->
    <!-- user root, class super-user -->
    <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
    <capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
    <capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</capability>
    <capability>http://xml.juniper.net/netconf/junos/1.0</capability>
    <capability>http://xml.juniper.net/dmi/system/1.0</capability>
    </capabilities>
    <session-id>85872</session-id>
    </hello>
    ]]>]]>

    <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:confirmed-commit:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
    <capability>urn:ietf:params:xml:ns:netconf:base:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:candidate:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:validate:1.0</capability>
    <capability>urn:ietf:params:xml:ns:netconf:capability:url:1.0?scheme=http,ftp,file</capability>
    <capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring</capability>
    <capability>http://xml.juniper.net/netconf/junos/1.0</capability>
    <capability>http://xml.juniper.net/dmi/system/1.0</capability>
    </capabilities>
    </hello>
    ]]>]]>

    <?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a05b5072-d658-4324-b1dc-b6507aa15348"><commit-configuration/></nc:rpc>]]>]]>
    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/20.3R0/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a05b5072-d658-4324-b1dc-b6507aa15348">
    <ok/>
    </rpc-reply>
    ]]>]]>

    <rpc>
    <get-software-information/>
    </rpc>

    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/20.3R0/junos">
    <software-information>
    <host-name>srx0</host-name>
    <product-model>vSRX</product-model>
    <product-name>vsrx</product-name>
    <junos-version>20.3R1.8</junos-version>
    <package-information>
    <name>os-kernel</name>
    <package-name>os-kernel-xen-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS Kernel 64-bit XEN [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-libs</name>
    <package-name>os-libs-11-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS libs [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-runtime</name>
    <package-name>os-runtime-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS runtime [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>zoneinfo</name>
    <package-name>os-zoneinfo-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS time zone information [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-libs-compat32</name>
    <package-name>os-libs-compat32-11-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS libs compat32 [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-compat32</name>
    <package-name>os-compat32-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS 32-bit compatibility [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>py-extensions2</name>
    <package-name>py-extensions2-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS py extensions2 [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>py-extensions</name>
    <package-name>py-extensions-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS py extensions [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>py-base2</name>
    <package-name>py-base2-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS py base2 [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>py-base</name>
    <package-name>py-base-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS py base [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>os-vmguest</name>
    <package-name>os-vmguest-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS vmguest [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-support</name>
    <package-name>os-support-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS support utilities [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-crypto</name>
    <package-name>os-crypto-x86-64-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS crypto [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>os-boot-junos</name>
    <package-name>os-boot-junos-ve-x86-32-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS OS boot-ve files [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>netstack</name>
    <package-name>junos-net-prd-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS network stack and utilities [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-libs</name>
    <package-name>junos-libs-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS libs [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-libs-compat32</name>
    <package-name>junos-libs-compat32-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS libs compat32 [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-runtime</name>
    <package-name>junos-runtime-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS runtime [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>na-telemetry</name>
    <package-name>na-telemetry-x86-32-20.3R1.8</package-name>
    <comment>JUNOS na telemetry [20.3R1.8]</comment>
    </package-information>
    <package-information>
    <name>jweb-srxtvp</name>
    <package-name>jweb-srxtvp-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS Web Management Platform Package [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-vmguest-platform</name>
    <package-name>junos-modules-vsrx-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS vsrx modules [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-libs-compat32-platform</name>
    <package-name>junos-libs-compat32-srx-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx libs compat32 [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-runtime-platform</name>
    <package-name>junos-runtime-srx-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx runtime [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-platform-platform</name>
    <package-name>junos-platform-srx-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx platform support [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-platform</name>
    <package-name>junos-platform-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS common platform support [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-runtime-vsrx</name>
    <package-name>junos-runtime-vsrx-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS vsrx runtime [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-probe</name>
    <package-name>junos-probe-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS probe utility [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-pppoe</name>
    <package-name>junos-pppoe-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS pppoe [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-openconfig</name>
    <package-name>junos-openconfig-x86-32-20.3R1.8</package-name>
    <comment>JUNOS Openconfig [20.3R1.8]</comment>
    </package-information>
    <package-information>
    <name>junos-net-platform</name>
    <package-name>junos-net-mtx-prd-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS mtx network modules [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-modules</name>
    <package-name>junos-modules-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS modules [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-libs-platform</name>
    <package-name>junos-libs-srx-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx libs [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-hsm</name>
    <package-name>junos-hsm-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS hsm [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-dp-crypto-support-platform</name>
    <package-name>junos-dp-crypto-support-srx-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx Data Plane Crypto Support [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-daemons</name>
    <package-name>junos-daemons-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS daemons [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-daemons-platform</name>
    <package-name>junos-daemons-srx-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS srx daemons [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-cloud-init</name>
    <package-name>junos-cloud-init-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS cloud init [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>junos-appsecure-tvp</name>
    <package-name>junos-appsecure-tvp-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS SRX TVP AppQos Daemon [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>jsd-jet-1</name>
    <package-name>jsd-x86-32-20.3R1.8-jet-1</package-name>
    <comment>JUNOS Extension Toolkit [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>jmrt-base</name>
    <package-name>jmrt-base-x86-64-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS Juniper Malware Removal Tool (JMRT) [1.0.0+20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>jinsight</name>
    <package-name>jinsight-x86-32-20.3R1.8</package-name>
    <comment>JUNOS J-Insight [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>jdocs</name>
    <package-name>jdocs-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS Online Documentation [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    <package-information>
    <name>jail-runtime</name>
    <package-name>jail-runtime-x86-32-20200908.87c9d89_builder_stable_11</package-name>
    <comment>JUNOS jail runtime [20200908.87c9d89_builder_stable_11]</comment>
    </package-information>
    <package-information>
    <name>fips-mode</name>
    <package-name>fips-mode-x86-32-20200921.081424_builder_junos_203_r1</package-name>
    <comment>JUNOS FIPS mode utilities [20200921.081424_builder_junos_203_r1]</comment>
    </package-information>
    </software-information>
    </rpc-reply>
    ]]>]]>

    Thank you



    ------------------------------
    Victor Serbu
    ------------------------------


  • 2.  RE: Netconf commit-result

    Posted 08-27-2021 05:35
    As per the documentation, this is supported as a proprietary extension to Netconf, so your software should meet this requirement.

    Can you attempt trying to commit some configuration and observe results? You should see something like this:

    <rpc-reply xmlns:junos="http://xml.juniper.net/junos/15.1R1/junos">
        <commit-results>
            <routing-engine>
                <name>re0</name>
                <commit-success/>       
                <commit-revision-information>
                    <old-db-revision>re0-1446493106-63</old-db-revision>
                    <new-db-revision>re0-1446493220-64</new-db-revision>
                </commit-revision-information>
            </routing-engine>
        </commit-results>
    </rpc-reply>​

    https://www.juniper.net/documentation/us/en/software/junos/junos-xml-protocol/topics/task/junos-xml-protocol-configuration-commit-revision-identifier.html

    Elvin



  • 3.  RE: Netconf commit-result

    Posted 08-27-2021 09:03
    Hello. I have included in first message a full netconf session.
    In hello message I have sent all capabilities that junos sent, but commit-result doesn't contains proprietary reply. I only get

    <?xml version="1.0" encoding="UTF-8"?><nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a05b5072-d658-4324-b1dc-b6507aa15348"><commit-configuration/></nc:rpc>]]>]]>

    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/20.3R0/junos" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:a05b5072-d658-4324-b1dc-b6507aa15348">
    <ok/>
    </rpc-reply>
    ]]>]]>


    ------------------------------
    Victor Serbu
    ------------------------------