ONOS CLI changes and cleanup
diff --git a/cli/cli/c_actions.py b/cli/cli/c_actions.py
index 85b0e7a..e445315 100755
--- a/cli/cli/c_actions.py
+++ b/cli/cli/c_actions.py
@@ -38,6 +38,7 @@
 from midw import *
 from vnsw import *
 
+onos=1
 #
 # ACTION PROCS
 #
@@ -1542,7 +1543,20 @@
                 print "command_query_rest: %s #entries %d " % (url, len(entries))
                 print result
         else:
-            result = entries
+            result = []
+            if (onos == 1) and (url == 'links'):
+                for entry in entries:
+                    result.append({
+                       'src-switch'          : entry['src']['dpid'],
+                       'src-port'            : entry['src']['portNumber'],
+                       'src-port-state'      : 0,
+                       'dst-switch'          : entry['dst']['dpid'],
+                       'dst-port'            : entry['dst']['portNumber'],
+                       'dst-port-state'      : 0,
+                       'type'                : entry['type'],
+                    })
+            else:
+                result = entries
         
     if append:
         for entry in result:
diff --git a/cli/cli/cli.py b/cli/cli/cli.py
index b03f6dc..0f807ce 100755
--- a/cli/cli/cli.py
+++ b/cli/cli/cli.py
@@ -516,7 +516,7 @@
         #
         # config mode commands
         #
-        self.command_dict['config'] = [ "boot" ]
+        #self.command_dict['config'] = [ "boot" ]
 
         #
         # commands which start at 'login'
@@ -534,9 +534,9 @@
                                               'ping', 'test', 'version',
                                               'connect', 'watch', 'no' ]
 
-        self.command_nested_dict['enable'] = [ 'clear', 'end' ]
+        #self.command_nested_dict['enable'] = [ 'clear', 'end' ]
 
-        self.command_dict['config-internal'] = ['lint', 'permute']
+        #self.command_dict['config-internal'] = ['lint', 'permute']
 
     #
     # --------------------------------------------------------------------------------
@@ -1413,7 +1413,10 @@
     #
     #
     def all_obj_types_starting_with(self, text=""):
