Bug 1482383

Summary: Page doesn't exist (404) for tailoring file, scap content and policies through API
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: SCAP PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: mhulan, oprazak, tstrachota
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-17 08:38:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nikhil Kathole 2017-08-17 06:50:35 UTC
Description of problem: We were trying to perform feature testing for tailoring file, scap content and compliance policies through API. As per API documentation,

https://$HOST/apidoc/v2.html

To list policies, tailoring files and scap content, GET requests are

GET /api/compliance/policies
GET /api/compliance/tailoring_files
GET /api/compliance/scap_contents

But these all results in 404.

Version-Release number of selected component (if applicable): sat 6.3 snap 11


How reproducible: always


Steps to Reproduce:
1. curl -s -X GET -k -u admin:<password>  'https://$HOST/api/compliance/policies/'
2. curl -s -X GET -k -u admin:<password>  'https://$HOST/api/compliance/tailoring_files'
3. curl -s -X GET -k -u admin:<password>  'https://$HOST/api/compliance/scap_contents'

Actual results:

Results in "The page you were looking for doesn't exist"

Expected results:

Proper Results should be displayed.

Additional info:

Instead of 

curl -s -X GET -k -u admin:<password>  'https://$HOST/api/compliance/policies/'

The GET request for

curl -s -X GET -k -u admin:<password>  'https://$HOST/api/v2/compliance/policies/'

shows the correct result. (similar for scap content and tailoring file)

Comment 1 Nikhil Kathole 2017-08-17 08:38:35 UTC
It was my bad...This works using the header

API -H "Accept: version=2,application/json"

Closing this issue.