Forum Discussion

Wyko's avatar
Icon for Altostratus rankAltostratus
Aug 05, 2021

How to Duplicate an Object from REST API / Python SDK

Question: How can you use the Python SDK to create a new object (like a pool) from an existing object?



As a bonus, is there any way to generate the CLI commands for an action from the SDK? My use case is that I use the SDK to get information from the live devices, and then I use that info to create change documents for other implementers to follow. They need written CLI commands. So then, given the newly duplicated object we just generated in the CLI, is there a way to create the CLI commands to make it?

1 Reply

  • Hello Wyko.

    This command give you a JSON structure with all the configuration sets located in "mynode".

    mynode ='mynode', partition='Common')

    For creation of a new object, you need to specify all the configuration parameters that you would like to use from the other object.

    mynode ='mynode', address='', partition='Common', ... etc ...)


    Bash execution is possible with Python SDK

    command ='run', utilCmdArgs='-c "netstat -rn"')