# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: Nodes.py,v 1.19 2006/11/09 03:07:42 mlhuang Exp $
+# $Id: Nodes.py,v 1.25 2006/11/28 10:25:03 thierry Exp $
#
from types import StringTypes
'slice_ids': Parameter([int], "List of slices on this node"),
'pcu_ids': Parameter([int], "List of PCUs that control this node"),
'ports': Parameter([int], "List of PCU ports that this node is connected to"),
+ 'peer_id': Parameter(int, "Peer at which this node is managed", nullok = True),
}
+ # for Cache
+ class_key = 'hostname'
+ foreign_fields = ['boot_state','model','version','date_created','last_updated']
+ foreign_xrefs = [
+ # in this case, we dont need the 'table' but Cache will look it up, so...
+ {'field' : 'site_id' , 'class' : 'Site' , 'table' : 'unused-on-direct-refs' } ,
+ ]
+
def validate_hostname(self, hostname):
if not valid_hostname(hostname):
raise PLCInvalidArgument, "Invalid hostname"
self['deleted'] = True
self.sync(commit)
+
class Nodes(Table):
"""
Representation of row(s) from the nodes table in the
sql += " AND (%s)" % node_filter.sql(api, "AND")
self.selectall(sql)
+