cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2095
Views
0
Helpful
1
Replies

Removing Contracts and FilterEntries

irocha001
Level 1
Level 1

Hi,

  As shown in aci_demo_contract.py, I was able to create a new contract and setup several filters as well. When I try to remove a contract or filter, using mark_as_deleted() and pushing to APIC, everything work as usual but in the Secutity Policies -> Filters the property created with <contract name> + <entry name> is not removed. See below:

  ...

contract = Contract('mysql-contract', tenant)

entry1 = FilterEntry('entry1',

                     applyToFrag='no',

                     arpOpc='unspecified',

                     dFromPort='3306',

                     dToPort='3306',

                     etherT='ip',

                     prot='tcp',

                     sFromPort='1',

                     sToPort='65535',

                     tcpRules='unspecified',

                     parent=contract)

...

<push to APIC>

...

entry1.mark_as_deleted()

contract.mark_as_deleted()

...

<push to APIC>

...

After that, inside Secutity Policies -> Filters I still get 'mysql-contractentry1'. What should I do to remove all the entries related to my contract?


Thanks in advance,


   Ivan Rocha



1 Reply 1

davbark2
Level 1
Level 1

Hi Ivan,

Sorry your question has been neglected for so long.

If it still matters,  using entry1.mark_as deleted()  only deletes an entry in that filter, but not the filter itself.  I think you want to use the following instead, to remove the filter and any entries it contains, along with the contract:

filter = entry1.get_parent()

filter.mark_as_deleted()

contract.mark_as_deleted()

Hope that helps,

Dave