Table Of Contents
Making a NETCONF Request to the Cisco E-DI Server
NETCONF Client GUI
The NETCONF client is a simple GUI client application that can be used to understand the implementation of the NETCONF protocol in Cisco E-DI.
This appendix includes the following information:
•Making a NETCONF Request to the Cisco E-DI Server
Client Application Files
The client is distributed as a set of three jar files, one startup script and a directory of example requests.
Copy the client files from Cisco E-DI Documentation CD-ROM to D:\eft\client. The structure should look similar to the structure in figure that follows.
Figure B-1 Typical Client File Structure
Starting a NETCONF Session
You will need the following information before you can create a NETCONF session:
1. The location of the Cisco E-DI server. For example, the localhost if it is running locally, or the IP address.
2. The username and password to login to Cisco E-DI.
3. The IP address of the device to be managed through the NETCONF protocol.
Start the client GUI, enter the following command:
D:\eft\client>bin\ncclient .\examplesThe client GUI opens. See the following figure.
Figure B-2 GUI Example
Note The GUI has not connected to Cisco E-DI server yet.
Enter the following information:
•Cisco E-DI server address (EDI Server field)
•Username ( Login field)
•Password (Password field)
•Device IP address (NC Session with Device field)
•Device login—Required when session based device authentication is enabled.
•Device password—Required when session based device authentication is enabled.
Note Cisco E-DI can have session based device authentication enabled or disabled. The device credentials (device login and password) are required when session based device authentication is enabled. Otherwise, these credentials are optional.
Note When the session is established, the fields cannot be edited. To change the information, you will have to close the current client session, and open a new session.
Click Connect to E-DI.
When a session is created, the Session ID is added to the device IP field. The Connect to E-DI button now says Send Hello, and the button outline is colored cyan. See the figure that follows.
Figure B-3 Active NETCONF Session Window
Note The session is active when the session ID is displayed.
Making a NETCONF Request to the Cisco E-DI Server
When a session with Cisco E-DI is created, you see a window similar to Figure B-3. When a client connects to Cisco E-DI, it sends a hello message from the NETCONF agent which contains the session id. In Figure B-3, the hello message is displayed in the response text area (lower left pane). The client extracts the session id, this is displayed in the Session id field.
The button is now Send Hello. As specified in the NETCONF protocol, both the agent (Cisco E-DI) and the manager (the GUI client) are required to send hello messages.
The default hello message from the client to Cisco E-DI is displayed in the request text area (upper left pane). You can edit this message, for example, to specify a different set of capabilities.
At this point, you can enter the device information (the device id, device login and password), and the tool will provide the associate-devices message which can be used after send hello is sent.
Note The tool now has a connection with the Cisco E-DI server, but Cisco E-DI does not know which device you want to manage through the XML PI.
Enter the device information, and click Send Hello.
Figure B-4 Making a NETCONF Request
The tool prepares the default associate devices message, and displays it in the request text area. See Figure B-5. Associate devices is a Cisco E-DI specific operation. It is required to inform Cisco E-DI about the device the client wants to maange through the XML PI.
Click Associate With Device.
Figure B-5 Associate With Devices
When Associate devices is successful, Cisco E-DI now knows which device is being managed in this NETCONF session, and is ready to start NETCONF operations. See Figure B-6.
You can now send protocol messages such as get-config, and edit-config. In the following example, the user navigates to the device specific get-config protocol message.
Figure B-6 Starting a NETCONF Operation
Know the Device Type
Each device type and OS combination has its own set of data model elements (the XSD). In operations where you have to express device commands in XML format, you will need to refer to the device specific namespace. The operations edit-config and get-config or get with filter will require this information.
An operation where the user is not expressing a specific command set in XML format does not need this namespace information. For example, lock is one operation which refers to a data store, and not configuration data.
If you do not know the device type, you can obtain the information from Cisco E-DI as follows:
Use an operation that does not require the namespace to be specified. For example, you can use a get operation without the filter element. This means that the get operation without a filter element looks the same no matter what device you are talking to. Select any get from any device specific example in the hierarchy in the right pane.
In Figure B-7, a get from the Cat6500 set of examples is selected, and the response shows that the device 172.25.86.106 is a Cisco2600.
Now that you know the device type, you can use the Cisco2600 specific example set. In this example, navigate through the hierarchy to locate the Cisco 2600 to see the running configuration of the device 172.25.86.106. See Figure B-8.
Figure B-7 Finding the Device Type
Figure B-8 Displaying the Running Configuration
Ending the NETCONF Session
When you want to close the session, you can use the close-session.xml file from the Sample requests in the right pane. You will see a window similar to Figure B-9.
Click Submit Request.
Note You can also click the Close button to close the window, and end the session.
Figure B-9 Closing a Session