# Copyright 2018: Mirantis Inc.
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


RESOLVED_STATUSES = ('UP', 'OK', 'resolved')


def alert_fields_and_action(alert):
    fields = []
    action = 'create_case'

    if alert['status'] in RESOLVED_STATUSES:
        fields.append(alert['labels'])
        action = 'close_case'
    else:
        # Order matters
        fields.append('[sf-notifier] {}'.format(
            alert['annotations']['summary'])
        )
        fields.append(alert['annotations']['description'])
        fields.append(alert['status'])
        fields.append(alert['labels'])
    return fields, action
