Bug #6844

Going to /api/v2 shows API v1 routes rather than v2

Added by Dominic Cleal over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:dustin tsang
Category:API
Target version:Sprint 27
Difficulty: Bugzilla link:1105773
Found in release: Pull request:https://github.com/theforeman/foreman/pull/1644
Story points-
Velocity based estimate-
Release1.6.0Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1105773
If I go to /api/v2 in a fortello install, I do not see all the endpoints for katello in there. What I see listed is:

"links": {
"List all authsource ldaps": "/api/auth_source_ldaps",
"List all media": "/api/media",
"List of subnets": "/api/subnets",
"List roles": "/api/roles",
"List all hosts": "/api/hosts",
"List all users": "/api/users",
"List all ptables": "/api/ptables",
"List all lookup_keys": "/api/lookup_keys",
"List all architectures": "/api/architectures",
"List templates": "/api/config_templates",
"List all compute resources": "/api/compute_resources",
"List all settings": "/api/settings",
"List all audits": "/api/audits",
"List all fact values": "/api/fact_values",
"List all smart_proxies": "/api/smart_proxies",
"List all models": "/api/models",
"List all puppetclasses": "/api/puppetclasses",
"Show available links": "/api",
"List all operating systems": "/api/operatingsystems",
"List all common parameters": "/api/common_parameters",
"Get Dashboard results": "/api/dashboard",
"List all usergroups": "/api/usergroups",
"List all reports": "/api/reports",
"List of domains": "/api/domains",
"Get statistics": "/api/statistics",
"List all bookmarks": "/api/bookmarks",
"List all images for compute resource": "/api/compute_resources/:compute_resource_id/images",
"List all autosign": "/api/smart_proxies/smart_proxy_id/autosign",
"List all template kinds": "/api/template_kinds",
"List all environments": "/api/environments",
"List all hostgroups": "/api/hostgroups",
"List custom info": "/katello/api/custom_info/:informable_type/:informable_id",
"List distributors in environment": "/katello/api/environments/:environment_id/distributors",
"List permissions for a role": "/katello/api/roles/:role_id/permissions",
"Shows status of system and it's subcomponents": "/katello/api/about",
"List LDAP groups associated with the role": "/katello/api/roles/:role_id/ldap_groups",
"Get list of errata associated with the host collection": "/katello/api/organizations/:organization_id/host_collections/:host_collection_id/errata",
"Show status": "/api/status"
}

Associated revisions

Revision 06bbfc35
Added by dustin tsang over 3 years ago

Fixes #6844 - display v2 resources rather than v1 resources in /api/v2

History

#1 Updated by Dominic Cleal over 3 years ago

  • Subject changed from Going to /api/v2 should show me all apis for plugins and main foreman server to Going to /api/v2 shows API v1 routes rather than v2
  • Category set to API

As Walden observed in the bugzilla:

It looks like the routing for /api/v2 is incorrectly routing to /api/v1 (or at least pointing to v1 apipie docs instead of v2):

[walden@[redacted] katello (6828)]$ diff -dbu <(curl -s http://admin:changeme@[redacted]/api/v1) <(curl -s http://admin:changeme@[redacted]/api/v2)
[walden@[redacted] katello (6828)]$

#2 Updated by The Foreman Bot over 3 years ago

  • Status changed from New to Ready For Testing
  • Target version set to Sprint 27
  • Pull request https://github.com/theforeman/foreman/pull/1644 added

#3 Updated by Dominic Cleal over 3 years ago

  • Assigned To set to dustin tsang

#4 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.6.0

#5 Updated by dustin tsang over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF