NetconfSession¶
-
class
ydk::path::
NetconfSession
: public path::Session¶ Implementation of
Session
for the netconf protocol.-
NetconfSession
(const std::string &address, const std::string &username, const std::string &password, int port = 830, const std::string &protocol = "ssh", bool on_demand = true, bool common_cache = false, int timeout = -1)¶ Constructs an instance of the
NetconfSession
to connect to a server which has to support model downloadParameters: - address – IP address of the device supporting a netconf interface
- username – Username to log in to the device
- password – Password to log in to the device
- port – Device port used to access the netconf interface. Default value is 830
- protocol –
ssh
ortcp
. - on_demand – Enable on demand downloading by default.
- common_cache – Use different directories for different connections by default.
- timeout – The timeout in microseconds, -1 for infinite timeout, 0 for non-blocking
-
NetconfSession
(const path::Repository &repo, const std::string &address, const std::string &username, const std::string &password, int port = 830, const std::string &protocol = "ssh", bool on_demand = true, int timeout = -1)¶ Constructs an instance of the
NetconfSession
using the providedRepository
Parameters: - repo – Reference to an instance of
Repository
- address – IP address of the device supporting a netconf interface
- username – Username to log in to the device
- password – Password to log in to the device
- port – Device port used to access the netconf interface. Default value is 830
- protocol –
ssh
ortcp
. - on_demand – Enable on demand downloading by default.
- timeout – The timeout in microseconds, -1 for infinite timeout, 0 for non-blocking
- repo – Reference to an instance of
-
NetconfSession
(const std::string &address, const std::string &username, const std::string &private_key_path, const std::string &public_key_path, int port = 830, bool on_demand = true, bool common_cache = false, int timeout = -1)¶ Constructs an instance of the
NetconfSession
to connect to a server which has to support model downloadParameters: - address – IP address of the device supporting a netconf interface
- username – Username to log in to the device
- private_key_path – Path to private key file.
- public_key_path – Path to public key file.
- port – Device port used to access the netconf interface. Default value is 830
- on_demand – Enable on demand downloading by default.
- common_cache – Use different directories for different connections by default.
- timeout – The timeout in microseconds, -1 for infinite timeout, 0 for non-blocking
-
NetconfSession
(const path::Repository &repo, const std::string &address, const std::string &username, const std::string &private_key_path, const std::string &public_key_path, int port = 830, bool on_demand = true, int timeout = -1)¶ Constructs an instance of the
NetconfSession
using the providedRepository
Parameters: - repo – Reference to an instance of
Repository
- address – IP address of the device supporting a netconf interface
- username – Username to log in to the device
- private_key_path – Path to private key file
- public_key_path – Path to public key file.
- port – Device port used to access the netconf interface. Default value is 830
- on_demand – Enable on demand downloading by default.
- timeout – The timeout in microseconds, -1 for infinite timeout, 0 for non-blocking
- repo – Reference to an instance of
-
path::RootSchemaNode &
get_root_schema
() const¶ Returns the
RootSchemaNode
tree supported by this instance of theNetconfSession
.Returns: Pointer to the RootSchemaNode
ornullptr
if one could not be created.
-
std::shared_ptr<path::DataNode>
invoke
(path::DataNode &datanode) const¶ -
std::string
execute_netconf_operation
(path::Rpc &rpc) const¶ Sends the specified RPC to device (similar to invoke function) and returns device response in XML encoded string.
Parameters: rpc – Reference to the Rpc
node.Returns: std::string, which represents the RPC output.
-
std::vector<std::string>
get_capabilities
() const¶ Returns a vector of the client’s capabilities
Returns: A vector of std::string
representing the client/server capabilities
-
~NetconfSession
()¶
-
std::string
-