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.

Please help about correct python command to add a new member to a existing group

existing groups organized as follow:

 

country

     office A

          switches

          routers

     office B

          switches

          routers

adding another office C. I can create the new groups for Office C but don't know how to update the 'country' container it has another member

I tried : swis.invoke('Orion.Container', "AddDefinition", int(rid), [{'Name': siteName, 'Definition': uri}])

where rid = 983, is the country group.

uri = swis://xxxx.y.com/Orion/Orion.Groups/ContainerID=1623 is the newly created member group (office c)

Got error message as:

Traceback (most recent call last):

 

  File "add_site.py", line 207, in <module>

swis.invoke('Orion.Container', "AddDefinition", int(rid), [{'Name': siteName, 'Definition': uri}

])

File "D:\Pcodes\swisclient.py", line 29, in invoke

    "Invoke/{}/{}".format(entity, verb), args).json()

  File "D:\Pcodes\swisclient.py", line 59, in _req

     resp.raise_for_status()

File "c:\python35\lib\site-packages\requests\models.py", line 909, in raise_for_status

  raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 400 Client Error: Verb Orion.Container.AddDefinition cannot unpackage parameter 1 for url:

https://xxxd016191.yyy.com:17778/SolarWinds/InformationService/v3/Json/Invoke/Orion.Container/AddDefinition