4 Replies Latest reply on Sep 8, 2016 9:30 AM by jchattaway

    NCM soap interface - getting started

    jchattaway

      Hi I’m evaluating Solarwinds NCM and as part of that this I’m looking at the webapi for integrating into an operator toolset. The developer environment will be C# .NET so the soap interface is the easiest to use in a service library as functions can be generated from the wsdl.

      I have downloaded the SDK and skimmed some of the pdf files, which unless I have missed something to me it looks like the interface isn’t very user friendly.

      I then hoped that someone had asked the questions I’m asking below, but as they haven’t I will and I’ll try to answer them hopefully others will find this useful in the future.  Any help will be gratefully received I’m going to try and post the request and response XML for what I consider to the minimum operations required for this product to be useable in our environment.

      Operations

      1. Create device groups
      2. Create a SNMPv2 device adding into the appropriate group.
      3. Associated SSH credentials to device so SCP is used for upload/download of config .
      4. Configure the device into a scheduled job for backing up config.
      5. Get a list of configs available against the device.
      6. Get any config from that list (text so this can be displayed on a browser)
      7. Compare two configs (text so this can be displayed on a browser)
      8. Trigger NCM to pull the config from the device into its config list/management (manual one off rather than scheduled)
      9. Trigger NCM to push a saved config to a device.
      10. Run a “Config Change Template” against a device passing in required variables.
        • Re: NCM soap interface - getting started
          jchattaway

          Having looked into this a bit more it appears that the soap wsdl is just a thin wrapper around CRUD and Query interface.  There is no schema (hence objects) for say create Cirrus.Node... Also you have to parse XML documents again because there is no schema behind the responses.

          So I believe that it is actually easier to use REST and get json back.  Anyone else look into this?  What are your thoughts?

           

          Queries seem fairly easy once you have found what you want in the SWQL studio.

          You can for instance POST

          https://localhost:17778/SolarWinds/InformationService/v3/Json/Query

          With a body of

          {"query":"SELECT ConfigID, BaseConfigID, NodeID, ConfigTitle, DownloadTime, AttemptedDownloadTime, ModifiedTime, ConfigType, Config,Baseline, IsIndexed FROM Cirrus.ConfigArchive"}

           

          Then using a combination of SWQL studio and the schema definition provided in the SDK you can

          1. Use schema definition to see entities and the rest verbs associated with the,
          2. Use SWQL studio to see the attributes required to be supplied with the Verbs by querying Metadata.VerbArgument table.

           

          Then you can for instance diff configs by POST

          https://localhost:17778/SolarWinds/InformationService/v3/Json/Invoke/Cirrus.ConfigArchive/Diff

          With a body of

          ["757bcdd8-118d-4098-980d-03b96fff9b63", "c0dc19cd-b080-423c-ae8c-1e36939ba59a"]

          It is worth noting on NCM 7.5 that this finds a diff on all lines of the config with whitespace differences that aren't there.

           

          But for creating entries I can't find any documentation on what needs to be created and what attributes against those entities are mandatory.

          This thread suggests there are multiple operations required, other threads where people have had issues suggest certain attributes are mandatory

          REST CRUD fails to load devices with Vendor Product or proper Polling

            • Re: NCM soap interface - getting started
              tdanner

              Your assessment of SOAP vs. REST support in SWIS is accurate. In general I would recommend using REST - it is just easier to work with.

               

              Re: creating entities. There is no complete documentation for what properties are required. For specific use cases I can either point you to existing documentation/samples or answer your questions.

            • Re: NCM soap interface - getting started
              jeff.stewart

              1.       Create device groups - Sample code in PowerShell for managing Orion groups: https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/Groups.ps1

              2.       Create a SNMPv2 device adding into the appropriate group. - Sample code for adding an SNMPv2 node: https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/CRUD.AddNode.ps1

              3.       Associated SSH credentials to device so SCP is used for upload/download of config .  – This can be done by invoking NCM SWIS verbs.

              4.       Configure the device into a scheduled job for backing up config. – Not easy but still can be done by invoking NCM SWIS verbs.

              5.       Get a list of configs available against the device- This can be done by executing SWQL query.

              6.       Get any config from that list (text so this can be displayed on a browser)- This can be done by executing SWQL query.

              7.       Compare two configs (text so this can be displayed on a browser) - This can be done by invoking NCM SWIS verbs.

              8.       Trigger NCM to pull the config from the device into its config list/management (manual one off rather than scheduled)- This can be done by invoking NCM SWIS verbs.

              9.       Trigger NCM to push a saved config to a device.- This can be done by invoking NCM SWIS verbs.

              10.      Run a “Config Change Template” against a device passing in required variables.  – Not possible to do this.