-        netvirt_feature = self.netvirt_feature_enabled()
+        if onos == 0:
+            netvirt_feature = self.netvirt_feature_enabled()
+        else:
+            netvirt_feature = False
 
         matched_obj_types = [x for x in mi.obj_types
                              if x.startswith(text) and
@@ -1489,7 +1492,7 @@
             return True
         return default_value
 
- 
+    '''
     #
     # --------------------------------------------------------------------------
     # address_space_default_create
@@ -1623,7 +1626,7 @@
         if controller_netvirt_feature == False:
             return False
         return True
-
+    '''
 
     #
     # --------------------------------------------------------------------------------
@@ -1687,7 +1690,10 @@
             return []
         #
         # vns features
-        netvirt_features = self.netvirt_feature_enabled()
+        if onos == 0:
+            netvirt_features = self.netvirt_feature_enabled()
+        else:
+            netvirt_features = False
         vns_objects = [ 'vns-definition' ]
 
         ret_list = [x for x in mi.obj_types
@@ -1768,7 +1774,10 @@
         #
         # vns features commands include:
         netvirt_feature_commands = ['vns', 'vns-definition']
-        netvirt_feature = self.netvirt_feature_enabled()
+        if onos == 0:
+            netvirt_feature = self.netvirt_feature_enabled()
+        else:
+            netvirt_feature = False
 
         mode_list = self.commands_for_mode(self.current_mode())
         ret_list = self.commands_feature_enabled(utif.unique_list_from_list(mode_list))
@@ -2583,7 +2592,10 @@
         matching_methods = [x for x in dir(self)
                             if self.show_command_prefix_matches(x, text)]
 
-        netvirt_feature = self.netvirt_feature_enabled()
+        if onos == 0:
+            netvirt_feature = self.netvirt_feature_enabled()
+        else:
+            netvirt_feature = False
 
         for method in matching_methods:
             m = re.search("do_show_(.*)", method)
@@ -7750,7 +7762,8 @@
             # vns feature enablement.
             #  when vns is enabled, call a init procedure
             #
-            self.netvirt_feature_enabled()
+            if onos == 0:
+                self.netvirt_feature_enabled()
 
         while self.run:
             # Get command line - this will use the command completion above
diff --git a/cli/cli/climodelinfo.py b/cli/cli/climodelinfo.py
index 75125c1..13e5cb6 100755
--- a/cli/cli/climodelinfo.py
+++ b/cli/cli/climodelinfo.py
@@ -43,7 +43,7 @@
 import re
 import doctest
 
-
+onos=1
 class CliModelInfo(): 
     # so the model is accessible from the formatter functions
     singleton = None
@@ -88,6 +88,7 @@
                                 else:
                                     for attr in addl_fields[f].keys():
                                         model_fields[f][attr] = addl_fields[f][attr]
+        #print self.complete_obj_type_info_dict
 
     def add_type_info(self, name, type_info):
         self.complete_obj_type_info_dict[name] = type_info
@@ -110,10 +111,474 @@
         return obj_type_info['fields'].get(field_name, None)
 
     # LOOK! Refactor - Should we merge this with model_info_list?
-    additional_model_info_dict = {
+    if (onos == 1):
+        additional_model_info_dict = {
+        'switches' : {
+            # switches are now directly fetched via rest api.
+            # 'has_rest_model' isn't set
+            # for this table.
+            # XXX perhaps these types of descriptions need to be
+            # in a file other than climodelinfo?
+            'source'          : 'user-config',
+            'source'          : 'display',
+            'url'             : 'switches',
+            'config-obj-type' : 'switch-config',
+
+            'fields' : {
+                'dpid'               : {
+                                         'edit' : False,
+                                         'max_length': 32,
+                                         'null': False,
+                                         'primary_key': True,
+                                         'type': 'CharField',
+                                         'edit' : False,
+                                       },
+                'active'             : {
+                                         'edit' : False
+                                       },
+                'core-switch'        : {
+                                         'edit' : False,
+                                       },
+                'connected-since'    : { 
+                                         'edit' : False
+                                       },
+                'capabilities'       : {
+                                         'edit' : False
+                                       },
+                'actions'            : {
+                                         'edit' : False
+                                       },
+                'ip-address'         : {
+                                         'edit' : False
+                                       },
+                'socket-address'     : {
+                                         'edit' : False
+                                       },
+                'buffers'            : {
+                                         'edit' : False
+                                       },
+                'controller'         : {
+                                         'edit' : False,
+                                       },
+                'tables'             : {
+                                         'edit' : False
+                                       },
+                'switch-alias'       : {
+                                         'help_text' : 'Switch alias for DPID',
+                                         'edit' : False,
+                                       },
+                'tunnels'            : {
+                                         'edit' : False,
+                                       },
+                'tunnel-supported'   : {
+                                         'edit' : False,
+                                       },
+                'tunnel-termination' : {
+                                         'edit' : False,
+                                       },
+                'tunnel-active'      : {
+                                         'edit' : False,
+                                       },
+                'dp-desc'            : {
+                                         'edit' : False,
+                                       },
+                'hw-desc'            : {
+                                         'edit' : False,
+                                       },
+                'sw-desc'            : {
+                                         'edit' : False,
+                                       },
+                'serial-num'         : {
+                                         'edit' : False,
+                                       },
+                }
+            },
+        'interfaces' : {
+            # switches are now directly fetched via rest api.
+            # 'has_rest_model' isn't set
+            # for this table.
+            # XXX perhaps these types of descriptions need to be
+            # in a file other than climodelinfo?
+            'source'          : 'display',
+            'url'             : 'switches',
+            'config-obj-type' : 'switch-interface-config',
+
+            'fields' : {
+                'id'                  : {
+                                         'edit' : False,
+                                         'max_length': 48,
+                                         'null': False,
+                                         'primary_key': True,
+                                         'type' : 'compound-key',
+                                         'edit' : False,
+                                         'help_text' : '#!dpid',
+                                         'compound_key_fields': [ 'dpid' ]
+                                        },
+                'dpid'                : {
+                                           #'type'           : 'ForeignKey',
+                                           #'rel_field_name' : 'dpid',
+                                           #'rel_obj_type'   : 'switch',
+                                        },
+                'name'                : {
+                                        },
+                'number'              : {
+                                        },
+                'config'              : {
+                                        },
+                'state'               : {
+                                        },
+                'current-features'    : {
+                                        },
+                'advertised-features' : {
+                                        },
+                'supported-features'  : {
+                                        },
+                'peer-features'       : {
+                                        },
+                }
+            },
+
+
+        'switch-config' : {
+            'source' : 'debug-only',
+        },
+
+
+        'switch-alias' : {
+            'source'          : 'user-config',
+            'cascade_delete'  : True,
+            },
+
+
+        'switch-interface-config' : {
+            'source'          : 'debug-only',
+            'cascade_delete'  : True,
+
+            'fields'          : {
+                'broadcast'           : { 'edit' : False
+                                        },
+                'name'                : { 'edit' : False
+                                        },
+                'mode'                : { 
+                                          'edit' : False
+                                        },
+                },
+            },
+
+
+        'host-alias' : {
+            'source'          : 'user-config',
+            'cascade_delete'  : True,
+            },
+
+
+        'link' : { 
+            'source'          : 'switch',
+
+            'fields' : {
+                'link-type'      : {
+                                    'type' : 'CharField'
+                                   },
+                }
+            },
+
+
+        'port' : {
+            'source'          : 'debug-only',
+
+            'fields' : {
+                'switch'              : {
+                                        },
+                'number'              : {
+                                        },
+                'config'              : {
+                                        },
+                'state'               : {
+                                        },
+                'current-features'    : {
+                                        },
+                'advertised-features' : {
+                                        },
+                'supported-features'  : {
+                                        },
+                'peer-features'       : {
+                                        },
+                }
+            },
+
+        'switch-interfaces' : {
+            'source'    : 'switch',
+
+            'fields' : {
+                'Idx'                 : { 
+                                           'edit' : False,
+                                          'type' : 'CharField'
+                                        },
+                'id'                  : {
+                                          'primary_key': True,
+                                          # format's out of the sorting business
+                                          # 'sort' : 'tail-integer',
+                                        },
+                'switch'              : {
+                                        },
+                'name'                : {
+                                          'type' : 'CharField',
+                                          'max_length' : 32,
+                                        },
+                'hardware-address'    : {
+                                        },
+                'config'              : { 
+                                        },
+                'state'               : {
+                                        },
+                'stp-state'           : { 
+                                        },
+                'current-features'    : { 
+                                        },
+                'advertised-features' : {
+                                        },
+                'supported-features'  : {
+                                        },
+                'peer-features'       : {
+                                        },
+                'receiveBytes'        : {
+                                        },
+                'receivePackets'      : {
+                                        },
+                'receiveErrors'       : {
+                                        },
+                'transmitBytes'       : {
+                                        },
+                'transmitPackets'     : {
+                                        },
+                'transmitErrors'      : {
+                                        },
+                },
+            },
+
+        'controller_switches' : {
+            'source'          : 'user-config',
+            
+            'fields' : {
+                'dpid' : { 'primary_key' : True,
+                         },
+                }
+            },
+    
+        'host-config' : {
+            'source'          : 'show',
+            'url'             : 'device',
+
+            'fields' : {
+                'Idx'                : {
+                                          'edit' : False,
+                                          'type' : 'CharField'
+                                       },
+                'mac'                : { 
+                                          'json_serialize_string': True,
+                                          'max_length': 17,
+                                          'null': False,
+                                          'type': 'CharField',
+                                          'edit' : False,
+                                        },
+                'vendor'              : {
+                                          'edit' : False,
+                                        },
+                'ips'                 : {
+                                          'edit' : False
+                                        },
+                'attachment-points'   : {
+                                          'edit' : False
+                                        },
+                'tag'                 : {
+                                          'edit' : False
+                                        },
+                'host-alias'          : { 'help_text' : 'Host alias',
+                                          'edit' : False,
+                                        },
+                'last-seen'           : {
+                                          'help_text': 'Last time a packet was seen by the controller',
+                                          'json_serialize_string': True,
+                                          'null': True,
+                                          'type': 'DateTimeField',
+                                        },
+                },
+            },
+
+        'host': {
+            # hosts are now directly fetched via rest api. 'has_rest_model' isn't set
+            # for this table.
+            # XXX perhaps these types of descriptions need to be
+            # in a file other than climodelinfo?
+            'source'          : 'user-config',
+            'source'          : 'display',
+            'url'             : 'device',
+            'config-obj-type' : 'host-config',
+
+            'fields': {
+                'mac'                : { 
+                                          'json_serialize_string': True,
+                                          'max_length': 17,
+                                          'null': False,
+                                          'primary_key': True,
+                                          'type': 'CharField',
+                                          'edit' : False,
+                                        },
+                'vlan'                : {
+                                          'help_text'            : 'VLAN Associated with host',
+                                          'json_serialize_string': False,
+                                          'null'                 : True,
+                                          'type'                 : 'IntegerField',
+                                          'edit'                 : False,
+                                          'searchable'           : True,
+                                        },
+                'dpid'                : {
+                                           'edit'           : False,
+                                           'type'           : 'ForeignKey',
+                                           'rel_field_name' : 'dpid',
+                                           'rel_obj_type'   : 'switches',
+                                        },
+                'ipv4'                : {
+                                           'edit' : False,
+                                        },
+                # Attachment point isn't searchable
+                #'attachment-points'  : {
+                                           #'edit' : False
+                                        #},
+                'last-seen'           : {
+                                          'help_text': 'Last time a packet was seen by the controller',
+                                          'json_serialize_string': True,
+                                          'null': True,
+                                          'type': 'DateTimeField',
+                                        },
+                 },
+            },
+
+
+        'host-attachment-point' : {
+            # directly fetched via rest api. 
+            # 'has_rest_model' isn't set for this table.
+            'source'          : 'controller',
+            'url'             : 'device',
+
+             'fields': {
+                'mac'          : {
+                                  'json_serialize_string': True,
+                                  'null': True,
+                                  'rel_field_name': 'mac',
+                                  'rel_obj_type': 'host',
+                                  'type': 'ForeignKey',
+                                 },
+                'vlan'         : {
+                                   'help_text': 'VLAN Associated with host',
+                                   'json_serialize_string': False,
+                                   'null': True,
+                                   'type': 'IntegerField',
+                                   'edit' : False,
+                                    'searchable' : True,
+                                 },
+                'id'           : {
+                                  'help_text': '#|mac|dpid|ingress-port',
+                                  'json_serialize_string': True,
+                                  'max_length': 64,
+                                  'null': False,
+                                  'primary_key': True,
+                                  'type': 'CharField',
+                                 },
+                'dpid'         : { 'json_serialize_string': True,
+                                   'null': True,
+                                   'rel_field_name': 'dpid',
+                                   'rel_obj_type': 'switch',
+                                   'type': 'ForeignKey',
+                                 },
+                'ingress-port' : {
+                                  'help_text': 'Open flow port number of ingress port',
+                                  'json_serialize_string': False,
+                                  'null': True,
+                                  'type': 'IntegerField',
+                                 },
+                'status'       : {
+                                   'help_text': 'Error description, blank mean no error ',
+                                   'json_serialize_string': True,
+                                   'max_length': 64,
+                                   'null': True,
+                                   'type': 'CharField',
+                                 },
+                'last-seen'    : {
+                                   'help_text': 'Last time a packet was seen by the controller',
+                                   'json_serialize_string': True,
+                                   'null': True,
+                                   'type': 'DateTimeField',
+                                 },
+                'ipv4'         : { # added to enable searching
+                                    'edit' : False,
+                                    'searchable' : True,
+                                 },
+                 },
+             },
+
+        'host-network-address': {
+            # directly fetched via rest api. 
+            # 'has_rest_model' isn't set for this table.
+            'source'          : 'switch',
+            'url'             : 'device',
+
+            'fields': {
+                'mac'        : { 'json_serialize_string': True,
+                                 'null': True,
+                                 'rel_field_name': 'mac',
+                                 'rel_obj_type': 'host',
+                                 'type': 'ForeignKey',
+                                 'edit' : False,
+                               },
+                'vlan'       : {
+                                 'help_text': 'VLAN Associated with host',
+                                 'json_serialize_string': False,
+                                 'null': True,
+                                 'type': 'IntegerField',
+                                 'edit' : False,
+                                 'searchable' : True,
+                               },
+                'id'         : {
+                                 'help_text': '#|mac|ipv4',
+                                 'json_serialize_string': True,
+                                 'max_length': 64,
+                                 'null': False,
+                                 'primary_key': True,
+                                 'type': 'CharField',
+                               },
+                'ip-address':  {
+                                 'help_text': 'IP Address of host',
+                                 'json_serialize_string': True,
+                                 'max_length': 15,
+                                 'null': True,
+                                 'type': 'CharField',
+                                 'edit' : False,
+                              },
+                'last-seen' : {
+                                'help_text': 'Last time a packet was seen by the controller',
+                                'json_serialize_string': True,
+                                'null': True,
+                                'type': 'DateTimeField',
+                              },
+                'ipv4'      : { # added to enable searching
+                                 'max_length': 15,
+                                 'null': True,
+                                 'type': 'CharField',
+                                 'edit' : False,
+                              },
+                'dpid'      : {
+                                 'edit' : False,
+                                 'searchable' : True,
+                              },
+                },
+            }
+        }
+    else:
+        additional_model_info_dict = {
         'flow-entry' : {
             'source'          : 'user-config',
-            'update-alias'    : ['switch', 'port'],
+           'update-alias'    : ['switch', 'port'],
             },
 
 
@@ -161,7 +626,6 @@
                 }
             },
 
-
         'switches' : {
             # switches are now directly fetched via rest api.
             # 'has_rest_model' isn't set
@@ -426,7 +890,6 @@
                 }
             },
 
-
         'test-pktin-route' : {
             'source' : 'debug-only',
             
@@ -1322,12 +1785,7 @@
                                   'type': 'DateTimeField',
                                 },
                 }
