Bug 1416040
| Summary: | GET /api/v2/provisioning_templates/build_pxe_default returns error "Resource provisioning_template not found by id 'build_pxe_default' | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Stanislav Tkachenko <stkachen> |
| Component: | Provisioning Templates | Assignee: | Swapnil Abnave <sabnave> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.3.0 | CC: | bbuckingham, jcallaha, mhulan, sabnave |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| 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-02-14 13:09:42 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
Stanislav Tkachenko
2017-01-24 12:52:31 UTC
(In reply to Stanislav Tkachenko from comment #0) Please ignore initial comment, 'Enter' accidentally was pressed. Description of problem: GET /api/v2/provisioning_templates/build_pxe_default returns: > "error": {"message":"Resource provisioning_template not found by id 'build_pxe_default'"} However, deprecated GET /api/v2/config_templates/build_pxe_default works as expected: > {"message":"PXE Default file has been deployed to all Capsules"} Version-Release number of selected component (if applicable): Satellite 6.3.0 Snap 8 / Foreman 1.13.2.2-1 Satellite 6.2.7 Snap 3.0 / Foreman 1.11.0.65-1 How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: Tail of production.log:
2017-01-24 08:33:47 d58fe0fa [app] [I] Started GET "/api/v2/config_templates/build_pxe_default" for 10.36.7.37 at 2017-01-24 08:33:47 -0500
2017-01-24 08:33:47 d58fe0fa [app] [I] Processing by Api::V2::ConfigTemplatesController#build_pxe_default as JSON
2017-01-24 08:33:47 d58fe0fa [app] [I] Parameters: {"apiv"=>"v2"}
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxegrub2_chainload'
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxegrub2_discovery'
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxelinux_chainload'
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxelinux_discovery'
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxegrub_chainload'
2017-01-24 08:33:47 d58fe0fa [templates] [I] Rendering template 'pxegrub_discovery'
2017-01-24 08:33:47 d58fe0fa [app] [I] Completed 200 OK in 224ms (Views: 0.4ms | ActiveRecord: 11.3ms)
2017-01-24 08:34:05 d58fe0fa [app] [I] Started GET "/api/v2/provisioning_templates/build_pxe_default" for 10.36.7.37 at 2017-01-24 08:34:05 -0500
2017-01-24 08:34:05 d58fe0fa [app] [I] Processing by Api::V2::ProvisioningTemplatesController#show as JSON
2017-01-24 08:34:05 d58fe0fa [app] [I] Parameters: {"apiv"=>"v2", "id"=>"build_pxe_default"}
2017-01-24 08:34:05 d58fe0fa [app] [I] Couldn't find ProvisioningTemplate with 'id'=build_pxe_default [WHERE "templates"."type" IN ('ProvisioningTemplate')] (ActiveRecord::RecordNotFound)
2017-01-24 08:34:05 d58fe0fa [app] [I] Rendered api/v2/errors/not_found.json.rabl within api/v2/layouts/error_layout (1.3ms)
2017-01-24 08:34:05 d58fe0fa [app] [I] Completed 404 Not Found in 19ms (Views: 3.0ms | ActiveRecord: 3.8ms)
> Description of problem: > GET /api/v2/provisioning_templates/build_pxe_default returns: > > "error": {"message":"Resource provisioning_template not found by id 'build_pxe_default'"} > The API request should be POST instead of GET. POST /api/v2/provisioning_templates/build_pxe_default -- GET call however works for "api/v2/config_templates/build_pxe_default" but it's depricated. Please have a look at https://bugzilla.redhat.com/1127576 -- Two ways this bug can be marked closed: 1. Obsolete GET api/v2/config_templates/build_pxe_default 2. Add GET api/v2/provisioning_templates/build_pxe_default Later doesn't make sense to me, since it would unnecessarily leverage the use of GET instead of POST on an update action. Upstream bug assigned to sabnave Upstream bug assigned to sabnave Hi Stanislav, As discussed here https://github.com/theforeman/foreman/pull/4278, the GET API can't be made obsolete in this version. You need to restrict the use of un-documented API(GET api/v2/config_templates/build_pxe_default) and use documented API(POST api/v2/config_templates/build_pxe_default). |