Exemplo n.º 1
0
def main(q, i, p, params, tags):
    rootobject = 'activity'
    domain = "crm"
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection('sampleapp')
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, False)
        view.setCol('description', q.enumerators.OsisType.STRING, False)
        view.setCol('customer', q.enumerators.OsisType.STRING, True)
        view.setCol('lead', q.enumerators.OsisType.STRING, True)
        view.setCol('location', q.enumerators.OsisType.STRING, True)
        view.setCol('type', q.enumerators.OsisType.STRING, True)
        view.setCol('priority', q.enumerators.OsisType.STRING, True)
        view.setCol('status', q.enumerators.OsisType.STRING, True)
        view.setCol('starttime', q.enumerators.OsisType.DATETIME, True)
        view.setCol('endtime', q.enumerators.OsisType.DATETIME, True)
        connection.viewAdd(view)

        indexes = ['name', 'customer', 'type', 'priority']
        for field in indexes:
            context = {
                'schema': "%s_%s" % (domain, rootobject),
                'view': view_name,
                'field': field
            }
            connection.runQuery(
                "CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)"
                % context)
Exemplo n.º 2
0
def main(q, i, p, params, tags):
    rootobject = 'businessparams'
    domain = "datacenter"
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection('dcsimulator')
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, True)
        view.setCol('collocation', q.enumerators.OsisType.INTEGER, True)
        view.setCol('storage', q.enumerators.OsisType.INTEGER, True)
        view.setCol('cpu', q.enumerators.OsisType.INTEGER, True)
        view.setCol('leasebuilding', q.enumerators.OsisType.INTEGER, True)
        view.setCol('leaseinfrastructure', q.enumerators.OsisType.INTEGER, True)
        view.setCol('leasehw', q.enumerators.OsisType.INTEGER, True)
        view.setCol('interestbuilding', q.enumerators.OsisType.FLOAT, True)
        view.setCol('interestdatacenter', q.enumerators.OsisType.FLOAT, True)
        view.setCol('leaseperiodbuilding', q.enumerators.OsisType.INTEGER, True)
        view.setCol('leaseperioddatacenter', q.enumerators.OsisType.INTEGER, True)
        view.setCol('technology', q.enumerators.OsisType.INTEGER, True)
        view.setCol('installperiod', q.enumerators.OsisType.INTEGER, True)
        view.setCol('size', q.enumerators.OsisType.INTEGER, False)
        view.setCol('racksurface', q.enumerators.OsisType.INTEGER, False)
        view.setCol('kwhourcost', q.enumerators.OsisType.FLOAT, False)
        view.setCol('pue', q.enumerators.OsisType.FLOAT, False)
        view.setCol('salescollocation', q.enumerators.OsisType.FLOAT, False)
        view.setCol('salescpu', q.enumerators.OsisType.FLOAT, False)
        view.setCol('salesstorage', q.enumerators.OsisType.FLOAT, False)
        view.setCol('salesbandwidth', q.enumerators.OsisType.FLOAT, False)
        connection.viewAdd(view)
        
        indexes = ['collocation', 'size', 'leasebuilding', 'interestdatacenter']
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)
Exemplo n.º 3
0
def main(q, i, params, tags):
    domain = 'ui'
    rootobject = 'space'
    conName = params['appname']
    connection = OsisDB().getConnection(conName)
    view_name = '%s_tag_list' % rootobject
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('tag', q.enumerators.OsisType.STRING, False, index=True)
        connection.viewAdd(view)
Exemplo n.º 4
0
def main(q, i, params, tags):
    rootobject = 'bookmark'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name', q.enumerators.OsisType.STRING, False, index=True)
        view.setCol('url', q.enumerators.OsisType.STRING, False)
        view.setCol('order', q.enumerators.OsisType.INTEGER, False)
        connection.viewAdd(view)
