Delete Device (Python code sample)

Problem this snippet solves:

This Python client code sample uses Enterprise Manager's device inventory to delete a list of devices managed by the referenced Enterprise Manager.

Code :


import sys
import pycontrol.pycontrol as pc

USAGE = "Management_EM_delete_devices  Mem_username> Mem_password> [] ..."

if len(sys.argv) < MIN_ARGS:
    print "Usage %s" % USAGE

em_address = sys.argv[1]
em_username = sys.argv[2]
em_password = sys.argv[3]

device_addresses = sys.argv[4:]

ic = pc.BIGIP(
    hostname = em_address,
    username = em_username,
    password = em_password,
    fromurl = True,
    wsdls = ['Management.EM'])


print "Device(s) deleted."
Published Mar 09, 2015
Version 1.0

Was this article helpful?

No CommentsBe the first to comment