ā01-14-2019 06:13 AM
Hi!
Im trying to export my apic policy via a python script. Creating an export policy works also creating the remote destination works.
But how do I tell the APIC to use the destination I created for the export policy. There is no attribute in the cobra.model.config.ExportP module to set the export destination
See my code so far below:
#import neccessary modules ..
loginSession = LoginSession(apicUrl, 'admin', 'admin', requestFormat='xml')
moDir = MoDirectory(loginSession)
moDir.login()
uniMo = moDir.lookupByClass('polUni')
topuniMo = moDir.lookupByDn((str(moDir.lookupByClass('polUni')[0].dn)))
fabricInst = cobra.model.fabric.Inst(topuniMo)
backup = cobra.model.config.ExportP(fabricInst, name="Backup_ACIsim", snapshot="true", adminSt="triggered" )
bckpath = cobra.model.file.RemotePath(fabricInst, host="192.168.1.9", name="NAS", nameAlias="", protocol="scp", remotePath="", remotePort="22", userName="admin", userPasswd="admin" )
c = cobra.mit.request.ConfigRequest()
c.addMo(fabricInst)
moDir.commit(c)
Appreciate any hint!
Solved! Go to Solution.
ā01-16-2019 02:25 AM
Hello,
I don't use the Cobra SDK, but from MIT perspective, I guess you should add child details into your Export policy.
Under cobra.model.config.ExportP you should have a class cobra.model.config.RsRemotePath in which you will set the property tnFileRemotePathName="bckpath"
Remi
ā01-16-2019 02:25 AM
Hello,
I don't use the Cobra SDK, but from MIT perspective, I guess you should add child details into your Export policy.
Under cobra.model.config.ExportP you should have a class cobra.model.config.RsRemotePath in which you will set the property tnFileRemotePathName="bckpath"
Remi
ā01-16-2019 01:30 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide