# Path: monitoring/alarmdefs/constants.py
# URL_PREFIX = 'horizon:monitoring:alarmdefs:'
# TEMPLATE_PREFIX = 'monitoring/alarmdefs/'
# 
# Path: monitoring/alarmdefs/forms.py
# def _get_metrics_call(request, offset=None):
# def _get_metrics(request):
# def _get_notifications(request):
#     def __init__(self, initial, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def _get_metrics(self):
#     def _set_metrics(self, value):
#     def __init__(self, initial, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def __init__(self, *args, **kwargs):
#     def _get_choices(self):
#     def _set_choices(self, value):
#     def compress(self, data_list):
#     def clean(self, value):
#     def __init__(self, *args, **kwargs):
#     def render(self, name, value, attrs=None, choices=(), renderer=None):
#     def value_from_datadict(self, data, files, name):
#     def __init__(self, request, *args, **kwargs):
#     def _instantiate(cls, request, *args, **kwargs):
#     def _init_fields(self, readOnly=False, create=False, initial=None):
#     def set_notification_choices(self, request):
#     def handle(self, request, data):
# class ExpressionWidget(forms.Widget):
# class ExpressionField(forms.CharField):
# class MatchByWidget(forms.Widget):
# class NotificationField(forms.MultiValueField):
# class NotificationCreateWidget(forms.Select):
# class EditAlarmForm(forms.SelfHandlingForm):


from django.utils.translation import ugettext_lazy as _  # noqa
from django.views.decorators.debug import sensitive_variables
from horizon import exceptions
from horizon import forms
from horizon.utils import memoized
from horizon import workflows
from monitoring.alarmdefs import constants
from monitoring.alarmdefs import forms as ad_forms
from monitoring import api
# Copyright 2016 FUJITSU LIMITED
#
# 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.





class SetAlarmNotificationsAction(workflows.Action):
    notifications = ad_forms.NotificationField(
        label=_('Notifications'),
        required=False,
        widget=ad_forms.NotificationCreateWidget(),
        help_text=_('Notification methods. '
                    'Notifications can be sent when an alarm '
                    'state transition occurs.'))


# Path: monitoring/alarmdefs/constants.py
# URL_PREFIX = 'horizon:monitoring:alarmdefs:'
# TEMPLATE_PREFIX = 'monitoring/alarmdefs/'
# 
# Path: monitoring/alarmdefs/forms.py
# def _get_metrics_call(request, offset=None):
# def _get_metrics(request):
# def _get_notifications(request):
#     def __init__(self, initial, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def _get_metrics(self):
#     def _set_metrics(self, value):
#     def __init__(self, initial, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def __init__(self, *args, **kwargs):
#     def _get_choices(self):
#     def _set_choices(self, value):
#     def compress(self, data_list):
#     def clean(self, value):
#     def __init__(self, *args, **kwargs):
#     def render(self, name, value, attrs=None, choices=(), renderer=None):
#     def value_from_datadict(self, data, files, name):
#     def __init__(self, request, *args, **kwargs):
#     def _instantiate(cls, request, *args, **kwargs):
#     def _init_fields(self, readOnly=False, create=False, initial=None):
#     def set_notification_choices(self, request):
#     def handle(self, request, data):
# class ExpressionWidget(forms.Widget):
# class ExpressionField(forms.CharField):
# class MatchByWidget(forms.Widget):
# class NotificationField(forms.MultiValueField):
# class NotificationCreateWidget(forms.Select):
# class EditAlarmForm(forms.SelfHandlingForm):


# Path: monitoring/alarmdefs/workflows.py
from django.utils.translation import ugettext_lazy as _  # noqa
from django.views.decorators.debug import sensitive_variables
from horizon import exceptions
from horizon import forms
from horizon.utils import memoized
from horizon import workflows
from monitoring.alarmdefs import constants
from monitoring.alarmdefs import forms as ad_forms
from monitoring import api

# Copyright 2016 FUJITSU LIMITED
#
# 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.





class SetAlarmNotificationsAction(workflows.Action):
    notifications = ad_forms.NotificationField(
        label=_('Notifications'),
        required=False,
        widget=ad_forms.NotificationCreateWidget(),
        help_text=_('Notification methods. '
                    'Notifications can be sent when an alarm '
                    'state transition occurs.'))


    alarm_actions = ad_forms.NotificationField(