Collector
Class
- class htcondor2.Collector(pool=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 (
Union
[str
,ClassAd
,List
[str
],Tuple
[str
],None
]) – Ahost::port
string specifying the remote collector, a list (or tuple) of such strings, or a ClassAd with aMyAddress
attribute (such as might be returned bylocate()
).None
means the value of the configuration parameterCOLLECTOR_HOST
.
- advertise(ad_list, command='UPDATE_AD_GENERIC', use_tcp=True)
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.
- Return type
- directQuery(daemon_type, name=None, projection=None, statistics=None)
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
,None
]) – The daemon’s name (theName
attribute from its ad in the collector). IfNone
, use the local daemon.
- Return type
- locate(daemon_type, name=None)
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.
- locateAll(daemon_type)
Return a list of
classad2.ClassAd
s, 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.- Return type
- query(ad_type=AdType.Any, constraint=None, projection=None, statistics=None)
Returns
classad2.ClassAd
(s) from the collector.- Parameters
ad_type (
AdType
) – The type of ClassAd to return.constraint (
Optional
[str
,None
]) – Only ads matching this expression are returned; if not specified, all ads are returned.projection (
Optional
[List
[str
],None
]) – 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
,None
]) – Specify the additional statistical attributes to include, if available, using the same syntax as STATISTICS_TO_PUBLISH.
- Return type