# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/actions/tables.py
# LOG = logging.getLogger(__name__)
# ACTION_STATE_DISPLAY_CHOICES = (
#     ("NO STATE", pgettext_lazy("Power state of an Instance", u"No State")),
#     ("ONGOING", pgettext_lazy("Power state of an Instance", u"On Going")),
#     ("SUCCEEDED", pgettext_lazy("Power state of an Instance", u"Succeeded")),
#     ("CANCELLED", pgettext_lazy("Power state of an Instance", u"Cancelled")),
#     ("FAILED", pgettext_lazy("Power state of an Instance", u"Failed")),
#     ("DELETED", pgettext_lazy("Power state of an Instance", u"Deleted")),
#     ("PENDING", pgettext_lazy("Power state of an Instance", u"Pending")),
# )
# class UpdateRow(horizon.tables.Row):
# class ActionsFilterAction(horizon.tables.FilterAction):
# class ActionsTable(horizon.tables.DataTable):
#     class Meta(object):
# class RelatedActionsTable(horizon.tables.DataTable):
#     class Meta(object):
# class ActionParametersTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_data(self, request, action_id):
# def get_action_plan_link(datum):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/actions/tabs.py
# class OverviewTab(tabs.Tab):
# class ActionDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):


import collections
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.utils.translation import ugettext_lazy as _
from horizon.utils import memoized
from watcher_dashboard.api import watcher
from watcher_dashboard.content.actions import tables
from watcher_dashboard.content.actions import tabs as wtabs
        return context

    def get_data(self):
        actions = []
        search_opts = self.get_filters()
        try:
            actions = watcher.Action.list(self.request, **search_opts)
        except Exception:
            horizon.exceptions.handle(
                self.request,
                _("Unable to retrieve action information."))
        return actions

    def get_actions_count(self):
        return len(self.get_data())

    def get_filters(self):
        filters = {}
        filter_action = self.table._meta._filter_action
        if filter_action:
            filter_field = self.table.get_filter_field()
            if filter_action.is_api_filter(filter_field):
                filter_string = self.table.get_filter_string()
                if filter_field and filter_string:
                    filters[filter_field] = filter_string
        return filters


class DetailView(horizon.tables.MultiTableView):
    table_classes = [tables.ActionParametersTable]

# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/actions/tables.py
# LOG = logging.getLogger(__name__)
# ACTION_STATE_DISPLAY_CHOICES = (
#     ("NO STATE", pgettext_lazy("Power state of an Instance", u"No State")),
#     ("ONGOING", pgettext_lazy("Power state of an Instance", u"On Going")),
#     ("SUCCEEDED", pgettext_lazy("Power state of an Instance", u"Succeeded")),
#     ("CANCELLED", pgettext_lazy("Power state of an Instance", u"Cancelled")),
#     ("FAILED", pgettext_lazy("Power state of an Instance", u"Failed")),
#     ("DELETED", pgettext_lazy("Power state of an Instance", u"Deleted")),
#     ("PENDING", pgettext_lazy("Power state of an Instance", u"Pending")),
# )
# class UpdateRow(horizon.tables.Row):
# class ActionsFilterAction(horizon.tables.FilterAction):
# class ActionsTable(horizon.tables.DataTable):
#     class Meta(object):
# class RelatedActionsTable(horizon.tables.DataTable):
#     class Meta(object):
# class ActionParametersTable(horizon.tables.DataTable):
#     class Meta(object):
#     def get_data(self, request, action_id):
# def get_action_plan_link(datum):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/actions/tabs.py
# class OverviewTab(tabs.Tab):
# class ActionDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):


# Path: watcher_dashboard/content/actions/views.py
import collections
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.utils.translation import ugettext_lazy as _
from horizon.utils import memoized
from watcher_dashboard.api import watcher
from watcher_dashboard.content.actions import tables
from watcher_dashboard.content.actions import tabs as wtabs

        return context

    def get_data(self):
        actions = []
        search_opts = self.get_filters()
        try:
            actions = watcher.Action.list(self.request, **search_opts)
        except Exception:
            horizon.exceptions.handle(
                self.request,
                _("Unable to retrieve action information."))
        return actions

    def get_actions_count(self):
        return len(self.get_data())

    def get_filters(self):
        filters = {}
        filter_action = self.table._meta._filter_action
        if filter_action:
            filter_field = self.table.get_filter_field()
            if filter_action.is_api_filter(filter_field):
                filter_string = self.table.get_filter_string()
                if filter_field and filter_string:
                    filters[filter_field] = filter_string
        return filters


class DetailView(horizon.tables.MultiTableView):
    table_classes = [tables.ActionParametersTable]

    tab_group_class = wtabs.ActionDetailTabs