Introduction

Utility library for configuring NETCONF topology node to connect to network elements. This operates on the legacy network-topology model, with topology-id="topology-netconf".

Keywords

Arguments

restconf_url device_names deadline_seconds use_node_encapsulation

Documentation

Await all specified devices to become connected in NETCONF topology at specified RESTCONF URL.

Arguments

restconf_url device_name_prefix device_ipaddress device_port device_count use_node_encapsulation first_device_id
= 1

Documentation

Generate device_count names in format "$device_name_prefix-$i" and configure them into NETCONF topology at specified RESTCONF URL. For example:

configure_device_range("http://127.0.0.1:8181/rests", "example", "127.0.0.1", 1730, 5)

would configure devices "example-0" through "example-4" to connect to 127.0.0.0:1730.

configure_device_range("http://127.0.0.1:8181/rests", "example", "127.0.0.1", 1720, 5, 5)

would configure devices "example-5" through "example-9" to connect to 127.0.0.0:1720.

This method assumes RFC8040 with RFC7952 encoding and support for RFC8072 (YANG patch). Payload it generates looks roughly like this: { "ietf-yang-patch:yang-patch" : { "patch-id" : "test" "edit" : [ { "edit-id" : "test-edit", "operation" : "replace", "target" : "/node=test-node", "value" : { "node" : [ { "node-id" : "test-node" "netconf-node-topology:host" : "127.0.0.1", "netconf-node-topology:port" : 17830, "netconf-node-topology:username" : "admin", "netconf-node-topology:password" : "topsecret", "netconf-node-topology:keepalive-delay" : 0, } ] } } ], } }

Arguments

msg * args ** kwargs

Documentation

Log a message with severity 'DEBUG' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format.

Get

Arguments

url params
= None
** kwargs

Documentation

Sends a GET request.

:param url: URL for the new :class:Request object. :param params: (optional) Dictionary, list of tuples or bytes to send in the query string for the :class:Request. :param \*\*kwargs: Optional arguments that request takes. :return: :class:Response <Response> object :rtype: requests.Response

Arguments

name device_ipaddress device_port

Arguments

name device_ipaddress device_port

Arguments

msg * args ** kwargs

Documentation

Log a message with severity 'INFO' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format.

Arguments

args

Arguments

url data
= None
** kwargs

Documentation

Sends a PATCH request.

:param url: URL for the new :class:Request object. :param data: (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the :class:Request. :param json: (optional) A JSON serializable Python object to send in the body of the :class:Request. :param \*\*kwargs: Optional arguments that request takes. :return: :class:Response <Response> object :rtype: requests.Response

Arguments

* args

Documentation

sleep(seconds)

Delay execution for a given number of seconds. The argument may be a floating point number for subsecond precision.

Arguments

* args

Documentation

time() -> floating point number

Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.

Documentation

Generate a random UUID.

TopologyNetconfNodes

image/svg+xml