1 Reply Latest reply on Oct 29, 2013 3:31 PM by tdanner

    perl swis bulkupdates

    chris.engstrom

      I was trying to build a perl script to do bulkupdates via swis.

      I tried to modify the sample to use a string that I create via code like the following:

       

      my $endpoint = "https://$hostname:17778/SolarWinds/InformationService/v3/OrionBasic";

      my $swis = SW::InformationService->new();

      ....

                  $updateString .= '\'swis://server.domain.com/Orion/Orion.Nodes/NodeID=' . $node . "\',\n";

      print $swis->BulkUpdate([

        $updateString

          ], {'Caption'=>'New Name'});


      this is the failure truncated:

      <detail><InformationServiceFaultContract xmlns="http://schemas.solarwinds.com/2007/08/informationservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message>Invalid SWIS uri at character 5: Invalid scheme.&#xD;

      Parameter name: uri</Message></InformationServiceFaultContract></detail>

        • Re: perl swis bulkupdates
          tdanner

          The first parameter to BulkUpdate should be a list of strings where each string is a SWIS Uri. It looks like you are building one string containing Uris enclosed in single quote characters and separated by newlines. Try something like this:

           

          $first = 'swis://localhost/Orion/Orion.Nodes/NodeID=1';

          $second = 'swis://localhost/Orion/Orion.Nodes/NodeID=2';

          @uris = ();

          push(@uris, $first);

          push(@uris, $second);

          $swis->BulkUpdate(@uris, {'Caption'=>'New Name'});

          2 of 2 people found this helpful