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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 745c218b5bafaa154576b6d4acfcc91a11366492a934f2bb07f36cac40cf29d6 |
|
MD5 | e747a95fd67d1adea53e9ec72c689b51 |
|
BLAKE2b-256 | d3e2fe5893f2a6366683b88b8193c104d700b16c279bb8e61d656534047f768e |
Close
Hashes for ops_py_message_handler-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2460d384aa4524f2368a0612d9f120f89656327e623f2e680a754801c2a4abc |
|
MD5 | f190d770ef4ba527f327238acd4174cc |
|
BLAKE2b-256 | f1cd28b0fcfeb6cdc1c05072134439a159ff00a0212b59fa321c56ae3614c1d4 |