On those lines, there is an XIQ-SE python script which does something similar on Gihub:
https://github.com/extremenetworks/ExtremeScripting/tree/master/XMC_XIQ-SE/oneview_CLI_scriptsThe one called "Move to Clip Mgmt IP". It is designed to go into a switch, give it a new mgmt clip IP, then delete the existing one (clip IP or mgmt vlan IP) and re-add the device to XIQ-SE using the new IP.
It uses the same approach of packing the necessary CLI commands in a text file, then making the switch get that text file by tftp and sourcing it locally.
You can extract the variuos functions from it.