Andrea Campanella | 420e4b4 | 2017-09-01 16:51:03 +0200 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
| 17 | # admin.py - vNaaSworkService Django Admin |
| 18 | |
| 19 | from core.admin import ReadOnlyAwareAdmin |
| 20 | from core.admin import XOSBaseAdmin |
| 21 | from django.contrib import admin |
| 22 | from django import forms |
| 23 | |
| 24 | |
| 25 | class XOSvNaaSBandwithProfileAdmin(XOSBaseAdmin): |
| 26 | verbose_name = "Bandwidth Profile" |
| 27 | list_display = ('cbs','ebs','cir','eir','name') |
| 28 | |
| 29 | fields = ('cbs', 'ebs', 'cir', 'eir', 'name') |
| 30 | |
| 31 | class XOSvNaaSUNIAdmin(XOSBaseAdmin): |
| 32 | verbose_name = "User Network Interface" |
| 33 | list_display = ('tenant', 'vlanIds', 'cpe_id', 'latlng', 'name') |
| 34 | fields = ('tenant','vlanIds', 'cpe_id', 'latlng', 'name') |
| 35 | |
| 36 | class XOSvNaaSEnterpriseLocationAdmin(XOSBaseAdmin): |
| 37 | verbose_name = "Enterprise Location" |
| 38 | list_display = ('name', 'cord_site_ip', 'cord_site_port', 'cord_site_username', 'cord_site_password', 'cord_site_type') |
| 39 | fields = ('name', 'cord_site_ip', 'cord_site_port', 'cord_site_username', 'cord_site_password', 'cord_site_type') |
| 40 | |
| 41 | class XOSvNaaSOnosModelAdmin(XOSBaseAdmin): |
| 42 | verbose_name = "Open Network Operating System" |
| 43 | list_display = ('name', 'onos_ip', 'onos_port', 'onos_username', 'onos_password', 'onos_type') |
| 44 | fields = ('name', 'onos_ip', 'onos_port', 'onos_username', 'onos_password', 'onos_type') |
| 45 | |
| 46 | class XOSvNaaSELineAdmin(XOSBaseAdmin): |
| 47 | verbose_name = "Ethernet Virtual Private Line" |
| 48 | list_display = ('name', 'connect_point_1_id', 'connect_point_2_id', 'vlanids', 'cord_site_name', 'bwp') |
| 49 | fields = ('name', 'connect_point_1_id', 'connect_point_2_id', 'vlanids', 'cord_site_name', 'bwp') |
| 50 | |
| 51 | admin.site.register(XOSvNaaSBandwithProfile, XOSvNaaSBandwithProfileAdmin) |
| 52 | admin.site.register(XOSvNaaSUNI, XOSvNaaSUNIAdmin) |
| 53 | admin.site.register(XOSvNaaSEnterpriseLocation, XOSvNaaSEnterpriseLocationAdmin) |
| 54 | admin.site.register(XOSvNaaSOnosModel, XOSvNaaSOnosModelAdmin) |
| 55 | admin.site.register(XOSvNaaSELine, XOSvNaaSELineAdmin) |