]> andersk Git - moira.git/blobdiff - server/queries2.c
Make gtlc version 7; it didn't change any interfaces so we don't need
[moira.git] / server / queries2.c
index 046ae23a22831a09453fe38927526e8e3503ac26..31644d218f3d4ed9d978c3908a8eb36db5e5dd56 100644 (file)
@@ -3243,6 +3243,11 @@ static struct validate dmcn_validate = /* for amtn and dmfn */
   set_mach_modtime_by_id,
 };
 
+static char *gmnm_fields[] = {
+  "machine",
+  "machine", "container",
+};
+
 static char *gmoc_fields[] = {
   "container",
   "isrecursive",
@@ -3282,6 +3287,11 @@ static struct validate gsoc_validate =
   get_subcontainers_of_container,
 };
 
+static char *gtlc_fields[] = {
+  "name",
+};
+
+
 /* Generalized Query Definitions */
 
 /* Multiple versions of the same query MUST be listed in ascending
@@ -6709,9 +6719,9 @@ struct query Queries[] = {
     RETRIEVE,
     "mcn",
     MCNTMAP_TABLE,
-    "c.name FROM machine m, containers c, mcntmap mcn",
-    amcn_fields,
-    1,
+    "m.name, c.name FROM machine m, containers c, mcntmap mcn",
+    gmnm_fields,
+    2,
     "m.name = UPPER('%s') AND mcn.cnt_id = c.cnt_id AND mcn.mach_id = m.mach_id",
     1,
     NULL,
@@ -6752,6 +6762,23 @@ struct query Queries[] = {
     &gsoc_validate,
   },
 
+  {
+    /* Q_GTLC - GET_TOPLEVEL_CONTAINERS, v7 */
+    "get_toplevel_containers",
+    "gtlc",
+    7,
+    RETRIEVE,
+    "c",
+    CONTAINERS_TABLE,
+    "name FROM containers",
+    gtlc_fields,
+    1,
+    "name NOT LIKE '%%/%%'",
+    0,
+    "name",
+    NULL,
+  },
+
 };
 
 int QueryCount = (sizeof(Queries) / sizeof(struct query));
This page took 0.038484 seconds and 4 git commands to generate.