# Path: monasca_notification/common/repositories/orm/models.py
# ALARM_STATES = ('UNDETERMINED', 'OK', 'ALARM')
# def create_alarm_action_model(metadata=None):
# def create_notification_method_model(metadata=None):
# def create_notification_method_type_model(metadata=None):
# def create_alarm_model(metadata=None):


from oslo_config import cfg
from oslo_log import log as logging
from sqlalchemy import engine_from_config, MetaData
from sqlalchemy.sql import select, bindparam, and_, insert
from sqlalchemy.exc import DatabaseError
from monasca_notification.common.repositories import exceptions as exc
from monasca_notification.common.repositories.orm import models
# Copyright 2015-2017 FUJITSU LIMITED
# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
#
# 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.



LOG = logging.getLogger(__name__)
CONF = cfg.CONF


class OrmRepo(object):
    def __init__(self):
        self._orm_engine = engine_from_config({
            'url': CONF.orm.url
        }, prefix='')

        metadata = MetaData()

        aa = models.create_alarm_action_model(metadata).alias('aa')
        nm = models.create_notification_method_model(metadata).alias('nm')

# Path: monasca_notification/common/repositories/orm/models.py
# ALARM_STATES = ('UNDETERMINED', 'OK', 'ALARM')
# def create_alarm_action_model(metadata=None):
# def create_notification_method_model(metadata=None):
# def create_notification_method_type_model(metadata=None):
# def create_alarm_model(metadata=None):


# Path: monasca_notification/common/repositories/orm/orm_repo.py
from oslo_config import cfg
from oslo_log import log as logging
from sqlalchemy import engine_from_config, MetaData
from sqlalchemy.sql import select, bindparam, and_, insert
from sqlalchemy.exc import DatabaseError
from monasca_notification.common.repositories import exceptions as exc
from monasca_notification.common.repositories.orm import models

# Copyright 2015-2017 FUJITSU LIMITED
# (C) Copyright 2015,2016 Hewlett Packard Enterprise Development LP
#
# 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.



LOG = logging.getLogger(__name__)
CONF = cfg.CONF


class OrmRepo(object):
    def __init__(self):
        self._orm_engine = engine_from_config({
            'url': CONF.orm.url
        }, prefix='')

        metadata = MetaData()

        aa = models.create_alarm_action_model(metadata).alias('aa')
        nm = models.create_notification_method_model(metadata).alias('nm')

        nmt_insert = models.create_notification_method_type_model(metadata)