1 # Copyright 2017 ZTE Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 from django.db import models
17 class NfInstModel(models.Model):
21 nfinstid = models.CharField(db_column='NFINSTID', max_length=200, primary_key=True)
22 nf_name = models.CharField(db_column='NFNAME', max_length=100, blank=True, null=True) # CreateVnfRequest.vnfInstanceName
23 package_id = models.CharField(db_column='PACKAGEID', max_length=200, blank=True, null=True)
24 status = models.CharField(db_column='STATUS', max_length=20, blank=True, null=True)
25 flavour_id = models.CharField(db_column='FLAVOURID', max_length=200, blank=True, null=True) # InstantiateVnfRequest.flavourId
26 location = models.CharField(db_column='LOCATION', max_length=200, blank=True, null=True)
27 version = models.CharField(db_column='VERSION', max_length=255, null=True)
28 vendor = models.CharField(db_column='VENDOR', max_length=255, null=True, blank=True)
29 netype = models.CharField(db_column='NETYPE', max_length=255, null=True)
30 vnfd_model = models.TextField(db_column='VNFDMODEL', max_length=20000, blank=True, null=True)
31 input_params = models.TextField(db_column='INPUTPARAMS', max_length=2000, blank=True, null=True) # InstantiateVnfRequest.additionalParams
32 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
33 lastuptime = models.CharField(db_column='LASTUPTIME', max_length=200, blank=True, null=True)
35 nf_desc = models.CharField(db_column='VNFINSTANCEDESC', max_length=200, blank=True, null=True)
36 vnfdid = models.CharField(db_column='VNFDID', max_length=200, blank=True, null=True)
37 vnfSoftwareVersion = models.CharField(db_column='VNFSOFTWAREVER', max_length=200, blank=True, null=True)
38 vnfConfigurableProperties = models.TextField(db_column='VNFCONFIGURABLEPROPERTIES', max_length=20000, blank=True, null=True)
39 localizationLanguage = models.CharField(db_column='LOCALIZATIONLANGUAGE', max_length=255, null=True)
41 class JobModel(models.Model):
47 jobid = models.CharField(db_column='JOBID', primary_key=True, max_length=255)
48 jobtype = models.CharField(db_column='JOBTYPE', max_length=255)
49 jobaction = models.CharField(db_column='JOBACTION', max_length=255)
50 resid = models.CharField(db_column='RESID', max_length=255)
51 status = models.IntegerField(db_column='STATUS', null=True, blank=True)
52 starttime = models.CharField(db_column='STARTTIME', max_length=255, null=True, blank=True)
53 endtime = models.CharField(db_column='ENDTIME', max_length=255, null=True, blank=True)
54 progress = models.IntegerField(db_column='PROGRESS', null=True, blank=True)
55 user = models.CharField(db_column='USER', max_length=255, null=True, blank=True)
56 parentjobid = models.CharField(db_column='PARENTJOBID', max_length=255, null=True, blank=True)
57 resname = models.CharField(db_column='RESNAME', max_length=255, null=True, blank=True)
61 return json.dumps(dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]]))
63 class JobStatusModel(models.Model):
65 db_table = 'JOB_STATUS'
69 indexid = models.IntegerField(db_column='INDEXID')
70 jobid = models.CharField(db_column='JOBID', max_length=255)
71 status = models.CharField(db_column='STATUS', max_length=255)
72 progress = models.IntegerField(db_column='PROGRESS', null=True, blank=True)
73 descp = models.TextField(db_column='DESCP', max_length=1024)
74 errcode = models.CharField(db_column='ERRCODE', max_length=255, null=True, blank=True)
75 addtime = models.CharField(db_column='ADDTIME', max_length=255, null=True, blank=True)
79 return json.dumps(dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]]))
81 class NfvoRegInfoModel(models.Model):
83 db_table = 'NFVOREGINFO'
85 nfvoid = models.CharField(max_length=255, primary_key=True, db_column='NFVOID')
86 vnfminstid = models.CharField(max_length=255, db_column='VNFMINSTID')
87 apiurl = models.CharField(max_length=255, db_column='URL')
88 nfvouser = models.CharField(max_length=255, db_column='USERNAME', null=True)
89 nfvopassword = models.CharField(max_length=255, db_column='PASSWD', null=True)
90 authtype = models.IntegerField(db_column='AUTHTYPE', default=2)
91 clientcert = models.CharField(max_length=255, db_column='CLIENTCERT', null=True)
92 servercert = models.CharField(max_length=255, db_column='SERVERCERT', null=True)
93 regtime = models.CharField(max_length=255, db_column='REGTIME')
95 class StorageInstModel(models.Model):
97 db_table = 'STORAGEINST'
99 storageid = models.CharField(db_column='STORAGEID', primary_key=True, max_length=255)
100 vimid = models.CharField(db_column='VIMID', max_length=255)
101 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
102 insttype = models.IntegerField(db_column='INSTTYPE')
103 instid = models.CharField(db_column='INSTID', max_length=255)
104 name = models.CharField(db_column='NAME', max_length=255, null=True)
105 storagetype = models.CharField(db_column='STORAGETYPE', max_length=255)
106 size = models.CharField(db_column='SIZE', max_length=255)
107 # rdmaenabled = models.IntegerField(db_column='RDMAENABLED', null=True)
108 # disktype = models.CharField(db_column='DISKTYPE', max_length=255)
109 # ownerid = models.CharField(db_column='OWNERID', max_length=255, null=True)
110 # zoneid = models.CharField(db_column='ZONEID', max_length=255, null=True)
111 # hostid = models.CharField(db_column='HOSTID', max_length=255, null=True)
112 # operationalstate = models.CharField(db_column='OPERATIONALSTATE', max_length=255, null=True)
113 tenant = models.CharField(db_column='TENANT', max_length=50, null=True)
114 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
115 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
116 nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
118 class VmInstModel(models.Model):
122 vmid = models.CharField(db_column='VMID', primary_key=True, max_length=255)
123 vimid = models.CharField(db_column='VIMID', max_length=255)
124 tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
125 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
126 vmname = models.CharField(db_column='VMNAME', max_length=255)
127 nic_array = models.CharField(db_column='NICARRAY', max_length=255)
128 metadata = models.CharField(db_column='METADATA', max_length=255)
129 volume_array = models.CharField(db_column='VOLUMEARRAY', max_length=255)
130 server_group = models.CharField(db_column='SERVERGROUP', max_length=255)
131 availability_zone = models.CharField(db_column='AVAILABILITYZONE', max_length=255)
132 flavor_id = models.CharField(db_column='FLAVORID', max_length=255)
133 security_groups = models.CharField(db_column='SECURITYGROUPS', max_length=255)
134 operationalstate = models.CharField(db_column='OPERATIONALSTATE', max_length=255, null=True)
135 insttype = models.IntegerField(db_column='INSTTYPE')
136 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
137 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
138 instid = models.CharField(db_column='INSTID', max_length=255)
139 nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
141 class VNFCInstModel(models.Model):
143 db_table = 'VNFCINST'
145 vnfcinstanceid = models.CharField(db_column='VNFCINSTANCEID', max_length=255, primary_key=True)
146 vduid = models.CharField(db_column='VDUID', max_length=255)
147 vdutype = models.CharField(db_column='VDUTYPE', max_length=255)
148 instid = models.CharField(db_column='NFINSTID', max_length=255)
149 vmid = models.CharField(db_column='VMID', max_length=255)
150 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
152 class FlavourInstModel(models.Model):
154 db_table = 'FLAVOURINST'
156 flavourid = models.CharField(db_column='FLAVOURID', max_length=255, primary_key=True)
157 vimid = models.CharField(db_column='VIMID', max_length=255)
158 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
159 name = models.CharField(db_column='NAME', max_length=255)
160 tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
161 vcpu = models.IntegerField(db_column='VCPU')
162 memory = models.IntegerField(db_column='MEMORY')
163 disk = models.IntegerField(db_column='DISK')
164 ephemeral = models.IntegerField(db_column='EPHEMERAL')
165 swap = models.IntegerField(db_column='SWAP')
166 isPublic = models.IntegerField(db_column='ISPUBLIC')
167 extraspecs = models.CharField(db_column='EXTRASPECS', max_length=255)
168 instid = models.CharField(db_column='INSTID', max_length=255)
169 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
170 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
172 class NetworkInstModel(models.Model):
174 db_table = 'NETWORKINST'
176 networkid = models.CharField(db_column='NETWORKID', primary_key=True, max_length=255)
177 vimid = models.CharField(db_column='VIMID', max_length=255)
178 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
179 insttype = models.IntegerField(db_column='INSTTYPE')
180 instid = models.CharField(db_column='INSTID', max_length=255)
181 name = models.CharField(db_column='NAME', max_length=255)
182 tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
183 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
184 desc = models.CharField(db_column='DESC', max_length=255, null=True)
185 vendor = models.CharField(db_column='VENDOR', max_length=255, null=True)
186 bandwidth = models.IntegerField(db_column='BANDWIDTH', null=True)
187 mtu = models.IntegerField(db_column='MTU', null=True)
188 network_type = models.CharField(db_column='NETWORKTYPE', max_length=255, null=True)
189 segmentid = models.CharField(db_column='SEGMENTID', max_length=255, null=True)
190 networkqos = models.CharField(db_column='NETWORKQOS', max_length=255, null=True)
191 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
192 physicalNetwork = models.CharField(db_column='PHYNETWORK', max_length=255, null=True)
193 is_shared = models.IntegerField(db_column='ISSHARED', default=0, null=True)
194 vlantrans = models.IntegerField(db_column='VLANTRANS', null=True)
195 routerExternal = models.IntegerField(db_column='ROUTEREXTERNAL', default=0, null=True)
196 nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
198 class SubNetworkInstModel(models.Model):
200 db_table = 'SUBNETWORKINST'
202 subnetworkid = models.CharField(db_column='SUBNETWORKID', primary_key=True, max_length=255)
203 vimid = models.CharField(db_column='VIMID', max_length=255)
204 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
205 networkid = models.CharField(db_column='NETWORKID', max_length=255)
206 insttype = models.IntegerField(db_column='INSTTYPE')
207 instid = models.CharField(db_column='INSTID', max_length=255)
208 name = models.CharField(db_column='NAME', max_length=255)
209 ipversion = models.IntegerField(db_column='IPVERSION', null=True)
210 gatewayip = models.CharField(db_column='GATEWAYIP', max_length=255, null=True)
211 isdhcpenabled = models.IntegerField(db_column='ISDHCPENABLED', null=True)
212 cidr = models.CharField(db_column='CIDR', max_length=255)
213 vdsname = models.CharField(db_column='VDSNAME', max_length=255, null=True)
214 operationalstate = models.CharField(db_column='OPERATIONALSTATE', max_length=255, null=True)
215 tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
216 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
217 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
218 dnsNameservers = models.TextField(db_column='DNSNAMESERVERS', max_length=1024)
219 hostRoutes = models.TextField(db_column='HOSTROUTES', max_length=1024)
220 allocationPools = models.TextField(db_column='ALLOCATIONPOOLS', max_length=1024)
222 class VLInstModel(models.Model):
226 vlinstanceid = models.CharField(db_column='VLINSTANCEID', max_length=255, primary_key=True)
227 vldid = models.CharField(db_column='VLDID', max_length=255)
228 vlinstancename = models.CharField(db_column='VLINSTANCENAME', max_length=255, blank=True, null=True)
229 ownertype = models.IntegerField(db_column='OWNERTYPE')
230 ownerid = models.CharField(db_column='OWNERID', max_length=255)
231 relatednetworkid = models.CharField(db_column='RELATEDNETWORKID', max_length=255, blank=True, null=True)
232 relatedsubnetworkid = models.CharField(db_column='RELATEDSUBNETWORKID', max_length=255, blank=True, null=True)
233 vltype = models.IntegerField(db_column='VLTYPE', default=0)
234 vimid = models.CharField(db_column='VIMID', max_length=255)
235 tenant = models.CharField(db_column='TENANT', max_length=50)
237 class PortInstModel(models.Model):
239 db_table = 'PORTINST'
241 portid = models.CharField(db_column='PORTID', primary_key=True, max_length=255)
242 networkid = models.CharField(db_column='NETWORKID', max_length=255)
243 subnetworkid = models.CharField(db_column='SUBNETWORKID', max_length=255, null=True)
244 vimid = models.CharField(db_column='VIMID', max_length=255)
245 resouceid = models.CharField(db_column='RESOURCEID', max_length=255)
246 name = models.CharField(db_column='NAME', max_length=255, null=True)
247 insttype = models.IntegerField(db_column='INSTTYPE')
248 instid = models.CharField(db_column='INSTID', max_length=255)
249 cpinstanceid = models.CharField(db_column='CPINSTANCEID', max_length=255, null=True)
250 bandwidth = models.CharField(db_column='BANDWIDTH', max_length=255, null=True)
251 operationalstate = models.CharField(db_column='OPERATIONALSTATE', max_length=255, null=True)
252 ipaddress = models.CharField(db_column='IPADDRESS', max_length=255)
253 macaddress = models.CharField(db_column='MACADDRESS', max_length=255)
254 nicorder = models.CharField(db_column='NICORDER', max_length=255)
255 floatipaddress = models.CharField(db_column='FLOATIPADDRESS', max_length=255, null=True)
256 serviceipaddress = models.CharField(db_column='SERVICEIPADDRESS', max_length=255, null=True)
257 typevirtualnic = models.CharField(db_column='TYPEVIRTUALNIC', max_length=255, null=True)
258 sfcencapsulation = models.CharField(db_column='SFCENCAPSULATION', max_length=255, null=True)
259 direction = models.CharField(db_column='DIRECTION', max_length=255, null=True)
260 tenant = models.CharField(db_column='TENANT', max_length=255, null=True)
261 interfacename = models.CharField(db_column='INTERFACENAME', max_length=255, blank=True, null=True)
262 vmid = models.CharField(db_column='VMID', max_length=255, blank=True, null=True)
263 create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
264 securityGroups = models.CharField(db_column='SECURITYGROUPS', max_length=255)
265 is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
266 nodeId = models.CharField(db_column='NODEID', max_length=255, null=True)
268 class CPInstModel(models.Model):
272 cpinstanceid = models.CharField(db_column='CPINSTANCEID', max_length=255, primary_key=True)
273 cpdid = models.CharField(db_column='CPDID', max_length=255)
274 cpinstancename = models.CharField(db_column='CPINSTANCENAME', max_length=255)
275 vlinstanceid = models.CharField(db_column='VLINSTANCEID', max_length=255)
276 ownertype = models.IntegerField(db_column='OWNERTYPE')
277 ownerid = models.CharField(db_column='OWNERID', max_length=255)
278 relatedtype = models.IntegerField(db_column='RELATEDTYPE')
279 relatedvl = models.CharField(db_column='RELATEDVL', max_length=255, blank=True, null=True)
280 relatedcp = models.CharField(db_column='RELATEDCP', max_length=255, blank=True, null=True)
281 relatedport = models.CharField(db_column='RELATEDPORT', max_length=255, blank=True, null=True)
283 class VimModel(models.Model):
284 vimid = models.IntegerField(db_column='CMSERVERID', primary_key=True)
285 name = models.CharField(db_column='NAME', max_length=255, blank=True, null=True)
286 type = models.CharField(db_column='CMSTYPE', max_length=255, blank=True, null=True)
287 imageurl = models.CharField(db_column='IMAGEURL', max_length=1024, blank=True, null=True)
288 apiurl = models.CharField(db_column='APIURL', max_length=1024, blank=True, null=True)
289 version = models.CharField(db_column='VER', max_length=1024, blank=True, null=True)
290 supportnotification = models.IntegerField(db_column='SUPPORTNOTIFICATION', default=0)
291 longitude = models.CharField(db_column='LONGITUDE', max_length=1024, blank=True, null=True)
292 latitude = models.CharField(db_column='LATITUDE', max_length=1024, blank=True, null=True)
293 grantexclude = models.CharField(db_column='GRANTEXCLUDE', max_length=1, default='0', blank=True, null=True)
294 slalevel = models.IntegerField(db_column='SLALEVEL', default=0)
297 db_table = 'CMSSERVER'
299 def __unicode__(self):
300 return '%s' % self.name
303 class VimUserModel(models.Model):
305 db_table = 'CMSSERVER_USER'
307 uuid = models.CharField(db_column='UUID', primary_key=True, max_length=255)
308 vimid = models.IntegerField(db_column='CMSERVERID')
309 username = models.CharField(db_column='USERNAME', max_length=255)
310 password = models.CharField(db_column='PWD', max_length=255, blank=True)
311 defaulttenant = models.CharField(db_column='TENANT', max_length=255, blank=True)
313 def __unicode__(self):
314 return '%s' % self.username