Bug 1626595
Summary: | Unable to Order Service Catalog via API when a Dialog is Required and Refreshed by Trigger | ||
---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | myoder |
Component: | API | Assignee: | eclarizi |
Status: | CLOSED DUPLICATE | QA Contact: | Dave Johnson <dajohnso> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 5.9.0 | CC: | bsorota, dmetzger, eclarizi, glamb, gtanzill, jcheal, jprause, myoder, obarenbo, rspagnol, simaishi, tfitzger |
Target Milestone: | GA | ||
Target Release: | 5.9.6 | ||
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: | 2018-11-05 21:22:32 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | Bug | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | CFME Core | Target Upstream Version: | |
Embargoed: |
Description
myoder
2018-09-07 17:23:35 UTC
Yoder, We looked (me, Julian and Brandon) at this and noticed that example **2** can't work because action is specified twice in the parameters. One action "order" or "refresh_dialog_fields" will overwrite the other. We tried to do this in 2 requests, refresh_dialog_fields followed by order. That seems to work - Refresh: curl -u admin:smartvm -k -H "Accept: application/json" --request POST --data '{ "action": "refresh_dialog_fields", "resource" : { "href" : "http://localhost:3000/api/service_templates/1000000000001", "dialog_fields" : { "input_dropdown": "One"}, "fields" : ["text_box"]}}' https://10.13.153.198/api/service_catalogs/1000000000001/service_templates {"results":[{"success":true,"message":"Refreshing dialog fields for Service Template id:1000000000001 name:'API_Test'","result":{"text_box":{"name":"text_box","description":"","display":"edit","display_method_options":{},"required":true,"required_method_options":{},"default_value":"","values_method_options":{},"options":{"protected":false},"label":"Text Box","position":1,"reconfigurable":false,"dynamic":true,"show_refresh_button":false,"load_values_on_init":false,"read_only":false,"auto_refresh":false,"trigger_auto_refresh":false,"visible":true,"type":"DialogFieldTextBox","resource_action":{"resource_type":"DialogField","ae_namespace":"Dialogs","ae_class":"Methods","ae_instance":"Text_Box","ae_attributes":{}},"dialog_field_responders":[],"values":"TB Ping Pong"}},"service_template_id":"1000000000001","service_template_href":"https://10.13.153.198/api/service_templates/1000000000001","href":"https://10.13.153.198/api/service_catalogs/1000000000001"}]} Followed by oder, taking the value of "text_box" that was returned from the refresh and plugging it in - curl -u admin:smartvm -k -H "Accept: application/json" --request POST --data '{ "action": "order", "resource" : { "href" : "http://localhost:3000/api/service_templates/1000000000001", "input_dropdown": "One", "text_box": "TB Ping Pong"}}' https://10.13.153.198/api/service_catalogs/1000000000001/service_templates {"results":[{"href":"https://10.13.153.198/api/service_requests/1000000000013","id":"1000000000013","description":"Provisioning Service [API_Test] from [API_Test]","approval_state":"pending_approval","type":"ServiceTemplateProvisionRequest","created_on":"2018-09-21T14:15:57Z","updated_on":"2018-09-21T14:15:57Z","requester_id":"1000000000001","requester_name":"Administrator","request_type":"clone_to_service","request_state":"pending","message":"Service_Template_Provisioning - Request Created","status":"Ok","options":{"dialog":{"dialog_input_dropdown":"One","dialog_text_box":"TB Ping Pong"},"workflow_settings":{"resource_action_id":"1000000000015","dialog_id":"1000000000002"},"src_id":"1000000000001","request_options":{"submit_workflow":true},"cart_state":"ordered","requester_group":"EvmGroup-super_administrator"},"userid":"admin","source_id":"1000000000001","source_type":"ServiceTemplate","tenant_id":"1000000000001","service_order_id":"1000000000011","process":true}]} We're not sure how the customer was doing this when it was successful in 5.9.3. Were they able to do this in a single request? If so, can we get that request? For reference, here's the API doc - http://manageiq.org/docs/reference/latest/api/reference/services#service-templates, Look for "Ordering Services Service Templates" *** This bug has been marked as a duplicate of bug 1635673 *** |