Example #1
0
        public InstanceInfo Update(Instance instance, IInstanceDataCollector collector)
        {
            // Get information about databases and their principals (inluding permissions).
            // Stars first because it has more data and more time to process it.
            DataTable databases           = collector.GetDatabases();           // List of all databases on the instance with some basic information (size, date of creation).
            DataTable databaseRoles       = collector.GetDatabaseRoles();       // List of all roles on all databases.
            DataTable databaseUsers       = collector.GetDatabaseUsers();       // List of all users on all databases.
            DataTable databasePermissions = collector.GetDatabasePermissions(); // List of all permissions on all databases.
            // Start parsing databases and their principals.
            var parsedDatabases = ParseDatabasesAndTheirPrincipals(databases, databaseRoles, databaseUsers, databasePermissions);
            // Get information about instance and it's principals.
            DataRow   instanceDetails     = collector.GetInstanceInfo().Rows[0];
            DataTable instanceRoles       = collector.GetInstanceRoles();
            DataTable instanceLogins      = collector.GetInstanceLogins();
            DataTable instancePermissions = collector.GetInstancePermissions();
            // Start parsing of instance principals
            InstanceInfo result = ParseInstancePrincipals(instance.Id, instanceDetails, instanceRoles, instanceLogins, instancePermissions);

            result.Databases.AddRange(parsedDatabases);
            return(result);
        }
Example #2
0
 public InstanceInfo UpdateStatusOnly(Instance instance, IInstanceDataCollector collector)
 {
     return(ParseInstanceInfo(new InstanceInfo(instance.Id), collector.GetInstanceInfo().Rows[0]));
 }