<div dir="ltr">That works, at least sort of.  I noticed that the unit_id values for non-rpm content types don't seem to be unique between repos.  Also my script failed to remove ~2000 RPMs from my local-centos-6-base repo.  Curious if there's some special technique required to make one repo a mirror of the other when one only receives content via "copy".  My goal is to sync centos-6-base using feed URL, then copy individual content as needed into local-centos-6-base.  Occasionally, like I am doing now, I'd like the local-centos-6-base repo to be a mirror of centos-6-base.  I'm thinking the best option is either delete and recreate my local-centos-6-base repo and run 'copy all' or add a feed to that repo that's the same as centos-6-base with --remove-missing added.<div><br></div><div>If anyone has done something similar, I'd be interested to know how this problem was solved.</div><div><br></div><div>Thanks,</div><div>- Trey</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 13, 2015 at 7:37 AM, Mihai Ibanescu <span dir="ltr"><<a href="mailto:mihai.ibanescu@gmail.com" target="_blank">mihai.ibanescu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p dir="ltr">Try association for filter, instead of unit.<br>
Just ran into this situation in the past week.</p>
</span><p dir="ltr">▶ Show quoted text</p>
<div class="gmail_quote"><span class="">On Dec 13, 2015 05:05, "Trey Dockendorf" <<a href="mailto:treydock@gmail.com" target="_blank">treydock@gmail.com</a>> wrote:<br type="attribution"></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><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>
<br></div></div><span class="">_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-list</a><br></span></blockquote></div>
</blockquote></div><br></div>