This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Need help to create python script to delete Thin AP

I've tried to create a python script to delete a thin AP using SWQL/SWIS.

From my script:

query = "SELECT TOP 5\
IPAddress,Name,\
ControllerName,\
DisplayName,\
Uri\
FROM Orion.Packages.Wireless.AccessPoints\
WHERE IPAddress = '"+thinap_ip+"' and Name = '"+thinap_name+"'"

results = swis.query(query)

for row in results['results']:
   print("{IPAddress} {Name} {ControllerName} {DisplayName} {Uri}".format(**row))
   input("Delete AP Press Enter to continue...")

for row in results['results']:
   swis.delete(row['Uri'])

I'm finding the AP just fine but when it tries to delete it, I get the following error:

10.47.159.99 013-1CO-ADM-119 VAVAB01A.CTRL01 013-1CO-ADM-119 swis://USASHSLW01.LYV.LiveNation.com/Orion/Orion.Nodes/NodeID=1919/AccessPoints/ID=326993

Delete AP Press Enter to continue...

Traceback (most recent call last):

  File "Delete Thin AP.py", line 47, in <module>

    main()

  File "Delete Thin AP.py", line 43, in main

    swis.delete(row['Uri'])

  File "/Users/brian.booher/Library/Python/3.8/lib/python/site-packages/orionsdk/swisclient.py", line 49, in delete

    self._req("DELETE", uri)

  File "/Users/brian.booher/Library/Python/3.8/lib/python/site-packages/orionsdk/swisclient.py", line 63, in _req

    resp.raise_for_status()

  File "/Users/brian.booher/Library/Python/3.8/lib/python/site-packages/requests/models.py", line 960, in raise_for_status

    raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 400 Client Error: Invalid key properties specified for entity Orion.Packages.Wireless.AccessPoints.

Parameter name: filter for url: overwatch.lyv.livenation.com:17778/.../ID=326993

I've used a similar construct to delete interfaces.

Any ideas on why this isn't working?