<div dir="ltr">Currently, we access content units at paths like /api/v3/content/file/. This works great if your plugin has a single content type that corresponds to the name of the plugin. <div><br></div><div>In pulp_ansible though, we have multiple content types (roles, role versions, etc) so we’ve opened an issue [0] we need feedback on. I’d like to outline the proposals on the issue and get feedback.<div><br></div><div><br></div><div>## Proposal 1</div><div><br></div><div>Use /api/v3/content/<plugin>/<type>/ for all plugins.</div><div><br></div><div>Examples:</div><div><br></div><div>/api/v3/content/file/files/</div><div>/api/v3/content/ansible/roles/</div><div><br></div><div>Advantages:</div><div><br></div><div>- Consistent across plugins<br></div><div>- Can add content types later without problems</div><div><div>- Restful. You’re acting on files, roles, etc</div></div><div><br></div><div>Disadvantages:</div><div><br></div><div>- A bit awkward in the case of single content plugins (/file/files)</div><div><br></div><div><br></div><div>## Proposal 2</div><div><br></div><div>Use /api/v3/content/<plugin>/ for single content plugins and /api/v3/content/<plugin>/<type>/ otherwise.</div><div><br></div><div><div>Examples:</div><div><br></div><div>/api/v3/content/file/</div><div>/api/v3/content/ansible/role/</div></div><div><br></div><div>Advantages:</div><div><br></div><div>- Shorter URLs for single content type plugins</div><div>- Already what we’re using</div><div><br></div><div>Disadvantages:</div><div><br></div><div><div>- Inconsistent across plugins</div></div><div>- Plugin writers can paint themselves into a corner (e.g. I have a single content plugin that implements /api/v3/content/rpm/ and I want to add a new content type like erratum)<br></div><div><br></div><div><br></div><div>## Proposal 3</div><div><br></div><div><div>Use /api/v3/content/<plugin>/ for single content plugins and /api/v3/content/<plugin>-<type>/ otherwise. Basically the same as proposal 2 but with hyphens instead of nesting.</div><div><br></div><div><div>Examples:</div><div><br></div><div>/api/v3/content/file/</div><div>/api/v3/content/ansible-role/</div></div></div><div><div><br></div><div><br></div><div>[0] <a href="https://pulp.plan.io/issues/3407">https://pulp.plan.io/issues/3407</a><br clear="all"><div><div class="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>
</div></div></div></div>