<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">On 2/18/19 2:41 PM, Austin Macdonald
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CA+Kyt=pFWq3Zp71BXvnpOHYm2xOc3unVx=o_RcjCgcCgifyQgA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Originally, our upload story was as follows:</div>
<div>The user will upload a new file to Pulp via POST to
/artifacts/ (provided by core)<br>
</div>
<div>The user will create a new plugin specific Content via POST
to /path/to/plugin/content/, referencing whatever artifacts
that are contained, and whatever fields are expected for the
new content.<br>
</div>
<div>The user will add the new content to a repository via POST
to /repositories/1/versions/<br>
</div>
<div><br>
</div>
<div>However, this is somewhat cumbersome to the user with 3 API
calls to accomplish something that only took one call in Pulp
2. <br>
</div>
</div>
</blockquote>
<p>How would you do this with one call in pulp2?
<a class="moz-txt-link-freetext" href="https://docs.pulpproject.org/dev-guide/integration/rest-api/content/upload.html">https://docs.pulpproject.org/dev-guide/integration/rest-api/content/upload.html</a>
seems to suggest 3-4 calls.<br>
</p>
<blockquote type="cite"
cite="mid:CA+Kyt=pFWq3Zp71BXvnpOHYm2xOc3unVx=o_RcjCgcCgifyQgA@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>There are a couple of different paths plugins have taken to
improve the user experience:</div>
<div>The Python plugin follows the above workflow, but reads the
Artifact file to determine the values for the fields. The RPM
plugin has gone even farther and created a new endpoint for
"one shot" upload that perform all of this in a single call. I
think it is likely that the Python plugin will move more in
the "one shot" direction, and other plugins will probably
follow.<br>
</div>
</div>
</blockquote>
<p>How does the RPM one shot api work? Will it be compatible with
whatever solution <a class="moz-txt-link-freetext" href="https://pulp.plan.io/issues/4196">https://pulp.plan.io/issues/4196</a> arrives at? </p>
<p>I would hate for all our plugins to move to One shot methods
which users can't even rely on.<br>
</p>
<p>My problem with single api calls to upload files is that we
cannot reliably use them due to limitation in request sizes. We
have to be prepared to use multiple calls to upload files
regardless. Maybe if a user is using some plugin that never has
super large files (ansible?) you could be confident you would
never hit a request size limitation. But file, docker, and yum
all would require multiple calls to get the physical data to the
server.<br>
</p>
<p>I care more about having a consistent method for uploading files
than having fewer api calls. If we need a some content specific
api, that's fine, but please make it a consistent part of the
process. <br>
</p>
<p>I feel like we may be chasing the wrong goal here (fewer calls vs
a more consistent experience). <br>
</p>
<blockquote type="cite"
cite="mid:CA+Kyt=pFWq3Zp71BXvnpOHYm2xOc3unVx=o_RcjCgcCgifyQgA@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>That said, I think we should discuss this as a community to
encourage plugins to behave similarly, and because there may
also be a possibility for sharing some of code. It is my hope
that a "one shot upload" could do 2 things: 1) Upload and
create Content. 2) Optionally add that content to
repositories.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Pulp-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/pulp-dev">https://www.redhat.com/mailman/listinfo/pulp-dev</a>
</pre>
</blockquote>
</body>
</html>