cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

Add a node to a container using Python

Jump to solution

Hello Community,

      Does anyone know how to add a node to a container without using a dynamic query in Python? I got the dynamic query to work, but wanted to see if there is a way to add the nodes to the groups directly without a dynamic query.

Thank you,

JAF

0 Kudos
1 Solution
Level 19

Adding a single object to a group is almost the same as adding a filter rule to a group. In place of the filter, put the Uri of the object you want to add. For example, to add node 33 to group 8, do this:

swis.invoke('Orion.Container', 'AddDefinition', 8, {'Name':'cpe','Definition':'swis://tim.swdev.local/Orion/Orion.Nodes/NodeID=33'})

View solution in original post

2 Replies
Level 19

Adding a single object to a group is almost the same as adding a filter rule to a group. In place of the filter, put the Uri of the object you want to add. For example, to add node 33 to group 8, do this:

swis.invoke('Orion.Container', 'AddDefinition', 8, {'Name':'cpe','Definition':'swis://tim.swdev.local/Orion/Orion.Nodes/NodeID=33'})

View solution in original post

Thank you TDanner! I had added one manually and checked the database to see what the definition looked like and then saw your answer to confirm it. I appreciate your help!

Thank you,

JAF

0 Kudos