<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>