(context, action, outcome, cluster_obj=None)
Send a notification about cluster operation.

    :param action: CADF action being audited
    :param outcome: CADF outcome
    :param cluster_obj: the cluster the notification is related to
Send a notification about cluster operation.
Send a notification about cluster operation .
def notify_about_cluster_operation(context, action, outcome, cluster_obj=None):
    """Send a notification about cluster operation.

    :param action: CADF action being audited
    :param outcome: CADF outcome
    :param cluster_obj: the cluster the notification is related to
    """
    notifier = rpc.get_notifier()

    event = eventfactory.EventFactory().new_event(
        eventType=cadftype.EVENTTYPE_ACTIVITY,
        outcome=outcome,
        action=action,
        initiator=_get_request_audit_info(context),
        target=_get_event_target(cluster_obj=cluster_obj),
        observer=resource.Resource(typeURI='service/magnum/cluster'))
    service = 'magnum'
    event_type = '%(service)s.cluster.%(action)s' % {
        'service': service, 'action': action}
    payload = event.as_dict()

    if outcome == taxonomy.OUTCOME_FAILURE:
        method = notifier.error
    else:
        method = notifier.info

    method(context, event_type, payload)
def notify_about_cluster_operation ( context , action , outcome , cluster_obj = None ) : notifier = rpc . get_notifier ( ) event = eventfactory . EventFactory ( ) . new_event ( eventType = cadftype . EVENTTYPE_ACTIVITY , outcome = outcome , action = action , initiator = _get_request_audit_info ( context ) , target = _get_event_target ( cluster_obj = cluster_obj ) , observer = resource . Resource ( typeURI = 'service/magnum/cluster' ) ) service = 'magnum' event_type = '%(service)s.cluster.%(action)s' % { 'service' : service , 'action' : action } payload = event . as_dict ( ) if outcome == taxonomy . OUTCOME_FAILURE : method = notifier . error else : method = notifier . info method ( context , event_type , payload )