Collector Class
- class htcondor2.Collector(pool=None, security=None)
The collector client. Locate one or more daemons, query for arbitrary ads, ask arbitrary daemons directly for their ads, or push new ads into the collector.
- Parameters
pool (Optional[Union[str, ClassAd, List[str], Tuple[str, ...]]]) – A
host::portstring specifying the remote collector, a list (or tuple) of such strings, or a ClassAd with aMyAddressattribute (such as might be returned bylocate()).Nonemeans the value of the configuration parameterCOLLECTOR_HOST.security (SecurityContext) – SecurityContext to use for authentication.
- advertise(ad_list, command='UPDATE_AD_GENERIC', use_tcp=True) None
Add ClassAd(s) to the collector.
- Parameters
command (str) – The “advertise command” specifies which kind of ad is being added to the collector. Different types of ads require different authorization. The list of valid “advertising commands” is kept in the condor_advertise manpage.
- directQuery(daemon_type, name=None, projection=None, statistics=None) ClassAd
As
query(), except querying the specified type of daemon rather than the collector, which means that at most one ad will be returned.- Parameters
daemon_type (DaemonType) – Which type of daemon to query. Some daemons respond to more than one daemon type.
name (Optional[str]) – The daemon’s name (the
Nameattribute from its ad in the collector). IfNone, use the local daemon.
- locate(daemon_type, name=None) ClassAd
Return a ClassAd with enough data to contact a daemon (of the specified type) known to the collector.
If more than one daemon matches, return only the first. Use
locateAll()to find all daemons of a given type, orquery()for all daemons of a given name.- Parameters
daemon_type (DaemonType) – The type of daemon to locate.
name (Optional[str]) – The daemon’s name (the
Nameattribute from its ad in the collector). IfNone, look for local daemon of the specified type.
- locateAll(daemon_type) List[ClassAd]
Return a list of
classad2.ClassAds, each enough data to contact a daemon known of the given type to the collector.- Parameters
daemon_type (DaemonType) – Which type of daemons to locate.
- query(ad_type=AdType.Any, constraint=None, projection=None, statistics=None) List[ClassAd]
Returns
classad2.ClassAd(s) from the collector.- Parameters
ad_type (AdType) – The type of ClassAd to return.
constraint (Optional[str]) – Only ads matching this expression are returned; if not specified, all ads are returned.
projection (Optional[List[str]]) – Returned ClassAds will have only these attributes (plus a few the collector insists on). If not specified, return all attributes of each ad.
statistics (Optional[str]) – Specify the additional statistical attributes to include, if available, using the same syntax as STATISTICS_TO_PUBLISH.