4 Replies Latest reply on Aug 28, 2017 2:24 PM by tdanner

    IPAM API Bug?

    ioan_bucsa

      When adding IPAddresses to a subnet by using the followind inside a loop :

       

      $IPProperties = @{

          SubnetId=$SubnetId;

          IPAddress=$Current_ip   

        }

      New-SwisObject $IPAMswis -EntityType "IPAM.IPNode" -Properties $IPProperties

       

      you only see the first page of IP addresses populated in the GUI. However if you query the DB they are all there.

      The reason behind this is that the column IPOrdinal in the IPAM_GroupNodetable does not get automatically populated and is left out as NULL. The fix that I found was manually inserting values (0 - [IP_Count]) into the table via SQL (the field is not editable via the API).

       

      Anyone else encounter this bug?

        • Re: IPAM API Bug?
          tdanner

          The IPAM dev team confirmed this bug. No workaround beyond what you already discovered.

            • Re: IPAM API Bug?
              ioan_bucsa

              Got another one:

               

              Set-SwisObject : Operation not supported on IPAM.GroupNode

              At line:23 char:1

              + Set-SwisObject $IPAMswis -Uri $URI -Properties @{DisableAutoScanning="false";}

              + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                  + CategoryInfo          : InvalidOperation: (:) [Set-SwisObject], FaultException`1

                  + FullyQualifiedErrorId : SwisError,SwisPowerShell.SetSwisObject

               

              New-Swisobject can write DisableAutoScanning for a subnet but Set-SwisObject cannot. Actually the error message seems to state that Set is not supported for IPAM.GroupNode at all (even though the documentation states otherwise).

              • Re: IPAM API Bug?
                ioan_bucsa

                And another one:

                 

                New-SwisObject : Unable to create IPAM.Subnet. Details : Error : In property CIDR. Reason : CIDR must be greater than 21..

                 

                When adding a Subnet via the API the CIDR must be at least 21 (you cannot add larger subnets) even though the limitation is not there when adding subnets via the GUI ; I was able to add a /8 subnet (not supernet).

                 

                Also, since you cannot add an IPAM.GroupNode object and you cannot modify GroupType (to be able to add Groups and Supernets) this seriously limits the scope of the API (at least when it comes to adding data).