Discussion:
Problems deleting devices via REST
panoptician
2012-12-13 23:05:20 UTC
Permalink
panoptician [http://community.zenoss.org/people/panoptician] created the discussion

"Problems deleting devices via REST"

To view the discussion, visit: http://community.zenoss.org/message/70525#70525

--------------------------------------------------------------
I recently decided to try automating adds/deletions using REST calls. I was successful art first, but after crawling my infrastructure to load devices, something seems to have gone wrong with deletions. I was successfully using this URL at first:

http://admin:***@zenoss:8080/zport/dmd/Devices/Server/Linux/devices/10.189.183.116/deleteDevice http://admin:***@zenoss:8080/zport/dmd/Devices/Server/Linux/devices/10.189.183.116/deleteDevice

but now when I run that against a device, I no longer receive any output and the device is left in limbo. It's no longer visible from the web UI, but trying to re-add it via REST gives the error that the device already exists. Running a second deleteDevice gives output, claiming that the device DOESN'T exist.

I found that I'm able to re-add the device using the web UI, so apparently there are different checks on if a device does or does not exist. Besides any cruft that may be getting created in the database, my primary worry is the inability to get output from the initial deleteDevice command so that I can test the successfulness. Might anyone hazard to guess what's going wrong here? I've tried doing a zencatalog --reindex so far without luck.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/70525#70525]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2012-12-17 21:38:40 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Problems deleting devices via REST"

To view the discussion, visit: http://community.zenoss.org/message/70595#70595

--------------------------------------------------------------
pan:

Try adding the device back via the webUI. I'm wondering if this is an issue with the legacy calls.

Best,

--Shane Scott (Hackman238)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/70595#70595]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
panoptician
2012-12-18 21:24:49 UTC
Permalink
panoptician [http://community.zenoss.org/people/panoptician] created the discussion

"Re: Problems deleting devices via REST"

To view the discussion, visit: http://community.zenoss.org/message/70638#70638

--------------------------------------------------------------
I can indeed add the device back via webUI, but I just did that out of curiosity more than as a use case - I generally intend for deleted devices to stay deleted.

Because we sometimes bring up and terminate lots of instances at once, I built some logic into the script to re-try the add/delete if there's competition writing to the database. deleteDevice no longer giving output is complicating my attempt to do this. I tried looking through the logs and was only able to find record of the URL being called in Z2.log

Are REST calls depricated now?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/70638#70638]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2012-12-20 00:29:15 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Problems deleting devices via REST"

To view the discussion, visit: http://community.zenoss.org/message/70667#70667

--------------------------------------------------------------
panoptician:

I'd stick to the JSON where possible.

--Shane Scott (Hackman238)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/70667#70667]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...