import pyodbc

class PlatformDB:
    
    def __init__(self, server, database, user, password) -> None:
        
        self.connection_string = f'Driver=SQL Server; \
                                   Server={server}; \
                                   Database={database}; \
                                   UID={user}; \
                                   PWD={password};'

    
    def GetRules(self):
        try:
            conn = pyodbc.connect(self.connection_string, timeout=10)
            cursor = conn.cursor()
            cursor.execute("SELECT * FROM dbo.ArcSight_Rules")
            
            return {
                'rules':
                    [dict(zip([column[0] for column in cursor.description], row)) for row in cursor.fetchall()]
            }
            
        except Exception as e:
            raise Exception(e)
        
        finally:
            conn.close()
        
1bed0193752fc174e68678b3ca20df81dd81750b
<mask token>


class PlatformDB:
    <mask token>
    <mask token>

<mask token>


class PlatformDB:

    def __init__(self, server, database, user, password) ->None:
        self.connection_string = (
            f'Driver=SQL Server;                                    Server={server};                                    Database={database};                                    UID={user};                                    PWD={password};'
            )
    <mask token>

<mask token>


class PlatformDB:

    def __init__(self, server, database, user, password) ->None:
        self.connection_string = (
            f'Driver=SQL Server;                                    Server={server};                                    Database={database};                                    UID={user};                                    PWD={password};'
            )

    def GetRules(self):
        try:
            conn = pyodbc.connect(self.connection_string, timeout=10)
            cursor = conn.cursor()
            cursor.execute('SELECT * FROM dbo.ArcSight_Rules')
            return {'rules': [dict(zip([column[0] for column in cursor.
                description], row)) for row in cursor.fetchall()]}
        except Exception as e:
            raise Exception(e)
        finally:
            conn.close()

import pyodbc


class PlatformDB:

    def __init__(self, server, database, user, password) ->None:
        self.connection_string = (
            f'Driver=SQL Server;                                    Server={server};                                    Database={database};                                    UID={user};                                    PWD={password};'
            )

    def GetRules(self):
        try:
            conn = pyodbc.connect(self.connection_string, timeout=10)
            cursor = conn.cursor()
            cursor.execute('SELECT * FROM dbo.ArcSight_Rules')
            return {'rules': [dict(zip([column[0] for column in cursor.
                description], row)) for row in cursor.fetchall()]}
        except Exception as e:
            raise Exception(e)
        finally:
            conn.close()

import pyodbc

class PlatformDB:
    
    def __init__(self, server, database, user, password) -> None:
        
        self.connection_string = f'Driver=SQL Server; \
                                   Server={server}; \
                                   Database={database}; \
                                   UID={user}; \
                                   PWD={password};'

    
    def GetRules(self):
        try:
            conn = pyodbc.connect(self.connection_string, timeout=10)
            cursor = conn.cursor()
            cursor.execute("SELECT * FROM dbo.ArcSight_Rules")
            
            return {
                'rules':
                    [dict(zip([column[0] for column in cursor.description], row)) for row in cursor.fetchall()]
            }
            
        except Exception as e:
            raise Exception(e)
        
        finally:
            conn.close()
        