-            },
-
-
-        'global-config' : {
-            'source'        : 'controller',
-        },
+            }
 
         # done.
         }
diff --git a/cli/cli/desc/version200/address_space.py b/cli/cli/desc/version200/address_space.py
index 154b825..9dfe17f 100755
--- a/cli/cli/desc/version200/address_space.py
+++ b/cli/cli/desc/version200/address_space.py
@@ -16,7 +16,7 @@
 
 import command
 import fmtcnv
-
+'''
 def address_space_origin_external (data):
     """
     Return origin-name when the address space wasn't created by the cli,
@@ -73,8 +73,8 @@
 command.add_action('address-space-confirm-external-delete',
                    address_space_confirm_external_delete,
                    {'kwargs': {'data'      : '$data',}})
-
-
+'''
+"""
 #
 # ----------------------------------------------------------------------
 # address-space submode configuration commands
@@ -193,7 +193,7 @@
         }
     )
 }
-
+"""
 
 def address_space_check_unique_vlan(data):
     """
@@ -217,7 +217,7 @@
                    address_space_check_unique_vlan,
                    {'kwargs': {'data' : '$data',}})
 
-
+"""
 #
 # conf/address-space <as>/vlan-tag-on-egress <tag>
 #
@@ -634,4 +634,4 @@
             }
         },
 }
