blob: de98a6dabd9d11e3e88d7444195398479549f589 [file] [log] [blame]
Murat Parlakisikb224cc92017-02-16 16:27:12 -08001from django.db import models
2from core.models import Service, PlCoreBase, Slice, Instance, Tenant, TenantWithContainer, Node, Image, User, Flavor, Subscriber, NetworkParameter, NetworkParameterType, Port, AddressPool
3from core.models.plcorebase import StrippedCharField
4import os
5from django.db import models, transaction
6from django.forms.models import model_to_dict
7from django.db.models import Q
8from operator import itemgetter, attrgetter, methodcaller
9from core.models import Tag
10from core.models.service import LeastLoadedNodeScheduler
11import traceback
12from xos.exceptions import *
13from xos.config import Config
14
15
16class ConfigurationError(Exception):
17 pass
18
19
20PROGRAN_KIND = "Progran"
21APP_LABEL = "progran"
22
23
24
25class VProgranService(Service):
26 KIND = PROGRAN_KIND
27
28 class Meta:
29 app_label = APP_LABEL
30 verbose_name = "Progran Service"
31 proxy = True
32
33 default_attributes = {
34 "rest_hostname": "10.6.0.1",
35 "rest_port": "8183",
36 "rest_user": "onos",
37 "rest_pass": "rocks"
38 }
39
40 @property
41 def rest_hostname(self):
42 return self.get_attribute("rest_hostname", self.default_attributes["rest_hostname"])
43
44 @rest_hostname.setter
45 def rest_hostname(self, value):
46 self.set_attribute("rest_hostname", value)
47
48 @property
49 def rest_port(self):
50 return self.get_attribute("rest_port", self.default_attributes["rest_port"])
51
52 @rest_port.setter
53 def rest_port(self, value):
54 self.set_attribute("rest_port", value)
55
56 @property
57 def rest_user(self):
58 return self.get_attribute("rest_user", self.default_attributes["rest_user"])
59
60 @rest_user.setter
61 def rest_user(self, value):
62 self.set_attribute("rest_user", value)
63
64 @property
65 def rest_pass(self):
66 return self.get_attribute("rest_pass", self.default_attributes["rest_pass"])
67
68
69
70
71class VProgranImsi(PlCoreBase):
72 class Meta:
73 app_label = APP_LABEL
74 verbose_name = "vProgran Imsi"
75
76 uiid = models.IntegerField( help_text="uiid ", null=False, blank=False)
77 imsi = models.CharField(max_length=20, help_text="imsi ", null=False, blank=False)
78 profile = models.CharField(max_length=20, help_text="profile name", null=True, blank=True)
79
80
81class VProgranProfile(PlCoreBase):
82
83 class Meta:
84 app_label = APP_LABEL
85 verbose_name = "vProgran Profile"
86
87 uiid = models.IntegerField( help_text="uiid ", null=False, blank=False)
88 profile = models.CharField(max_length=20, help_text="profile name", null=False, blank=False)
89 dlrate = models.IntegerField( help_text="device download rate", null=False, blank=False)
90 ulrate = models.IntegerField( help_text="device upload rate", null=False, blank=False )
91