Class NetConfClient
Contains operation for working with NetConf server.
public class NetConfClient : BaseClient, IBaseClient, IDisposable
- Inheritance
-
NetConfClient
- Implements
- Inherited Members
Constructors
NetConfClient(ConnectionInfo)
Initializes a new instance of the NetConfClient class.
public NetConfClient(ConnectionInfo connectionInfo)
Parameters
connectionInfoConnectionInfoThe connection info.
Exceptions
- ArgumentNullException
connectionInfois null.
NetConfClient(string, int, string, params IPrivateKeySource[])
Initializes a new instance of the NetConfClient class.
public NetConfClient(string host, int port, string username, params IPrivateKeySource[] keyFiles)
Parameters
hoststringConnection host.
portintConnection port.
usernamestringAuthentication username.
keyFilesIPrivateKeySource[]Authentication private key file(s) .
Exceptions
- ArgumentNullException
keyFilesis null.- ArgumentException
hostis invalid, -or-usernameis null or contains only whitespace characters.- ArgumentOutOfRangeException
NetConfClient(string, int, string, string)
Initializes a new instance of the NetConfClient class.
public NetConfClient(string host, int port, string username, string password)
Parameters
hoststringConnection host.
portintConnection port.
usernamestringAuthentication username.
passwordstringAuthentication password.
Exceptions
- ArgumentNullException
passwordis null.- ArgumentException
hostis invalid, orusernameis null or contains only whitespace characters.- ArgumentOutOfRangeException
NetConfClient(string, string, params IPrivateKeySource[])
Initializes a new instance of the NetConfClient class.
public NetConfClient(string host, string username, params IPrivateKeySource[] keyFiles)
Parameters
hoststringConnection host.
usernamestringAuthentication username.
keyFilesIPrivateKeySource[]Authentication private key file(s) .
Exceptions
- ArgumentNullException
keyFilesis null.- ArgumentException
hostis invalid, -or-usernameis null or contains only whitespace characters.
NetConfClient(string, string, string)
Initializes a new instance of the NetConfClient class.
public NetConfClient(string host, string username, string password)
Parameters
hoststringConnection host.
usernamestringAuthentication username.
passwordstringAuthentication password.
Exceptions
- ArgumentNullException
passwordis null.- ArgumentException
hostis invalid, orusernameis null or contains only whitespace characters.
Properties
AutomaticMessageIdHandling
Gets or sets a value indicating whether automatic message id handling is enabled.
public bool AutomaticMessageIdHandling { get; set; }
Property Value
ClientCapabilities
Gets the NetConf client capabilities.
public XmlDocument ClientCapabilities { get; }
Property Value
- XmlDocument
The NetConf client capabilities.
Exceptions
- SshConnectionException
Client is not connected.
OperationTimeout
Gets or sets the operation timeout.
public TimeSpan OperationTimeout { get; set; }
Property Value
- TimeSpan
The timeout to wait until an operation completes. The default value is negative one (-1) milliseconds, which indicates an infinite time-out period.
Exceptions
- ArgumentOutOfRangeException
valuerepresents a value that is less than -1 or greater than MaxValue milliseconds.
ServerCapabilities
Gets the NetConf server capabilities.
public XmlDocument ServerCapabilities { get; }
Property Value
- XmlDocument
The NetConf server capabilities.
Exceptions
- SshConnectionException
Client is not connected.
Methods
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrue to release both managed and unmanaged resources; false to release only unmanaged resources.
OnConnected()
Called when client is connected to the server.
protected override void OnConnected()
OnDisconnecting()
Called when client is disconnecting from the server.
protected override void OnDisconnecting()
SendCloseRpc()
Sends the close RPC.
public XmlDocument SendCloseRpc()
Returns
- XmlDocument
Reply message to closing RPC request.
Exceptions
- SshConnectionException
Client is not connected.
SendReceiveRpc(string)
Sends the receive RPC.
public XmlDocument SendReceiveRpc(string xml)
Parameters
xmlstringThe XML.
Returns
- XmlDocument
Reply message to RPC request.
Examples
var rpcXmlTemplate = "{0}"'
var rpcResponse = client.SendReceiveRpc(String.Format(rpcXmlTemplate, ""));
SendReceiveRpc(XmlDocument)
Sends the receive RPC.
public XmlDocument SendReceiveRpc(XmlDocument rpc)
Parameters
rpcXmlDocumentThe RPC.
Returns
- XmlDocument
Reply message to RPC request.
Examples
var rpcXmlTemplate = "{0}"'
rpc.LoadXml(String.Format(rpcXmlTemplate, ""));
var rpcResponse = client.SendReceiveRpc(rpc);
Exceptions
- SshConnectionException
Client is not connected.