示例#1
0
#    under the License.
#
# @author: Stéphane Albert
#
from oslo.db import exception
from oslo.db.sqlalchemy import utils
import six
import sqlalchemy

from cloudkitty.billing.hash.db import api
from cloudkitty.billing.hash.db.sqlalchemy import migration
from cloudkitty.billing.hash.db.sqlalchemy import models
from cloudkitty import db
from cloudkitty.openstack.common import log as logging

LOG = logging.getLogger(__name__)


def get_backend():
    return HashMap()


class HashMap(api.HashMap):

    def get_migrate(self):
        return migration

    def get_service(self, service):
        session = db.get_session()
        try:
            q = session.query(models.HashMapService)
示例#2
0
#
import os
from wsgiref import simple_server

from oslo.config import cfg
from oslo import messaging
from paste import deploy
import pecan

from cloudkitty.api import config as api_config
from cloudkitty.api import hooks
from cloudkitty.common import rpc
from cloudkitty import config  # noqa
from cloudkitty.openstack.common import log as logging

LOG = logging.getLogger(__name__)

auth_opts = [
    cfg.StrOpt('api_paste_config',
               default="api_paste.ini",
               help="Configuration file for WSGI definition of API."),
]

api_opts = [
    cfg.StrOpt('host_ip', default="0.0.0.0", help="Host serving the API."),
    cfg.IntOpt('port', default=8888, help="Host port serving the API."),
]

CONF = cfg.CONF
CONF.register_opts(auth_opts)
CONF.register_opts(api_opts, group='api')