# Path: tsuru_autoscale/instance/client.py
# def host():
# def list(token):
# def get(name, token):
# def alarms_by_instance(instance, token):
# 
# Path: tsuru_autoscale/wizard/client.py
# def host():
# def tsuru_host():
# def clean_token(token):
# def app_info(name, token):
# def pool_info(name, token):
# def process_list(instance_name, token):
# def new(data, token):
# def get(name, token):
# def remove(name, token):
# def enable(name, token):
# def disable(name, token):
# def events(name, token):


import os
from django.views.generic import TemplateView
from tsuru_autoscale.instance import client
from tsuru_autoscale.wizard import client as wclient
from tsuru_dashboard.apps.views import AppMixin




class AutoscaleApp(AppMixin, TemplateView):
    template_name = 'app/index.html'

    def get_context_data(self, *args, **kwargs):
        context = super(AutoscaleApp, self).get_context_data(*args, **kwargs)

        token = self.request.session.get('tsuru_token').split(" ")[-1]

# Path: tsuru_autoscale/instance/client.py
# def host():
# def list(token):
# def get(name, token):
# def alarms_by_instance(instance, token):
# 
# Path: tsuru_autoscale/wizard/client.py
# def host():
# def tsuru_host():
# def clean_token(token):
# def app_info(name, token):
# def pool_info(name, token):
# def process_list(instance_name, token):
# def new(data, token):
# def get(name, token):
# def remove(name, token):
# def enable(name, token):
# def disable(name, token):
# def events(name, token):


# Path: tsuru_autoscale/app/views.py
import os
from django.views.generic import TemplateView
from tsuru_autoscale.instance import client
from tsuru_autoscale.wizard import client as wclient
from tsuru_dashboard.apps.views import AppMixin





class AutoscaleApp(AppMixin, TemplateView):
    template_name = 'app/index.html'

    def get_context_data(self, *args, **kwargs):
        context = super(AutoscaleApp, self).get_context_data(*args, **kwargs)

        token = self.request.session.get('tsuru_token').split(" ")[-1]

        instances = client.list(token).json() or []