V1 api

In Fortello, the v2 apidoc references routes like "GET /api/domains" but when I actually go to http://localhost:3000/api/domains, it's hitting Api::V1::DomainsController. Is that a bug? Or is the onus on the user to set the version to v2 in their headers?

David

David,

Not a bug. The default API version is currently v1. In order to use v2, the user must pass 'version=2' in the header or in the URL such as GET /api/v2/domains

Joseph

··· ----- Original Message ----- > From: "David Davis" > To: "foreman-dev" > Sent: Wednesday, July 23, 2014 3:05:55 AM > Subject: [foreman-dev] V1 API > > In Fortello, the v2 apidoc references routes like "GET /api/domains" but when > I actually go to http://localhost:3000/api/domains, it's hitting > Api::V1::DomainsController. Is that a bug? Or is the onus on the user to set > the version to v2 in their headers? > > David > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

I see. I do think it might be confusing for API users though since Katello's default version is v2. For example GET /katello/api/content_views hits Katello::Api::V2::ContentViewsController.

David

··· ----- Original Message ----- > From: "Joseph Magen" > To: foreman-dev@googlegroups.com > Sent: Wednesday, July 23, 2014 2:37:30 AM > Subject: Re: [foreman-dev] V1 API > > David, > > Not a bug. The default API version is currently v1. In order to use v2, the > user must pass 'version=2' in the header or in the URL such as GET > /api/v2/domains > > Joseph > > > > ----- Original Message ----- > > From: "David Davis" > > To: "foreman-dev" > > Sent: Wednesday, July 23, 2014 3:05:55 AM > > Subject: [foreman-dev] V1 API > > > > In Fortello, the v2 apidoc references routes like "GET /api/domains" but > > when > > I actually go to http://localhost:3000/api/domains, it's hitting > > Api::V1::DomainsController. Is that a bug? Or is the onus on the user to > > set > > the version to v2 in their headers? > > > > David > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >