<div dir="ltr">I'm attempting to cleanup some of my repositories via API, and am finding I can successfully remove everything except RPMs.  Right now I have a repo like 'centos-6-base' that is synced against CentOS 6 base repo.  I then copy all the content to another repo, 'local-centos-6-base'.  Normally I copy individual RPMs, but now I'd like the local-centos-6-base repo to be a clone of centos-6-base.  I figured the easy way is delete local-centos-6-base, re-create, then run 'copy all'.  However I'd like to utilize API to remove items from local-centos-6-base that do not exist in centos-6-base.<div><br></div><div>Right now my method is get all units via source = /api/v2/repositories/centos-6-base/search/units and dest = /api/v2/repositories/local-centos-6-base/search/units.  I then identify the values for each unit's unit_id that exist in dest but not in source.  I then send a POST request to /api/v2/repositories/local-centos-6-base/actions/unassociate/ that looks like this:</div><div><br></div><div>{</div><div>  'criteria': {</div><div>    'type_ids': [unit_type_id],</div><div>    'filters': {</div><div>      'unit': { 'unit_id': { '$in' unit_ids } },</div><div>    }</div><div>  }</div><div>}</div><div><br></div><div>The unit_ids is a Python list that contains all the "unit_id" values that existed in dest but not in source.  The unit_ids all have the same "unit_type_id".  So far this method seems to have worked for type_ids "package_group" and "package_category" but not for "rpm".</div><div><br></div><div>Any suggestions on what I'm doing wrong?</div><div><br></div><div>Thanks,</div><div>- Trey<br><div><br></div></div></div>