-
+"""
diff --git a/cli/cli/desc/version200/controller_node.py b/cli/cli/desc/version200/controller_node.py
index 2ee7985..9ebea77 100755
--- a/cli/cli/desc/version200/controller_node.py
+++ b/cli/cli/desc/version200/controller_node.py
@@ -16,7 +16,7 @@
 
 import command
 import fmtcnv
-
+"""
 CONTROLLER_NODE_FORMAT = {
     'controller-node' : {
         'field-orderings' : {
@@ -1077,3 +1077,4 @@
         },
     )
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/core.py b/cli/cli/desc/version200/core.py
index e172141..f4610f5 100755
--- a/cli/cli/desc/version200/core.py
+++ b/cli/cli/desc/version200/core.py
@@ -17,6 +17,7 @@
 import command
 import run_config
 
+"""
 SHOW_RUNNING_CONFIG_COMMAND_DESCRIPTION = {
     'name'         : 'show',
     'mode'         : 'login',
@@ -720,7 +721,7 @@
         'optional'        : 'true',
     },
 }
-
+"""
 DEBUG_CLI_COMMAND_DESCRIPTION = {
     'name'                : 'debug',
     'mode'                : ['login', 'enable', 'config*'],
@@ -828,7 +829,7 @@
         )
     }
 }
