Hello Michael, The reason your bundle is not started with the "core" bundle is because it is not registered in the list here (reserved for core Apache Unomi bundles) : https://github.com/apache/incubator-unomi/blob/master/tools/shell-commands/src/main/resources/OSGI-INF/blueprint/blueprint.xml This configuration is the list of bundles that the unomi:start command will actually start.
By default all the bundles in Unomi are stopped to allow for the migration tasks to happen (if needed). Once you install and start your bundle it will remain started even if you restart Karaf. Btw one VERY useful command to know, especially as you have already learned how to install from your local Maven repository is the bundle:watch command. Once you call that with your bundle id it will watch your local repository (the location from which you have installed) and refresh the bundle if it changes. That way you can simply do : mvn clean install on your bundle and it will automatically refresh in Karaf without needed to restart anything. For the key pair it is not possible to do that with parameters, but I would suggest the following: simply "encode" the pairs in a string property, something like : { "id": "headers", "type": "string", "multivalued": false } and then put in headers something easy to parse like : Content-Type:application/json###Basic: asdf978adsf### or you could serialize some JSON in there and parse it out. That would also make the payload easy to store. Regards, Serge... On Tue, Dec 4, 2018 at 3:42 PM Michael Ghen <m...@mikeghen.com> wrote: > > One more thing about this plugin, seems like the HTTP GET request worked OK > so I'm interested in adding headers (for basic HTTP auth) and setting up > POST. > > Is there a way to accept key, value pairs in the parameters? > > I have this as parameters in my JSON now: > > "parameters": [ > { > "id": "webHookUrl", > "type": "string", > "multivalued": false > }, > { > "id": "webHookMethod", > "type": "string", > "multivalued": false > } > ] > > Would like to add "headers" and "payload" both as key-value pairs, I don't > see a type = mapping anywhere and I'm not sure what "multivalued" is, maybe > that could help? > > > On Tue, Dec 4, 2018 at 9:01 AM Michael Ghen <m...@mikeghen.com> wrote: > > > OK, I got this sorted out. Ended up running: > > > > karaf@root()> bundle:install > > mvn:org.apache.unomi/unomi-plugins-webhook/1.4.0-incubating-SNAPSHOT > > Bundle ID: 179 > > karaf@root()> bundle:start 179 > > > > Then my webhook action shows in unomi:action-list. Thanks Damien and Serge. > > > > I'm not sure why it is that the action I added is not immediately > > available like the other actions but this at least lets me give my webhook > > a try. > > > > BTW, the new unomi: commands are very helpful in 1.4 > > > > On Mon, Dec 3, 2018 at 11:47 AM Michael Ghen <m...@mikeghen.com> wrote: > > > >> Serge, I was mostly just copying exactly what was there so I just did > >> everything that existed for the mail action. I will try this bunble:start > >> thing and see what happens. I'll see if I can get it working with headers > >> and post body and maybe I can contribute it back. > >> > >> On Mon, Dec 3, 2018 at 6:03 AM Serge Huber <shu...@apache.org> wrote: > >> > >>> Hello Michael, > >>> > >>> I tried your code and everything is there, the only thing is that your > >>> bundle is not started. You have added it as part of the main Karaf > >>> Feature of Unomi (was this intentional ? Are you intending to > >>> contribute this as part as the core of Unomi ?) > >>> > >>> Anyway I just did a bundle:start on the bundle ID and your action was > >>> up and running (it's listed in the action-list command). > >>> > >>> If you're just looking to build an optional extension I would > >>> recommend building a seperate feature (or just a bundle) as Damien > >>> suggested. > >>> > >>> But it's true that a webhook plugin is a really good idea ! > >>> > >>> Regards, > >>> Serge... > >>> > >>> > >>> > >>> On Mon, Dec 3, 2018 at 10:55 AM Damien GAILLARD <dgaill...@jahia.com> > >>> wrote: > >>> > > >>> > Hi Michael, > >>> > > >>> > I haven't look at your entire code yet but did you check if your > >>> bundle is > >>> > activated by using the command bundle:list | grep unomi it should show > >>> up > >>> > in the list. > >>> > If the bundle is here it's a good start and if it's in resolved you > >>> might > >>> > just need to start it, with something like that: > >>> > > >>> > bundle:install > >>> mvn:org.apache.unomi/login-integration-samples/${project.version} > >>> > > >>> > or like that: > >>> > > >>> > feature:repo-add > >>> > > >>> mvn:org.apache.unomi/unomi-salesforce-connectors-karaf-kar/${project.version}/xml/features > >>> > feature:install unomi-salesforce-connectors-karaf-kar > >>> > > >>> > I'm pretty sure we have some documentation somewhere but I could not > >>> find > >>> > it, and the closest video that show how to deploy a plugin might be > >>> this > >>> > one but the quality is not really good: > >>> > https://www.youtube.com/watch?v=IvP_iIlw2vQ&t=1389s > >>> > and this is the repo that was used for the demo so you can easily use > >>> it as > >>> > an example > >>> > https://github.com/Jahia/unomi-twilio > >>> > > >>> > Cheers > >>> > > >>> > On Sun, Dec 2, 2018 at 6:11 PM Michael Ghen <m...@mikeghen.com> wrote: > >>> > > >>> > > PS: The message I get in the logs is: > >>> > > > >>> > > 2018-12-01T22:23:13,867 | WARN | pool-44-thread-1 | ParserHelper > >>> > > | 185 - org.apache.unomi.services - > >>> 1.4.0.incubating-SNAPSHOT | > >>> > > Couldn't resolve action types : webHookAction > >>> > > > >>> > > On Sun, Dec 2, 2018 at 12:06 PM Michael Ghen <m...@mikeghen.com> > >>> wrote: > >>> > > > >>> > > > Hi, > >>> > > > > >>> > > > I'm working on my first plugin. I'm trying to add a general webhook > >>> > > action > >>> > > > to send requests to another service when a condition is met in a > >>> rule. I > >>> > > > looked at the docs about Plugins and looked a little at OSGI. I > >>> took the > >>> > > > approach of trying to start with a copy of another action and > >>> refactor > >>> > > it. > >>> > > > > >>> > > > The plugin I made seems to build OK and shows up in the build. > >>> > > > Unfortunately, when I use unomi:action-list, the action doesn't > >>> show up > >>> > > > there and when I add a rule using the action, I just get an error > >>> that > >>> > > > unomi can't find my action. > >>> > > > > >>> > > > Would anyone be able to review my plugin and help me trace down > >>> what I > >>> > > > missed? > >>> > > > > >>> > > > > >>> > > > > >>> > > > >>> https://github.com/apache/incubator-unomi/compare/master...mikeghen:feature/webhook-action?expand=1 > >>> > > > > >>> > > > I've been going file by file through my action and comparing it to > >>> the > >>> > > > mail action I copied and refactored but can't seem to see what the > >>> > > problem > >>> > > > is. Any suggestions? I tried walking back through the action-list > >>> code to > >>> > > > see if that gave me some clues but it did not. > >>> > > > > >>> > > > > >>> > > > > >>> > > > >>> > > >>> > > >>> > -- > >>> > Damien GAILLARD > >>> > Software Developer > >>> > < > >>> https://www.jahia.com/cms/render/default/en/sites/jahiacom/home/employees/grid-layout/jahia-employee/GaillardDamien.signature.html.ajax > >>> > > >>> > < > >>> https://www.jahia.com/cms/render/default/en/sites/jahiacom/home/employees/grid-layout/jahia-employee/GaillardDamien.signature.html.ajax > >>> > > >>> > 8 rue du sentier | 75002 | France > >>> > < > >>> https://www.jahia.com/cms/render/default/en/sites/jahiacom/home/employees/grid-layout/jahia-employee/GaillardDamien.signature.html.ajax > >>> > > >>> > < > >>> https://www.jahia.com/cms/render/default/en/sites/jahiacom/home/employees/grid-layout/jahia-employee/GaillardDamien.signature.html.ajax > >>> > > >>> > jahia.com <http://www.jahia.com/> > >>> > SKYPE | TWITTER <https://twitter.com/> | VCARD > >>> > <http://www.jahia.com/vcard/GaillardDamien.vcf> > >>> > > >>> > > JAHIA <http://www.jahia.com/> empowers organizations to create > >>> > sophisticated websites that drive their business growth > >>> > >>