Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Python Orion SDK swis.update broken after IPAM 4.6.0 upgrade

$
0
0

Before upgrade, the Python Orion SDK swis.update was working fine. After upgrade, the Python Orion SDK swis.update broke with the error HTTP error 400: "The given key was not present in the dictionary”

 

Full technical details

Before upgrade: IPAM 4.5.2, SAM  6.4.0, VMAN 8.0.0, NPM 12.1, 

After upgrade:  IPAM 4.6.0, SAM 6.5.0, VMAN 8.1.0, NPM 12.2

 

The Python code

 

    swis = orionsdk.SwisClient(solarwinds_url, solarwinds_user, solarwinds_pass)

    ipFree = swis.query(

        "SELECT TOP 1 I.uri, I.DisplayName FROM IPAM.IPNode I WHERE Status=2 " +

        " AND I.DNSBackward is NULL " +

        " AND I.Subnet.DisplayName = '" + solarwinds_network + "'")

    ipAddr=ipFree['results'][0]['DisplayName']

    ipUri=ipFree['results'][0]['uri']

    swis.update(ipUri , Status=1, DNSBackward=customer_hostname)

 

 

Did a HTTP request and reponse capture

  1. Find the next free IP (This works)
    URL: https://solarwinds.url.com:17778
    POST /SolarWinds/InformationService/v3/Json/Query
    Request: {"query": "SELECT TOP 1 I.uri, I.DisplayName FROM IPAM.IPNode I WHERE Status=2  AND I.DNSBackward is NULL  AND I.Subnet.DisplayName = \'Mgt Services\'", "parameters": {}}
    Response: [{u'DisplayName': u'10.10.14.26', u'uri': u'swis://HE1-SWAPP-01.headquarters.healthedge.com/Orion/IPAM.IPNode/IpNodeId=9316'}]
  2. Change IP Node status to Used (This does not work)
    URL: https://solarwinds.url.com:17778

POST /SolarWinds/InformationService/v3/Json/swis://HE1-SWAPP-01.headquarters.healthedge.com/Orion/IPAM.IPNode/IpNodeId=9316
Request: {"Status": 1, "DNSBackward": "mynewdomain.url.com"}
Response: 'HTTP/1.1 400 Bad Request  "The given key was not present in the dictionary”

 

 

 

There is an open Solarwinds ticket for this issue 35188

 

Message was edited by: Jirawat Uttayaya


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>