[katello-devel] A couple API quasi-issues

Bryan Kearney bkearney at redhat.com
Tue May 8 23:36:56 UTC 2012


On 05/08/2012 05:37 PM, Matt Wagner wrote:
> Howdy,
>
> I've been dabbling with writing a client for the Katello API to be used
> in Aeolus Conductor, and I've run into a couple of things that seemed
> off. Both were ultimately user error on my part, but I wanted to mention
> them in case it was helpful in enhanced idiot-proofing. ;)
>
> The API docs[1] confused me today by describing
> "/api/organizations/:organization_id/environments", so I dutifully spent
> a bit of time trying to figure out why /api/organizations/1/environments
> was returning a 404, with organization ID 1 being the only organization.
>
> It turns out that :organization_id is not organization.id, but rather,
> organization.cp_key. In fairness, this is partially implied in the
> detailed description, but it's not explicitly stated as the cp_key
> parameter. Would it be possible (slash helpful) to say
> /api/organizations/:organization_cp_key/environments or something
> similar instead? (Or, alternatively, to also accept an integer ID?)
>
> The other issue is one I ran into yesterday and mentioned in
> #systemengine. Somewhat like the above, the root cause was me doing
> something wrong, but the behavior was strange -- I accidentally appended
> ".json" to an otherwise valid API call. (In fairness, Active Resource
> did this automatically.)
>
> As shown here[2], what actually happens in this case is that WHERE
> "environments"."format" = 'json' gets added to the SQL query that is
> run, which understandably raises an exception.
>
> I've successfully worked around both of these, but I wanted to pass the
> feedback on in case it could help future API users.
>
> Best,
> Matt
>
>
> [1] https://10.34.56.16/katello/apidoc
> [2] https://gist.github.com/2639421
>
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
Ivan:

How would your auto-doco stuff help here?

-- bk




More information about the katello-devel mailing list