]> andersk Git - moira.git/commitdiff
Add ghba/get_host_by_account_number query.
authorzacheiss <zacheiss>
Wed, 22 Aug 2001 08:22:43 +0000 (08:22 +0000)
committerzacheiss <zacheiss>
Wed, 22 Aug 2001 08:22:43 +0000 (08:22 +0000)
server/queries2.c

index 3103c5819133bf60c0ce5fd7ce903d85517ac3c3..a7557913412ec5192286c1463b5e1b72eba4a8e3 100644 (file)
@@ -819,6 +819,14 @@ static char *ghbh_fields[] = {
   "inuse", "modtime", "modby", "modwith",
 };
 
+static char *ghba_fields[] = {
+  "account_number",
+  "name", "vendor", "model", "os", "location", "contact", "billing_contact",
+  "account_number", "use", "status", "status_change", "network", "address", 
+  "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator",
+  "inuse", "modtime", "modby", "modwith",
+};
+
 static struct validate ghst_validate = {
   0,
   0,
@@ -4497,6 +4505,23 @@ struct query Queries[] = {
     &ghst_validate,
   },
 
+  {
+    /* Q_GHBA - GET_HOST_BY_ACCOUNT_NUMBER, v8 */
+    "get_host_by_account_number",
+    "ghba",
+    8,
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "m.name, m.vendor, m.model, m.os, m.location, m.contact, m.billing_contact, m.account_number, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",    
+    ghba_fields,
+    23,
+    "m.account_number LIKE '%s' AND m.mach_id != 0 and s.snet_id = m.snet_id",
+    1,
+    "m.name",
+    &ghst_validate,
+  },
+
   {
     /* Q_GHHA - GET_HOST_HWADDR */
     "get_host_hwaddr",
This page took 0.057874 seconds and 5 git commands to generate.