2015-07-11 02:06:57 +02:00
|
|
|
"""
|
|
|
|
.. module: lemur.destinations.models
|
|
|
|
:platform: unix
|
2018-05-29 19:18:16 +02:00
|
|
|
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
|
2015-07-11 02:06:57 +02:00
|
|
|
:license: Apache, see LICENSE for more details.
|
|
|
|
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
|
|
|
|
"""
|
|
|
|
from sqlalchemy import Column, Integer, String, Text
|
|
|
|
from sqlalchemy_utils import JSONType
|
|
|
|
from lemur.database import db
|
|
|
|
|
|
|
|
from lemur.plugins.base import plugins
|
|
|
|
|
2015-07-21 22:06:13 +02:00
|
|
|
|
2015-07-11 02:06:57 +02:00
|
|
|
class Destination(db.Model):
|
2019-05-16 16:57:02 +02:00
|
|
|
__tablename__ = "destinations"
|
2015-07-11 02:06:57 +02:00
|
|
|
id = Column(Integer, primary_key=True)
|
|
|
|
label = Column(String(32))
|
|
|
|
options = Column(JSONType)
|
|
|
|
description = Column(Text())
|
|
|
|
plugin_name = Column(String(32))
|
|
|
|
|
|
|
|
@property
|
|
|
|
def plugin(self):
|
2016-07-05 00:30:20 +02:00
|
|
|
return plugins.get(self.plugin_name)
|
2016-11-16 18:30:54 +01:00
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return "Destination(label={label})".format(label=self.label)
|