-
+"""
 HA_CONFIG_CLI_COMMAND_DESCRIPTION = {
     'name'                : 'ha',
     'short-help'          : 'Configure high availability',
@@ -1245,7 +1246,7 @@
         },
     ),
 }
-
+"""
 
 #
 # FORMATS 
@@ -1253,7 +1254,7 @@
 
 import fmtcnv
 
-
+"""
 GLOBAL_CONFIG_FORMAT = {
     'global-config' : {
         'field-orderings' : {
@@ -1308,7 +1309,7 @@
     },
 }
 
-
+"""
 LINK_FORMAT = {
     'link' : {
         'field-orderings' : {
@@ -1328,7 +1329,7 @@
         },
 }
 
-
+"""
 CONFIG_FORMAT = {
     'config' : {
         'field-orderings' : {
@@ -2137,4 +2138,4 @@
         },
     },
 }
-
+"""
diff --git a/cli/cli/desc/version200/flow_entry.py b/cli/cli/desc/version200/flow_entry.py
index dfe9449..bbb49f9 100755
--- a/cli/cli/desc/version200/flow_entry.py
+++ b/cli/cli/desc/version200/flow_entry.py
@@ -15,7 +15,7 @@
 #
 
 import fmtcnv
-
+"""
 FLOW_ENTRY_SUBMODE_COMMAND_DESCRIPTION = {
     'name'            : 'flow-entry',
     'mode'            : 'config-switch*',
@@ -489,4 +489,4 @@
             },
         },
 }
-
+"""
diff --git a/cli/cli/desc/version200/forwarding.py b/cli/cli/desc/version200/forwarding.py
index 8083f37..52c5673 100755
--- a/cli/cli/desc/version200/forwarding.py
+++ b/cli/cli/desc/version200/forwarding.py
@@ -14,7 +14,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 # CLI for forwarding configuration
 #
 
@@ -87,5 +87,5 @@
         },
     ),
 }
-
+"""
 # --------------------------------------------------------------------------------
diff --git a/cli/cli/desc/version200/host.py b/cli/cli/desc/version200/host.py
index 82bfff1..b65bb4e 100755
--- a/cli/cli/desc/version200/host.py
+++ b/cli/cli/desc/version200/host.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 HOST_SUBMODE_COMMAND_DESCRIPTION = {
     'name'                : 'host',
     'obj-type'            : 'host-config',
@@ -60,7 +60,7 @@
          }
     )
 }
-
+"""
 
 host_show_mac_action = (
     {
@@ -357,7 +357,7 @@
     )
 }
 
-
+"""
 HOST_HOST_ALIAS_COMMAND_DESCRIPTION = {
     'name'         : 'host-alias',
     'mode'         : 'config-host',
@@ -460,7 +460,7 @@
         },
     ),
 }
-
+"""
 
 #
 # FORMATS
@@ -472,12 +472,12 @@
 HOST_FORMAT = {
     'host': {
         'field-orderings' : {
-            'default' : [ 'Idx', 'id', 'address-space', 'vlan', 
-                          'ips', 'attachment-points', 'tag', 'last-seen' ],
-            'details' : [ 'Idx', 'id', 'address-space', 'vlan', 
-                          'vendor', 'ips', 'attachment-points', 'tag', 'dhcp-client-name',
-                          'last-seen' ],
-            'brief'   : [ 'Idx', 'id', 'address-space', 'vlan', 'ips', 'last-seen'],
+            'default' : [ 'Idx', 'id',  
+                          'ips', 'attachment-points' ],
+            'details' : [ 'Idx', 'id',  
+                          'vendor', 'ips', 'attachment-points'
+                          ],
+            'brief'   : [ 'Idx', 'id', 'ips'],
             },
 
 
@@ -604,7 +604,7 @@
         },
 }
 
-
+"""
 HOST_CONFIG_FORMAT = {
     'host-config' : {
         'field-orderings' : {
@@ -647,3 +647,4 @@
         },
     },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/internal.py b/cli/cli/desc/version200/internal.py
index cd5f812..5fe7ad2 100755
--- a/cli/cli/desc/version200/internal.py
+++ b/cli/cli/desc/version200/internal.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 import command
 
 INTERNAL_SUBMODE_COMMAND_DESCRIPTION = {
@@ -666,3 +666,4 @@
         }
     },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/link.py b/cli/cli/desc/version200/link.py
index 319bbc5..bddb090 100755
--- a/cli/cli/desc/version200/link.py
+++ b/cli/cli/desc/version200/link.py
@@ -67,8 +67,8 @@
     'links' : {
         'field-orderings' : {
             'default' : [ 'Idx',
-                          'src-switch', 'src-port', 'src-port-state',
-                          'dst-switch', 'dst-port', 'dst-port-state', 'type' ]
+                          'src-switch', 'src-port', 
+                          'dst-switch', 'dst-port', 'type' ]
              },
         'fields' : {
             'src-switch'     : {
diff --git a/cli/cli/desc/version200/snmp.py b/cli/cli/desc/version200/snmp.py
index b3cb6b4..ad9b31e 100755
--- a/cli/cli/desc/version200/snmp.py
+++ b/cli/cli/desc/version200/snmp.py
@@ -37,7 +37,7 @@
                     {'kwargs': { 'data'   : '$data',
                                }})
 
-
+"""
 #
 # --------------------------------------------------------------------------------
 # SNMP command descriptions 
