<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>For the copy case, it's common to copy more than one type, I think, so probably 'plugin/copy/ types=[]' makes more sense.</div></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Thanks for this thread. I'm +1 on documenting these general conventions 
in the pulpcore-plugin docs for plugin writers. Maybe we could include a
 section on URLs so plugin writers could self-assess if they are doing 
this or not. <br></div></blockquote><div><br></div><div></div><div>Regarding POST /pulp/api/v3/plugin/action/ types=[]</div><div><br></div><div>Since this doesn't need to do anything plugin specific (as the type is part of the base content model), my thought was that we would just make it part of core.  Individual plugins would then implement endpoints for more specific behaviors.  I would hope that each plugin wouldn't need to implement the exact same code to copy units based on their type.<br></div><div><br></div><div>My thoughts are based on these use cases (I hope I'm not missing anything):<br></div><div><br></div><div>A) copying specific content units by content ID</div><div>B) copying the contents of entire repositories into other repositories<br></div><div>C) copying all units of a type (e.g. RPM)  from one repo to another, with no filtering<br></div><div>D) copying units of a type (e.g. RPM) from one repo to another if they match some user-provided filters (e.g. name, version)<br></div><div>E) copying units of a type (e.g. RPM) from one repo to another if they match some user-provided filters (e.g. name, version), and also copying all their dependencies (using various schemes)<br></div><div><br></div><div>Providing a list of types is semi-incompatible with cases D and E (because how would it know how to apply filters to multiple different types at once?  it could probably be done, but it would probably be very messy and very plugin-specific code) so I don't know if that is a good basis for an API that all plugins would build on top of.  On the other hand, A, B, and C can all be accomplished without any plugin involvement -- core could handle those use cases fine, and plugins would be free to handle D and E however they see fit (although we probably do want some common patterns there).</div><div><br></div><div>But the common patterns for solving D and E are probably going to be different from what we're discussing at the moment.  So I'm not sure if we want to codify  POST /pulp/api/v3/plugin/action/ types=[] as our common pattern just yet, at least not without more discussion.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 31, 2019 at 7:04 AM Tatiana Tereshchenko <<a href="mailto:ttereshc@redhat.com" target="_blank">ttereshc@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>If the goal is to make endpoints unified across all actions, then I think we can only do <br></div><div>POST /pulp/api/v3//plugin/action/ types=[]</div><div><br></div><div>Having plugin/content_type/upload would be nice, however I'm not sure if it covers enough use cases.</div><div>E.g. For pulp_rpm,  it makes sense for packages or advisories to have a dedicated endpoint each, however it doesn't make much sense for modulemd or modulemd_defaults, because usually they are in the same file and uploaded in bulk (maybe a separate endpoint is needed for this case).</div><div><br></div><div>For the copy case, it's common to copy more than one type, I think, so probably 'plugin/copy/ types=[]' makes more sense.</div><div><br></div><div>It would be great to here from more people and other plugins.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2019 at 5:46 PM Pavel Picka <<a href="mailto:ppicka@redhat.com" target="_blank">ppicka@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>+1 for discuss this to keep some standard as I have already opened PRs for rpm modulemd[-defaults]. <br></div><div>I like idea of /upload in the end.</div><div>But also think it can work without as it will be differ by POST/GET methods. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2019 at 4:49 PM Dana Walker <<a href="mailto:dawalker@redhat.com" target="_blank">dawalker@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Just to provide an added data point, I'll be merging the one-shot PR for pulp_python soon and it currently uses /api/v3/python/upload/</div><div><br></div><div>I wanted to keep it simple as well, and so would be happy to change it for consistency based on whatever we decide.</div><div><br></div><div>--Dana<br></div><div><br></div><div><div><div><div dir="ltr" class="m_-1091485883467740405gmail-m_-4985103987362494466gmail-m_5783098891308451578gmail-m_-7436848791281106389gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div>
        <p style="font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:capitalize;font-family:"RedHatText",sans-serif">
          <span>Dana</span> <span>Walker</span><span style="color:rgb(170,170,170);margin:0px"></span>
        </p>
        <p style="font-weight:normal;font-size:12px;margin:0px 0px 4px;text-transform:capitalize;font-family:"RedHatText",sans-serif">She / Her / Hers</p>
        <p style="font-weight:normal;font-size:12px;margin:0px;text-transform:capitalize;font-family:"RedHatText",sans-serif">
          <span>Software Engineer, Pulp Project</span>
        </p>
        <p style="font-weight:normal;margin:0px 0px 4px;font-size:12px;font-family:"RedHatText",sans-serif">
          <a style="color:rgb(0,136,206);font-size:12px;margin:0px;text-decoration:none;font-family:"RedHatText",sans-serif" href="https://www.redhat.com" target="_blank">Red Hat <span></span></a>
        </p>
    <div style="margin-bottom:4px">
      
      
    </div>
    <p style="font-weight:normal;margin:0px;font-size:12px;font-family:"RedHatText",sans-serif">
      <span style="margin:0px;padding:0px"><a style="color:rgb(0,0,0);font-size:12px;margin:0px;text-decoration:none;font-family:"RedHatText",sans-serif" href="mailto:dawalker@redhat.com" target="_blank">dawalker@redhat.com</a>   </span>
      
      
    </p>
    
    

    <div style="margin-top:12px">
      <table border="0">
        <tbody><tr>
          <td width="100px"><a href="https://www.redhat.com" target="_blank"> <img width="90" height="auto"></a> </td>
          
        </tr>
      </tbody></table>
    </div>

  </div><table border="0"><tbody><tr><td width="100px"><br></td>
</tr></tbody></table>

</div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2019 at 10:42 AM Ina Panova <<a href="mailto:ipanova@redhat.com" target="_blank">ipanova@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div>As of today, plugins have the freedom to define whichever endpoints they want ( to some extent).<br></div><div>This leads to the question - shall we namespace one-shot upload and copy endpoints for some consistency?   <br></div><div><br></div><div>POST /api/v3/content/rpm/packages/upload/ <br></div><div><div><div>POST /api/v3/content/rpm/packages/copy/</div></div><div><br></div><div>or <br></div></div><div><br></div><div><div><div dir="ltr" class="m_-1091485883467740405gmail-m_-4985103987362494466gmail-m_5783098891308451578gmail-m_-7436848791281106389gmail-m_350206686320217759gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>POST /api/v3/content/rpm/upload/ type =package<br></div><div><div>POST /api/v3/content/rpm/copy/ type = [package, modulemd]</div></div></div><div dir="ltr"><br></div><div>I wanted to bring this up, before it diverges a lot. For the record, I have checked only RPM plugin, I am not aware of the state of the other plugins.<br></div><div>Right now we have an active endpoint for one-shot upload of rpm package:</div><div dir="ltr">POST /api/v3/content/rpm/upload/ <br></div><div dir="ltr"><br></div><div>And there is PR for one-shot upload of modulemd-defaults:</div><div>POST /api/v3/content/rpm/modulemd-defaults/  <br></div><div><br></div><div>For rpm copy we have POST /api/v3/content/rpm/copy/ types=[]</div><div><br></div><div>We are starting some work on docker recursive copy, so it would be helpful to reach some agreement before going further that path.<br></div><div><br></div><div>Thank you!<br></div><div dir="ltr">--------<br>Regards,<br><br>Ina Panova<br>Senior Software Engineer| Pulp| Red Hat Inc.<br><br>"Do not go where the path may lead,<br> go instead where there is no path and leave a trail."<br></div></div></div></div></div></div></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_-1091485883467740405gmail-m_-4985103987362494466gmail-m_5783098891308451578gmail_signature"><div dir="ltr"><div>Pavel Picka</div><div>Red Hat<br></div></div></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div>
_______________________________________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/pulp-dev</a><br>
</blockquote></div></div>