Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

Delete Device

VERSION 1 
Created on: Sep 14, 2009 11:16 AM by Noel Brockett - Last Modified:  Apr 20, 2010 3:57 PM by Matt Ray

How to delete a device using a REST or XML-RPC call

 

Devices can be deleted through the UI but also through a programmatic interface. This how to will describe deleting a device using that interface.

Using a REST call

Deleting a device through a rest call can be done by a simple web get. In this example we will use wget to delete a device. If you use wget don't for get to escape the "&" or wrap the URL in single quotes.

 

[zenos@zenoss $] wget 'http://admin:zenoss@MYHOST:8080/zport/dmd/Devices/Server/Linux/devices/MYDEVICE/deleteDevice'

 

The result of this command will delete the device: MYDEVICE.

Using an XML-RPC Call from Python

This is an example of how to delete a device using python. Because XML-RPC can be used from any language feel free to use your favorite. What is important here is the base URL in ServerProxy, passing named parameters, and calling "deleteDevice" on your proxy object.

 

>>> from xmlrpclib import ServerProxy
>>> serv = ServerProxy('http://admin:zenoss@MYHOST:8080/zport/dmd/Devices/Server/Linux/devices/MYDEVICE')
>>> serv.deleteDevice()
Comments (1)