Bug 1653689 - can't order service via api
Summary: can't order service via api
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Documentation
Version: 5.9.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: cfme-future
Assignee: Red Hat CloudForms Documentation
QA Contact: Red Hat CloudForms Documentation
Red Hat CloudForms Documentation
Depends On:
TreeView+ depends on / blocked
Reported: 2018-11-27 12:09 UTC by Niladri Roy
Modified: 2019-04-30 19:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-04-30 19:12:38 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3723831 0 None None None 2018-12-04 15:47:08 UTC

Description Niladri Roy 2018-11-27 12:09:01 UTC
Description of problem:
Can't order service via api when the service dialog values are passed, fails with below error

{"error":{"kind":"bad_request","message":"Failed to order Service Template id:39 name:'niroy-test' - Basic Information/Extra Variables/var1 is required","klass":"Api::BadRequestError"}}

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a service dialog with 2 text boxes 
2. Create a catalog item using that service dialog
3. take a note of the catalog and catalog item ID
4. Run below query to order the service (pass the values)

curl -k -u admin:smartvm -X POST -H "Accept:application/json" -d '{ "action" : "order", "href" : "https://<IP>/api/service_templates/39", "param_var1" : "hello", "param_var2" : "test" }' https://<IP>/api/service_catalogs/1/service_templates

Actual results:
Service order fails

{"error":{"kind":"bad_request","message":"Failed to order Service Template id:39 name:'niroy-test' - Basic Information/Extra Variables/var1 is required","klass":"Api::BadRequestError"}}

Expected results:
Service order should succeed

Additional info:
This is regression, works fine in

Comment 5 Joe Vlcek 2018-11-27 19:18:44 UTC
It seems this PR: https://github.com/ManageIQ/manageiq-api/pull/485
created this regression

Comment 6 Joe Vlcek 2018-11-27 20:14:48 UTC
It turns out that this is not a bug.

There were 2 PRs made to address BZ 1635673 [1]

PR, 485 [2], to the manageiq-api repo and
PR, 18061 [3], to the manageiq repo.

With these changes it is now necessary to set the new configuration
parameter, run_automate_methods_on_service_api_submit, to be true
when doing the API calls that are described as failing here.

To get this to work simply set the configuration option

":run_automate_methods_on_service_api_submit: true"

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1635673
[2] https://github.com/ManageIQ/manageiq-api/pull/485
[3] https://github.com/ManageIQ/manageiq/pull/18061

Comment 7 Joe Vlcek 2018-11-27 20:30:14 UTC
I no longer need the appliances so I am canceling the NEEDSINFO

Comment 8 Joe Vlcek 2018-11-27 21:13:34 UTC
Moving to Documentation.

Comment 9 Joe Vlcek 2018-11-27 21:36:32 UTC

Can support write a KB article on the new product setting described in comment 6?


Comment 10 myoder 2018-12-04 15:01:39 UTC

Sure, thing, just attached the KB article to this case.

Kind Regards,

Note You need to log in before you can comment on or make changes to this bug.