Add apache support script for solum API

This patch add scripts for running API services via apache.
The follow-up patch will add the devstack install support.

bp: https://blueprints.launchpad.net/solum/+spec/solum-api-under-wsgi
ref: https://github.com/openstack/heat/blob/master/heat/httpd/heat_api.py

Change-Id: Ia1c892e1b53b2d0ac247f33604cf891792a829a9
Partially-Implements: blueprint solum-api-under-wsgi
This commit is contained in:
zhurong 2017-03-22 14:19:54 +08:00
parent fbd5bbe122
commit 7d68ffa899
3 changed files with 46 additions and 0 deletions

View File

@ -53,6 +53,9 @@ console_scripts =
solum-deployer = solum.cmd.deployer:main solum-deployer = solum.cmd.deployer:main
solum-worker = solum.cmd.worker:main solum-worker = solum.cmd.worker:main
wsgi_scripts =
solum-wsgi-api = solum.httpd.solum_api:init_application
mistral.actions = mistral.actions =
solum.create_image = solum.mistral_actions.builder:CreateImageAction solum.create_image = solum.mistral_actions.builder:CreateImageAction
solum.get_image_id = solum.mistral_actions.builder:GetImageIdAction solum.get_image_id = solum.mistral_actions.builder:GetImageIdAction

0
solum/httpd/__init__.py Normal file
View File

43
solum/httpd/solum_api.py Normal file
View File

@ -0,0 +1,43 @@
# 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.
"""WSGI script for solum-api.
Script for running solum-api under Apache2.
"""
from oslo_config import cfg
import oslo_i18n as i18n
from oslo_log import log as logging
from solum.api import app as api_app
from solum.common import config
from solum import objects
def init_application():
i18n.enable_lazy()
LOG = logging.getLogger('solum.api')
logging.register_options(cfg.CONF)
cfg.CONF(project='solum')
logging.setup(cfg.CONF, 'solum')
config.set_config_defaults()
objects.load()
port = cfg.CONF.api.port
host = cfg.CONF.api.host
LOG.info(('Starting Solum REST API on %(host)s:%(port)s'),
{'host': host, 'port': port})
return api_app.setup_app()