CORD-1252 add onos rest username and password fields
eliminate obsolete files
Change-Id: Id2ca59b0a78d31b72283b43b08fceb95995f1621
diff --git a/xos/admin.py b/xos/admin.py
deleted file mode 100644
index 5256339..0000000
--- a/xos/admin.py
+++ /dev/null
@@ -1,100 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-from django.contrib import admin
-
-from services.onos.models import *
-from django import forms
-from django.utils.safestring import mark_safe
-from django.contrib.auth.admin import UserAdmin
-from django.contrib.admin.widgets import FilteredSelectMultiple
-from django.contrib.auth.forms import ReadOnlyPasswordHashField
-from django.contrib.auth.signals import user_logged_in
-from django.utils import timezone
-from django.contrib.contenttypes import generic
-from suit.widgets import LinkedSelect
-from core.admin import ServiceAppAdmin,SliceInline,ServiceAttrAsTabInline, ReadOnlyAwareAdmin, XOSTabularInline, ServicePrivilegeInline, ServiceInstanceAttrAsTabInline, SubscriberLinkInline, ProviderLinkInline, ProviderDependencyInline,SubscriberDependencyInline
-from core.middleware import get_request
-
-from functools import update_wrapper
-from django.contrib.admin.views.main import ChangeList
-from django.core.urlresolvers import reverse
-from django.contrib.admin.utils import quote
-
-class ONOSServiceAdmin(ReadOnlyAwareAdmin):
- model = ONOSService
- verbose_name = "ONOS Service"
- verbose_name_plural = "ONOS Services"
- list_display = ("backend_status_icon", "name", "enabled")
- list_display_links = ('backend_status_icon', 'name', )
- fieldsets = [(None, {'fields': ['backend_status_text', 'name','enabled','versionNumber', 'description',"view_url","icon_url", "rest_hostname", "rest_port", "no_container" ], 'classes':['suit-tab suit-tab-general']})]
- readonly_fields = ('backend_status_text', )
- inlines = [SliceInline,ServiceAttrAsTabInline,ServicePrivilegeInline, ProviderDependencyInline,SubscriberDependencyInline]
-
- extracontext_registered_admins = True
-
- user_readonly_fields = ["name", "enabled", "versionNumber", "description"]
-
- suit_form_tabs =(('general', 'ONOS Service Details'),
- ('administration', 'Administration'),
- ('slices','Slices'),
- ('serviceattrs','Additional Attributes'),
- ('servicetenants', 'Dependencies'),
- ('serviceprivileges','Privileges'),
- )
-
- suit_form_includes = (('onosadmin.html', 'top', 'administration'),
- )
-
- def get_queryset(self, request):
- return ONOSService.select_by_user(request.user)
-
-class ONOSAppForm(forms.ModelForm):
- def __init__(self,*args,**kwargs):
- super (ONOSAppForm,self ).__init__(*args,**kwargs)
-# self.fields['kind'].widget.attrs['readonly'] = True
- self.fields['owner'].queryset = ONOSService.objects.all()
- if (not self.instance) or (not self.instance.pk):
- # default fields for an 'add' form
-# self.fields['kind'].initial = ONOS_KIND
-# self.fields['creator'].initial = get_request().user
- if ONOSService.objects.exists():
- self.fields["owner"].initial = ONOSService.objects.all()[0]
-
- def save(self, commit=True):
- return super(ONOSAppForm, self).save(commit=commit)
-
- class Meta:
- model = ONOSApp
- fields = '__all__'
-
-class ONOSAppAdmin(ReadOnlyAwareAdmin):
- list_display = ('backend_status_icon', 'name', )
- list_display_links = ('backend_status_icon', 'name')
- fieldsets = [ (None, {'fields': ['backend_status_text', 'name', 'owner', 'service_specific_attribute', "dependencies"],
- 'classes':['suit-tab suit-tab-general']})]
- readonly_fields = ('backend_status_text', 'service_specific_attribute')
- inlines = [ServiceInstanceAttrAsTabInline, ProviderLinkInline, SubscriberLinkInline]
- form = ONOSAppForm
-
- suit_form_tabs = (('general','Details'), ('serviceinstanceattrs', 'Attributes'), ('servicelinks','Links'),)
-
- def get_queryset(self, request):
- return ONOSApp.select_by_user(request.user)
-
-admin.site.register(ONOSService, ONOSServiceAdmin)
-admin.site.register(ONOSApp, ONOSAppAdmin)
-
diff --git a/xos/onos-onboard.yaml b/xos/onos-onboard.yaml
index 465844f..c6dd3ea 100644
--- a/xos/onos-onboard.yaml
+++ b/xos/onos-onboard.yaml
@@ -30,9 +30,6 @@
# The following will concatenate with base_url automatically, if
# base_url is non-null.
xproto: ./
- admin: admin.py
- admin_template: templates/onosadmin.html
- #tosca_custom_types: exampleservice.yaml
tosca_resource: tosca/resources/onosservice.py, tosca/resources/onosapp.py
private_key: file:///opt/xos/key_import/onos_rsa
public_key: file:///opt/xos/key_import/onos_rsa.pub
diff --git a/xos/onos.xproto b/xos/onos.xproto
index 2481a5a..fe00bdd 100644
--- a/xos/onos.xproto
+++ b/xos/onos.xproto
@@ -12,4 +12,6 @@
required int32 rest_port = 2 [default = 8181, null = False, db_index = False, blank = False];
required bool no_container = 3 [default = False, null = False, db_index = False, blank = True];
optional string node_key = 4 [db_index = False, max_length = 1024, null = True, content_type = "stripped", blank = True];
+ optional string rest_username = 5 [db_index = False, max_length = 255, null = True, content_type = "stripped", blank = True, default="karaf"];
+ optional string rest_password = 6 [db_index = False, max_length = 255, null = True, content_type = "stripped", blank = True, default="karaf"];
}
diff --git a/xos/templates/onosadmin.html b/xos/templates/onosadmin.html
deleted file mode 100644
index 816f03b..0000000
--- a/xos/templates/onosadmin.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-<!--
-Copyright 2017-present Open Networking Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-
-<div class = "row text-center">
- <div class="col-xs-12">
- <a class="btn btn-primary" href="/admin/onos/onosapp/">ONOS Apps</a>
- </div>
-</div>
-