remove @ from the file
Change-Id: Ia9852cc6e1815130c21e8bb24872c27aa6ecc8b3
This commit is contained in:
parent
6879a80e1a
commit
9f36d93e40
26
README.rst
26
README.rst
@ -21,12 +21,20 @@ Project Resources
|
||||
|
||||
How to use this package
|
||||
-----------------------
|
||||
git clone https://github.com/openstack/horizon.git
|
||||
git clone https://github.com/openstack/vitrage-dashboard.git
|
||||
cd horizon
|
||||
./run_tests.sh -f --docs
|
||||
cp ./openstack_dashboard/local/local_settings.py.example ./openstack_dashboard/local/local_settings.py
|
||||
pushd ../vitrage-dashboard
|
||||
../horizon/tools/with_venv.sh pip install --upgrade .
|
||||
cp -a vitragedashboard/enabled/* ../horizon/openstack_dashboard/enabled/
|
||||
popd
|
||||
::
|
||||
git clone https://github.com/openstack/horizon.git
|
||||
git clone https://github.com/openstack/vitrage-dashboard.git
|
||||
git clone https://github.com/openstack/python-vitrageclient.git
|
||||
|
||||
cd pyton-vitrageclient
|
||||
sudo pip install -e.
|
||||
../horizon/tools/with_venv.sh pip install --upgrade .
|
||||
|
||||
cd ../horizon
|
||||
./run_tests.sh -f --docs
|
||||
cp ./openstack_dashboard/local/local_settings.py.example ./openstack_dashboard/local/local_settings.py
|
||||
pushd ../vitrage-dashboard
|
||||
../horizon/tools/with_venv.sh pip install --upgrade .
|
||||
cp -a vitragedashboard/enabled/* ../horizon/openstack_dashboard/enabled/
|
||||
cp -a vitrageclient/api/* ../horizon/openstack_dashboard/api/
|
||||
popd
|
65
vitrageclient/api/__init__.py
Normal file
65
vitrageclient/api/__init__.py
Normal file
@ -0,0 +1,65 @@
|
||||
# Copyright 2012 United States Government as represented by the
|
||||
# Administrator of the National Aeronautics and Space Administration.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Copyright 2012 Nebula, Inc.
|
||||
# Copyright 2013 Big Switch Networks
|
||||
#
|
||||
# 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.
|
||||
|
||||
"""
|
||||
Methods and interface objects used to interact with external APIs.
|
||||
|
||||
API method calls return objects that are in many cases objects with
|
||||
attributes that are direct maps to the data returned from the API http call.
|
||||
Unfortunately, these objects are also often constructed dynamically, making
|
||||
it difficult to know what data is available from the API object. Because of
|
||||
this, all API calls should wrap their returned object in one defined here,
|
||||
using only explicitly defined attributes and/or methods.
|
||||
|
||||
In other words, Horizon developers not working on openstack_dashboard.api
|
||||
shouldn't need to understand the finer details of APIs for
|
||||
Keystone/Nova/Glance/Swift et. al.
|
||||
"""
|
||||
from openstack_dashboard.api import base
|
||||
from openstack_dashboard.api import ceilometer
|
||||
from openstack_dashboard.api import cinder
|
||||
from openstack_dashboard.api import fwaas
|
||||
from openstack_dashboard.api import glance
|
||||
from openstack_dashboard.api import heat
|
||||
from openstack_dashboard.api import keystone
|
||||
from openstack_dashboard.api import lbaas
|
||||
from openstack_dashboard.api import network
|
||||
from openstack_dashboard.api import neutron
|
||||
from openstack_dashboard.api import nova
|
||||
from openstack_dashboard.api import swift
|
||||
from openstack_dashboard.api import vitrage
|
||||
from openstack_dashboard.api import vpn
|
||||
|
||||
|
||||
__all__ = [
|
||||
"base",
|
||||
"cinder",
|
||||
"fwaas",
|
||||
"glance",
|
||||
"heat",
|
||||
"keystone",
|
||||
"lbaas",
|
||||
"network",
|
||||
"neutron",
|
||||
"nova",
|
||||
"swift",
|
||||
"ceilometer",
|
||||
"vpn",
|
||||
"vitrage"
|
||||
]
|
34
vitrageclient/api/rest/__init__.py
Normal file
34
vitrageclient/api/rest/__init__.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright 2014, Rackspace, US, Inc.
|
||||
#
|
||||
# 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 package holds the REST API that supports the Horizon dashboard
|
||||
Javascript code.
|
||||
|
||||
It is not intended to be used outside of Horizon, and makes no promises of
|
||||
stability or fitness for purpose outside of that scope.
|
||||
|
||||
It does not promise to adhere to the general OpenStack API Guidelines set out
|
||||
in https://wiki.openstack.org/wiki/APIChangeGuidelines.
|
||||
"""
|
||||
|
||||
# import REST API modules here
|
||||
from . import cinder #flake8: noqa
|
||||
from . import config #flake8: noqa
|
||||
from . import glance #flake8: noqa
|
||||
from . import heat #flake8: noqa
|
||||
from . import keystone #flake8: noqa
|
||||
from . import network #flake8: noqa
|
||||
from . import neutron #flake8: noqa
|
||||
from . import nova #flake8: noqa
|
||||
from . import policy #flake8: noqa
|
||||
from . import vitrage #flake8: noqa
|
41
vitrageclient/api/rest/vitrage.py
Normal file
41
vitrageclient/api/rest/vitrage.py
Normal file
@ -0,0 +1,41 @@
|
||||
# Copyright 2015 - Alcatel-Lucent
|
||||
#
|
||||
# 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.views import generic
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.api.rest import utils as rest_utils
|
||||
|
||||
from openstack_dashboard.api.rest import urls
|
||||
|
||||
|
||||
@urls.register
|
||||
class Topolgy(generic.View):
|
||||
"""API for vitrage topology."""
|
||||
|
||||
url_regex = r'vitrage/topology/$'
|
||||
|
||||
@rest_utils.ajax()
|
||||
def get(self, request):
|
||||
"""Get a single volume's details with the volume id.
|
||||
|
||||
The following get parameters may be passed in the GET
|
||||
|
||||
:param volume_id the id of the volume
|
||||
|
||||
The result is a volume object.
|
||||
"""
|
||||
|
||||
return api.vitrage.topology(request)
|
34
vitrageclient/api/vitrage.py
Normal file
34
vitrageclient/api/vitrage.py
Normal file
@ -0,0 +1,34 @@
|
||||
# Copyright 2015 - Alcatel-Lucent
|
||||
#
|
||||
# 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.utils.memoized import memoized # noqa
|
||||
from keystoneauth1.identity.generic.token import Token
|
||||
from keystoneauth1.session import Session
|
||||
from openstack_dashboard.api import base
|
||||
from vitrageclient import client as vitrage_client
|
||||
|
||||
|
||||
@memoized
|
||||
def vitrageclient(request, password=None):
|
||||
endpoint = base.url_for(request, 'identity')
|
||||
tokenId = request.user.token.id
|
||||
tenentName = request.user.tenant_name
|
||||
auth = Token(auth_url=endpoint, token=tokenId, project_name=tenentName)
|
||||
session = Session(auth=auth, timeout=600)
|
||||
return vitrage_client.Client('1', session)
|
||||
|
||||
|
||||
def topology(request):
|
||||
return vitrageclient(request).topology.get(graph_type='tree')
|
@ -9,27 +9,26 @@
|
||||
vitrageAPI.$inject = [
|
||||
'horizon.framework.util.http.service',
|
||||
'horizon.framework.widgets.toast.service'
|
||||
|
||||
];
|
||||
|
||||
function vitrageAPI(apiService, toastService) {
|
||||
|
||||
return {
|
||||
var service = {
|
||||
getTopology: getTopology
|
||||
};
|
||||
|
||||
return service;
|
||||
|
||||
///////////
|
||||
|
||||
// Topology
|
||||
function getTopology() {
|
||||
console.log("**** getToplogy test ****");
|
||||
return apiService.get('/api/nova/keypairs/')
|
||||
function getTopology(config) {
|
||||
return apiService.get('/api/vitrage/topology', config)
|
||||
.error(function () {
|
||||
toastService.add('error', gettext('Unable to get the Vitrage service Topology.'));
|
||||
toastService.add('error', gettext('Unable to fetch the Vitrage Topology service.'));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}());
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
function MainController($scope, vitrageTopologySrv) {
|
||||
$scope.STATIC_URL = STATIC_URL;
|
||||
console.log("MainController");
|
||||
var srv = vitrageTopologySrv;
|
||||
console.log("***** srv ",srv);
|
||||
}
|
||||
|
||||
})();
|
||||
|
@ -16,7 +16,8 @@
|
||||
if (vitrageAPI) {
|
||||
vitrageAPI.getTopology()
|
||||
.success(function (data) {
|
||||
console.log("Success " + data);
|
||||
console.log("Success " , data);
|
||||
return data;
|
||||
})
|
||||
.error(function (err) {
|
||||
console.error(err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user