Added base methods and classes for API
This commit is contained in:
parent
19b1a51ce8
commit
a05a5e80e1
|
@ -5,3 +5,4 @@
|
|||
dist
|
||||
ChangeLog
|
||||
AUTHORS
|
||||
craton_ui.egg-info/*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
CHANGES
|
||||
=======
|
||||
|
||||
* Added base .gitignore
|
||||
* Added regions panel
|
||||
* Initial Structure
|
||||
* Initial commit
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
include setup.py
|
||||
|
||||
recursive-include craton_dashboard *.js *.html *.scss
|
|
@ -0,0 +1 @@
|
|||
from craton_dashboard.api import craton
|
|
@ -11,3 +11,87 @@
|
|||
# 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 six.moves.urllib import request
|
||||
from django.conf import settings
|
||||
|
||||
from horizon import exceptions
|
||||
from openstack_dashboard.api import base
|
||||
|
||||
def cratonclient():
|
||||
pass
|
||||
|
||||
def project_create(request, **kwargs):
|
||||
pass
|
||||
|
||||
def project_delete(request, **kwargs):
|
||||
pass
|
||||
|
||||
def project_list(request, **kwargs):
|
||||
pass
|
||||
|
||||
def project_show(request, **kwargs):
|
||||
pass
|
||||
|
||||
def project_update(request, **kwargs):
|
||||
pass
|
||||
|
||||
def region_create(request, **kwargs):
|
||||
pass
|
||||
|
||||
def region_delete(request, **kwargs):
|
||||
pass
|
||||
|
||||
def region_list(request, **kwargs):
|
||||
pass
|
||||
|
||||
def region_show(request, **kwargs):
|
||||
pass
|
||||
|
||||
def region_update(request, **kwargs):
|
||||
pass
|
||||
|
||||
def cell_create(request, **kwargs):
|
||||
pass
|
||||
|
||||
def cell_delete(request, **kwargs):
|
||||
pass
|
||||
|
||||
def cell_list(request, **kwargs):
|
||||
pass
|
||||
|
||||
def cell_show(request, **kwargs):
|
||||
pass
|
||||
|
||||
def cell_update(request, **kwargs):
|
||||
pass
|
||||
|
||||
def device_create(request, **kwargs):
|
||||
pass
|
||||
|
||||
def device_delete(request, **kwargs):
|
||||
pass
|
||||
|
||||
def device_list(request, **kwargs):
|
||||
pass
|
||||
|
||||
def device_show(request, **kwargs):
|
||||
pass
|
||||
|
||||
def host_create(request, **kwargs):
|
||||
pass
|
||||
|
||||
def host_delete(request, **kwargs):
|
||||
pass
|
||||
|
||||
def host_list(request, **kwargs):
|
||||
pass
|
||||
|
||||
def host_show(request, **kwargs):
|
||||
pass
|
||||
|
||||
def host_update(request, **kwargs):
|
||||
pass
|
||||
|
||||
def user_list(request, **kwargs):
|
||||
pass
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from craton_dashboard.api.rest import craton
|
|
@ -0,0 +1,106 @@
|
|||
# Copyright 2016 Intel Corporation
|
||||
#
|
||||
# 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 django.views import generic
|
||||
|
||||
from craton_dashboard.api import craton
|
||||
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api.rest import urls
|
||||
from openstack_dashboard.api.rest import utils as rest_utils
|
||||
|
||||
from six.moves.urllib import request
|
||||
|
||||
@urls.register
|
||||
class Regions(generic.View):
|
||||
"""API for craton"""
|
||||
|
||||
url_regex = r'craton/regions/$'
|
||||
|
||||
@rest_utils.ajax()
|
||||
def get(self, request, **kwargs):
|
||||
"""Gets all Regions"""
|
||||
regions = craton.region_list(request)
|
||||
return {'items': regions}
|
||||
|
||||
@rest_utils.ajax()
|
||||
def post(self, request, **kwargs):
|
||||
"""Creates a new Region"""
|
||||
return craton.region_create(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def put(self, request, **kwargs):
|
||||
"""Updates a Region"""
|
||||
return craton.region_update(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def delete(self, request, **kwargs):
|
||||
"""Deletes a Region"""
|
||||
return craton.region_delete(request)
|
||||
|
||||
|
||||
@urls.register
|
||||
class Cells(generic.View):
|
||||
"""API for craton"""
|
||||
|
||||
url_regex = r'craton/cells/$'
|
||||
|
||||
@rest_utils.ajax()
|
||||
def get(self, request, **kwargs):
|
||||
"""Gets all Cells"""
|
||||
return craton.cell_list(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def post(self, request, **kwargs):
|
||||
"""Creates a new Cell"""
|
||||
return craton.cell_create(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def put(self, request, **kwargs):
|
||||
"""Updates a Cell"""
|
||||
return craton.cell_update(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def delete(self, request, **kwargs):
|
||||
"""Deletes a Cell"""
|
||||
return craton.cell_delete(request)
|
||||
|
||||
@urls.register
|
||||
class Hosts(generic.View):
|
||||
"""API for craton"""
|
||||
|
||||
url_regex = r'craton/hosts/$'
|
||||
|
||||
@rest_utils.ajax()
|
||||
def get(self, request, **kwargs):
|
||||
"""Gets all Hosts"""
|
||||
return craton.host_list(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def post(self, request, **kwargs):
|
||||
"""Creates a new Host"""
|
||||
return craton.hosts_create(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def put(self, request, **kwargs):
|
||||
"""Updates a Host"""
|
||||
return craton.hosts_update(request)
|
||||
|
||||
@rest_utils.ajax()
|
||||
def delete(self, request, **kwargs):
|
||||
"""Deletes a Host"""
|
||||
return craton.hosts_delete(request)
|
||||
|
|
@ -0,0 +1 @@
|
|||
from craton_dashboard.api import rest
|
|
@ -16,6 +16,6 @@ from django.utils.translation import ugettext_lazy as _
|
|||
|
||||
import horizon
|
||||
|
||||
class Taskflow(horizon.Panel):
|
||||
class Taskflows(horizon.Panel):
|
||||
name = _('Taskflows')
|
||||
slug = 'taskflow'
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
<h2>Hello World!</h2>
|
|
@ -1 +0,0 @@
|
|||
<h1>Hello</h1>
|
|
@ -16,17 +16,9 @@ from django.utils.translation import ugettext_lazy as _
|
|||
from django.views import generic
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
from horizon import tables
|
||||
from horizon import views
|
||||
|
||||
class IndexView(tables.DataTableView):
|
||||
template_name = 'project/fleet/index.hml'
|
||||
class IndexView(generic.TemplateView):
|
||||
|
||||
template_name = 'regions/index.html'
|
||||
page_title = _('Regions')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(IndexView, self).__init__(*args, **kwargs)
|
||||
self._more = None
|
||||
|
||||
def get_data(self):
|
||||
return []
|
||||
|
|
|
@ -20,5 +20,4 @@ PANEL_DASHBOARD = 'project'
|
|||
|
||||
PANEL_GROUP = 'fleet_management'
|
||||
|
||||
ADD_PANEL = 'craton_dashboard.dashboards.project.fleeti.taksflows.panel.Taskflows'
|
||||
|
||||
ADD_PANEL = 'craton_dashboard.dashboards.project.fleet.taskflows.panel.Taskflows'
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Craton" %}{% endblock %}
|
||||
{% block page_header %}{% endblock %}
|
||||
|
||||
{% block ng_route_base %}
|
||||
<base href="{{ WEBROOT }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div ng-view></div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,12 @@
|
|||
{% extends 'base.html' %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Craton" %}{% endblock %}
|
||||
{% block page_header %}{% endblock %}
|
||||
|
||||
{% block ng_route_base %}
|
||||
<base href="{{ WEBROOT }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div ng-view></div>
|
||||
{% endblock %}
|
|
@ -1,6 +1,6 @@
|
|||
Metadata-Version: 1.0
|
||||
Name: craton-ui
|
||||
Version: 0.0.1.dev2
|
||||
Version: 0.0.1.dev3
|
||||
Summary: The Craton UI for Horizon Dashboard
|
||||
Home-page: http://www.openstack.org/
|
||||
Author: OSIC
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
AUTHORS
|
||||
ChangeLog
|
||||
LICENSE
|
||||
MANIFEST.in
|
||||
README.rst
|
||||
setup.cfg
|
||||
setup.py
|
||||
craton_dashboard/__init__.py
|
||||
craton_dashboard/api/__init__.py
|
||||
craton_dashboard/api/craton.py
|
||||
craton_dashboard/api/rest/__init__.py
|
||||
craton_dashboard/api/rest/craton.py
|
||||
craton_dashboard/dashboards/__init__.py
|
||||
craton_dashboard/dashboards/project/__init__.py
|
||||
craton_dashboard/dashboards/project/fleet/__init__.py
|
||||
|
@ -20,6 +24,11 @@ craton_dashboard/enabled/_1710_fleet_panel_group.py
|
|||
craton_dashboard/enabled/_1720_fleet_regions_panel.py
|
||||
craton_dashboard/enabled/_1730_fleet_taskflows_panel.py
|
||||
craton_dashboard/enabled/__init__.py
|
||||
craton_dashboard/templates/__init__.py
|
||||
craton_dashboard/templates/regions/__init__.py
|
||||
craton_dashboard/templates/regions/index.html
|
||||
craton_dashboard/templates/workflows/__init__.py
|
||||
craton_dashboard/templates/workflows/index.html
|
||||
craton_ui.egg-info/PKG-INFO
|
||||
craton_ui.egg-info/SOURCES.txt
|
||||
craton_ui.egg-info/dependency_links.txt
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"is_release": false, "git_version": "e263577"}
|
||||
{"is_release": false, "git_version": "19b1a51"}
|
Loading…
Reference in New Issue