Changeset 24001
- Timestamp:
- Apr 29, 2009, 3:29:41 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
ippScripts/Build.PL (modified) (1 diff)
-
ippScripts/scripts/dist_queue_runs.pl (added)
-
ippTasks/dist.pro (modified) (2 diffs)
-
ippTools/src/disttool.c (modified) (9 diffs)
-
ippTools/src/disttool.h (modified) (1 diff)
-
ippTools/src/disttoolConfig.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/Build.PL
r23912 r24001 83 83 scripts/dist_advancerun.pl 84 84 scripts/dist_make_fileset.pl 85 scripts/dist_queue_runs.pl 85 86 scripts/receive_source.pl 86 87 scripts/receive_fileset.pl -
trunk/ippTasks/dist.pro
r23887 r24001 14 14 $distToProcess_DB = 0 15 15 $distToAdvance_DB = 0 16 $distQueue_DB = 0 16 17 17 18 ### Check status of tasks … … 293 294 end 294 295 296 task dist.queueruns 297 # host local 298 299 periods -poll $RUNPOLL 300 periods -exec 10 301 periods -timeout 45 302 npending 1 303 304 # stdout $LOGDIR/dist.queuruns 305 # stderr $LOGDIR/dist.queueruns 306 307 task.exec 308 $MYARGS = "" 309 # assume that we need magic unless we are running simtest 310 if ($?SIMTEST_CAMERA != 0) 311 $MYARGS = --no_magic 312 end 313 314 $run = dist_queue_runs.pl $MYARGS --stage_limit 16 --logfile $LOGDIR/dist.queueruns 315 316 if ($DB:n == 0) 317 $DBNAME = DEFAULT 318 else 319 # save the DB name for add_standard_args 320 $DBNAME = $DB:$distQueue_DB 321 $distQueue_DB ++ 322 if ($distQueue_DB >= $DB:n) set distQueue_DB = 0 323 end 324 325 host anyhost 326 327 add_standard_args run 328 329 # create the command line 330 if ($VERBOSE > 1) 331 echo command $run 332 end 333 command $run 334 end 335 336 task.exit $EXIT_SUCCESS 337 # nothing to do 338 end 339 340 # default exit status 341 task.exit default 342 showcommand failure 343 end 344 345 # operation timed out? 346 task.exit timeout 347 showcommand timeout 348 end 349 350 # operation timed out? 351 task.exit crash 352 showcommand crash 353 end 354 end -
trunk/ippTools/src/disttool.c
r23972 r24001 47 47 static bool pendingdestMode(pxConfig *config); 48 48 49 static bool definetargetMode(pxConfig *config); 50 static bool updatetargetMode(pxConfig *config); 51 static bool listtargetMode(pxConfig *config); 52 53 static bool definedsproductMode(pxConfig *config); 54 static bool updatedsproductMode(pxConfig *config); 55 56 static bool definedestinationMode(pxConfig *config); 57 static bool updatedestinationMode(pxConfig *config); 58 59 static bool defineinterestMode(pxConfig *config); 60 static bool updateinterestMode(pxConfig *config); 61 49 62 # define MODECASE(caseName, func) \ 50 63 case caseName: \ … … 81 94 MODECASE(DISTTOOL_MODE_REVERTRCRUN, revertrcrunMode); 82 95 MODECASE(DISTTOOL_MODE_PENDINGDEST, pendingdestMode); 96 MODECASE(DISTTOOL_MODE_DEFINETARGET, definetargetMode); 97 MODECASE(DISTTOOL_MODE_UPDATETARGET, updatetargetMode); 98 MODECASE(DISTTOOL_MODE_LISTTARGET, listtargetMode); 99 MODECASE(DISTTOOL_MODE_DEFINEDSPRODUCT, definedsproductMode); 100 MODECASE(DISTTOOL_MODE_UPDATEDSPRODUCT, updatedsproductMode); 101 MODECASE(DISTTOOL_MODE_DEFINEDESTINATION, definedestinationMode); 102 MODECASE(DISTTOOL_MODE_UPDATEDESTINATION, updatedestinationMode); 103 MODECASE(DISTTOOL_MODE_DEFINEINTEREST, defineinterestMode); 104 MODECASE(DISTTOOL_MODE_UPDATEINTEREST, updateinterestMode); 83 105 default: 84 106 psAbort("invalid option (this should not happen)"); … … 157 179 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false); 158 180 PXOPT_LOOKUP_S64(limit, config->args, "-limit", false, false); 181 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 159 182 160 183 PXOPT_LOOKUP_BOOL(dry_run, config->args, "-dry_run", false); … … 323 346 } 324 347 if (!psArrayLength(output)) { 325 psTrace(" warptool", PS_LOG_INFO, "no rows found");348 psTrace("disttool", PS_LOG_INFO, "no rows found"); 326 349 psFree(output); 327 350 return true; 328 351 } 329 352 330 // XXX Remove this debugging output at some point 331 if (!ippdbPrintMetadatas(stdout, output, "newdistRuns", true)) { 332 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 333 psFree(output); 334 return false; 335 } 353 336 354 if (dry_run) { 355 if (!ippdbPrintMetadatas(stdout, output, "newdistRuns", true)) { 356 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 357 psFree(output); 358 return false; 359 } 337 360 psFree(output); 338 361 return true; 339 362 } 340 363 364 if (!psDBTransaction(config->dbh)) { 365 psError(PS_ERR_UNKNOWN, false, "database error"); 366 return false; 367 } 368 369 psArray *list = psArrayAllocEmpty(limit); 341 370 for (long i=0; i < psArrayLength(output); i++) { 342 371 psMetadata *md = output->data[i]; … … 350 379 psStringAppend(&outroot, "%s/%s/%s", workdir, run_tag, stage); 351 380 352 if (!distRunInsert(config->dbh,381 distRunRow *row = distRunRowAlloc( 353 382 0, // dist_id 354 383 target_id, … … 362 391 NULL, // time_stamp 363 392 0 // fault 364 )) { 393 ); 394 395 if (!row) { 396 psError(PS_ERR_UNKNOWN, false, "failed to allocate distRunRow"); 397 psFree(outroot); 398 psFree(output); 399 return false; 400 } 401 if (!distRunInsertObject(config->dbh, row)) { 365 402 psError(PS_ERR_UNKNOWN, false, "database error"); 366 403 psFree(outroot); … … 369 406 } 370 407 psFree(outroot); 371 } 372 408 psS64 dist_id = psDBLastInsertID(config->dbh); 409 row->dist_id = dist_id; 410 psArrayAdd(list, list->n, row); 411 psFree(row); 412 } 413 414 if (!psDBCommit(config->dbh)) { 415 psError(PS_ERR_UNKNOWN, false, "database error"); 416 return false; 417 } 418 if (!distRunPrintObjects(stdout, list, !simple)) { 419 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 420 psFree(list); 421 return false; 422 } 423 424 psFree(list); 373 425 psFree(output); 374 426 … … 1109 1161 1110 1162 1111 PXOPT_LOOKUP_STR(last_fileset, config->args, "- last_fileset", false, false);1163 PXOPT_LOOKUP_STR(last_fileset, config->args, "-set_last_fileset", false, false); 1112 1164 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1113 1165 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); … … 1213 1265 return true; 1214 1266 } 1267 1268 static bool definetargetMode(pxConfig *config) 1269 { 1270 PS_ASSERT_PTR_NON_NULL(config, false); 1271 1272 // required 1273 PXOPT_LOOKUP_STR(obs_mode, config->args, "-obs_mode", true, false); 1274 PXOPT_LOOKUP_STR(stage, config->args, "-stage", true, false); 1275 1276 // optional 1277 PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false); 1278 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1279 PXOPT_LOOKUP_STR(comment, config->args, "-comment", false, false); 1280 1281 distTargetRow *row = distTargetRowAlloc( 1282 0, // target_id 1283 obs_mode, 1284 stage, 1285 clean, 1286 state ? state : "enabled", 1287 comment 1288 ); 1289 1290 if (!row) { 1291 psError(PS_ERR_UNKNOWN, false, "failed to allocate distTarget object"); 1292 return false; 1293 } 1294 if (!distTargetInsertObject(config->dbh, row)) { 1295 psError(PS_ERR_UNKNOWN, false, "database error"); 1296 psFree(row); 1297 return false; 1298 } 1299 1300 // get the assigned target_id 1301 row->target_id = psDBLastInsertID(config->dbh); 1302 1303 if (!distTargetPrintObject(stdout, row, true)) { 1304 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1305 psFree(row); 1306 return false; 1307 } 1308 1309 psFree(row); 1310 1311 return true; 1312 } 1313 static bool updatetargetMode(pxConfig *config) 1314 { 1315 PS_ASSERT_PTR_NON_NULL(config, false); 1316 1317 psMetadata *where = psMetadataAlloc(); 1318 PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "=="); 1319 PXOPT_COPY_STR(config->args, where, "-obs_mode", "obs_mode", "=="); 1320 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "=="); 1321 1322 PXOPT_LOOKUP_STR(state, config->args, "-set_state", true, false); 1323 1324 psString query = psStringCopy("UPDATE distTarget SET state = '%s'"); 1325 1326 if (psListLength(where->list)) { 1327 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1328 psStringAppend(&query, " WHERE %s", whereClause); 1329 psFree(whereClause); 1330 } else { 1331 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 1332 psFree(where); 1333 psFree(query); 1334 return false; 1335 } 1336 psFree(where); 1337 1338 if (!p_psDBRunQueryF(config->dbh, query, state)) { 1339 psError(PS_ERR_UNKNOWN, false, "database error"); 1340 psFree(query); 1341 return false; 1342 } 1343 psFree(query); 1344 1345 return true; 1346 } 1347 1348 static bool listtargetMode(pxConfig *config) 1349 { 1350 PS_ASSERT_PTR_NON_NULL(config, false); 1351 1352 psMetadata *where = psMetadataAlloc(); 1353 PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "=="); 1354 PXOPT_COPY_STR(config->args, where, "-obs_mode", "obs_mode", "=="); 1355 PXOPT_COPY_STR(config->args, where, "-stage", "stage", "=="); 1356 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 1357 1358 PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false); 1359 PXOPT_LOOKUP_BOOL(full, config->args, "-full", false); 1360 1361 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1362 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1363 1364 if (clean && full) { 1365 psError(PS_ERR_UNKNOWN, false, "can't select both -clean and -full"); 1366 return false; 1367 } 1368 1369 psString query = psStringCopy("SELECT * FROM distTarget"); 1370 1371 if (psListLength(where->list)) { 1372 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1373 psStringAppend(&query, " WHERE %s", whereClause); 1374 psFree(whereClause); 1375 if (clean) { 1376 psStringAppend(&query, " (AND clean)"); 1377 } else if (full) { 1378 psStringAppend(&query, " (AND !clean)"); 1379 } 1380 } else if (clean) { 1381 psStringAppend(&query, " WHERE clean"); 1382 } else if (full) { 1383 psStringAppend(&query, " WHERE !clean"); 1384 } 1385 psFree(where); 1386 1387 // treat limit == 0 as "no limit" 1388 if (limit) { 1389 psString limitString = psDBGenerateLimitSQL(limit); 1390 psStringAppend(&query, " %s", limitString); 1391 psFree(limitString); 1392 } 1393 1394 if (!p_psDBRunQuery(config->dbh, query)) { 1395 psError(PS_ERR_UNKNOWN, false, "database error"); 1396 psFree(query); 1397 if (!psDBRollback(config->dbh)) { 1398 psError(PS_ERR_UNKNOWN, false, "database error"); 1399 } 1400 return false; 1401 } 1402 psFree(query); 1403 1404 psArray *output = p_psDBFetchResult(config->dbh); 1405 if (!output) { 1406 psError(PS_ERR_UNKNOWN, false, "database error"); 1407 return false; 1408 } 1409 if (!psArrayLength(output)) { 1410 psTrace("disttool", PS_LOG_INFO, "no rows found"); 1411 psFree(output); 1412 return true; 1413 } 1414 1415 if (!ippdbPrintMetadatas(stdout, output, "distTarget", !simple)) { 1416 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1417 psFree(output); 1418 return false; 1419 } 1420 1421 psFree(output); 1422 1423 return true; 1424 } 1425 1426 static bool definedsproductMode(pxConfig *config) 1427 { 1428 PS_ASSERT_PTR_NON_NULL(config, false); 1429 1430 // required 1431 PXOPT_LOOKUP_STR(name, config->args, "-name", true, false); 1432 PXOPT_LOOKUP_STR(dbname, config->args, "-ds_dbname", true, false); 1433 PXOPT_LOOKUP_STR(dbhost, config->args, "-ds_dbhost", true, false); 1434 1435 // XXX: should we insure that these names do not contatin any whitespace? 1436 1437 rcDSProductRow *row = rcDSProductRowAlloc( 1438 0, // prod_id 1439 name, 1440 dbname, 1441 dbhost 1442 ); 1443 1444 if (!row) { 1445 psError(PS_ERR_UNKNOWN, false, "failed to allocate rcDSProduct object"); 1446 return false; 1447 } 1448 if (!rcDSProductInsertObject(config->dbh, row)) { 1449 psError(PS_ERR_UNKNOWN, false, "database error"); 1450 psFree(row); 1451 return false; 1452 } 1453 1454 // get the assigned target_id 1455 row->prod_id = psDBLastInsertID(config->dbh); 1456 1457 if (!rcDSProductPrintObject(stdout, row, true)) { 1458 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1459 psFree(row); 1460 return false; 1461 } 1462 1463 psFree(row); 1464 1465 return true; 1466 } 1467 static bool updatedsproductMode(pxConfig *config) 1468 { 1469 PS_ASSERT_PTR_NON_NULL(config, false); 1470 1471 psMetadata *where = psMetadataAlloc(); 1472 PXOPT_COPY_S64(config->args, where, "-prod_id", "prod_id", "=="); 1473 1474 PXOPT_LOOKUP_STR(dbname, config->args, "-ds_dbname", false, false); 1475 PXOPT_LOOKUP_STR(dbhost, config->args, "-ds_dbhost", false, false); 1476 1477 if (!(dbname || dbhost)) { 1478 psError(PS_ERR_UNKNOWN, true, "one or more of dbname or dbhost is required"); 1479 psFree(where); 1480 return false; 1481 } 1482 psString query = psStringCopy("UPDATE rcDSProduct SET"); 1483 psString sep = ""; 1484 if (dbname) { 1485 psStringAppend(&query, " dbname = '%s'", dbname); 1486 sep = ","; 1487 } 1488 if (dbhost) { 1489 psStringAppend(&query, " %s dbhost = '%s'", sep, dbhost); 1490 } 1491 1492 if (psListLength(where->list)) { 1493 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1494 psStringAppend(&query, " WHERE %s", whereClause); 1495 psFree(whereClause); 1496 } else { 1497 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 1498 psFree(where); 1499 psFree(query); 1500 return false; 1501 } 1502 psFree(where); 1503 1504 if (!p_psDBRunQuery(config->dbh, query)) { 1505 psError(PS_ERR_UNKNOWN, false, "database error"); 1506 psFree(query); 1507 return false; 1508 } 1509 psFree(query); 1510 1511 return true; 1512 } 1513 1514 static bool definedestinationMode(pxConfig *config) 1515 { 1516 PS_ASSERT_PTR_NON_NULL(config, false); 1517 1518 // required 1519 PXOPT_LOOKUP_S64(prod_id, config->args, "-prod_id", true, false); 1520 PXOPT_LOOKUP_STR(name, config->args, "-name", true, false); 1521 1522 // optional 1523 PXOPT_LOOKUP_STR(status_uri, config->args, "-status_uri", false, false); 1524 PXOPT_LOOKUP_STR(comment, config->args, "-comment", false, false); 1525 PXOPT_LOOKUP_STR(last_fileset, config->args, "-last_fileset", false, false); 1526 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1527 1528 // XXX: should we insure that these names do not contatin any whitespace? 1529 1530 rcDestinationRow *row = rcDestinationRowAlloc( 1531 0, // dest_id 1532 prod_id, 1533 name, 1534 status_uri, 1535 comment, 1536 last_fileset, 1537 state ? state : "enabled" 1538 ); 1539 1540 if (!row) { 1541 psError(PS_ERR_UNKNOWN, false, "failed to allocate rcDestination object"); 1542 return false; 1543 } 1544 if (!rcDestinationInsertObject(config->dbh, row)) { 1545 psError(PS_ERR_UNKNOWN, false, "database error"); 1546 psFree(row); 1547 return false; 1548 } 1549 1550 // get the assigned target_id 1551 row->dest_id = psDBLastInsertID(config->dbh); 1552 1553 if (!rcDestinationPrintObject(stdout, row, true)) { 1554 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1555 psFree(row); 1556 return false; 1557 } 1558 1559 psFree(row); 1560 1561 return true; 1562 } 1563 1564 static bool updatedestinationMode(pxConfig *config) 1565 { 1566 PS_ASSERT_PTR_NON_NULL(config, false); 1567 1568 psMetadata *where = psMetadataAlloc(); 1569 PXOPT_COPY_S64(config->args, where, "-dest_id", "dest_id", "=="); 1570 PXOPT_COPY_S64(config->args, where, "-prod_id", "prod_id", "=="); 1571 1572 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1573 #ifdef ALLOW_UPDATE_LAST_FILESET 1574 PXOPT_LOOKUP_STR(last_fileset, config->args, "-set_last_fileset", false, false); 1575 if (!(state || last_fileset)) { 1576 psError(PS_ERR_UNKNOWN, true, "one or more of -set_state or -set_last_fileset is required"); 1577 # else 1578 if (!state) { 1579 #endif 1580 psFree(where); 1581 return false; 1582 } 1583 psString query = psStringCopy("UPDATE rcDestination SET"); 1584 psString sep = ""; 1585 if (state) { 1586 psStringAppend(&query, " state = '%s'", state); 1587 sep = ","; 1588 } 1589 #ifdef ALLOW_UPDATE_LAST_FILESET 1590 // last_fileset normally gets set by updatercrunMode 1591 // Allowing it to be set here might cause problems 1592 // especially since we are allowing selection by prod_id 1593 if (last_fileset) { 1594 psStringAppend(&query, " %s last_fileset = '%s'", sep, last_fileset); 1595 } 1596 #endif 1597 1598 if (psListLength(where->list)) { 1599 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1600 psStringAppend(&query, " WHERE %s", whereClause); 1601 psFree(whereClause); 1602 } else { 1603 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 1604 psFree(where); 1605 psFree(query); 1606 return false; 1607 } 1608 psFree(where); 1609 1610 if (!p_psDBRunQuery(config->dbh, query)) { 1611 psError(PS_ERR_UNKNOWN, false, "database error"); 1612 psFree(query); 1613 return false; 1614 } 1615 psFree(query); 1616 1617 return true; 1618 } 1619 1620 static bool defineinterestMode(pxConfig *config) 1621 { 1622 PS_ASSERT_PTR_NON_NULL(config, false); 1623 1624 // required 1625 PXOPT_LOOKUP_S64(dest_id, config->args, "-dest_id", true, false); 1626 PXOPT_LOOKUP_S64(target_id, config->args, "-target_id", true, false); 1627 1628 // optional 1629 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1630 1631 // XXX: should we insure that these names do not contatin any whitespace? 1632 1633 rcInterestRow *row = rcInterestRowAlloc( 1634 0, // int_id 1635 dest_id, 1636 target_id, 1637 state ? state : "enabled" 1638 ); 1639 1640 if (!row) { 1641 psError(PS_ERR_UNKNOWN, false, "failed to allocate rcInterest object"); 1642 return false; 1643 } 1644 if (!rcInterestInsertObject(config->dbh, row)) { 1645 psError(PS_ERR_UNKNOWN, false, "database error"); 1646 psFree(row); 1647 return false; 1648 } 1649 1650 // get the assigned target_id 1651 row->int_id = psDBLastInsertID(config->dbh); 1652 1653 if (!rcInterestPrintObject(stdout, row, true)) { 1654 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1655 psFree(row); 1656 return false; 1657 } 1658 1659 psFree(row); 1660 1661 return true; 1662 } 1663 1664 static bool updateinterestMode(pxConfig *config) 1665 { 1666 PS_ASSERT_PTR_NON_NULL(config, false); 1667 1668 psMetadata *where = psMetadataAlloc(); 1669 PXOPT_COPY_S64(config->args, where, "-int_id", "int_id", "=="); 1670 PXOPT_COPY_S64(config->args, where, "-dest_id", "dest_id", "=="); 1671 PXOPT_COPY_S64(config->args, where, "-target_id", "target_id", "=="); 1672 1673 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1674 if (!state) { 1675 psError(PS_ERR_UNKNOWN, true, "-set_state is required"); 1676 psFree(where); 1677 return false; 1678 } 1679 psString query = NULL; 1680 psStringAppend(&query, "UPDATE rcInterest SET state = '%s'", state); 1681 1682 if (psListLength(where->list)) { 1683 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1684 psStringAppend(&query, " WHERE %s", whereClause); 1685 psFree(whereClause); 1686 } else { 1687 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); 1688 psFree(where); 1689 psFree(query); 1690 return false; 1691 } 1692 psFree(where); 1693 1694 if (!p_psDBRunQuery(config->dbh, query)) { 1695 psError(PS_ERR_UNKNOWN, false, "database error"); 1696 psFree(query); 1697 return false; 1698 } 1699 psFree(query); 1700 1701 return true; 1702 } 1703 -
trunk/ippTools/src/disttool.h
r23912 r24001 40 40 DISTTOOL_MODE_REVERTRCRUN, 41 41 DISTTOOL_MODE_PENDINGDEST, 42 DISTTOOL_MODE_DEFINEDESTINATION, 43 DISTTOOL_MODE_UPDATEDESTINATION, 44 DISTTOOL_MODE_DEFINEDSPRODUCT, 45 DISTTOOL_MODE_UPDATEDSPRODUCT, 46 DISTTOOL_MODE_DEFINETARGET, 47 DISTTOOL_MODE_UPDATETARGET, 48 DISTTOOL_MODE_LISTTARGET, 49 DISTTOOL_MODE_DEFINEINTEREST, 50 DISTTOOL_MODE_UPDATEINTEREST, 42 51 } disttoolMode; 43 52 -
trunk/ippTools/src/disttoolConfig.c
r23912 r24001 62 62 63 63 psMetadataAddU64(definebyqueryArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 64 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 64 65 65 66 // -definerun … … 178 179 psMetadataAddStr(updatercrunArgs, PS_LIST_TAIL, "-status_fs_name", 0, "define status fileset name", NULL); 179 180 psMetadataAddStr(updatercrunArgs, PS_LIST_TAIL, "-set_state",0, "new value for state", NULL); 180 psMetadataAddStr(updatercrunArgs, PS_LIST_TAIL, "- last_fileset",0, "new value for last_fileset", NULL);181 psMetadataAddStr(updatercrunArgs, PS_LIST_TAIL, "-set_last_fileset",0, "new value for last_fileset", NULL); 181 182 psMetadataAddS16(updatercrunArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", -1); 182 183 … … 188 189 psMetadataAddS16(revertrcrunArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 189 190 psMetadataAddBool(revertrcrunArgs, PS_LIST_TAIL, "-all", 0, "revert all faulted runs", NULL); 191 192 // -definedsproduct 193 psMetadata *definedsproductArgs = psMetadataAlloc(); 194 psMetadataAddStr(definedsproductArgs, PS_LIST_TAIL, "-name", 0, "define product name", NULL); 195 psMetadataAddStr(definedsproductArgs, PS_LIST_TAIL, "-ds_dbname",0, "define data store database name", NULL); 196 psMetadataAddStr(definedsproductArgs, PS_LIST_TAIL, "-ds_dbhost",0, "define data store database host", NULL); 197 198 // -updatedsproduct 199 // does this mode make sense? 200 psMetadata *updatedsproductArgs = psMetadataAlloc(); 201 psMetadataAddS64(updatedsproductArgs, PS_LIST_TAIL, "-prod_id", 0, "select by prod_id", 0); 202 // can't select by name because it isn't necssarily unique 203 psMetadataAddStr(updatedsproductArgs, PS_LIST_TAIL, "-ds_dbname",0, "define data store database name", NULL); 204 psMetadataAddStr(updatedsproductArgs, PS_LIST_TAIL, "-ds_dbhost",0, "define data store database host", NULL); 205 206 // -definedestination 207 psMetadata *definedestinationArgs = psMetadataAlloc(); 208 psMetadataAddS64(definedestinationArgs, PS_LIST_TAIL, "-prod_id", 0, "define prod_id (required)", 0); 209 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-name", 0, "define destination name (required)", NULL); 210 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-status_uri", 0, "define status_uri", NULL); 211 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-comment", 0, "define comment", NULL); 212 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-last_fileset",0, "define last_fileset", NULL); 213 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 214 215 // -updatedestination 216 psMetadata *updatedestinationArgs = psMetadataAlloc(); 217 psMetadataAddS64(updatedestinationArgs, PS_LIST_TAIL, "-dest_id", 0, "define dest_id", 0); 218 psMetadataAddS64(updatedestinationArgs, PS_LIST_TAIL, "-prod_id", 0, "define prod_id", 0); 219 psMetadataAddStr(updatedestinationArgs, PS_LIST_TAIL, "-name", 0, "define destination name", NULL); 220 psMetadataAddStr(updatedestinationArgs, PS_LIST_TAIL, "-status_uri", 0, "define status_uri", NULL); 221 psMetadataAddStr(updatedestinationArgs, PS_LIST_TAIL, "-comment", 0, "define comment", NULL); 222 // last_fileset gets updated by -updatercrun 223 // psMetadataAddStr(updatedestinationArgs, PS_LIST_TAIL, "-set_last_fileset",0, "define last_fileset", NULL); 224 psMetadataAddStr(updatedestinationArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 225 226 // -definetarget 227 psMetadata *definetargetArgs = psMetadataAlloc(); 228 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-obs_mode", 0, "define obs_mode (required)", NULL); 229 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-stage", 0, "define stage (required)", NULL); 230 psMetadataAddBool(definetargetArgs, PS_LIST_TAIL,"-clean", 0, "define clean", false); 231 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 232 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-comment", 0, "define comment", NULL); 233 234 // -updatetarget 235 psMetadata *updatetargetArgs = psMetadataAlloc(); 236 psMetadataAddS64(updatetargetArgs, PS_LIST_TAIL, "-target_id", 0, "define target_id", 0); 237 psMetadataAddStr(updatetargetArgs, PS_LIST_TAIL, "-obs_mode", 0, "define obs_mode", NULL); 238 psMetadataAddStr(updatetargetArgs, PS_LIST_TAIL, "-stage", 0, "define stage", NULL); 239 psMetadataAddStr(updatetargetArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 240 241 // -listtarget 242 psMetadata *listtargetArgs = psMetadataAlloc(); 243 psMetadataAddS64(listtargetArgs, PS_LIST_TAIL, "-target_id", 0, "list target with target_id", 0); 244 psMetadataAddStr(listtargetArgs, PS_LIST_TAIL, "-obs_mode", 0, "list targets for obs_mode", NULL); 245 psMetadataAddStr(listtargetArgs, PS_LIST_TAIL, "-stage", 0, "list targets for stage", NULL); 246 psMetadataAddBool(listtargetArgs, PS_LIST_TAIL,"-clean", 0, "list clean targets", false); 247 psMetadataAddBool(listtargetArgs, PS_LIST_TAIL,"-full", 0, "list full targets", false); 248 psMetadataAddStr(listtargetArgs, PS_LIST_TAIL, "-state", 0, "list tarets in state", NULL); 249 psMetadataAddU64(listtargetArgs, PS_LIST_TAIL, "-limit", 0, "limit number of targets listed to N", 0); 250 psMetadataAddBool(listtargetArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 251 252 // -defineinterest 253 psMetadata *defineinterestArgs = psMetadataAlloc(); 254 psMetadataAddS64(defineinterestArgs, PS_LIST_TAIL, "-dest_id", 0, "define dest_id (required)", 0); 255 psMetadataAddS64(defineinterestArgs, PS_LIST_TAIL, "-target_id", 0, "define target_id (required)", 0); 256 psMetadataAddStr(defineinterestArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 257 258 // -updateinterest 259 psMetadata *updateinterestArgs = psMetadataAlloc(); 260 psMetadataAddS64(updateinterestArgs, PS_LIST_TAIL, "-int_id", 0, "define int_id", 0); 261 psMetadataAddS64(updateinterestArgs, PS_LIST_TAIL, "-dest_id", 0, "define dest_id", 0); 262 psMetadataAddS64(updateinterestArgs, PS_LIST_TAIL, "-target_id", 0, "define target_id", 0); 263 psMetadataAddStr(updateinterestArgs, PS_LIST_TAIL, "-set_state", 0, "define state (required)", NULL); 190 264 191 265 psMetadata *argSets = psMetadataAlloc(); … … 208 282 PXOPT_ADD_MODE("-pendingdest", "", DISTTOOL_MODE_PENDINGDEST, pendingdestArgs); 209 283 284 PXOPT_ADD_MODE("-definedsproduct", "", DISTTOOL_MODE_DEFINEDSPRODUCT, definedsproductArgs); 285 PXOPT_ADD_MODE("-updatedsproduct", "", DISTTOOL_MODE_UPDATEDSPRODUCT, updatedsproductArgs); 286 // PXOPT_ADD_MODE("-listdsproduct", "", DISTTOOL_MODE_LISTDSPRODUCT, updatedsproductArgs); 287 288 PXOPT_ADD_MODE("-definedestination", "", DISTTOOL_MODE_DEFINEDESTINATION, definedestinationArgs); 289 PXOPT_ADD_MODE("-updatedestination", "", DISTTOOL_MODE_UPDATEDESTINATION, updatedestinationArgs); 290 // PXOPT_ADD_MODE("-listdestination", "", DISTTOOL_MODE_LISTDESTINATION, listdestinationArgs); 291 292 PXOPT_ADD_MODE("-definetarget", "", DISTTOOL_MODE_DEFINETARGET, definetargetArgs); 293 PXOPT_ADD_MODE("-updatetarget", "", DISTTOOL_MODE_UPDATETARGET, updatetargetArgs); 294 PXOPT_ADD_MODE("-listtarget", "", DISTTOOL_MODE_LISTTARGET, listtargetArgs); 295 296 PXOPT_ADD_MODE("-defineinterest", "", DISTTOOL_MODE_DEFINEINTEREST, defineinterestArgs); 297 PXOPT_ADD_MODE("-updateinterest", "", DISTTOOL_MODE_UPDATEINTEREST, updateinterestArgs); 298 // PXOPT_ADD_MODE("-listinterest", "", DISTTOOL_MODE_LISTINTEREST, listinterestArgs); 299 210 300 if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) { 211 301 psError(PS_ERR_UNKNOWN, true, "option parsing failed");
Note:
See TracChangeset
for help on using the changeset viewer.
