# 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/native/forms.py
# class ScaleForm(forms.Form):
#     def clean(self):


import json
import requests
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.views.generic import FormView, View
from tsuru_dashboard.apps.views import AppMixin
from tsuru_autoscale.wizard import client as wclient
from tsuru_autoscale.native import forms




class NativeAutoscale(AppMixin, FormView):
    template_name = "native/index.html"
    form_class = forms.ScaleForm

    def get_form(self):
        token = self.request.session.get('tsuru_token').split(" ")[-1]
        app_name = self.kwargs.get('app_name')

# 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/native/forms.py
# class ScaleForm(forms.Form):
#     def clean(self):


# Path: tsuru_autoscale/native/views.py
import json
import requests
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.views.generic import FormView, View
from tsuru_dashboard.apps.views import AppMixin
from tsuru_autoscale.wizard import client as wclient
from tsuru_autoscale.native import forms





class NativeAutoscale(AppMixin, FormView):
    template_name = "native/index.html"
    form_class = forms.ScaleForm

    def get_form(self):
        token = self.request.session.get('tsuru_token').split(" ")[-1]
        app_name = self.kwargs.get('app_name')

        form = forms.ScaleForm(self.request.POST or None)