Startd Class

class htcondor2.Startd(location=None)

The startd client. Used to access the startd history and to control draining.

Parameters

location (ClassAd) – A ClassAd with a MyAddress attribute, such as might be returned by htcondor2.Collector.locate(). None means the the local daemon.

cancelDrainJobs(request_id=None)

Cancel a draining request.

Parameters

request_id (str) – An opaque drain request ID returned by a previous call to drainJobs(). If None, cancel all draining requests for this startd.

Return type

None

drainJobs(drain_type=DrainType.Graceful, on_completion=CompletionType.Nothing, check_expr=None, start_expr=None, reason=None)

Request that this startd begin draining.

Parameters
  • drain_type (DrainType) – How much time, if any, jobs are given to finish.

  • on_completion (CompletionType) – What to do when the startd finishes draining.

  • check_expr (Optional[str, None]) – An expression which must evaluate to True in the context of each slot ad for draining to begin. If None, treated as True.

  • start_expr (Optional[str, None]) – The value of the START expression while the startd is draining. If None, use the configured default (DEFAULT_DRAINING_START_EXPR).

  • reason (Optional[str, None]) – A string describing the reason for draining.

Return type

str

Returns

An opaque request ID only useful for cancelling this drain via cancelDrainJobs().

history(constraint=None, projection=[], match=-1, since=None)

Query this startd’s job history.

Parameters
  • constraint (Union[str, ExprTree, None]) – A query constraint. Only jobs matching this constraint will be returned. None will match all jobs.

  • projection (List[str]) – A list of job attributes. These attributes will be returned for each job in the list. (Others may be as well.) The default (an empty list) returns all attributes.

  • match (int) – The maximum number of ads to return. The default (-1) is to return all ads.

  • since (Union[int, str, ExprTree]) –

    A cluster ID, job ID, or expression. If a cluster ID (passed as an integer) or job ID (passed as a string in the format {clusterID}.{procID}), only jobs recorded in the history file after (and not including) the matching ID will be returned. If an expression (including strings that aren’t job IDs), jobs will be returned, most-recently-recorded first, until the expression becomes true; the job making the expression become true will not be returned. Thus, 1038 and "clusterID == 1038" return the same set of jobs.

    If None, return all (matching) jobs.

Return type

List[ClassAd]

Returns

A list of job ClassAds.