Library scope: | GLOBAL |
---|
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".
Await all specified devices to become connected in NETCONF topology at specified RESTCONF URL.
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, } ] } } ], } }
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.
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
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.
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
sleep(seconds)
Delay execution for a given number of seconds. The argument may be a floating point number for subsecond precision.
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.
Generate a random UUID.