Post a payload to specfied url
Project description
ops-py-message-handler
Description
Post a message to a url (webhook).
Note: In the example code below a Slack Automation Workflow has already been built. The message part of the Slack Workflow has been defined to receive a Title
and a Text
variable.
Installation
pip install ops-py-message-handler
Usage
Export your slack webhook:
export WEBHOOK="12345blablabla...."
Example code:
from message_handler import message_handler as mh
WEBHOOK = os.getenv("WEBHOOK")
heading = "This is the heading"
message = "This is the message"
mh = MessageHandler(WEBHOOK)
mh.set_payload(Title=heading, Text=message)
mh.post_payload()
response_code = mh.get_response_code()
print(response_code)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ops-py-message-handler-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9807a9d9760516335707bffb8e7ed9fbc60cd674be1da143a7f2d500edc66389 |
|
MD5 | 71979a52e4b0cc50685a2e5a97945adc |
|
BLAKE2b-256 | 00c62d878998c46b7091460bd436c35b7e3520c1d8d9f0287f97ebbfe67b8964 |
Close
Hashes for ops_py_message_handler-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b6c0548dc776a1bc6c838937a4b6f9d9d6338744e7b49bec8743e16ca49c42f |
|
MD5 | 3de2cac15fd52ea33f9052202a8e5867 |
|
BLAKE2b-256 | 3cc8d0dd56c911cfb77c5ccd984133b1e0abf66eae95cf0dc7a8d777fe4d17f3 |