Exemplo n.º 5
0
def main(q, i, params, tags):
    rootobject = 'user'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('login', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('groupguids', q.enumerators.OsisType.STRING, True)
        connection.viewAdd(view)
Exemplo n.º 6
0
def main(q, i, params, tags):
    rootobject = '_index'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name', q.enumerators.OsisType.STRING, False)
        view.setCol('url', q.enumerators.OsisType.STRING, False)
        view.setCol('content', q.enumerators.OsisType.TEXT, True)
        view.setCol('tags', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('description', q.enumerators.OsisType.STRING, True)
        connection.viewAdd(view)
Exemplo n.º 7
0
def main(q, i, params, tags):
    rootobject = 'config'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('space', q.enumerators.OsisType.UUID, True, index=True)
        view.setCol('page', q.enumerators.OsisType.UUID, True, index=True)
        view.setCol('macro', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('configid', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('username', q.enumerators.OsisType.STRING, True, index=True)
        connection.viewAdd(view)
Exemplo n.º 8
0
def main(q, i, params, tags):
    rootobject = 'project'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name',
                    q.enumerators.OsisType.STRING,
                    False,
                    index=True,
                    unique=True)
        view.setCol('path', q.enumerators.OsisType.STRING, False)
        view.setCol('tags', q.enumerators.OsisType.STRING, True, index=True)
        connection.viewAdd(view)
Exemplo n.º 9
0
def main(q, i, params, tags):
    rootobject = 'customer'
    domain = "crm"
    appname = params['appname']
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, True)
        connection.viewAdd(view)

        indexes = ['name']
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)
Exemplo n.º 10
0
def main(q, i, params, tags):
    rootobject = 'eventqueue'
    domain = "monitoring"
    appname = params['appname']
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, True)
        view.setCol('numberofevents', q.enumerators.OsisType.INTEGER, True)
        connection.viewAdd(view)

        indexes = ['name', 'numberofevents']
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)
Exemplo n.º 11
0
def main(q, i, params, tags):
    rootobject = 'permission'
    domain = "crm"
    appname = params['appname']
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, True)
        view.setCol('uri', q.enumerators.OsisType.STRING, True)
        connection.viewAdd(view)
        indexes =list()
         
        indexes.append('name')
        indexes.append('uri')
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)
Exemplo n.º 12
0
def main(q, i, params, tags):
    rootobject = 'page'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('space', q.enumerators.OsisType.UUID, True, index=True)
        view.setCol('category',
                    q.enumerators.OsisType.STRING,
                    True,
                    index=True)
        view.setCol('parent', q.enumerators.OsisType.UUID, True, index=True)
        view.setCol('tags', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('order', q.enumerators.OsisType.INTEGER, True)
        view.setCol('title', q.enumerators.OsisType.STRING, True)
        view.setCol('pagetype', q.enumerators.OsisType.STRING, True)
        connection.viewAdd(view)
Exemplo n.º 13
0
def main(q, i, params, tags):
    rootobject = 'space'
    domain = "ui"
    appname = params['appname']
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, rootobject):
        view = connection.viewCreate(domain, rootobject, rootobject)
        view.setCol('name',
                    q.enumerators.OsisType.STRING,
                    True,
                    index=True,
                    unique=True)
        view.setCol('tags', q.enumerators.OsisType.STRING, True, index=True)
        view.setCol('repository',
                    q.enumerators.OsisType.STRING,
                    True,
                    index=True)
        view.setCol('repo_username', q.enumerators.OsisType.STRING, True)
        view.setCol('order', q.enumerators.OsisType.INTEGER, True)
        connection.viewAdd(view)
Exemplo n.º 14
0
def main(q, i, params, tags):
    rootobject = 'lead'
    domain = "crm"
    appname = params['appname']
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection(appname)
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, True)
        view.setCol('code', q.enumerators.OsisType.STRING, True)
        view.setCol('customerguid', q.enumerators.OsisType.UUID, True)
        view.setCol('source', q.enumerators.OsisType.STRING, True)
        view.setCol('type', q.enumerators.OsisType.STRING, True)
        view.setCol('status', q.enumerators.OsisType.STRING, True)
        view.setCol('amount', q.enumerators.OsisType.FLOAT, True)
        view.setCol('probability', q.enumerators.OsisType.BIGINT, True)
        connection.viewAdd(view)

        indexes = ['name', 'code', 'source', 'type', 'status', 'amount', 'probability']
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)
def main(q, i, p, params, tags):
    rootobject = 'activity'
    domain = "crm"
    view_name = '%s_view_%s_list' % (domain, rootobject)
    connection = OsisDB().getConnection('sampleapp')
    if not connection.viewExists(domain, rootobject, view_name):
        view = connection.viewCreate(domain, rootobject, view_name)
        view.setCol('name', q.enumerators.OsisType.STRING, False)
        view.setCol('description', q.enumerators.OsisType.STRING, False)
        view.setCol('customer', q.enumerators.OsisType.STRING, True)
        view.setCol('lead', q.enumerators.OsisType.STRING, True)
        view.setCol('location', q.enumerators.OsisType.STRING, True)
        view.setCol('type', q.enumerators.OsisType.STRING, True)
        view.setCol('priority', q.enumerators.OsisType.STRING, True)
        view.setCol('status', q.enumerators.OsisType.STRING, True)
        view.setCol('starttime', q.enumerators.OsisType.DATETIME, True)
        view.setCol('endtime', q.enumerators.OsisType.DATETIME, True)
        connection.viewAdd(view)
        
        indexes = ['name', 'customer', 'type', 'priority']
        for field in indexes:
            context = {'schema': "%s_%s" % (domain, rootobject), 'view': view_name, 'field': field}
            connection.runQuery("CREATE INDEX %(field)s_%(schema)s_%(view)s ON %(schema)s.%(view)s (%(field)s)" % context)