Skip to content
Permalink
Browse files

Improve Resource Spec

  • Loading branch information...
terry-xiaoyu committed Apr 19, 2019
1 parent 8367e02 commit 5a13457d4f823fa80df1c7eab9a8e945ae6a0701
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/emqx_web_hook_actions.erl
@@ -18,8 +18,14 @@
-include_lib("emqx/include/emqx.hrl").

-define(RESOURCE_TYPE_WEBHOOK, 'web_hook').
-define(RESOURCE_CONFIG_SPEC, #{url => string, headers => json,
method => ['GET','PUT','POST','DELETE']}).
-define(RESOURCE_CONFIG_SPEC,
#{url => #{type => url, required => true,
description => <<"Request URL">>},
headers => #{type => object, required => false,
description => <<"Request Header">>},
method => #{type => enum, enum => ['GET','PUT','POST','DELETE'],
required => false,
description => <<"Request Method">>}}).

-define(JSON_REQ(URL, HEADERS, BODY), {(URL), (HEADERS), "application/json", (BODY)}).

@@ -35,7 +41,7 @@
func => forward_publish_action,
params => #{'$resource' => ?RESOURCE_TYPE_WEBHOOK},
type => ?RESOURCE_TYPE_WEBHOOK,
description => "Forward MQTT messages to Web Server"
description => "Forward Messages to Web Server"
}).

-rule_action(#{name => event_action,

0 comments on commit 5a13457

Please sign in to comment.
You can’t perform that action at this time.