@@ -134,7 +134,7 @@
         },
     )
 }
-
+"""
 
 def snmp_firewall_interfaces(data):
     """
@@ -160,7 +160,7 @@
                     {'kwargs': { 'data'   : '$data',
                                }})
 
-
+"""
 SNMP_SERVER_SHOW_COMMAND_DESCRIPTION = {
     'name'         : 'show',
     'mode'         : 'login',
@@ -211,3 +211,4 @@
         },
     }
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/switch.py b/cli/cli/desc/version200/switch.py
index 541b3a5..6a814f3 100755
--- a/cli/cli/desc/version200/switch.py
+++ b/cli/cli/desc/version200/switch.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 SWITCH_SUBMODE_COMMAND_DESCRIPTION = {
     'name'          : 'switch',
     'short-help'    : 'Enter switch submode, configure switch details',
@@ -38,7 +38,7 @@
         }
     )
 }
-
+"""
 #
 # ------------------------------------------------------------------------------
 # show switch
@@ -153,7 +153,7 @@
         },
     )
 }
-
+"""
 SWITCH_SHOW_REALTIME_STATS_COMMAND_DESCRIPTION = {
     'name'                : 'show',
     'mode'                : 'login',
@@ -676,9 +676,9 @@
         'format'   : 'tunnel-pipeline',
     }
 )
-
+"""
 import fmtcnv
-
+"""
 TUNNEL_PIPELINE_FORMAT = {
     'tunnel-pipeline' : {
         'field-orderings' : {
@@ -941,7 +941,7 @@
         }
     )
 }
-
+"""
 #
 # FORMATS
 #
@@ -951,9 +951,9 @@
     'switch' : {
         'field-orderings' : {
             'default' : [ 'Idx', '@', 'switch-alias', 'connected-since',
-                          'ip-address', ],
+                          'ip-address', 'type'],
             'details' : [ 'Idx','@', 'switch-alias', 'connected-since',
-                          'ip-address', ],
+                          'ip-address', 'type'],
             'brief'   : [ 'Idx', '@', 'switch-alias', 'connected-since',
                           'ip-address', ],
             },
@@ -969,7 +969,7 @@
                                    },
             'connected-since'    : {
                                      'verbose-name' : 'Connected Since',
-                                     'formatter' : fmtcnv.timestamp_to_local_timestr,
+                                     #'formatter' : fmtcnv.timestamp_to_local_timestr,
                                    },
             'capabilities'       : {
                                      'formatter' : fmtcnv.decode_switch_capabilities,
@@ -1009,11 +1009,13 @@
                                    },
             'serial-num'         : {
                                    },
+            'type'               : {
+                                   },
             }
         },
 }
 
-
+"""
 SWITCH_CONFIG_FORMAT = {
     'switch-config' : {
         'field-orderings' : {
@@ -1156,4 +1158,4 @@
         },
     },
 }
-
+"""
diff --git a/cli/cli/desc/version200/tacacs.py b/cli/cli/desc/version200/tacacs.py
index 321c28a..31efcf2 100755
--- a/cli/cli/desc/version200/tacacs.py
+++ b/cli/cli/desc/version200/tacacs.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 TACACS_SERVER_HOST_COMMAND_DESCRIPTION = {
     'name'         : 'tacacs',
     'mode'         : 'config*',
@@ -388,3 +388,4 @@
         }
     }
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/tag.py b/cli/cli/desc/version200/tag.py
index d6cbd0a..309eb97 100755
--- a/cli/cli/desc/version200/tag.py
+++ b/cli/cli/desc/version200/tag.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 #
 #
 
@@ -170,3 +170,4 @@
         },
     },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/techsupport.py b/cli/cli/desc/version200/techsupport.py
index fafc788..7110f36 100755
--- a/cli/cli/desc/version200/techsupport.py
+++ b/cli/cli/desc/version200/techsupport.py
@@ -26,7 +26,7 @@
 #  tech-support-config type command
 #  no tech-support-config type command
 #
-
+"""
 TECH_SUPPORT_COMMAND_DESCRIPTION = {
     'name'         : 'tech-support-config',
     'mode'         : 'config',
@@ -79,3 +79,4 @@
         },
     )
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/tenant.py b/cli/cli/desc/version200/tenant.py
index d0fa0c4..1608953 100755
--- a/cli/cli/desc/version200/tenant.py
+++ b/cli/cli/desc/version200/tenant.py
@@ -18,6 +18,7 @@
 #
 
 import command
+'''
 def tenant_origin_external(data):
     """
     Return origin-name when the tenant wasn't created by the cli,
@@ -101,6 +102,8 @@
 command.add_completion('complete-tenant-preprocess', complete_tenant_preprocess,
                            {'kwargs': {'data': '$data',
                                        }})
