Forum Discussion
Wyko
Altostratus
Aug 05, 2021How 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?...
Dario_Garrido
Noctilucent
Aug 27, 2021Hello Wyko.
This command give you a JSON structure with all the configuration sets located in "mynode".
mynode = session.tm.ltm.nodes.node.load(name='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 = session.tm.ltm.nodes.node.create(name='mynode', address='5.5.5.5', partition='Common', ... etc ...)
-------
Bash execution is possible with Python SDK
command = session.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "netstat -rn"')
print(command.commandResult)
Regards,
Dario.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects