Merge "Added REST API skeleton for EDP component"
This commit is contained in:
commit
880ed49576
31
savanna/api/v11.py
Normal file
31
savanna/api/v11.py
Normal file
@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2013 Mirantis 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.
|
||||
|
||||
|
||||
from savanna.openstack.common import log as logging
|
||||
from savanna.service.edp import api
|
||||
import savanna.utils.api as u
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
rest = u.Rest('v11', __name__)
|
||||
|
||||
|
||||
## EDP ops
|
||||
|
||||
@rest.get('/jobs')
|
||||
def jobs_list():
|
||||
return u.render(jobs=api.get_jobs())
|
@ -20,6 +20,7 @@ from oslo.config import cfg
|
||||
from werkzeug import exceptions as werkzeug_exceptions
|
||||
|
||||
from savanna.api import v10 as api_v10
|
||||
from savanna.api import v11 as api_v11
|
||||
from savanna import context
|
||||
from savanna.db import api as db_api
|
||||
from savanna.middleware import auth_valid
|
||||
@ -99,6 +100,8 @@ def make_app():
|
||||
context.set_ctx(None)
|
||||
|
||||
app.register_blueprint(api_v10.rest, url_prefix='/v1.0')
|
||||
app.register_blueprint(api_v10.rest, url_prefix='/v1.1')
|
||||
app.register_blueprint(api_v11.rest, url_prefix='/v1.1')
|
||||
|
||||
db_api.configure_db()
|
||||
scheduler.setup_scheduler(app)
|
||||
|
0
savanna/service/edp/__init__.py
Normal file
0
savanna/service/edp/__init__.py
Normal file
18
savanna/service/edp/api.py
Normal file
18
savanna/service/edp/api.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2013 Mirantis 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.
|
||||
|
||||
|
||||
def get_jobs():
|
||||
return []
|
Loading…
Reference in New Issue
Block a user