| Summary: | API Doc for content view publishing is wrong | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Erinn Looney-Triggs <erinn.looneytriggs> | ||||
| Component: | API - Content | Assignee: | Christine Fouant <cfouant> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Nikhil Kathole <nkathole> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.1.8 | CC: | bbuckingham, bkearney, cfouant, jcallaha, kgaikwad, nkathole, nshaik, swadeley | ||||
| Target Milestone: | Unspecified | Keywords: | Triaged | ||||
| Target Release: | Unused | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| URL: | http://projects.theforeman.org/issues/20471 | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1480316 (view as bug list) | Environment: | |||||
| Last Closed: | 2018-02-21 16:54:37 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: | |||||
| Attachments: |
|
||||||
This bug is for the builtin API reference doc, not the API Guide. We need to change the Bugzilla component to API as "Docs API Guide" means the guide on the customer portal. Thank you Created attachment 1308864 [details]
API call to publish content view supplying id parameter
In 6.3.0, the API call POST /katello/api/content_views/:id/publish is able to publish with or without the id parameter passed in.
Version Tested: Satellite 6.3 beta As per comment #4, It seems that id parameter is optional for publishing content view.But I can see doc https://satellite/apidoc/v2/content_views.html is showing id parameter as required. Should it be mentioned as "optional" in doc? and when I tried using id parameter, publishing content view started.But it shows warning as Invalid URL curl -s -X POST -k -u admin:<passwd> id '{"id":'2'}' https://satellite/katello/api/content_views/2/publish --header "Content-Type:application/json" <HTML><HEAD> <TITLE>Invalid URL</TITLE> </HEAD><BODY> <H1>Invalid URL</H1> The requested URL "[no URL]", is invalid.<p> Reference #9.527c4117.1510919022.e36070c </BODY></HTML> {"id":"f48f7b25-30c6-472a-b797-fe5363fed3ae","label":"Actions::Katello::ContentView::Publish","pending":true,"username":"admin","started_at":"2017-11-17 11:43:43 UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"content_view":{"id":2,"name":"capsule","label":"capsule"},"organization":{"id":1,"name":"Default Organization","label":"Default_Organization"},"services_checked":["pulp","pulp_auth","candlepin","candlepin_auth"],"history_id":6,"content_view_id":2,"environment_id":1,"user_id":3,"current_user_id":3},"output":{},"humanized":{"action":"Publish","input":[["content_view",{"text":"content view 'capsule'","link":"#/content_views/2/versions"}],["organization",{"text":"organization 'Default Organization'","link":"/organizations/1/edit"}]],"output":"","errors":[]},"cli_example":null} Am I missing something here? Moving this to VERIFIED In comment #5, warning showed due to typo in curl request (id in place of -d) Version tested : Satellite 6.3 snap 33 curl -s -X POST -k -u admin:pass https://sat/katello/api/content_views/5/publish --header "Content-Type:application/json" {"id":"4636976e-e422-4b90-a8ba-aa27b3cb9d89","label":"Actions::Katello::ContentView::Publish","pending":true,"username":"admin","started_at":"2018-01-22 12:09:07 UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"content_view":{"id":5,"name":"test_CV","label":"test_CV"},"organization":{"id":1,"name":"Default Organization","label":"Default_Organization"},"history_id":16,"content_view_id":5,"environment_id":1,"user_id":3,"current_user_id":3},"output":{},"humanized":{"action":"Publish","input":[["content_view",{"text":"content view 'test_CV'","link":"#/content_views/5/versions"}],["organization",{"text":"organization 'Default Organization'","link":"/organizations/1/edit"}]],"output":"","errors":[]},"cli_example":null} curl -s -X POST -k -u admin:pass -d '{"id":'5'}' https://sat/katello/api/content_views/5/publish --header "Content-Type:application/json" {"id":"62fd092e-577b-417e-834c-ccf225c956a4","label":"Actions::Katello::ContentView::Publish","pending":true,"username":"admin","started_at":"2018-01-22 12:08:21 UTC","ended_at":null,"state":"planned","result":"pending","progress":0.0,"input":{"content_view":{"id":5,"name":"test_CV","label":"test_CV"},"organization":{"id":1,"name":"Default Organization","label":"Default_Organization"},"history_id":15,"content_view_id":5,"environment_id":1,"user_id":3,"current_user_id":3},"output":{},"humanized":{"action":"Publish","input":[["content_view",{"text":"content view 'test_CV'","link":"#/content_views/5/versions"}],["organization",{"text":"organization 'Default Organization'","link":"/organizations/1/edit"}]],"output":"","errors":[]},"cli_example":null} Found able to publish with or without the id parameter in request. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> >
> > For information on the advisory, and where to find the updated files, follow the link below.
> >
> > If the solution does not work for you, open a new bug report.
> >
> > https://access.redhat.com/errata/RHSA-2018:0336
|
Description of problem: The generated API documentation for content views, specifically the POST for publish is incorrect. It states: POST /katello/api/content_views/:id/publish Publish a content view Params Param name Description id required Content view identifier Value: string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space.. description optional Description for the new published content view version Value: String If you actually pass the id as a parameter, the content view will not publish. It makes sense as the ID is already in the path, but the documentation is simply wrong. Using hammer in debug mode you can see the same: [ INFO 2016-04-22 12:56:23 API] POST /katello/api/content_views/35/publish [DEBUG 2016-04-22 12:56:23 API] Params: {} [DEBUG 2016-04-22 12:56:23 API] Headers: {} So the doc needs to be fixed. Note again this is in the autogenerated apidoc, I have no idea what is in the docs hosted by red hat. -Erinn