Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement hooks #4

Open
zorbash opened this issue Nov 8, 2016 · 4 comments
Open

Implement hooks #4

zorbash opened this issue Nov 8, 2016 · 4 comments

Comments

@zorbash
Copy link
Member

zorbash commented Nov 8, 2016

Currently one can update a widget either using a job or HTTP POST to /widgets/:id.

We could also allow settings hooks for easier integration with external services.

Example usage with GitHub webhooks:

# File: hooks/github.exs

hook :github_issues do
  issue = body |> Poison.decode!

  # Other, heavier processing can be added here
 
  broadcast! :github_issues, 
             %{user: issue |> get_in(["sender", "login"]), 
               title: issue |> get_in(["issue", "title"])}
end 

Kitto with the above hook definition would pass the request context and handling of POST /hooks/github_issues to the code in the hook.

@zorbash zorbash added this to the 0.3.0 milestone Nov 8, 2016
@zorbash zorbash removed this from the 0.3.0 milestone Nov 16, 2016
@davejlong
Copy link
Member

davejlong commented Nov 16, 2016

Had this thought from #21. When building out hooks there should be a general hook where any service can POST to /hooks/some_hook which will broadcast whatever the POST body as some_hook. Totally configureless so someone can build out a real time dashboard based on webhooks without writing a single line of Elixir.

@zorbash
Copy link
Member Author

zorbash commented Nov 16, 2016

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?

@davejlong
Copy link
Member

In building this out I would probably look to bring POST /widgets/:id
into the hooks. Implementation. The current implementation requires the
hook to post a specific format. The hook implementation would flip it to
enforce the widget to take in the data specific to the metric.

On Wed, Nov 16, 2016, 4:23 PM Dimitrios Zorbas [email protected]
wrote:

By totally configure-less you mean on the backend right?
How does this differ to POST/widgets/:id ?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKs1WYTbx8y0QBVitzhLwlhL645Uf9uks5q-3RkgaJpZM4Ksqc_
.

@zorbash
Copy link
Member Author

zorbash commented Nov 16, 2016

Oh i see, one can though even now create a dashboard only using POST /widgets/:id and not a single elixir job.

@davejlong davejlong mentioned this issue Nov 18, 2016
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants