Code Monkey home page Code Monkey logo

Comments (6)

chadell avatar chadell commented on June 17, 2024

You can trigger Jobs via API: https://nautobot.readthedocs.io/en/stable/additional-features/jobs/#via-the-api
is it good enough?

from nautobot-app-ssot.

 avatar commented on June 17, 2024

Unfortunately no as IP Fabric does not let you send custom responses. The endpoint receiving the webhooks must parse the data and then do automation against it.

https://ipfabric.atlassian.net/wiki/spaces/ND/pages/1456537601/Webhooks

from nautobot-app-ssot.

chadell avatar chadell commented on June 17, 2024

So, if don't understand it wrong, the problem is that you can't add "data" or custom authorization to the request.
Actually, "data" is optional, we could create a Job that assumes the defaults, but authorization is mandatory, for any API endpoint in Nautobot.
Isn't any way to add it in the webhook?

from nautobot-app-ssot.

 avatar commented on June 17, 2024

Nautobot will need to process the webhook IP Fabric sends because it sends a message for every discovery action and status:
"action": "discover" | "clone" | "delete" | "download" | "load" | "unload", "status": "started" | "completed" | "failed" | "resumed" | "resumed (stopping)" | "stopped",

This will then possibly kick off an SSOT job for example when a snapshot action:delete/status:started which is incorrect. It needs to only kick off an SSOT job when action:discover, status:completed, requester:cron.

There is no way to add any authorization to the webhook. Nautobot will need to accept the event and verify the message:
The secret code is used to calculate the SHA256 HMAC payload hash which is sent inx-ipf-signature header. Using x-ipf-signature you can validate that request comes from correct server.

Full IP Fabric webhook message:
{ "type": "snapshot", "action": "discover" | "clone" | "delete" | "download" | "load" | "unload", "status": "started" | "completed" | "failed" | "resumed" | "resumed (stopping)" | "stopped", "reason"?: string, "requester": "cron" | "user:<id>", "snapshot"?: { "id": string, "name"?: string, "cloneId"?: string, "file"?: string, } "timestamp": number, "test"?: boolean }

from nautobot-app-ssot.

jedelman8 avatar jedelman8 commented on June 17, 2024

Just for kicks, worth exploring the roadmap of webhooks in IPF too. For example, being able to template the JSON body as in Nautobot make it very flexible! :)

https://nautobot.readthedocs.io/en/latest/models/extras/webhook/#jinja2-template-support

https://blog.networktocode.com/post/nautobot-webhooks/

from nautobot-app-ssot.

 avatar commented on June 17, 2024

At this time changes to IP Fabric webhooks is not on the roadmap as our highest priorities is adding new vendor functionality.

from nautobot-app-ssot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.