This post is more than 5 years old

1 Rookie

 • 

33 Posts

1211

April 26th, 2019 08:00

create discovery group API issue

We’re using python scripts to create device groups through API and noticed when scripting we were able to make multiples of the same name. That might cause an issue for us down the line, any tips on how to avoid this?

 

discovery1.pngdiscovery2.png

Doesn’t allow us to create Discovery Jobs with the same name through GUI

 

 

4 Operator

 • 

2.9K Posts

April 29th, 2019 15:00

I looked at the API guide, but didn't see anything to serve as a safety mechanism to prevent duplication. The simplest thing to do might be to integrate a flat file to store group names. Hopefully I can explain my thoughts a bit better below.

 

def createGroup(groupname)
     flatfile = open('C:\\DracGroups', 'a')
     if 'groupname' not in flatfile:
          *do stuff to make group*
           flatfile.append(groupname)

The other thing you might do is set up your python request to include a group getter, put the names in a set. Since the same item can't be put in a set, you could use that as a sort of screen. 

 

I'll also talk to some of my colleagues in the Systems Management escalation group to see if this is something that they would want to look into. I would imagine that duplicate names could be a problem for a lot of people.

https://www.dell.com/support/manuals/dell-openmanage-enterprise-tech-release/lex_techrel_pub/groups-service?guid=guid-894c21ef-14f8-44ea-9e98-9e4e613ca4a3

No Events found!

Top