cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

481
Views
5
Helpful
2
Replies
Highlighted
Beginner

APIC Cobra SDK - export Policy to remote location

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!

Everyone's tags (5)
1 ACCEPTED SOLUTION

Accepted Solutions
Beginner

Re: APIC Cobra SDK - export Policy to remote location

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

View solution in original post

2 REPLIES 2
Beginner

Re: APIC Cobra SDK - export Policy to remote location

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

View solution in original post

Beginner

Re: APIC Cobra SDK - export Policy to remote location

Yeah, that should work. Thank you.
Content for Community-Ad
FusionCharts will render here