<div dir="ltr"><div>I want to bring back a variation on upload needs that has come out of various discussions w/ several plugin developers. I wrote it up here in more detail and I'll sumarize below:  <a href="https://pulp.plan.io/issues/5403">https://pulp.plan.io/issues/5403</a></div><div><br></div><div>1. Make all uploads of a specific content type live at POST /pulp/api/v3/content/<plugin_name>/<content_name>/</div><div>2. Have it accept either binary data (to create an Artifact from before the Content unit) OR a reference to an existing Artifact (allowing the chunked upload API to be used) but not both.</div><div><br></div><div>What do you think?<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 12:32 PM Ina Panova <<a href="mailto:ipanova@redhat.com">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">There have been ongoing couple of more discussions offline regarding copy/remove and it kinda boiled down to:<br><br><div>v3/<plugin-type>/<content-type>/action/  which will allow filtering</div>v3/<plugin-type>/<genericaction>/  will not allow filtering<br><div><div dir="ltr" class="gmail-m_8950921142205414385gmail_signature"><div dir="ltr"><div><div dir="ltr"><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><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 1, 2019 at 8:31 PM Daniel Alley <<a href="mailto:dalley@redhat.com" target="_blank">dalley@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>Ina and I discussed this earlier today and she made good points -- she pointed out that what I suggested wouldn't work for content types that have relations on non-content models, as several content types in the Docker and Python plugins do. So, I no longer think it's a good idea to have an endpoint with "types=[]" in core.</div><div><br></div><div>However, I still think that the "types=[]" pattern doesn't compose very well with other features like filtering so I'm not sure if we want to adopt that yet.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 1, 2019 at 8:54 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>For the one shot upload usecase I tend to lean towards /v3/<plugin>/<content_type>/upload/ and for content_types that require special treatment we can define separate endpoints.</div><div>If talking about modulemd or modulemd_defaults, it could be /v3/rpm/modules/upload/.</div><div dir="ltr"><br>--------<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><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 31, 2019 at 1:04 PM 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="gmail-m_8950921142205414385gmail-m_8021910933961339569gmail-m_2095837419508224578gmail-m_6093804603784435769gmail-m_-3130798068184246528gmail-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="gmail-m_8950921142205414385gmail-m_8021910933961339569gmail-m_2095837419508224578gmail-m_6093804603784435769gmail-m_-3130798068184246528gmail-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="gmail-m_8950921142205414385gmail-m_8021910933961339569gmail-m_2095837419508224578gmail-m_6093804603784435769gmail-m_-3130798068184246528gmail-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>
_______________________________________________<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>
</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>