Difference between revisions of "Using nxshell to automate bulk operations"

Jump to navigation Jump to search
Line 51: Line 51:
= Sample Scripts =
= Sample Scripts =
== Create Container and some nodes ==
== Create Container and some nodes ==
<pre>parentId = objects.GenericObject.SERVICEROOT # Infrastructure Services root
<syntaxhighlight lang="python">
parentId = objects.GenericObject.SERVICEROOT # Infrastructure Services root
cd = NXCObjectCreationData(objects.GenericObject.OBJECT_CONTAINER, "Sample Container", parentId);
cd = NXCObjectCreationData(objects.GenericObject.OBJECT_CONTAINER, "Sample Container", parentId);
containerId = session.createObject(cd) # createObject return ID of newly created object
containerId = session.createObject(cd) # createObject return ID of newly created object
Line 66: Line 67:
     nodeId = session.createObject(cd)
     nodeId = session.createObject(cd)
     print '"%s" created, id=%d' % (name, nodeId)
     print '"%s" created, id=%d' % (name, nodeId)
</pre>
</syntaxhighlight>


== Change Object comments ==
== Change Object comments ==
683

edits

Navigation menu