RESTCONF Service Provider

class ydk.providers.RestconfServiceProvider(repo, address, username, password, port, encoding)

Constructs an instance of the RestconfServiceProvider to connect to a server which has to support model download. Since the class is a Python wrapper for C++ RestconfServiceProvider class, which has clean up methods implemented in its destructor. The user does not need to worry about close RESTCONF session.

Parameters:
  • repo – (Repository) User provided repository stores cached models
  • address – (str) IP address of the device supporting a restconf interface
  • username – (str) Username to log in to the device
  • password – (str) Password to log in to the device
  • port – (int) Device port used to access the restconf interface, the default value being 80
  • encoding – (EncodingFormat) Type of encoding to be used for the payload, the default being JSON
get_encoding()

Returns the type of encoding supported by the service provider.

get_session()

Returns the instance of the NetconfSession used to connect to the netconf server

Returns:A NetconfSession instance.