 --
 -- Copyright (C) 2006 The Trustees of Princeton University
 --
--- $Id: planetlab4.sql,v 1.15 2006/10/18 20:54:28 tmack Exp $
+-- $Id: planetlab4.sql,v 1.17 2006/10/19 21:36:54 tmack Exp $
 --
 
 --------------------------------------------------------------------------------

GROUP BY person_id;

--------------------------------------------------------------------------------
-- Attributes
--------------------------------------------------------------------------------

-- Slice attribute types

node_nodegroups.nodegroup_ids,
node_slices.slice_ids,
node_pcus.pcu_ids,
node_pcus.ports,
node_conf_files.conf_file_ids
FROM nodes
LEFT JOIN node_nodenetworks USING (node_id)
LEFT JOIN node_nodegroups USING (node_id)
LEFT JOIN node_slices USING (node_id)
LEFT JOIN node_pcus USING (node_id)
LEFT JOIN node_conf_files USING (node_id);

CREATE VIEW view_nodegroups AS
SELECT
nodegroups.nodegroup_id,
nodegroups.name,
nodegroups.description,
nodegroup_nodes.node_ids,
nodegroup_conf_files.conf_file_ids
FROM nodegroups
LEFT JOIN nodegroup_nodes USING (nodegroup_id)
LEFT JOIN nodegroup_conf_files USING (nodegroup_id);

CREATE VIEW view_conf_files AS
SELECT
conf_files.conf_file_id,
conf_files.enabled,
conf_files.source,
conf_files.dest,
conf_files.file_permissions,
conf_files.file_owner,
conf_files.file_group,
conf_files.preinstall_cmd,
conf_files.postinstall_cmd,
conf_files.error_cmd,
conf_files.ignore_cmd_errors,
conf_files.always_update,
conf_file_nodes.node_ids,
conf_file_nodegroups.nodegroup_ids
FROM conf_files
LEFT JOIN conf_file_nodes USING (conf_file_id)
LEFT JOIN conf_file_nodegroups USING (conf_file_id);

CREATE VIEW view_pcus AS
SELECT
