Added bootstrap for the currently existing PCU types and Protocol types.
authorStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 18 Dec 2007 17:07:46 +0000 (17:07 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Tue, 18 Dec 2007 17:07:46 +0000 (17:07 +0000)
db-config

index 8e7dc12..7a7f6f0 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -842,6 +842,134 @@ message, please reply so that we may investigate the problem.
         if not messages:
             AddMessage(template)
 
+    
+    ### Setup Initial PCU information
+    pcu_types = [{'model': 'AP79xx',
+          'name': 'APC AP79xx',
+          'pcu_protocol_types': [{ 'port': 80,
+                                  'protocol': 'APC79xxHttp',
+                                  'supported': False},
+                                 { 'port': 23,
+                                  'protocol': 'APC79xx',
+                                  'supported': True},
+                                 { 'port': 22,
+                                  'protocol': 'APC79xx',
+                                  'supported': True}],
+          },
+         {'model': 'Masterswitch',
+          'name': 'APC Masterswitch',
+          'pcu_protocol_types': [{ 'port': 80,
+                                  'protocol': 'APCMasterHttp',
+                                  'supported': False},
+                                 { 'port': 23,
+                                  'protocol': 'APCMaster',
+                                  'supported': True},
+                                 { 'port': 22,
+                                  'protocol': 'APCMaster',
+                                  'supported': True}],
+          },
+         {'model': 'DS4-RPC',
+          'name': 'BayTech DS4-RPC',
+          'pcu_protocol_types': [{ 'port': 80,
+                                  'protocol': 'BayTechHttp',
+                                  'supported': False},
+                                 { 'port': 23,
+                                  'protocol': 'BayTech',
+                                  'supported': True},
+                                 { 'port': 22,
+                                  'protocol': 'BayTech',
+                                  'supported': True}],
+          },
+         {'model': 'IP-41x_IP-81x',
+          'name': 'Dataprobe IP-41x & IP-81x',
+          'pcu_protocol_types': [ { 'port': 23,
+                                  'protocol': 'IPALTelnet',
+                                  'supported': True},
+                                  { 'port': 80,
+                                  'protocol': 'IPALHttp',
+                                  'supported': False}],
+          },
+         {'model': 'DRAC3',
+          'name': 'Dell RAC Version 3',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'DRAC4',
+          'name': 'Dell RAC Version 4',
+          'pcu_protocol_types': [{ 'port': 443,
+                                  'protocol': 'DRACRacAdm',
+                                  'supported': True},
+                                 { 'port': 80,
+                                  'protocol': 'DRACRacAdm',
+                                  'supported': False},
+                                 { 'port': 22,
+                                  'protocol': 'DRAC',
+                                  'supported': True}],
+          },
+         {'model': 'ePowerSwitch',
+          'name': 'ePowerSwitch 1/4/8x',
+          'pcu_protocol_types': [{ 'port': 80,
+                                  'protocol': 'ePowerSwitch',
+                                  'supported': True}],
+          },
+         {'model': 'ilo2',
+          'name': 'HP iLO2 (Integrated Lights-Out)',
+          'pcu_protocol_types': [{ 'port': 443,
+                                  'protocol': 'HPiLOHttps',
+                                  'supported': True},
+                                 { 'port': 22,
+                                  'protocol': 'HPiLO',
+                                  'supported': True}],
+          },
+         {'model': 'ilo1',
+          'name': 'HP iLO version 1',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'PM211-MIP',
+          'name': 'Infratec PM221-MIP',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'AMT2.5',
+          'name': 'Intel AMT v2.5 (Active Management Technology)',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'AMT3.0',
+          'name': 'Intel AMT v3.0 (Active Management Technology)',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'WTI_IPS-4',
+          'name': 'Western Telematic (WTI IPS-4)',
+          'pcu_protocol_types': [],
+          },
+         {'model': 'unknown',
+          'name': 'Unknown Vendor or Model',
+          'pcu_protocol_types': [{ 'port': 443,
+                                  'protocol': 'UnknownPCU',
+                                  'supported': False},
+                                 { 'port': 80,
+                                  'protocol': 'UnknownPCU',
+                                  'supported': False},
+                                 { 'port': 23,
+                                  'protocol': 'UnknownPCU',
+                                  'supported': False},
+                                 { 'port': 22,
+                                  'protocol': 'UnknownPCU',
+                                  'supported': False}],
+          }]
+
+    # Get all model names
+    pcu_models = [type['model'] for type in GetPCUTypes()]
+    for type in pcu_types:
+        protocol_types = type['pcu_protocol_types']
+        # Take this value out of the struct.
+        del type['pcu_protocol_types']
+        if type['model'] not in pcu_models:
+            # Add the name/model info into DB
+            id = AddPCUType(type)
+            # for each protocol, also add this.
+            for ptype in protocol_types:
+                AddPCUProtocolType(id, ptype)
+
+
 if __name__ == '__main__':
     main()