Bug 1653689

Summary: can't order service via api
Product: Red Hat CloudForms Management Engine Reporter: Niladri Roy <niroy>
Component: DocumentationAssignee: Red Hat CloudForms Documentation <cloudforms-docs>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.9.5CC: dmetzger, jvlcek, kdixon, myoder, niroy, obarenbo, tfitzger
Target Milestone: GAKeywords: Regression
Target Release: cfme-future   
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: 2019-04-30 19:12:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:

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):
5.9.5.3

How reproducible:
Always

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 5.9.4.7

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
Michael,

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

JoeV

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

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

Kind Regards,
Yoder