0 Replies Latest reply on Sep 15, 2017 9:32 AM by iamarobot

    [python] update() on subnet fails

    iamarobot

      Hi,

       

      I'm trying to update the 'Comments' property on one of my subnets:

       

      code looks like this:

      ----------------------

      import orionsdk

      swis = orionsdk.SwisClient('hostname', user, passwd)

      uri = 'swis://localhost/Orion/IPAM.Subnet/SubnetId=6244,ParentId=109'

      comments = 'MY-TEST-COMMENT'

      swis.update(uri, Comments=comments)

      ----------------------

       

      API responds with this error (running inside ipython):

       

      In [51]: swis.update(uri, Comments=comments)

      ---------------------------------------------------------------------------

      HTTPError                                 Traceback (most recent call last)

      <ipython-input-55-133cfe3d54f8> in <module>()

      ----> 1 swis.update(uri, Comments=comments)

       

       

      /home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/orionsdk/swisclient.pyc in update(self, uri, **properties)

           38

           39     def update(self, uri, **properties):

      ---> 40         self._req("POST", uri, properties)

           41

           42     def delete(self, uri):

       

       

      /home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/orionsdk/swisclient.pyc in _req(self, method, frag, data)

           57                 pass;

           58

      ---> 59         resp.raise_for_status()

           60         return resp

       

       

      /home/eto/dev/venv-orionsdk/lib/python2.7/site-packages/requests/models.pyc in raise_for_status(self)

          933

          934         if http_error_msg:

      --> 935             raise HTTPError(http_error_msg, response=self)

          936

          937     def close(self):

       

       

      HTTPError: 400 Client Error: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. for url: https://hostname:17778/SolarWinds/InformationService/v3/Json/swis://localhost/Orion/IPAM.Subnet/SubnetId=6244,ParentId=109

       

      -------------------------------

       

      What am I doing wrong?

      /BR, Espen