Bug 1449538

Summary: [Eventing]: url validation to be done with webhook-add
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Sweta Anandpara <sanandpa>
Component: eventsapiAssignee: Bug Updates Notification Mailing List <rhs-bugs>
Status: CLOSED WONTFIX QA Contact: Sweta Anandpara <sanandpa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.3CC: amukherj, avishwan, rhs-bugs, sanandpa
Target Milestone: ---Keywords: ZStream
Target Release: ---   
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-19 06:53:11 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 Sweta Anandpara 2017-05-10 08:51:12 UTC
Description of problem:
=======================

Currently on an eventing enabled cluster when we would want to test and add a webhook, the command 'gluster-eventapi webhook-test' does catch the exceptions (if any) and errors out with the message. A similar error when committed on the command 'gluster-eventsapi webhook-add' (say, missing schema) does NOT error out but gets executed successfully. From the usability aspect it is expected to print out an error to intimate the user that the command is not successful, and why.

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


How reproducible:
=================
Always


Additional info:
================
In the below pasted output, the command 'gluster-eventsapi webhook-add' gets executed successfully even when the webhook-path specified is missing the protocol information.

[root@dhcp47-121 ~]# gluster-eventsapi webhook-test 10.70.35.119:9001/listen
+-----------------------------------+-------------+--------------------------------------------------------------------------+
|                NODE               | NODE STATUS |                                                           WEBHOOK STATUS |
+-----------------------------------+-------------+--------------------------------------------------------------------------+
| dhcp47-113.lab.eng.blr.redhat.com |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
| dhcp47-114.lab.eng.blr.redhat.com |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
| dhcp47-115.lab.eng.blr.redhat.com |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
| dhcp47-116.lab.eng.blr.redhat.com |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
| dhcp47-117.lab.eng.blr.redhat.com |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
|             localhost             |          UP | NOT OK: No connection adapters were found for '10.70.35.119:9001/listen' |
+-----------------------------------+-------------+--------------------------------------------------------------------------+
[root@dhcp47-121 ~]# gluster-eventsapi webhook-add 10.70.35.119:9001/listen
+-----------------------------------+-------------+-------------+
|                NODE               | NODE STATUS | SYNC STATUS |
+-----------------------------------+-------------+-------------+
| dhcp47-113.lab.eng.blr.redhat.com |          UP |          OK |
| dhcp47-114.lab.eng.blr.redhat.com |          UP |          OK |
| dhcp47-115.lab.eng.blr.redhat.com |          UP |          OK |
| dhcp47-116.lab.eng.blr.redhat.com |          UP |          OK |
| dhcp47-117.lab.eng.blr.redhat.com |          UP |          OK |
|             localhost             |          UP |          OK |
+-----------------------------------+-------------+-------------+
[root@dhcp47-121 ~]# gluster-eventsapi status
Webhooks: 
http://10.70.35.21:9000/listen
10.70.35.119:9001/listen

+-----------------------------------+-------------+-----------------------+
|                NODE               | NODE STATUS | GLUSTEREVENTSD STATUS |
+-----------------------------------+-------------+-----------------------+
| dhcp47-113.lab.eng.blr.redhat.com |          UP |                    OK |
| dhcp47-114.lab.eng.blr.redhat.com |          UP |                    OK |
| dhcp47-115.lab.eng.blr.redhat.com |          UP |                    OK |
| dhcp47-116.lab.eng.blr.redhat.com |          UP |                    OK |
| dhcp47-117.lab.eng.blr.redhat.com |          UP |                    OK |
|             localhost             |          UP |                    OK |
+-----------------------------------+-------------+-----------------------+
[root@dhcp47-121 ~]#