IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37833 for trunk/ippTools


Ignore:
Timestamp:
Jan 12, 2015, 12:53:36 PM (12 years ago)
Author:
eugene
Message:

merging changes from ipp-pv3-20140717 (via branches/eam_branches/ipp-pv3-20140717-merge)

Location:
trunk/ippTools
Files:
12 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/Makefile.am

    r37551 r37833  
    524524        remotetool_definebyquery_warp.sql \
    525525        remotetool_definebyquery_stack.sql \
     526        remotetool_definebyquery_staticsky.sql \
    526527        remotetool_dropcomponent.sql \
     528        remotetool_listcomponent.sql \
     529        remotetool_doneprep.sql \
    527530        remotetool_updatepoll.sql
  • trunk/ippTools/share/laptool_exposures.sql

  • trunk/ippTools/share/pxadmin_create_tables.sql

    r37769 r37833  
    23852385    remote_id BIGINT,
    23862386    stage_id  BIGINT,
     2387    jobs      INT
     2388    state     VARCHAR(64) NOT NULL,
     2389    path_base VARCHAR(255),
    23872390    KEY (stage_id),
    23882391    FOREIGN KEY (remote_id) REFERENCES remoteRun(remote_id)
  • trunk/ippTools/share/remotetool_definebyquery_cam.sql

    r36968 r37833  
    1111LEFT JOIN
    1212
    13 (SELECT remote_id,remoteRun.stage,remoteRun.label,remoteComponent.stage_id,remoteRun.state 
    14    FROM remoteRun 
     13(SELECT remote_id,remoteRun.stage,remoteRun.label,remoteComponent.stage_id,remoteRun.state
     14   FROM remoteRun
    1515   JOIN remoteComponent USING (remote_id)
    1616WHERE
    17 remoteRun.stage = 'camera'
     17remoteRun.stage = 'camera' and remoteComponent.state != 'retry'
    1818-- where hook %s
    1919) AS R
  • trunk/ippTools/share/remotetool_definebyquery_chip.sql

    r36968 r37833  
    1111LEFT JOIN
    1212
    13 (SELECT remote_id,remoteRun.stage,remoteRun.label,remoteComponent.stage_id,remoteRun.state 
    14    FROM remoteRun 
     13(SELECT remote_id,remoteRun.stage,remoteRun.label,remoteComponent.stage_id,remoteRun.state
     14   FROM remoteRun
    1515   JOIN remoteComponent USING (remote_id)
    1616WHERE
    17 remoteRun.stage = 'chip'
     17remoteRun.stage = 'chip' and remoteComponent.state != 'retry'
    1818-- where hook %s
    1919) AS R
     
    2424
    2525
    26        
     26
  • trunk/ippTools/share/remotetool_definebyquery_stack.sql

    r36968 r37833  
    1515   JOIN remoteComponent USING (remote_id)
    1616WHERE
    17 remoteRun.stage = 'stack'
     17remoteRun.stage = 'stack' and remoteComponent.state != 'retry'
    1818-- where hook %s
    1919) AS R
  • trunk/ippTools/share/remotetool_definebyquery_warp.sql

    r36968 r37833  
    1717   JOIN remoteComponent USING (remote_id)
    1818WHERE
    19 remoteRun.stage = 'warp'
     19remoteRun.stage = 'warp' and remoteComponent.state != 'retry'
    2020-- where hook %s
    2121) AS R
  • trunk/ippTools/src/remotetool.c

    r37054 r37833  
    2121static bool listrunMode(pxConfig *config);
    2222static bool listcomponentMode(pxConfig *config);
     23
     24// list remoteRuns with all remoteComponents in state 'prep_done' or 'prep_fail'
     25static bool doneprepMode(pxConfig *config);
    2326
    2427// Update
     
    2629static bool updaterunMode(pxConfig *config);
    2730static bool updatepollMode(pxConfig *config);
     31static bool updatecomponentMode(pxConfig *config);
    2832static bool revertrunMode(pxConfig *config);
    2933static bool revertauthMode(pxConfig *config);
     34static bool revertcomponentMode(pxConfig *config);
    3035
    3136# define MODECASE(caseName, func) \
     
    4752
    4853  switch (config->mode) {
    49     MODECASE(REMOTETOOL_MODE_DEFINEBYQUERY, definebyqueryMode);
    50     MODECASE(REMOTETOOL_MODE_LISTRUN,       listrunMode);
    51     MODECASE(REMOTETOOL_MODE_LISTCOMPONENT, listcomponentMode);
    52     MODECASE(REMOTETOOL_MODE_DROPCOMPONENT, dropcomponentMode);
    53     MODECASE(REMOTETOOL_MODE_UPDATERUN,     updaterunMode);
    54     MODECASE(REMOTETOOL_MODE_UPDATEPOLL,    updatepollMode);
    55     MODECASE(REMOTETOOL_MODE_REVERTRUN,     revertrunMode);
    56     MODECASE(REMOTETOOL_MODE_REVERTAUTH,    revertauthMode);
     54    MODECASE(REMOTETOOL_MODE_DEFINEBYQUERY,   definebyqueryMode);
     55    MODECASE(REMOTETOOL_MODE_LISTRUN,         listrunMode);
     56    MODECASE(REMOTETOOL_MODE_DONEPREP,         doneprepMode);
     57    MODECASE(REMOTETOOL_MODE_LISTCOMPONENT,   listcomponentMode);
     58    MODECASE(REMOTETOOL_MODE_DROPCOMPONENT,   dropcomponentMode);
     59    MODECASE(REMOTETOOL_MODE_UPDATERUN,       updaterunMode);
     60    MODECASE(REMOTETOOL_MODE_UPDATEPOLL,      updatepollMode);
     61    MODECASE(REMOTETOOL_MODE_UPDATECOMPONENT, updatecomponentMode);
     62    MODECASE(REMOTETOOL_MODE_REVERTRUN,       revertrunMode);
     63    MODECASE(REMOTETOOL_MODE_REVERTAUTH,      revertauthMode);
     64    MODECASE(REMOTETOOL_MODE_REVERTCOMPONENT, revertcomponentMode);
    5765
    5866  default:
     
    92100  PXOPT_LOOKUP_BOOL(simple,    config->args, "-simple",       false);
    93101  PXOPT_LOOKUP_BOOL(pretend,   config->args, "-pretend",      false);
    94  
     102
    95103  set_label = set_label ? set_label : label;
    96104
     
    105113      return(false);
    106114    }
    107    
     115
    108116    if (label) {
    109117      psStringAppend(&whereOption, "\n AND (label = '%s')", label);
     
    116124      return(false);
    117125    }
    118    
     126
    119127    if (label) {
    120128      psStringAppend(&whereOption, "\n AND (label = '%s')", label);
    121129    }
    122   }   
     130  }
    123131  else if (!strcmp(stage,"warp")) {
    124132    query = pxDataGet("remotetool_definebyquery_warp.sql");
     
    127135      return(false);
    128136    }
    129    
     137
    130138    if (label) {
    131139      // Because warp has to check to see if something other than the state is set correctly, I have to use this wonky way to pass the label in.
     
    133141      psStringAppend(&whereOption, "\n AND (label = '%s')", label);
    134142    }
    135   }   
     143  }
    136144  else if (!strcmp(stage,"stack")) {
    137145    query = pxDataGet("remotetool_definebyquery_stack.sql");
     
    140148      return(false);
    141149    }
    142    
     150
    143151    if (label) {
    144152      psStringAppend(&whereOption, "\n AND (label = '%s')", label);
    145153    }
    146   }   
     154  }
     155  else if (!strcmp(stage,"staticsky")) {
     156    query = pxDataGet("remotetool_definebyquery_staticsky.sql");
     157    if (!query) {
     158      psError(PXTOOLS_ERR_SYS,false, "failed to retreive SQL statement");
     159      return(false);
     160    }
     161
     162    if (label) {
     163      psStringAppend(&whereOption, "\n AND (label = '%s')", label);
     164    }
     165  }
    147166  else {
    148167    psError(PS_ERR_UNKNOWN, true, "unknown value for stage: %s", stage);
     
    191210  // Insert the top level run object
    192211  remoteRunRow *run = remoteRunRowAlloc(0, // remote_id
    193                                         "new", // state
    194                                         stage,
    195                                         set_label,
    196                                         path_base,
    197                                         -1, // job_id
    198                                         NULL, // last_poll
    199                                         0   // fault
    200                                           );
     212                                        "new", // state
     213                                        stage,
     214                                        set_label,
     215                                        path_base,
     216                                        -1, // job_id
     217                                        NULL, // last_poll
     218                                        0   // fault
     219                                          );
    201220  if (!run) {
    202     psError(PS_ERR_UNKNOWN, false, "failed to alloc lapRun object");
     221    psError(PS_ERR_UNKNOWN, false, "failed to alloc remoteRun object");
    203222    return(true);
    204223  }
    205  
     224
    206225  if (!remoteRunInsertObject(config->dbh, run)) {
    207226    if (!psDBRollback(config->dbh)) {
     
    213232  }
    214233  psS64 remote_id = psDBLastInsertID(config->dbh);
    215  
     234
    216235  psArray *list = psArrayAllocEmpty(limit);
    217236  for (long i=0; i < psArrayLength(output); i++) {
     
    219238    psS64 stage_id = psMetadataLookupS64(NULL, md, "stage_id");
    220239
    221     remoteComponentRow *comp = remoteComponentRowAlloc(remote_id,
    222                                                        stage_id);
     240    remoteComponentRow *comp = remoteComponentRowAlloc(remote_id, stage_id, 0, "new", NULL);
    223241    if (!comp) {
    224       psError(PS_ERR_UNKNOWN, false, "failed to alloc lapRun object");
     242      psError(PS_ERR_UNKNOWN, false, "failed to alloc remoteComponent object");
    225243      return(true);
    226244    }
    227    
     245
    228246    if (!remoteComponentInsertObject(config->dbh, comp)) {
    229247      if (!psDBRollback(config->dbh)) {
    230         psError(PS_ERR_UNKNOWN, false, "database error");
     248        psError(PS_ERR_UNKNOWN, false, "database error");
    231249      }
    232250      psError(PS_ERR_UNKNOWN, false, "database error");
     
    237255    psArrayAdd(list, list->n, comp);
    238256    psFree(comp);
    239    
     257
    240258  }
    241259  psFree(run);
     
    245263    return false;
    246264  }
    247  
     265
    248266  if (!remoteComponentPrintObjects(stdout, list, !simple)) {
    249267    if (!psDBRollback(config->dbh)) {
     
    254272    return false;
    255273  }
    256  
     274
    257275  psFree(list);
    258276  psFree(output);
    259                                        
     277
    260278  return true;
    261279}
     
    265283{
    266284  psMetadata *where = psMetadataAlloc();
    267  
     285
    268286  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    269287  PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
     
    274292  PXOPT_COPY_TIME(config->args, where, "-poll_begin", "last_poll", ">=");
    275293  PXOPT_COPY_TIME(config->args, where, "-poll_end", "last_poll", "<=");
    276  
     294
    277295  PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
    278296
    279297  PXOPT_LOOKUP_S16(limit,   config->args, "-limit",  false, false);
    280298  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    281  
    282299
    283300  psArray *remRuns = NULL;
    284301  remRuns = psDBSelectRows(config->dbh, "remoteRun", where, limit);
    285  
     302
    286303  if (!ippdbPrintMetadatas(stdout, remRuns, "remoteRun", !simple)) {
    287304    psError(PS_ERR_UNKNOWN, false, "failed to print array");
     
    299316
    300317  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     318  PXOPT_COPY_S64(config->args, where, "-stage_id",  "stage_id",  "==");
     319  PXOPT_COPY_S64(config->args, where, "-jobs",      "jobs",      "==");
     320
     321  PXOPT_COPY_STR(config->args, where, "-state", "remoteComponent.state", "==");
     322  PXOPT_COPY_STR(config->args, where, "-label", "remoteRun.label", "==");
     323
    301324  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    302  
    303   psArray *remComps = NULL;
    304   remComps = psDBSelectRows(config->dbh, "remoteComponent", where, 0);
    305  
    306   if (!ippdbPrintMetadatas(stdout, remComps, "remoteComponent", !simple)) {
     325  PXOPT_LOOKUP_S16(limit,   config->args, "-limit",  false, false);
     326
     327  psString query = pxDataGet("remotetool_listcomponent.sql");
     328  if (!query) {
     329      psError(PXTOOLS_ERR_SYS,false, "failed to retreive SQL statement");
     330      return(false);
     331  }
     332
     333  if (psListLength(where->list)) {
     334      psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     335      psStringAppend(&query, " WHERE %s", whereClause);
     336      psFree(whereClause);
     337  }
     338  psFree(where);
     339
     340  if (limit) {
     341    psString limitString = psDBGenerateLimitSQL(limit);
     342    psStringAppend(&query, " %s", limitString);
     343    psFree(limitString);
     344  }
     345
     346  if (!p_psDBRunQuery(config->dbh, query)) {
     347      psError(PS_ERR_UNKNOWN, false, "database error");
     348      psFree(query);
     349      return false;
     350  }
     351  psFree(query);
     352
     353  psArray *output = p_psDBFetchResult(config->dbh);
     354  if (!output) {
     355      psError(PS_ERR_UNKNOWN, false, "database error");
     356      return false;
     357  }
     358  if (!psArrayLength(output)) {
     359    psTrace("remotetool", PS_LOG_INFO, "no rows found");
     360    psFree(output);
     361    return true;
     362  }
     363
     364  if (!ippdbPrintMetadatas(stdout, output, "remoteComponent", !simple)) {
    307365    psError(PS_ERR_UNKNOWN, false, "failed to print array");
    308     psFree(remComps);
    309     return false;
    310   }
    311   psFree(remComps);
     366    psFree(output);
     367    return false;
     368  }
     369  psFree(output);
    312370
    313371  return true;
    314372}
    315373
     374// List
     375static bool doneprepMode(pxConfig *config)
     376{
     377  psMetadata *where = psMetadataAlloc();
     378
     379  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     380  PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "==");
     381
     382  PXOPT_COPY_STR(config->args, where, "-stage",  "stage",  "==");
     383  PXOPT_COPY_STR(config->args, where, "-state", "remoteRun.state", "==");
     384  PXOPT_COPY_STR(config->args, where, "-label",  "label",  "==");
     385
     386  PXOPT_LOOKUP_S16(limit,   config->args, "-limit",  false, false);
     387  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     388
     389  psString query = pxDataGet("remotetool_doneprep.sql");
     390  if (!query) {
     391      psError(PXTOOLS_ERR_SYS,false, "failed to retreive SQL statement");
     392      return(false);
     393  }
     394
     395  psString whereDone = NULL;
     396  psString whereJobs = NULL;
     397  if (psListLength(where->list)) {
     398      psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     399      psStringAppend(&whereDone, " \n AND %s", whereClause);
     400      psStringAppend(&whereJobs, " \n WHERE %s", whereClause);
     401      psFree(whereClause);
     402  }
     403
     404  if (limit) {
     405    psString limitString = psDBGenerateLimitSQL(limit);
     406    psStringAppend(&query, " %s", limitString);
     407    psFree(limitString);
     408  }
     409
     410  // fprintf (stderr, "query: %s\n", query);
     411  // fprintf (stderr, "whereDone: %s\n", whereDone);
     412  // fprintf (stderr, "whereJobs: %s\n", whereJobs);
     413
     414  if (!p_psDBRunQueryF(config->dbh, query, whereDone, whereJobs)) {
     415      psError(PS_ERR_UNKNOWN, false, "database error");
     416      psFree(whereDone);
     417      psFree(whereJobs);
     418      psFree(query);
     419      return false;
     420  }
     421  psFree(whereDone);
     422  psFree(whereJobs);
     423  psFree(query);
     424
     425  psArray *output = p_psDBFetchResult(config->dbh);
     426  if (!output) {
     427      psError(PS_ERR_UNKNOWN, false, "database error");
     428      return false;
     429  }
     430  if (!psArrayLength(output)) {
     431    psTrace("remotetool", PS_LOG_INFO, "no rows found");
     432    psFree(output);
     433    return true;
     434  }
     435
     436  if (!ippdbPrintMetadatas(stdout, output, "remoteRun", !simple)) {
     437    psError(PS_ERR_UNKNOWN, false, "failed to print array");
     438    psFree(output);
     439    return false;
     440  }
     441  psFree(output);
     442
     443  return true;
     444}
     445
    316446// Update
    317447
    318448static bool dropcomponentMode(pxConfig *config)
    319449{
     450  fprintf (stderr, "do we really want to use -dropcomponent?\n");
     451  exit (1);
     452
    320453  // Assert that we have a unique component to operate on.
    321454  PXOPT_LOOKUP_S64(remote_id,config->args, "-remote_id",true, false);
     
    329462    return false;
    330463  }
    331  
     464
    332465  if (!psDBTransaction(config->dbh)) {
    333466    psError(PS_ERR_UNKNOWN, false, "database error");
     
    341474  }
    342475  psFree(query);
    343  
    344  
    345476
    346477  // point of no return
     
    349480    return false;
    350481  }
    351  
     482
    352483  return true;
    353484}
     
    364495  // Wheres
    365496  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    366  
     497
    367498  // Values to set
    368499  PXOPT_COPY_STR(config->args, values, "-set_label", "label", "==");
     
    374505  psFree(values);
    375506
    376   if (rows < 1) {
    377     psError(PS_ERR_UNKNOWN,false, "no rows affected");
    378     return(false);
    379   }
    380  
     507  if (rows < 1) fprintf (stderr, "no rows changed (run may already be in desired state)\n");
    381508  return(true);
    382509}
     
    393520  psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    394521  psFree(where);
    395  
     522
    396523  psString query = NULL;
    397524  query = pxDataGet("remotetool_updatepoll.sql");
     
    412539  return(true);
    413540}
    414  
    415 
    416  
     541
     542static bool updatecomponentMode(pxConfig *config)
     543{
     544  PS_ASSERT_PTR_NON_NULL(config, false);
     545  PXOPT_LOOKUP_S64(remote_id,  config->args, "-remote_id",    true, false);
     546  psAssert(remote_id,"This should have failed before this point.");
     547
     548  psMetadata *where = psMetadataAlloc();
     549  psMetadata *values = psMetadataAlloc();
     550
     551  // Wheres
     552  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     553  PXOPT_COPY_S64(config->args, where, "-stage_id",  "stage_id",  "==");
     554  PXOPT_COPY_STR(config->args, where, "-state",     "state",     "==");
     555
     556  // Values to set
     557  PXOPT_COPY_S32(config->args, values, "-set_jobs",      "jobs",      "==");
     558  PXOPT_COPY_STR(config->args, values, "-set_path_base", "path_base", "==");
     559  PXOPT_COPY_STR(config->args, values, "-set_state", "state", "==");
     560
     561  long rows = psDBUpdateRows(config->dbh, "remoteComponent", where, values);
     562  psFree(values);
     563
     564  if (rows < 1) fprintf (stderr, "no rows changed (component may already be in desired state)\n");
     565  return true;
     566}
    417567
    418568static bool revertrunMode(pxConfig *config)
     
    426576  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    427577  PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    428  
     578  PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
    429579  // Value to set
    430   PXOPT_COPY_S16(config->args, values, "-fault", "fault", "==");
    431   long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values);
    432   psFree(values);
    433   psFree(where);
    434   if (rows < 1) {
    435     psError(PS_ERR_UNKNOWN,false, "no rows affected");
    436     return(false);
    437   }
    438 
    439   return(true);
    440 }
    441 
    442 static bool revertauthMode(pxConfig *config)
    443 {
    444   PS_ASSERT_PTR_NON_NULL(config, false);
    445 
    446   psMetadata *where = psMetadataAlloc();
    447   psMetadata *values = psMetadataAlloc();
    448 
    449   // required
    450   PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    451   PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    452 
    453   psMetadataAddStr(where, PS_LIST_TAIL, "state", 0, "==", "auth");
    454 
    455   // Value to set
    456   psMetadataAddStr(values, PS_LIST_TAIL, "state", 0, "==", "run");
     580  psMetadataAddS16(values,PS_LIST_TAIL,"fault",0, "==", 0);
    457581 
    458582  long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values);
     
    466590  return(true);
    467591}
    468    
     592
     593static bool revertcomponentMode(pxConfig *config)
     594{
     595  PS_ASSERT_PTR_NON_NULL(config,false);
     596  psMetadata *where = psMetadataAlloc();
     597  psMetadata *values = psMetadataAlloc();
     598
     599  // required
     600  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     601  PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "==");
     602  psMetadataAddStr(where,PS_LIST_TAIL,"state",0, "LIKE", "%fail");
     603 
     604  // value to set
     605  psMetadataAddStr(values, PS_LIST_TAIL, "state",0, "==", "retry");
     606 
     607
     608  long rows = psDBUpdateRows(config->dbh, "remoteComponent", where, values);
     609  psFree(values);
     610  psFree(where);
     611  if (rows < 1) {
     612    psError(PS_ERR_UNKNOWN,false, "no rows affected");
     613    return(false);
     614  }
     615
     616  return(true);
     617}
     618 
     619 
     620
     621static bool revertauthMode(pxConfig *config)
     622{
     623  PS_ASSERT_PTR_NON_NULL(config, false);
     624
     625  psMetadata *where = psMetadataAlloc();
     626  psMetadata *values = psMetadataAlloc();
     627
     628  // required
     629  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     630  PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     631
     632  psMetadataAddStr(where, PS_LIST_TAIL, "state", 0, "==", "auth");
     633
     634  // Value to set
     635  psMetadataAddStr(values, PS_LIST_TAIL, "state", 0, "==", "run");
     636
     637  long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values);
     638  psFree(values);
     639  psFree(where);
     640  if (rows < 1) {
     641    psError(PS_ERR_UNKNOWN,false, "no rows affected");
     642    return(false);
     643  }
     644
     645  return(true);
     646}
     647
  • trunk/ippTools/src/remotetool.h

    r36981 r37833  
    1212  REMOTETOOL_MODE_DEFINEBYQUERY,
    1313  REMOTETOOL_MODE_LISTRUN,
     14  REMOTETOOL_MODE_DONEPREP,
    1415  REMOTETOOL_MODE_LISTCOMPONENT,
    1516  REMOTETOOL_MODE_DROPCOMPONENT,
    1617  REMOTETOOL_MODE_UPDATERUN,
    1718  REMOTETOOL_MODE_UPDATEPOLL,
    18   REMOTETOOL_MODE_REVERTRUN,   
    19   REMOTETOOL_MODE_REVERTAUTH,   
     19  REMOTETOOL_MODE_UPDATECOMPONENT,
     20  REMOTETOOL_MODE_REVERTRUN,
     21  REMOTETOOL_MODE_REVERTAUTH,
     22  REMOTETOOL_MODE_REVERTCOMPONENT,
    2023} remotetoolMode;
    2124
  • trunk/ippTools/src/remotetoolConfig.c

    r36981 r37833  
    4040  ADD_OPT(Bool, definebyqueryArgs, "-pretend",       "pretend to do this.", 0);
    4141  ADD_OPT(Bool, definebyqueryArgs,"-simple",         "simple print format",0);
    42  
     42
    4343  // -listrun
    4444  psMetadata *listrunArgs = psMetadataAlloc();
     
    5959  ADD_OPT(S16, listrunArgs,  "-limit",             "limit to number of runs to display", 0);
    6060
     61  // -doneprep
     62  psMetadata *doneprepArgs = psMetadataAlloc();
     63  ADD_OPT(S64, doneprepArgs, "-remote_id",          "run to list", 0);
     64  ADD_OPT(S64, doneprepArgs, "-job_id",             "job_id", 0);
     65  ADD_OPT(Str, doneprepArgs, "-stage",              "stage to return", NULL);
     66  ADD_OPT(Str, doneprepArgs, "-state",              "state to return", NULL);
     67  ADD_OPT(Str, doneprepArgs, "-label",              "remRun label to use", NULL);
     68
     69  ADD_OPT(Bool, doneprepArgs, "-simple",            "simple print format", false);
     70  ADD_OPT(S16, doneprepArgs,  "-limit",             "limit to number of runs to display", 0);
     71
     72  // -revertcomponent
     73  psMetadata   *revertcomponentArgs = psMetadataAlloc();
     74  ADD_OPT(S64,  revertcomponentArgs, "-remote_id",       "run to revert components from", 0);
     75  ADD_OPT(S64,  revertcomponentArgs, "-stage_id",        "component stage_id to revert", 0);
     76 
     77 
    6178  // -listcomponents
    62   psMetadata *listcomponentArgs = psMetadataAlloc();
    63   ADD_OPT(S64, listcomponentArgs, "-remote_id",             "run to list", 0);
    64   ADD_OPT(S16, listcomponentArgs, "-limit",              "limit to number of runs to display", 0);
     79  psMetadata   *listcomponentArgs = psMetadataAlloc();
     80  ADD_OPT(S64,  listcomponentArgs, "-remote_id",         "run to list", 0);
     81  ADD_OPT(S64,  listcomponentArgs, "-stage_id",          "run to list", 0);
     82  ADD_OPT(S32,  listcomponentArgs, "-jobs",              "run to list", 0);
     83  ADD_OPT(Str,  listcomponentArgs, "-state",             "run to list", NULL);
     84  ADD_OPT(S16,  listcomponentArgs, "-limit",             "limit to number of runs to display", 0);
    6585  ADD_OPT(Bool, listcomponentArgs, "-simple",            "simple print format", false);
     86  ADD_OPT(Str,  listcomponentArgs, "-label",             "label to use", NULL);
    6687
    6788  // -dropcomponent
     
    6990  ADD_OPT(S64, dropcomponentArgs, "-remote_id",         "run to update", 0);
    7091  ADD_OPT(S64, dropcomponentArgs, "-stage_id",          "stage_id to remote", 0);
    71  
     92
    7293  // -updaterun
    7394  psMetadata *updaterunArgs = psMetadataAlloc();
     
    83104  psMetadata *updatepollArgs = psMetadataAlloc();
    84105  ADD_OPT(S64, updatepollArgs, "-remote_id",            "run to update", 0);
    85  
     106
     107  // -updatecomponent
     108  psMetadata  *updatecomponentArgs = psMetadataAlloc();
     109  ADD_OPT(S64, updatecomponentArgs, "-remote_id",     "remote_id to update", 0);
     110  ADD_OPT(S64, updatecomponentArgs, "-stage_id",      "stage_id to update", 0);
     111  ADD_OPT(Str, updatecomponentArgs, "-state",         "limit to this remoteComponent state", NULL);
     112  ADD_OPT(Str, updatecomponentArgs, "-set_state",     "remoteComponent state to assign", NULL);
     113  ADD_OPT(Str, updatecomponentArgs, "-set_path_base", "remoteRun path_base to assign", NULL);
     114  ADD_OPT(S32, updatecomponentArgs, "-set_jobs",      "number of jobs for this stage_id", 0);
     115
    86116  // -revertrun
    87117  psMetadata *revertrunArgs = psMetadataAlloc();
     
    89119  ADD_OPT(Str, revertrunArgs, "-label",      "remRun label to use", NULL);
    90120  ADD_OPT(S16, revertrunArgs, "-fault",              "fault code", 0);
    91  
     121
    92122  // -revertauth
    93123  psMetadata *revertauthArgs = psMetadataAlloc();
     
    98128  psMetadata *modes   = psMetadataAlloc();
    99129
    100   PXOPT_ADD_MODE("-definebyquery",     "", REMOTETOOL_MODE_DEFINEBYQUERY,  definebyqueryArgs);
    101   PXOPT_ADD_MODE("-listrun",           "", REMOTETOOL_MODE_LISTRUN,        listrunArgs);
    102   PXOPT_ADD_MODE("-listcomponent",     "", REMOTETOOL_MODE_LISTCOMPONENT,  listcomponentArgs);
    103   PXOPT_ADD_MODE("-dropcomponent",     "", REMOTETOOL_MODE_DROPCOMPONENT,  dropcomponentArgs);
    104   PXOPT_ADD_MODE("-updaterun",         "", REMOTETOOL_MODE_UPDATERUN,      updaterunArgs);
    105   PXOPT_ADD_MODE("-updatepoll",        "", REMOTETOOL_MODE_UPDATEPOLL,     updatepollArgs);
    106   PXOPT_ADD_MODE("-revertrun",         "", REMOTETOOL_MODE_REVERTRUN,      revertrunArgs);
    107   PXOPT_ADD_MODE("-revertauth",        "", REMOTETOOL_MODE_REVERTAUTH,     revertauthArgs);
     130  PXOPT_ADD_MODE("-definebyquery",     "", REMOTETOOL_MODE_DEFINEBYQUERY,   definebyqueryArgs);
     131  PXOPT_ADD_MODE("-listrun",           "", REMOTETOOL_MODE_LISTRUN,         listrunArgs);
     132  PXOPT_ADD_MODE("-doneprep",          "", REMOTETOOL_MODE_DONEPREP,        doneprepArgs);
     133  PXOPT_ADD_MODE("-listcomponent",     "", REMOTETOOL_MODE_LISTCOMPONENT,   listcomponentArgs);
     134  PXOPT_ADD_MODE("-revertcomponent",   "", REMOTETOOL_MODE_REVERTCOMPONENT, revertcomponentArgs);
     135  PXOPT_ADD_MODE("-dropcomponent",     "", REMOTETOOL_MODE_DROPCOMPONENT,   dropcomponentArgs);
     136  PXOPT_ADD_MODE("-updaterun",         "", REMOTETOOL_MODE_UPDATERUN,       updaterunArgs);
     137  PXOPT_ADD_MODE("-updatepoll",        "", REMOTETOOL_MODE_UPDATEPOLL,      updatepollArgs);
     138  PXOPT_ADD_MODE("-updatecomponent",   "", REMOTETOOL_MODE_UPDATECOMPONENT, updatecomponentArgs);
     139  PXOPT_ADD_MODE("-revertrun",         "", REMOTETOOL_MODE_REVERTRUN,       revertrunArgs);
     140  PXOPT_ADD_MODE("-revertauth",        "", REMOTETOOL_MODE_REVERTAUTH,      revertauthArgs);
    108141
    109142
  • trunk/ippTools/src/stacktool.c

  • trunk/ippTools/src/stacktoolConfig.c

Note: See TracChangeset for help on using the changeset viewer.