pynetconf
libnetconf wrapper for Python
 All Classes Namespaces Functions Variables Pages
netconf Namespace Reference

The netconf is a libnetconf wrapper for Python. More...

Classes

class  Session
 Representation of a connection between a NETCONF server and client. More...
 

Functions

def setVerbosity
 Set libnetconf verbose level. More...
 
def setSyslog
 Enable/disable logging using syslog. More...
 
def setCapabilities
 Set the list of default NETCONF capabilities used for all actions where required. More...
 
def getCapabilities
 Get the list of default NETCONF capabilities used for all actions where required. More...
 
def addModel
 Set a reference to a data model (in the YIN format) that is required (e.g. More...
 
def addDatastore
 Add support of the configuration data defined in the provided data model to the datastore. More...
 
def addAugment
 Add augmenting data model. More...
 

Variables

string NETCONFv1_0 = "urn:ietf:params:netconf:base:1.0"
 NETCONF version constant. More...
 
string NETCONFv1_1 = "urn:ietf:params:netconf:base:1.1"
 NETCONF version constant. More...
 
string TRANSPORT_SSH = "ssh"
 NETCONF transport protocol constant. More...
 
string TRANSPORT_TLS = "tls"
 NETCONF transport protocol constant. More...
 
int WD_ALL = 0x0001
 NETCONF :with-defaults capability constant. More...
 
int WD_TRIM = 0x0010
 NETCONF :with-defaults capability constant. More...
 
int WD_EXPLICIT = 0x0100
 NETCONF :with-defaults capability constant. More...
 
int WD_ALL_TAGGED = 0x1000
 NETCONF :with-defaults capability constant. More...
 
int RUNNING = 3
 NETCONF datastores constant. More...
 
int STARTUP = 4
 NETCONF datastores constant. More...
 
int CANDIDATE = 5
 NETCONF datastores constant. More...
 

Detailed Description

The netconf is a libnetconf wrapper for Python.

Function Documentation

def netconf.addAugment (   model,
  transapi = None,
  features = None 
)

Add augmenting data model.

The arguments have the same meanings as for the addDatastore() function except the missing datastore argument. It is no more needed since the configuration data are placed into the datastore files of the augmented datastores.

Parameters
modelThe path to the data model in the YIN format.
transapiThe path to an optional libnetconf transAPI module (.so) implementing the augmenting data model.
featuresThe list of enabled features of this data model. By default, all features are enabled. Empty list disables all features of the model.
def netconf.addDatastore (   model,
  datastore = None,
  transapi = None,
  features = None 
)

Add support of the configuration data defined in the provided data model to the datastore.

Parameters
modelThe path to the data model in the YIN format.
datastoreThe path to the file where the configuration data related to this data model will be stored. The file does not need exist, in that case it will be created automatically. If the argument is not specified, configuration data of the data model are not handled (e.g. some data models can define only state data).
transapiThe path to an optional libnetconf transAPI module (.so) implementing the data model of the datastore.
featuresThe list of enabled features of this data model. By default, all features are enabled. Empty list disables all features of the model.
def netconf.addModel (   model,
  features = None 
)

Set a reference to a data model (in the YIN format) that is required (e.g.

imported) by some other data model.

All required models must be provided before creating the datastore using addDatastore() function.

Parameters
modelThe path to the data model file. The data model must be in the YIN format.
featuresOptional list of enabled features in this data model. By default, all features are enabled. Empty list disables all features of the model.
def netconf.getCapabilities ( )

Get the list of default NETCONF capabilities used for all actions where required.

Returns
The list of strings with the currently supported capabilities identifiers.
def netconf.setCapabilities (   list)

Set the list of default NETCONF capabilities used for all actions where required.

Parameters
listThe list of strings with the supported NETCONF capabilities. By default, this list is provided by libnetconf containing all capbilities supported by libnetconf.
def netconf.setSyslog (   enabled,
  name = None,
  option = LOG_PID,
  facility = LOG_DAEMON 
)

Enable/disable logging using syslog.

Parameters
enabledTrue/False to enable/disable logging (enabled by default).
nameThe text prepended to every message, typically the program name. If None, the program name is used.
optionFlags which control the operation of openlog(3).
facilitySpecifies what type of program is logging the message. For details see openlog(3) man page.
def netconf.setVerbosity (   level)

Set libnetconf verbose level.

When initiated, it starts with value 0 (show only errors).

Parameters
levelVerbosity level, allowed values are as follows:
  • 0 (errors)
  • 1 (warnings)
  • 2 (verbose)
  • 3 (debug)

Variable Documentation

int CANDIDATE = 5

NETCONF datastores constant.

NETCONF candidate datastore. Available only if the NETCONF :candidate capability is supported by the server.

string NETCONFv1_0 = "urn:ietf:params:netconf:base:1.0"

NETCONF version constant.

The identifier for version 1.0 of the NETCONF protocol in the :meth:connect method.

string NETCONFv1_1 = "urn:ietf:params:netconf:base:1.1"

NETCONF version constant.

The identifier for version 1.1 of the NETCONF protocol in the :meth:connect method.

int RUNNING = 3

NETCONF datastores constant.

NETCONF running datastore.

int STARTUP = 4

NETCONF datastores constant.

NETCONF startup datastore. Available only if the NETCONF :startup capability is supported by the server.

string TRANSPORT_SSH = "ssh"

NETCONF transport protocol constant.

The identifier for NETCONF over SSH transport.

string TRANSPORT_TLS = "tls"

NETCONF transport protocol constant.

The identifier for NETCONF over TLS transport.

int WD_ALL = 0x0001

NETCONF :with-defaults capability constant.

:with-default's 'report-all' retrieval mode. All data nodes are reported including any data nodes considered to be default data.

int WD_ALL_TAGGED = 0x1000

NETCONF :with-defaults capability constant.

:with-default's 'report-all-tagged' retrieval mode. Same as the 'report-all' mode except the data nodes containing default data include an XML attribute indicating this condition.

int WD_EXPLICIT = 0x0100

NETCONF :with-defaults capability constant.

:with-default's 'explicit' retrieval mode. Only data nodes explicitly set by the client (including those set to its schema default value) are reported.

int WD_TRIM = 0x0010

NETCONF :with-defaults capability constant.

:with-default's 'trim' retrieval mode. Data nodes containing the schema default value are not reported.