Bug #12539
openDiscovery plug-in requires api/v2 to be specified even though v2 is the default in Foreman now
Description
I noticed in 1.10-rcX - even though APIv2 is a default one these days, discovered_hosts does not work unless "v2" is explicitly specified:
[root@centos7 ~]# curl -kSs -u admin:<pass> https://localhost/api/v2/discovered_hosts | jq '.total'
2
[root@centos7 ~]# curl -kSs -u admin:<pass> https://localhost/api/discovered_hosts | jq '.total'
parse error: Invalid numeric literal at line 1, column 10
[root@centos7 ~]# curl -kSs -u admin:<pass> https://localhost/api/discovered_hosts
<!DOCTYPE html>
<html>
<head>
<title>The page you were looking for doesn't exist (404)</title>
<style type="text/css">
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
div.dialog {
width: 25em;
padding: 0 4em;
margin: 4em auto 0 auto;
border: 1px solid #ccc;
border-right-color: #999;
border-bottom-color: #999;
}
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
</style>
</head>
<body>
<div class="dialog">
<h1>The page you were looking for doesn't exist.</h1>
<p>You may have mistyped the address or the page may have moved.</p>
</div>
</body>
</html>
[root@centos7 ~]#
Updated by Dominic Cleal over 9 years ago
This may need a similar change to https://github.com/theforeman/foreman/commit/823e62f4fa572978bc591c45df6c144827346ec0#diff-83737aa988d7e8c6ef57d0efd0776854