<div dir="ltr">Yea, the names here are in terms of the names we use today and are subject to the outcome of the field naming thread.<br clear="all"><div><div dir="ltr" class="m_-6513711847925840592m_-7084889148794164446gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>David<br></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 8, 2018 at 12:17 PM Daniel Alley <<a href="mailto:dalley@redhat.com" target="_blank">dalley@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> As per the other discussion thread, I assume the names will actually be _id, _type, _href?</div><div><br></div><div class="gmail_extra">Errata have both "id" and "type" fields, so if we're going to attempt to keep the Pulp metadata field names out of the way of Content field names, we need to do it for all of them.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 8, 2018 at 12:02 PM, David Davis <span dir="ltr"><<a href="mailto:daviddavis@redhat.com" target="_blank">daviddavis@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>After recent meetings with stakeholders, we've arrived at a solution on how to handle ids and hrefs in the Pulp 3 API. The plan is to stop accepting hrefs for fields to instead rely solely on IDs. Hrefs will still be displayed in the API as a convenience to users but will not be accepted for fields in POST/PUT requests.</div><div><br></div><div>In order to support polymorphic fields, we'll also be adding a 'type' field that will be returned for all objects that will contain the package name and resource name (e.g. pulp_file.FileContent). This will allow these objects to be posted to polymorphic fields like add_content_units/remove_content_units (see below).</div><div><br></div><div>Lastly, we also propose un-nesting the repository versions endpont and making it a top-level resources. Filtering of repository versions associated with a specific repo will be handled by repo filters, e.g. /pulp/api/v3/repository_versions/?repository=3</div><div><br></div><div><br></div><div>RETURNING DATA</div><div><br></div><div>Return for all objects:</div><div>- id</div><div>- _href</div><div>- type</div><div><br></div><div>e.g. {'id': 4, 'type': 'pulp_file.FileContent', '_href': '<a href="http://localhost:8000/pulp/api/v3/content/file/files/4/" target="_blank">http://localhost:8000/pulp/api/v3/content/file/files/4/</a>'}</div><div><br></div><div>This includes polymorphic fields (e.g. created_resource on TaskStatus)</div><div><br></div><div><br></div><div>POSTING DATA</div><div><br></div><div>Submitting data in general will use id only (no hrefs). For example:</div><div><br></div><div>http <a href="http://localhost:8000/pulp/api/v3/remotes/file/3/sync" target="_blank">http://localhost:8000/pulp/api/v3/remotes/file/3/sync</a> repository=3</div><div><br></div><div>Submitting polymorphic fields can be handled in the following way: </div><div><br></div><div>add_content_units=[</div><div>    {'id': 4, 'type': 'pulp_file.FileContent', '_href': '<a href="http://localhost:8000/pulp/api/v3/content/file/files/4/'" target="_blank">http://localhost:8000/pulp/api/v3/content/file/files/4/'</a>},</div><div>    {'id': 4, 'type': 'pulp_python.PythonContent', '_href': '<a href="http://localhost:8000/pulp/api/v3/content/python/p/4/" target="_blank">http://localhost:8000/pulp/api/v3/content/python/p/4/</a>'}</div><div>]</div><div><br></div><div>Note: the only fields that are inspected are id and type. the rest are ignored. This simply allows users to pass back the data they receive from the content endpoint.</div><div><br></div><div><br></div><div>We're holding off on proceeding until August 15th to allow time for comment. Please respond with any concerns or feedback before then. </div><div><br></div></div>
<br>_______________________________________________<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>
<br></blockquote></div><br></div></div>
</blockquote></div>