nautobot-app-chatops icon indicating copy to clipboard operation
nautobot-app-chatops copied to clipboard

Expose a method to send unrequested IM

Open chadell opened this issue 4 years ago • 4 comments

Environment

Nautobot version: 1.0.0 nautobot-plugin-chatops version: 1.1.0

Proposed Functionality

Even Chatops is designed for user interaction today, I believe that having the necessary credentials to interact with the different IM systems, it would make sense to expose a method such as send_message that would be able to send an unrequested message to a specific group.

Use Case

This feature could be used from other plugins to send custom notifications to IM groups in order to notify when an event happens.

chadell avatar May 10 '21 12:05 chadell

Interesting idea. I've been thinking about something similar using webhooks, but it doesn't always make sense to have it on-change. The right approach is having a "Notifications System/Engine". What you are proposing makes sense to me and I like the idea with starting with chat. An obvious next use case may be email. But for now allowing the system and other plugins to be able to notify or send_message is great. This feature particularly could make sense to have in core at some point, but maybe it starts here since it may accelerate development. Think about sending a message at the start and/or stop of each Nautobot job, etc. Curious what others think?

jedelman8 avatar May 10 '21 14:05 jedelman8

The traditional method for handling notifications would be through webhooks for many chat applications. I'm personally good to change that tradition.

The ubiquitous nature of webhooks is the reason for that, all of chat applications that this integrates with will need to support sending a message without solicitation. If they all support it, then setting up through the same methodology would make sense.

jvanderaa avatar May 10 '21 15:05 jvanderaa

I was actually referring Nautobot webhooks. I believe this would still require creating a webhook in the App, in Slack, for example. It'll be based on the design. Users could have the ability to use same token or new token for this feature.

jedelman8 avatar May 10 '21 15:05 jedelman8

From my experience (with Webex) we wouldn't need to create/define custom webhooks in the other side (maybe this is not true for other apps). We could use well-defined API endpoints webex or slack to post a message to a chat/room.

So, the idea is just reuse the setup already in place (credentials) to be able to send_message(destination, message) that the plugin will translate to the proper API call. So, from the caller perspective is just a method call.

I also agree with you Jason about adding to Nautobot a "Notifications System/Engine" that could support IM and email, but for now adding this feature here would be pretty straight-forward.

chadell avatar May 12 '21 05:05 chadell