Skip to main content

Post Key Vault Secrets report to webhook

Project description

ops-py-reports

Payloads

Slack App

Creates Slack payload(s) from the provided title and body.

The title will be formatted as bold, while the body will be formatted as a Code block:
[{"text": f"*{title}*\n{body}"}]

  • If the payload is too large it will be split into multiple parts (individual posts).
    • If spilt, the provided title will be used for all posts.
      • The part number will be appended to the title on each post.

Reports

SlackMessages

Accepts a list of dicts and returns Slack Markdown formatted rows.

The get_ssl_report() method creates a message with a provided title in bold (defaults to SSL certificates report) .
If any of the provided rows of dicts contains a status key, the value of this key will be formatted according to the status value. Defaults to the following config:

{
  "ok": {
    "emoji": ":white_check_mark:",
    "txt": "OK"
  },
  "warning": {
    "emoji": ":warning:",
    "txt": "WARNING"
  },
  "critical": {
    "emoji": ":bangbang:",
    "txt": "CRITICAL!"
  },
  "expired": {
    "emoji": ":rotating_light:",
    "txt": "EXPIRED!!"
  },
  "error": {
    "emoji": ":no_entry:",
    "txt": "ERROR"
  },
  "unknown": {
    "emoji": ":question:",
    "txt": "UNKNOWN"
  }
}

The status will use the provided config to apply corresponding emoji and status text.

Markdown

Creates a plain text Markdown table from a list (rows) of lists (columns). The header is the first list in the list of rows.

HTMLTable

Creates a HTML table from a list (rows) of lists (columns). The header is the first list in the list of rows.

Styles

"grey": " style='background-color: Grey; color: White; font-weight:bold'"
"purple": " style='background-color: Purple; color: White; font-weight:bold'"
"yellow": " style='background-color: Yellow; color: Black; font-weight:bold'"
"red": " style='background-color: Red; color: White; font-weight:bold'"
"green": " style='background-color: Green; color: White; font-weight:bold'"

will be added to the cells which equals the following values:

"disabled": "grey"  
"unknown": "grey"  
"warning": "yellow"  
"critical": "red"  
"ok": "green"  
"error": "red"  
"expired": "red"  

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

ops_py_reports-0.4.4.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ops_py_reports-0.4.4-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ops_py_reports-0.4.4.tar.gz.

File metadata

  • Download URL: ops_py_reports-0.4.4.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ops_py_reports-0.4.4.tar.gz
Algorithm Hash digest
SHA256 d8cb0cabdc37f116fe9c5bb1a6c0f810dd7b6dc58f6bcf1010298bcabec5b605
MD5 3de485fd2ccb4e19ba5273c84501b75a
BLAKE2b-256 790faf707f4b7cb2d1bd6b8d5216ed488ff2daa23ec38a042488b92eac9152b6

See more details on using hashes here.

File details

Details for the file ops_py_reports-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: ops_py_reports-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ops_py_reports-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80a3097573928e564fdc5c20ac2df8d40dcf6f13629beeac16ddee097920784b
MD5 fbd137bc144700c3c3aa1ff2a380627e
BLAKE2b-256 645c339d04600009b47bdfcbebecb78139631c2c5f355981bc48dece5d4d90a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page