+'''
+"""
 #
 # ----------------------------------------------------------------------
 # tenant submode commands
@@ -539,3 +542,4 @@
            }
         },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/topology.py b/cli/cli/desc/version200/topology.py
index 2fb26ba..4bb51a4 100755
--- a/cli/cli/desc/version200/topology.py
+++ b/cli/cli/desc/version200/topology.py
@@ -13,7 +13,7 @@
 # implied. See the License for the specific language governing
 # permissions and limitations under the License.
 #
-
+"""
 
 TOPOLOGY_COMMAND_DESCRIPTION = {
     'name'         : 'topology',
@@ -56,3 +56,4 @@
         )
     }
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/tunnel.py b/cli/cli/desc/version200/tunnel.py
index 7e50ae4..0a3f5ba 100755
--- a/cli/cli/desc/version200/tunnel.py
+++ b/cli/cli/desc/version200/tunnel.py
@@ -15,7 +15,7 @@
 #
 
 import fmtcnv
-
+"""
 TUNNEL_COMMAND_DESCRIPTION = {
     'name'          : 'tunnel-link',
     'feature'      : 'vns',
@@ -105,3 +105,4 @@
             }
         },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/vcenter.py b/cli/cli/desc/version200/vcenter.py
index dbee0ea..f71eafd 100755
--- a/cli/cli/desc/version200/vcenter.py
+++ b/cli/cli/desc/version200/vcenter.py
@@ -18,7 +18,7 @@
 #
 # vCenter commands
 #
-
+"""
 import os
 VCENTER_COMMAND_DESCRIPTION = {
     'name'         : 'vcenter',
@@ -546,3 +546,4 @@
 
         },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/virtualrouter.py b/cli/cli/desc/version200/virtualrouter.py
index ef186f2..19722db 100755
--- a/cli/cli/desc/version200/virtualrouter.py
+++ b/cli/cli/desc/version200/virtualrouter.py
@@ -164,7 +164,7 @@
 command.add_action('virtualrouter-confirm-external-delete', virtualrouter_confirm_external_delete,
                     {'kwargs': {'data'      : '$data',}})
 
-
+"""
 #
 # ----------------------------------------------------------------------
 # router submode commands
@@ -1114,3 +1114,4 @@
            }
         },
 }
+"""
\ No newline at end of file
diff --git a/cli/cli/desc/version200/vns.py b/cli/cli/desc/version200/vns.py
index cca1da6..8ea1f19 100755
--- a/cli/cli/desc/version200/vns.py
+++ b/cli/cli/desc/version200/vns.py
@@ -16,7 +16,7 @@
 
 import command
 import fmtcnv
-
+'''
 def vns_origin_external(data):
     """
     Return origin-name when the vns wasn't created by the cli,
@@ -91,7 +91,8 @@
 
 command.add_action('vns-confirm-external-delete', vns_confirm_external_delete,
                     {'kwargs': {'data'      : '$data',}})
-
+'''
+"""
 #
 # ----------------------------------------------------------------------
 # vns-definition submode commands
@@ -1888,3 +1889,4 @@
             }
         },
 }
+"""
\ No newline at end of file
diff --git a/cli/sdncon/controller/admin.py b/cli/sdncon/controller/admin.py
index 7f8aebf..86c11c9 100755
--- a/cli/sdncon/controller/admin.py
+++ b/cli/sdncon/controller/admin.py
@@ -15,7 +15,7 @@
 #
 
 from django.contrib import admin
-from .models import Switch, StaticFlowTableEntry, HostConfig
+#from .models import Switch, StaticFlowTableEntry, HostConfig
 
 #admin.site.register(Switch)
 #admin.site.register(StaticFlowTableEntry)
diff --git a/cli/sdncon/controller/config.py b/cli/sdncon/controller/config.py
index 36dcd16..708fdb5 100755
--- a/cli/sdncon/controller/config.py
+++ b/cli/sdncon/controller/config.py
@@ -15,10 +15,12 @@
 #
 
 from sdncon.rest.config import add_config_handler
+"""
 from sdncon.controller.models import Feature, GlobalConfig, Controller, \
     ControllerInterface, ControllerDomainNameServer, \
     FirewallRule, ControllerAlias, SnmpServerConfig, ImageDropUser
 from sdncon.controller.models import TacacsPlusConfig, TacacsPlusHost
+"""
 from oswrapper import exec_os_wrapper
 import os
 import re
@@ -46,7 +48,7 @@
             f.close()
     return local_controller_id
 
-
+"""
 # Add the config handlers here. Check the comments for add_config_handler in rest/config.py
 # for a description of the calling conventions for config handlers.
 
@@ -233,7 +235,7 @@
         print "Calling oswrapper with:", [server_enable, community, location, contact, enable_changed]
         exec_os_wrapper('SetSnmpServerConfig', 'set',
                         [server_enable, community, location, contact, enable_changed])
-
+"""
 def test_config_handler(op, old_instance, new_instance, modified_fields=None):
     pass
 
@@ -247,6 +249,7 @@
     # Associate the config handlers with specific callout for each of the fields
     #  Keep in mind that these are the django names, NOT the rest api names,
     #
+    """
     disabled_by_shell_variable = os.environ.get('SDNCON_CONFIG_HANDLERS_DISABLED', False)
     disabled_by_file = os.path.exists("%s/sdncon_config_handlers_disabled" % sdncon.SDN_ROOT)
     if not disabled_by_shell_variable and not disabled_by_file:
@@ -282,3 +285,4 @@
                 Feature: None,
                 GlobalConfig: ['ha-enabled', 'cluster-number'],
             }, test_config_handler)
+    """
diff --git a/cli/sdncon/controller/models.py b/cli/sdncon/controller/models.py
index c6dcc9f..8529a3e 100755
--- a/cli/sdncon/controller/models.py
+++ b/cli/sdncon/controller/models.py
@@ -64,7 +64,6 @@
     """
     return int(time.time()*1000000)
 
