Skip to content

Load Config XML #2

@sek3b

Description

@sek3b

Daryl,

I am having trouble using the router.load(); function i am attempting to load

<configuration>
    <policy-options>
        <prefix-list>
            <name>Shayne_TEST</name>
            <prefix-list-item>
                <name>10.10.0.5/32</name>
            </prefix-list-item>
        </prefix-list>
    </policy-options>
</configuration>

But i can not seem to get it to work. My assumption was this should work

var xml = "<configuration><policy-options><prefix-list><name>Shayne_TEST</name><prefix-list-item delete='delete'><name>10.10.0.5/32</name></prefix-list-item></prefix-list></policy-options></configuration>";

router.load({config: xml, action: 'merge', format: 'xml'}, commitConf);

But it always returns

{ rpcError: {"rpc_reply":{"$":{"xmlns_junos":"http://xml.juniper.net/junos/11.4R7/junos","message_id":101,"xmlns":"urn:ietf:params:xml:ns:netconf:base:1.0"},"load_configuration_results":{"rpc_error":{"error_severity":"error","error_info":{"bad_element":"<policy-options>\n<prefix-list>\n<name>Shayne_TEST</name>\n<prefix-list-item>\n<name>10.10.0.5/32</name>\n</prefix-list-item>\n</prefix-list>\n</policy-options>"},"error_message":"syntax error, expecting </configuration>"},"load_error_count":1}}}

I have gotten this to work by using the following.

policy-options {
    prefix-list Shayne_TEST {
        10.10.4.0/32;
    }
}

router.load({config: configData, action: 'merge', format: 'text'},
                         commitConf);

Any clarification would be greatly appreciated and i thank you very much for your work on this module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions