quads icon indicating copy to clipboard operation
quads copied to clipboard

[RFE] General Purpose Tenant Contact Tool

Open sadsfae opened this issue 1 year ago • 2 comments

This is an RFE for a general-purpose tenant contact tool like src/quads/tools/notify_tenant.py

Description

  • Contacts cloud-owner and cc-users of one more more environments either via email, ticket or both
  • Parses a file somewhere for the message payload

Integration

notify_tenant.py

Payload

--message /path/to/message.txt

Usage Options

--cloud "cloud02 cloud03 cloud04" (list of environments) --all (all active environments) --rack "rack1 rack2 rack3" (send to all clouds with systems in certain racks) - this may need to wait for https://github.com/redhat-performance/quads/issues/448 to simplify lookups --ticket (can be used with or without --email) --email (can be used with or without --ticket) --subject (used for email)

Example Usage

  • notifying all environments of an outage or downtime
notify_tenant.py --all --ticket --email --subject "Ongoing Power Outage in XYZ!" --message /tmp/2024-10-15-outage.txt
  • notifying cloud02 of switch maintenance via JIRA
notify_tenant.py --cloud "cloud02" --ticket --message /tmp/cloud02-maintenance.txt
  • notifying cloud04 and cloud06 via email of their expiration
notify_tenant.py --cloud "cloud04 cloud06" --email --subject "Upcoming Expiration 2024-10-15" --message /tmp/expirationso-2024-10-15.txt
  • notifying system owners with clouds in rack b01 and b02 about maintenance
notify_tenant.py --rack "b01 b02" --email --subject "Upcoming Maintenance 2024-10" --message /tmp/rack_b01_b02.txt

sadsfae avatar Oct 16 '24 06:10 sadsfae

Don't we already send the expiration emails via cron entries for notifications? I only ask because of the 3rd example, but the use cases for power outage, or maintenance work would be great use cases. Perhaps also add something like:

notify_tenant.py --racks <rack1_name[,rack2_name[,rack3_name...]]> --ticket --message /tmp/message.txt

may be a good use case, for which the notification goes out to any environment that has a current/active allocation with hosts that are part of a given rack.

kambiz-aghaiepour avatar Oct 16 '24 09:10 kambiz-aghaiepour

Don't we already send the expiration emails via cron entries for notifications? I only ask because of the 3rd example, but the use cases for power outage, or maintenance work would be great use cases. Perhaps also add something like:

Yeah we use use postman lib for those notifications currently so any new tool can just import that.

notify_tenant.py --racks <rack1_name[,rack2_name[,rack3_name...]]> --ticket --message /tmp/message.txt

may be a good use case, for which the notification goes out to any environment that has a current/active allocation with hosts that are part of a given rack.

Yeah love the idea of --rack too, I'll update the RFE

--rack may want to wait until we implement https://github.com/redhat-performance/quads/issues/448 where we move rack location into the host metadata.

sadsfae avatar Oct 16 '24 09:10 sadsfae