from trove.common.notification import EndNotification def delete_database(): # Some code to delete a database end_notification = EndNotification() end_notification.notify()
from trove.common.notification import EndNotification def resize_database(instance_id, flavor_id): # Some code to resize a database instance end_notification = EndNotification(instance_id=instance_id) end_notification.extra_payload.update({'flavor_id': flavor_id}) end_notification.notify()This example shows how the `EndNotification` can be used to notify the system that a database instance has been resized. The `instance_id` parameter is passed in to the constructor to identify the instance being resized. The `extra_payload` attribute is used to store additional information, in this case, the `flavor_id` that the instance was resized to. The `notify()` function is called to trigger the notification.