NETCONF client module.
The NETCONF client is compliant with RFC 4741 NETCONF Configuration Protocol and RFC 4742 Using the NETCONF Configuration Protocol over Secure SHell (SSH)..
For each server to test against, the following entry can be added to a configuration file:
{server_id(),options()}.
The
If no configuration exists for a server, a session can still be
opened by calling
The NETCONF server uses
suite() -> [{ct_hooks, [{cth_conn_log, [{conn_mod(),hook_options()}]}]}].
Hook option
The sent and received NETCONF data is logged to a separate text file "as is" without any formatting. A link to the file is added to the test case HTML log.
.The sent and received NETCONF data is logged to a separate text file with XML data nicely indented. A link to the file is added to the test case HTML log.
The sent and received NETCONF traffic is pretty printed directly in the test case HTML log.
NETCONF traffic is not logged.
By default, all NETCONF traffic is logged in one single log file.
However, different connections can be logged in separate files.
To do this, use hook option
Option
The hook options can also be specified in a configuration file with
configuration variable
{ct_conn_log,[{conn_mod(),hook_options()}]}.
For example:
{ct_conn_log,[{ct_netconfc,[{log_type,pretty}, {hosts,[key_or_name()]}]}]}
Hook options specified in a configuration file overwrite the hard-coded hook options in the test suite.
Logging Example 1:
The following
suite() -> [{ct_hooks, [{cth_conn_log, [{ct_netconfc,[{log_type,pretty}}, {hosts,[nc_server1,nc_server2]}]} ]}]}].
Connections must be opened as follows:
open(nc_server1,[...]), open(nc_server2,[...]).
Logging Example 2:
The following configuration file causes raw logging of all NETCONF traffic in to one single text file:
{ct_conn_log,[{ct_netconfc,[{log_type,raw}]}]}.
The
suite() -> [{ct_hooks, [{cth_conn_log, []}]}].
The same
The NETCONF client is also compliant with RFC 5277 NETCONF Event Notifications, which defines a mechanism for an asynchronous message notification delivery service for the NETCONF protocol.
Specific functions to support this are
For
Opaque reference for a connection (NETCONF session). For more
information, see module
For
Options used for setting up an SSH connection to a NETCONF server.
The identity of a server, specified in a configuration file.
This type is further described in application
For details about the data format for the string values, see "XML Schema for Event Notifications" in RFC 5277.
This date and time identifier has the same format as the XML type
[-]CCYY-MM-DDThh:mm:ss[.s][Z|(+|-)hh:mm]
Equivalent to
Executes an action. If the return type is void,
Equivalent to
Requests graceful termination of the session associated with the client.
When a NETCONF server receives a
Equivalent to
Copies configuration data.
Which source and target options that can be issued depends on the
capabilities supported by the server. That is,
Creates a subscription for event notifications.
This function sets up a subscription for NETCONF event
notifications of the specified stream type, matching the specified
filter. The calling process receives notifications as messages of
type
Optional parameter that indicates which stream of event is of interest. If not present, events in the default NETCONF stream are sent.
Optional parameter that indicates which subset of all possible events is of interest. The parameter format is the same as that of the filter parameter in the NETCONF protocol operations. If not present, all events not precluded by other parameters are sent.
Optional parameter used to trigger the replay feature and
indicate that the replay is to start at the time specified.
If
It is not valid to specify start times that are later than
the current time. If
This parameter is of type
Optional parameter used with the optional replay feature
to indicate the newest notifications of interest. If
Must be used with and be later than
For more details about the event notification mechanism, see RFC 5277.
Equivalent to
Deletes configuration data.
The running configuration cannot be deleted and
Equivalent to
If
If
Edits configuration data.
By default only the running target is available, unless the server
includes
[{'default-operation', ["none"]}, {'error-option', ["rollback-on-error"]}]
Equivalent to
Gets data.
This operation returns both configuration and state data from the server.
Filter type
Equivalent to
Returns the server side capabilities.
The following capability identifiers, defined in RFC 4741 NETCONF Configuration Protocol, can be returned:
More identifiers can exist, for example, server-side namespace.
Equivalent to
Gets configuration data.
To be able to access another source than
Filter type
Equivalent to
Sends a request to get the specified event streams.
<netconf xmlns="urn:ietf:params:xml:ns:netmod:notification"> <streams> <stream> <name>StreamName1</name> </stream> <stream> <name>StreamName2</name> </stream> ... </streams> </netconf>
If
<netconf xmlns="urn:ietf:params:xml:ns:netmod:notification"> <streams/> </netconf>
If more complex filtering is needed, use
Equivalent to
Returns the session Id associated with the specified client.
Equivalent to
Equivalent to
Exchanges
Adds optional capabilities and sends a
Equivalent to
Forces termination of the session associated with the supplied session Id.
The server side must abort any ongoing operations, release any locks and resources associated with the session, and close any associated connections.
Only if the server is in the confirmed commit phase, the configuration is restored to its state before entering the confirmed commit phase. Otherwise, no configuration rollback is performed.
If the specified
Equivalent to
Unlocks the configuration target.
Which target parameters that can be used depends on if
Operation
Opens a NETCONF session, but does not send
As
Opens a name NETCONF session, but does not send
As
Opens a NETCONF session and exchanges
If the server options are specified in a configuration file,
or if a named client is needed for logging purposes (see section
The opaque
Option
Opens a named NETCONF session and exchanges
If
Argument
If the server is not specified in a configuration file, use
The opaque
Option
See also
Equivalent to
Sends an XML document to the server.
The specified XML document is sent "as is" to the server. This function can be used for sending XML documents that cannot be expressed by other interface functions in this module.
Equivalent to
Sends a NETCONF
The specified XML document is wrapped in a valid NETCONF
This function can be used for sending
Equivalent to
Unlocks the configuration target.
If the client earlier has acquired a lock through