vigiboard / dashboard / model / bdd_dashboard / host.py @ 70c5f034
History | View | Annotate | Download (1.45 KB)
1 | 805cc54a | Thomas ANDREJAK | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | """Model For Host Table"""
|
||
3 | |||
4 | from sqlalchemy.orm import mapper, relation |
||
5 | from sqlalchemy import Table, ForeignKeyConstraint, Column, Index |
||
6 | from sqlalchemy.types import Integer, String, Text, DateTime |
||
7 | |||
8 | from dashboard.model import metadata |
||
9 | |||
10 | |||
11 | # Generation par SQLAutoCode
|
||
12 | |||
13 | host = Table('host', metadata,
|
||
14 | Column(u'name', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=True, nullable=False), |
||
15 | Column(u'checkhostcmd', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
||
16 | Column(u'community', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
||
17 | Column(u'fqhn', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
||
18 | Column(u'hosttpl', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
||
19 | Column(u'mainip', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False, nullable=False), |
||
20 | Column(u'port', Integer(), primary_key=False, nullable=False), |
||
21 | Column(u'snmpoidsperpdu', Integer(), primary_key=False), |
||
22 | Column(u'snmpversion', String(length=255, convert_unicode=False, assert_unicode=None), primary_key=False), |
||
23 | ) |
||
24 | Index(u'name', host.c.name, unique=False) |
||
25 | |||
26 | # Classe a mapper
|
||
27 | |||
28 | class Host(object): |
||
29 | pass
|
||
30 | mapper(Host,host) |
||
31 |