Downloading YANG files via NETCONF from a device to a YANG repository
=====================================================================

If you have defined a device profile for a device that supports NETCONF and
supports in particular the ``ietf-netconf-monitoring`` model,
and you have the ``yangsuite-netconf`` YANG Suite plugin installed, you can
download YANG models directly from the device.

1. On the "Setup → YANG files and repositories" page, after selecting the desired repository,
   in the "Add modules to repository" section, select the "NETCONF" tab.

2. Select your device from the "Select device profile" menu.

3. (Optional) The "Check device connectivity" button repeats the same
   connectivity check(s) as when you were creating the device profile.
   This can be useful if, for example, you are logging back into YANG Suite
   after some time away and want to confirm that the device is still reachable.

   .. image:: images/connectivity_check_results.png
      :alt: Screenshot showing connectivity check results dialog

4. Select "Get schema list."
   After a moment the page will update to display a listing
   of YANG modules supported by this device.

   .. image:: images/schema_list.png
      :alt: Screenshot showing updated schema listing for a device.

5. You can select individual modules from this list, or click the
   "Select all" button to select the entire list.

6. Select "Download selected schemas."

7. You will see a progress bar updating as the individual modules
   are downloaded from the device and saved to the YANG Suite server.
   When complete, a pop-up dialog will summarize the results.

   .. image:: images/repo_add_results.png
      :alt: Screenshot showing dialog summarizing results of YANG module
            download to repository

8. You can now continue as described at :doc:`create_repository`.
