diff --git a/kiloeyes_horizon/MANIFEST.in b/kiloeyes_horizon/MANIFEST.in new file mode 100644 index 0000000..fb1ad12 --- /dev/null +++ b/kiloeyes_horizon/MANIFEST.in @@ -0,0 +1,12 @@ +include setup.py +recursive-include kiloeyes_ui/templates * +recursive-include kiloeyes_ui/static * +recursive-include kiloeyes_ui/load_avg/templates * +recursive-include kiloeyes_ui/cpu_perc/templates * +recursive-include kiloeyes_ui/process_thrdcount/templates * +recursive-include kiloeyes_ui/process_mem/templates * +recursive-include kiloeyes_ui/network/templates * +recursive-include kiloeyes_ui/disk_space/templates * +recursive-include kiloeyes_ui/inputoutput/templates * + + diff --git a/kiloeyes_horizon/README.rst b/kiloeyes_horizon/README.rst new file mode 100644 index 0000000..a0ee78e --- /dev/null +++ b/kiloeyes_horizon/README.rst @@ -0,0 +1,40 @@ +=============================================================== +Kiloeyes UI: Kiloeyes Extension for the OpenStack Dashboard (Horizon) +=============================================================== + +Kiloeyes UI is a Horizon Dashboard to monitor openstack metrics collected by Kiloeyes. +It uses the standard Horizon extension systems, and maintains code and styling +consistency where possible. + +Most of the developer information, as well as an overview of Horizon, can be +found in the `Horizon documentation online`_. + +.. _Horizon documentation online: http://docs.openstack.org/developer/horizon/index.html + +Getting Started +=============== + +The quickest way to get up and running is: + + 1. Setup a basic `Devstack installation`_ + 2. Clone `Kiloeyes` with ``git clone https://github.com/openstack/kiloeyes`` + 3. Open ``/horizon/`` + 4. Run ``./tools/with_venv.sh pip install --upgrade /kiloeyes/kiloeyes_horizon/dist/kiloeyes_horizon-0.0.1.tar.gz``. + 5. Copy ``/kiloeyes/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py`` to ``/horizon/openstack_dashboard/enabled`` + 6. Copy and paste below configs to ``/horizon/openstack_dashboard/local/local_settings.py`` + + ``KIBANA_HOST = "" + KIBANA_URL = "http://%s:5601" % KIBANA_HOST`` + +Building Documentation +====================== + +This documentation is written by contributors who wats to add new panel to the dashboard. +After adding the desired panels + + 1. Add the panel name in ``/kiloeyes/kiloeyes_horizon/kiloeyes_ui/dashboard.py`` + 2. Include the new panel template in ``/kiloeyes/kiloeyes_horizon/MANIFEST.in`` + example: ``recursive-include kiloeyes_ui//templates *`` + 3. Run ``python Setup.py sdist`` + + After this, Follow the steps in ``Getting Started`` diff --git a/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py b/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py new file mode 100644 index 0000000..95add00 --- /dev/null +++ b/kiloeyes_horizon/enabled/_50_kiloeyes_ui.py @@ -0,0 +1,10 @@ +# The name of the dashboard to be added to HORIZON['dashboards']. Required. +DASHBOARD = 'kiloeyes_ui' + +# If set to True, this dashboard will not be added to the settings. +DISABLED = False + +# A list of applications to be added to INSTALLED_APPS. +ADD_INSTALLED_APPS = [ + 'kiloeyes_ui', +] diff --git a/kiloeyes_horizon/kiloeyes_ui/__init__.py b/kiloeyes_horizon/kiloeyes_ui/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py new file mode 100644 index 0000000..cfc4d52 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Cpu_Perc(horizon.Panel): + name = _("CPU Perc") + slug = "cpu_perc" + + +dashboard.Kiloeyes_Ui.register(Cpu_Perc) diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html new file mode 100644 index 0000000..147697d --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/templates/cpu_perc/index.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Cpu_Perc" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Cpu_Perc") %} +{% endblock page_header %} + +{% block main %} +{{ kibana_url }} +{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py new file mode 100644 index 0000000..29564a5 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Cpu_PercTests(test.TestCase): + # Unit tests for cpu_perc. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py new file mode 100644 index 0000000..4285f50 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.cpu_perc import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py new file mode 100644 index 0000000..f85a3d9 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/cpu_perc/views.py @@ -0,0 +1,24 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/cpu_perc/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/dashboard.py b/kiloeyes_horizon/kiloeyes_ui/dashboard.py new file mode 100644 index 0000000..3c418a7 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/dashboard.py @@ -0,0 +1,27 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon + + +class Kiloeyes_Ui(horizon.Dashboard): + name = _("Kiloeyes") + slug = "kiloeyes_ui" + panels = ('load_avg', 'process_thrdcount', 'process_mem', 'network', + 'disk_space', 'inputoutput', ) # Add your panels here. + default_panel = 'load_avg' # Specify the slug of + # the dashboard's default panel. + + +horizon.register(Kiloeyes_Ui) diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py new file mode 100644 index 0000000..682c254 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Disk_Space(horizon.Panel): + name = _("Disk Space") + slug = "disk_space" + + +dashboard.Kiloeyes_Ui.register(Disk_Space) diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html b/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html new file mode 100644 index 0000000..b7fe487 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/templates/disk_space/index.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Disk Space" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Disk Space") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID:" %} +{{ project_id }} +
+
+ +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py new file mode 100644 index 0000000..9689ec5 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Disk_Space(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py new file mode 100644 index 0000000..be71b8f --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.disk_space import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py b/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py new file mode 100644 index 0000000..255fcaa --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/disk_space/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/disk_space/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py new file mode 100644 index 0000000..470254a --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Inputoutput(horizon.Panel): + name = _("IO") + slug = "inputoutput" + + +dashboard.Kiloeyes_Ui.register(Inputoutput) diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html b/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html new file mode 100644 index 0000000..ccb4314 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/templates/inputoutput/index.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "IO" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("IO") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID:" %} +{{ project_id }} +
+
+ +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py new file mode 100644 index 0000000..d874154 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Inputoutput(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py new file mode 100644 index 0000000..06d0b52 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.inputoutput import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py b/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py new file mode 100644 index 0000000..1b889f8 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/inputoutput/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/inputoutput/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py new file mode 100644 index 0000000..d6b938a --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Load_Avg(horizon.Panel): + name = _("Load Avg") + slug = "load_avg" + + +dashboard.Kiloeyes_Ui.register(Load_Avg) diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html b/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html new file mode 100644 index 0000000..1a82e29 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/templates/load_avg/index.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Load Average" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Load Average") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID: "%} +{{ project_id }} +
+
+ +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py new file mode 100644 index 0000000..fd3b56f --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Load_AvgTests(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py new file mode 100644 index 0000000..077449a --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.load_avg import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py b/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py new file mode 100644 index 0000000..7c52f5a --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/load_avg/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/load_avg/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/network/__init__.py b/kiloeyes_horizon/kiloeyes_ui/network/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/network/panel.py b/kiloeyes_horizon/kiloeyes_ui/network/panel.py new file mode 100644 index 0000000..137fa65 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/network/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Network(horizon.Panel): + name = _("Network") + slug = "network" + + +dashboard.Kiloeyes_Ui.register(Network) diff --git a/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html b/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html new file mode 100644 index 0000000..92c3bc7 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/network/templates/network/index.html @@ -0,0 +1,26 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Network" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Network") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID:" %} +{{ project_id }} +
+
+ +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/network/tests.py b/kiloeyes_horizon/kiloeyes_ui/network/tests.py new file mode 100644 index 0000000..1c701d1 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/network/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Network(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/network/urls.py b/kiloeyes_horizon/kiloeyes_ui/network/urls.py new file mode 100644 index 0000000..fa51837 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/network/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.network import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/network/views.py b/kiloeyes_horizon/kiloeyes_ui/network/views.py new file mode 100644 index 0000000..e702a6e --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/network/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/network/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py new file mode 100644 index 0000000..827fa83 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Process_Mem(horizon.Panel): + name = _("Process Memory") + slug = "process_mem" + + +dashboard.Kiloeyes_Ui.register(Process_Mem) diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html b/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html new file mode 100644 index 0000000..63d17ba --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/templates/process_mem/index.html @@ -0,0 +1,35 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Process Memory" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Process Memory in Bytes") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID:" %} +{{ project_id }} +
+
+ + +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py new file mode 100644 index 0000000..43c562f --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Process_Mem(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py new file mode 100644 index 0000000..30fb7c7 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.process_mem import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py b/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py new file mode 100644 index 0000000..556276e --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_mem/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/process_mem/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py new file mode 100644 index 0000000..60aa5df --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/panel.py @@ -0,0 +1,24 @@ +# 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.utils.translation import ugettext_lazy as _ + +import horizon +from kiloeyes_ui import dashboard + + +class Process_Thrdcount(horizon.Panel): + name = _("Process Thread Count") + slug = "process_thrdcount" + + +dashboard.Kiloeyes_Ui.register(Process_Thrdcount) diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html new file mode 100644 index 0000000..6061d28 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/templates/process_thrdcount/index.html @@ -0,0 +1,40 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}{% trans "Process Thread Count" %}{% endblock %} + +{% block page_header %} + {% include "horizon/common/_page_header.html" with title=_("Process Thread Count") %} +{% endblock page_header %} + +{% block main %} +
+{% trans "Project ID:" %} +{{ project_id }} +
+
+ + +
+{% endblock %} + + diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py new file mode 100644 index 0000000..ea54971 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/tests.py @@ -0,0 +1,19 @@ +# 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 horizon.test import helpers as test + + +class Process_ThrdcountTests(test.TestCase): + # Unit tests for load_avg. + def test_me(self): + self.assertTrue(1 + 1 == 2) diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py new file mode 100644 index 0000000..cb54046 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/urls.py @@ -0,0 +1,20 @@ +# 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.conf.urls import url + +from kiloeyes_ui.process_thrdcount import views + + +urlpatterns = [ + url(r'^$', views.IndexView.as_view(), name='index'), +] diff --git a/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py new file mode 100644 index 0000000..30dca93 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/process_thrdcount/views.py @@ -0,0 +1,26 @@ +# 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.conf import settings +from horizon import views + + +class IndexView(views.APIView): + # A very simple class-based view... + template_name = 'kiloeyes_ui/process_thrdcount/index.html' + + def get_data(self, request, context, *args, **kwargs): + # Add data to the context here... + context['project_id'] = kwargs.get('project_id', + request.user.tenant_id) + context['kibana_url'] = settings.KIBANA_URL + return context diff --git a/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js new file mode 100644 index 0000000..59c981b --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/js/kiloeyes_ui.js @@ -0,0 +1 @@ +/* Additional JavaScript for kiloeyes_ui. */ diff --git a/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss new file mode 100644 index 0000000..431771b --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/static/kiloeyes_ui/scss/kiloeyes_ui.scss @@ -0,0 +1 @@ +/* Additional SCSS for {{ dash_name }}. */ diff --git a/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html b/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html new file mode 100644 index 0000000..d03ae24 --- /dev/null +++ b/kiloeyes_horizon/kiloeyes_ui/templates/kiloeyes_ui/base.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{% block sidebar %} + {% include 'horizon/common/_sidebar.html' %} +{% endblock %} + +{% block main %} + {% include "horizon/_messages.html" %} + {% block kiloeyes_ui_main %}{% endblock %} +{% endblock %} + diff --git a/kiloeyes_horizon/setup.py b/kiloeyes_horizon/setup.py new file mode 100644 index 0000000..0f60022 --- /dev/null +++ b/kiloeyes_horizon/setup.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# 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. + +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT + +from setuptools import find_packages +from setuptools import setup + +setup( + name='kiloeyes_horizon', + version='0.0.1', + url='https://github.com/openstack/kiloeyes/kiloeyes_horizon', + author='Vishnu Govindaraj', + author_email='vg249@cornell.edu', + packages=find_packages(), + include_package_data=True, + setup_requires=['pbr'], + pbr=True, +)