<div dir="ltr"><div></div><div>Having full, relative urls returned would resolve the issues with the use case of changing the FQDN. I think it would also work with multi-host and container environments well. I agree w/ @thommckay's concerns about containers and full urls with FQDNs not working well.<br><br></div><div>I'm not sure how using full, relative urls would or wouldn't resolve the bindings ID issue.<br><br></div><div>I responded inline about IDs and hrefs too.<br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 30, 2018 at 11:22 AM, Bryan Kearney <span dir="ltr"><<a href="mailto:bkearney@redhat.com" target="_blank">bkearney@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is that true in practice? Most uses I see of APIs are around language<br>
bindings where the url is not used as oftern.<br></blockquote><div><br>In practice, using IDs instead of hrefs is common. I think REST
motivates us towards the detail resource full, relative path being the universal
descriptor of that resource. If we start referring to a detail resource by its ID only (not full relative path) then we tightly couple the client and server which gives back some of the benefits of REST.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- bk<br>
<span class=""><br>
On 04/30/2018 11:13 AM, Brian Bouterse wrote:<br>
> +1 to fixing whatever the issue that prevents the built bindings from<br>
> working. If David's proposal does that then +1.<br>
> <br>
> I want to share an opinion on continuing with the use of urls (in<br>
> addition perhaps to ids) and not supporting rerooting a Pulp deployment.<br>
> Using hrefs is valuable in the response and the requests because the<br>
> client doesn't have to understand what resource type they should use for<br>
> a given object being referenced. In practice you can open the next<br>
> resource without any url parsing/forming. In terms of rerooting an<br>
> application, it will break clients. It reminds me of this W3C page I<br>
> read which suggests that great URIs are expected to never change:<br>
> <a href="https://www.w3.org/Provider/Style/URI" rel="noreferrer" target="_blank">https://www.w3.org/Provider/<wbr>Style/URI</a><br>
> <br>
> I hope we can fix the bindings asap. Sorry they aren't working. Thank<br>
> you for reporting this via the list.<br>
> <br>
> <br>
> <br>
> On Mon, Apr 30, 2018 at 10:24 AM, Justin Sherrill <<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a><br>
</span><span class="">> <mailto:<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
> On 04/30/2018 10:05 AM, David Davis wrote:<br>
>> So what I’d probably propose is exposing the UUIDs in the response<br>
>> and then extending <wbr>HyperlinkedRelatedFields to accept UUID or<br>
>> href. Then third parties like Katello could store and just use<br>
>> UUIDs (and not worry about hrefs).<br>
>><br>
>> Regarding hrefs though, hostname and port don’t matter. The app<br>
>> just looks at the relative path. It looks like changing the<br>
>> deployment path causes problems though.<br>
> <br>
> It matters if you are a client and are fetching stored hrefs.<br>
> <br>
> Justin<br>
> <br>
> <br>
>><br>
>><br>
>> David<br>
>><br>
>> On Mon, Apr 30, 2018 at 9:58 AM, Justin Sherrill<br>
</span><div><div class="h5">>> <<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a> <mailto:<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a>>> wrote:<br>
>><br>
>><br>
>><br>
>> On 04/27/2018 07:18 PM, David Davis wrote:<br>
>>> I’m not sure how returning UUIDs in our responses helps<br>
>>> Katello. In our previous conversation, it was concluded that<br>
>>> Katello should use the hrefs[0]. Why expose UUIDs if Katello<br>
>>> is not going to store them?<br>
>><br>
>> And thats fine, but bindings are pointless at that point, so<br>
>> pulp shouldn't really advertise them as a feature. This<br>
>> seemed to have been 'talked up' quite a bit as a feature, but<br>
>> is completely unusable.<br>
>><br>
>>><br>
>>> Katello could store/use UUIDs but then it's going to run into<br>
>>> problems when dealing with parameters that are hrefs (such as<br>
>>> repository_version for publishing[1]).<br>
>>><br>
>>> [0] <a href="https://www.redhat.com/archives/pulp-dev/2018-January/msg00004.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/pulp-dev/2018-<wbr>January/msg00004.html</a><br>
>>> <<a href="https://www.redhat.com/archives/pulp-dev/2018-January/msg00004.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/pulp-dev/2018-<wbr>January/msg00004.html</a>><br>
>>> [1] <a href="https://github.com/pulp/pulp_file/blob/5ffb33d8c70ffbb247aba8bf5b45633eba414b79/pulp_file/app/viewsets.py#L54" rel="noreferrer" target="_blank">https://github.com/pulp/<wbr>pulp_file/blob/<wbr>5ffb33d8c70ffbb247aba8bf5b4563<wbr>3eba414b79/pulp_file/app/<wbr>viewsets.py#L54</a><br>
>>> <<a href="https://github.com/pulp/pulp_file/blob/5ffb33d8c70ffbb247aba8bf5b45633eba414b79/pulp_file/app/viewsets.py#L54" rel="noreferrer" target="_blank">https://github.com/pulp/pulp_<wbr>file/blob/<wbr>5ffb33d8c70ffbb247aba8bf5b4563<wbr>3eba414b79/pulp_file/app/<wbr>viewsets.py#L54</a>><br>
>><br>
>> Could you explain a bit about this?<br>
>><br>
>> In order to use pulp 3 then, i'd guess we would either need to:<br>
>><br>
>> 1) store ALL hrefs about all objects<br>
>> 2) fetch an object before we can do anything with it<br>
>><br>
>> Or am i missing an option 3?<br>
>><br>
>> On a side note, the href's seem to include<br>
>> hostname/port/deployment path. This seems incompatible with<br>
>> things like hostname changes. We can fairly easily just chomp<br>
>> off only the path, but if i were a user and had stored all<br>
>> these hrefs, i would be very unhappy if i had all the full<br>
>> href's stored.<br>
>><br>
>> Justin<br>
>><br>
>>><br>
>>><br>
>>><br>
>>> David<br>
>>><br>
>>> On Fri, Apr 27, 2018 at 4:29 PM, Dennis Kliban<br>
</div></div><span class="">>>> <<a href="mailto:dkliban@redhat.com">dkliban@redhat.com</a> <mailto:<a href="mailto:dkliban@redhat.com">dkliban@redhat.com</a>>> wrote:<br>
>>><br>
>>> I can't remember why we decided to remove UUID from the<br>
>>> responses. It sounds like we should add them back.<br>
>>><br>
>>> On Fri, Apr 27, 2018 at 12:26 PM, Justin Sherrill<br>
</span><div><div class="h5">>>> <<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a> <mailto:<a href="mailto:jsherril@redhat.com">jsherril@redhat.com</a>>> wrote:<br>
>>><br>
>>> Hi All!<br>
>>><br>
>>> I started playing around with pulp 3 and generated<br>
>>> bindings via <a href="https://pulp.plan.io/issues/3580" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/<wbr>3580</a><br>
>>> <<a href="https://pulp.plan.io/issues/3580" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/<wbr>3580</a>> and it results<br>
>>> somewhat in what you would expect. Here's an example:<br>
>>><br>
>>> # @param id A UUID string identifying this<br>
>>> repository.<br>
>>> # @param [Hash] opts the optional parameters<br>
>>> # @return [Repository]<br>
>>> def repositories_read(id, opts = {})<br>
>>> data, _status_code, _headers =<br>
>>> repositories_read_with_http_<wbr>info(id, opts)<br>
>>> return data<br>
>>> end<br>
>>><br>
>>><br>
>>> Notice that the UUID is to be passed in. When<br>
>>> creating a repository, i only get the _href:<br>
>>><br>
>>> {<br>
>>> "_href":<br>
>>> "<a href="http://localhost:8000/pulp/api/v3/repositories/bfc61565-89b1-4b7b-9c4a-2ec91f299aca/" rel="noreferrer" target="_blank">http://localhost:8000/pulp/<wbr>api/v3/repositories/bfc61565-<wbr>89b1-4b7b-9c4a-2ec91f299aca/</a><br>
>>> <<a href="http://localhost:8000/pulp/api/v3/repositories/bfc61565-89b1-4b7b-9c4a-2ec91f299aca/" rel="noreferrer" target="_blank">http://localhost:8000/pulp/<wbr>api/v3/repositories/bfc61565-<wbr>89b1-4b7b-9c4a-2ec91f299aca/</a>>"<wbr>,<br>
>>> "_latest_version_href": null,<br>
>>> "_versions_href":<br>
>>> "<a href="http://localhost:8000/pulp/api/v3/repositories/bfc61565-89b1-4b7b-9c4a-2ec91f299aca/versions/" rel="noreferrer" target="_blank">http://localhost:8000/pulp/<wbr>api/v3/repositories/bfc61565-<wbr>89b1-4b7b-9c4a-2ec91f299aca/<wbr>versions/</a><br>
>>> <<a href="http://localhost:8000/pulp/api/v3/repositories/bfc61565-89b1-4b7b-9c4a-2ec91f299aca/versions/" rel="noreferrer" target="_blank">http://localhost:8000/pulp/<wbr>api/v3/repositories/bfc61565-<wbr>89b1-4b7b-9c4a-2ec91f299aca/<wbr>versions/</a>>",<br>
>>> "created": "2018-04-27T15:26:03.546956Z",<br>
>>> "description": "",<br>
>>> "name": "test",<br>
>>> "notes": {}<br>
>>> }<br>
>>><br>
>>> Meaning, there's really no way to use this specific<br>
>>> binding with the return format for pulp. I imagine<br>
>>> most binding generation would be expecting the user<br>
>>> to know the ID of the objects and not work off of<br>
>>> _hrefs. Any reason to not include the IDs in the<br>
>>> response?<br>
>>><br>
>>> Justin<br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> Pulp-dev mailing list<br>
</div></div>>>> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a> <mailto:<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a>><br>
>>> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<span class="">>>> <<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a>><br>
>>><br>
>>><br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> Pulp-dev mailing list<br>
</span>>>> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a> <mailto:<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a>><br>
>>> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<span class="">>>> <<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a>><br>
>>><br>
>>><br>
>><br>
>><br>
> <br>
> <br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
</span>> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a> <mailto:<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a>><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<div class="HOEnZb"><div class="h5">> <<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a>><br>
> <br>
> <br>
> <br>
> <br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
> <br>
<br>
<br>
</div></div></blockquote></div><br></div></div>