-
 #
 # ------------------------------------------------------------
 
@@ -114,6 +113,7 @@
             {'name': 'static_flow_pusher_feature', 'rest_name': 'static-flow-pusher-feature'},
             {'name': 'performance_monitor_feature','rest_name': 'performance-monitor-feature'},
             )
+"""
 
 #
 # ------------------------------------------------------------
@@ -237,7 +237,7 @@
             {'name': 'core_priority',      'rest_name': 'core-priority'},
         )
 
-
+"""
 #
 # ------------------------------------------------------------
 
@@ -384,7 +384,7 @@
             {'name': 'logging_level',           'rest_name': 'logging-level'},
             )
 
-
+"""
 #
 # ------------------------------------------------------------
 
@@ -611,7 +611,7 @@
         NAME = 'controller-domain-name-server'
         FIELD_INFO = (
             )
-
+"""
 
 #
 # ------------------------------------------------------------
@@ -1027,6 +1027,7 @@
         FIELD_INFO = (
             {'name': 'switch_interface', 'rest_name': 'switch-interface'},
         )
+"""
 #
 # ------------------------------------------------------------
 
@@ -1206,7 +1207,7 @@
             {'name': 'tp_dst',          'rest_name': 'dst-port'},
             {'name': 'actions',         'rest_name': 'actions'},
             )
-
+"""
 
 #
 # ------------------------------------------------------------
@@ -1288,6 +1289,7 @@
             {'name': 'link_type',       'rest_name': 'link-type'}
             )
             
+"""
 #
 # ------------------------------------------------------------
 # An address-space separation
@@ -1495,7 +1497,7 @@
             {'name': 'vlans',           'rest_name': 'vlans'},
             {'name': 'tag',             'rest_name': 'tag'},
             )
-
+"""
 #
 # ------------------------------------------------------------
 
@@ -1504,9 +1506,9 @@
     #
     # fields ----------------------------------------
 
-    address_space = models.ForeignKey(
-        AddressSpace,
-        verbose_name = "Address space name")
+    #address_space = models.ForeignKey(
+    #    AddressSpace,
+    #    verbose_name = "Address space name")
 
     mac = models.CharField(
         verbose_name="MAC Address",
@@ -1526,22 +1528,24 @@
 
     def __unicode__(self):
         self.mac = self.mac.lower()
-        return "%s::%s" % (self.addressSpace, self.mac)
+        #return "%s::%s" % (self.addressSpace, self.mac)
+        return "%s" % (self.addressSpace)
 
     class CassandraSettings:
-        COMPOUND_KEY_FIELDS = ('address_space', 'vlan', 'mac')
+        #COMPOUND_KEY_FIELDS = ('address_space', 'vlan', 'mac')
+        COMPOUND_KEY_FIELDS = ('vlan', 'mac')
 
     def validate_unique(self, exclude = None):
         # Invoke the default validator; error out if the vns already exists
         super(HostConfig, self).validate_unique(exclude)
-        if self.vlan and str(self.address_space) != 'default': 
-            raise ValidationError('host: vlan configured for '
-                                  'address-space other than "default" %s' % self.address_space)
+        #if self.vlan and str(self.address_space) != 'default': 
+        #    raise ValidationError('host: vlan configured for '
+        #                          'address-space other than "default" %s' % self.address_space)
 
     class Rest:
         NAME = 'host-config'
         FIELD_INFO = (
-            {'name': 'address_space', 'rest_name': 'address-space'},
+            #{'name': 'address_space', 'rest_name': 'address-space'},
             )
 
 #
@@ -1642,7 +1646,7 @@
     class Rest:
         NAME = 'host-alias'
 
-
+"""
 class VlanConfig(models.Model):
     #
     # fields ----------------------------------------    
@@ -2849,7 +2853,7 @@
                       {'name': 'dst_vns',                  'rest_name': 'dst-vns'},
                       {'name': 'gateway_pool',             'rest_name': 'gateway-pool'},
             )
-
+"""
 #
 # ------------------------------------------------------------
 
@@ -2963,7 +2967,7 @@
 
 #
 # ------------------------------------------------------------
-
+"""
 class TechSupportConf(models.Model):
 
     #
@@ -3223,3 +3227,4 @@
 #
 #    class Rest:
 #        NAME = 'user'
+"""
\ No newline at end of file
diff --git a/cli/sdncon/rest/views.py b/cli/sdncon/rest/views.py
index be01800..4a3ef48 100755
--- a/cli/sdncon/rest/views.py
+++ b/cli/sdncon/rest/views.py
@@ -19,7 +19,9 @@
 from django.http import HttpResponse
 from django.utils import simplejson
 from functools import wraps
-from sdncon.controller.models import Controller, ControllerAlias, ControllerDomainNameServer, ControllerInterface, FirewallRule, Switch, Port, PortAlias, Link
+from sdncon.controller.models import Controller
+#from sdncon.controller.models import ControllerAlias, ControllerDomainNameServer, ControllerInterface, FirewallRule
+from sdncon.controller.models import Switch, Port, PortAlias, Link
 from sdncon.rest.models import UserData
 from sdncon.controller.notification import begin_batch_notification, end_batch_notification
 from django.views.decorators.csrf import csrf_exempt