Skip to main content

Python API Reference

Classes

qb.Callback

PurposeContainer for Qube's Callback properties. Callbacks execute an action when triggered by an event.
PrototypeCallback(data={})
Parametersdatadict or Callback initilization properties (optional)
ResultCallback object.
CommentsKey properties include id, pid, triggers, code, language, user, count, maximum, ready.

Properties

  • id : Callback id (int)
  • pid : Parent job id (int)
  • triggers : list of events that trigger the Callback. See Event Triggers below. (list)
  • code : code called when Callback triggered. (str)
  • language : language the code block is written in [values: perl, python, qube] (str)
  • user : username the Callback code will execute as (str)
  • count : Number of times the callback has been executed. (int)
  • maximum : Maximum number of times the callback will be executed. (int) [default: unlimited]
  • ready : (Internal data property)

qb.Host

PurposeContainer for Qube's Host properties. Hosts are the Workers/Subjobs that process the Work of a Job
PrototypeHost(data={})
Parametersdatadict or Host initilization properties (optional)
ResultHost object.
CommentsKey properties include state, name, macaddress, cluster, resources, restrictions, properties, stats, groups, address, subjobs.

Properties

  • state : state of the host [values: active, down, panic, none] (str)
  • name : name of machine (str)
  • macaddress : MAC address of the machine. This is the db's primary key. (str, comma-separated)
  • cluster : cluster the Host belongs to (str)
  • resources : list of resources associated with host that can be reserved by job reservations (str, comma-separated)
  • restrictions : cluster restrictions associated with host will only run jobs in specified clusters (str, comma-separated)
  • properties : properties of the host (i.e. processor speed, OS, etc)
  • stats : (reserved)
  • groups : groups the host belongs to (str, comma-separated)
  • address : IP address of host
  • subjobs : subjobs currently running on host

qb.Job

PurposeContainer for Qube's job properties. Jobs are the main containers that are submitted by the user.
PrototypeJob(data={}, name='', prototype='', package={})
Parametersdatadict or Job initializing properties (optional)
namestr specify name of job (optional)
prototypestr specify prototype/jobtype (optional)
packagedict specify package dict of job (optional)
ResultJob object.
CommentsKey properties include account, agenda, p_agenda, agendastatus, callbacks, cluster, cpus, cpustally, data, dependency, domain, flags

Properties

  • account : Container for holding account information for Job (str)
  • agenda : list of Work that specifies tasks/frames (list(Work))
  • p_agenda : list of priority/poster/preview-work items (list(Work))
  • agendastatus : Agenda state. See below for list of states. (str)
  • callbacks : list of Callbacks to be called when job completes (list(Callback))
  • cluster : Cluster to run the Job on (str)
  • cpus : Number of processes/workers/subjobs to use for the Job (int)
  • cpustally : Tally of number of subjobs per status (dict)
  • data : Encoded string representing the package. Note: Edit the package property, not this. (str, internal) available for developers who wish to use a different encoding scheme rather than the package system.
  • dependency : Jobid(s) to complete before running (str, comma-separated) (listing <jobid> is shortcut for a job, full format is link-<complete,done,failed,killed>-<job,work,subjob>-<jobid>)
  • domain : Windows Domain for authentication on the Worker (str)
  • flags : Bitfield derived from flagsstring field (Internal use only)
  • flagsstring : Comma-separated list of Job flags (str)
  • globalorder : Priority number used with 'top' and 'bottom' (Internal use only)
  • groups : Group of machines the Job can be dispatched to (str, comma-separated)
  • hostorder : Specified order of machines to dispatch Job to
  • hosts : Machines the Job can be dispatched to (str, comma-separated)
  • id : Job id (int)
  • kind : Extra string tag (str)
  • label : Abstract tag that can be used to reference Job in Callback triggers. Note: the combination of pgrp and label must be unique for a job.
  • lastupdate : timestamp since last modification (int)
  • localorder : Priority number used with 'top' and 'bottom' (Internal use only)
  • mailaddress : Email address to use for the email callback (str)
  • name : Name of the job (str)
  • notes : User-specified general notes on the job (str)
  • omitgroups : Specified groups of machines to NOT be dispatched to (str, comma-separated)
  • omithosts : Machines the Job can be dispatched to (str, comma-separated)
  • package : Data used when Worker runs the job. (dict(str, val))
  • path : Reserved
  • pathmap : Reserved
  • pgrp : Job process group. (int) Useful for grouping jobs together logically. Note: the combination of pgrp and label must be unique for a job.
  • pid : Job parent id (int)
  • priority : Job priority (int) Lower number means higher priority.
  • prototype : Job type name (str)
  • queue : Reserved
  • reason : Reason why a job is pending, specified by Supervisor (str)
  • requirements : Properties required to determine host eligibility (str, comma-separated)
  • reservations : Reserved properties used when dispatching a job (i.e. licenses, memory, etc) (str, comma separated)
  • restrictions : Restrict jobs to specific clusters. (str, comma separated)
  • retrysubjob : Number of time to attempt to retry a subjob on failure (int)
  • retrywork : Number of time to attempt to retry a frame or work item on failure (int)
  • retrywork_delay : Number of seconds to wait before automatically retrying a frame or work item on failure (int)
  • serverid : Reserved
  • status : Job state. See below for list of states. (str)
  • subjobs : list of Subjobs that specifies the machines to execute the work (list(Subjob))
  • subjobstatus : Subjob state. See below for list of states. (str)
  • timecomplete : timestamp for when job completed (int)
  • timelimit : maximum time in seconds the job is allowed to run before it's forcefully failed (int)
  • timeout : maximum time in seconds the job is allowed to run before a timeout event is generated (int)
  • agenda_timelimit : maximum time in seconds a frame is allowed to run before it's forcefully failed (int)
  • agenda_timeout : maximum time in seconds a frame is allowed to run before a frame timeout event is generated (int)
  • timestart : timestamp for when job started (int)
  • timesubmit : timestamp for submission time (int)
  • todo : Number of frames/tasks for the job (int)
  • todotally : Tally of number of frames (work) per status (dict)
  • user : User submitting the job. (str) Note: Submitting as different user requires "impersonate" priviledges.
  • waitfor : Jobid(s) to complete before running (int), Generates callbacks in qb.submit() [DEPRECATED: Use 'dependency']
  • prod_show : holds production show name (str)
  • prod_shot : holds production shot name (str)
  • prod_seq : holds production seq name (str)
  • prod_client : holds production client name (str)
  • prod_dept : holds production department name (str)
  • prod_custom1 : holds production custom data (str)
  • prod_custom2 : holds production custom data (str)
  • prod_custom3 : holds production custom data (str)
  • prod_custom4 : holds production custom data (str)
  • prod_custom5 : holds production custom data (str)
  • preflights : comma-separated list of paths to job-level preflight programs (str)
  • postflights : comma-separated list of paths to job-level postflight programs (str)
  • agenda_preflights : comma-separated list of paths to agenda-level preflight programs (str)
  • agenda_postflights : comma-separated list of paths to agenda-level postflight programs (str)

qb.JobTallyValidator

PurposeA class to validate a qb.Job's todotally and cpustally
Prototypevalidate(tally_dict)
Parameterstally_dicttally_dict
ResultJobTallyValidator object.

Example

qb.JobTallyValidator.validate(job['cpustally'])

qb.JobValidator

PurposeA class to ensure that a qb.Job instance is not malformed
Prototypeclass JobValidator
ParametersNone.
ResultJobValidator object.

Example

qb.JobValidator.validate({'id': 123, 'cluster': '/',...})
qb.JobValidator.validate({'id': 123, 'cluster': '/',...}, verbose=True)
qb.JobValidator.validate({'id': 123, 'cluster': '/',...}, agenda=True, subjobs=True, verbose=True)

qb.QBObject

PurposeBaseclass for Qube python objects.
Prototypeclass QBObject
ParametersNone.
ResultQBObject object.

qb.Subjob

PurposeContainer for Qube's subjob properties. Subjobs control the processes that perform the Work.
PrototypeSubjob(data={})
Parametersdatadict or Subjob initilization properties (optional)
ResultSubjob object.
CommentsKey properties include id, pid, host, count, retry, status, lastupdate, timesubmit, timestart, timecomplete.

Properties

  • id : Subjob id (int)
  • pid : Parent job id (int)
  • host : machine the subjob is running on (str)
  • count : number of attempts to process the Subjob
  • retry : retry limit
  • status : Subjob state. See below for list of states. (str)
  • lastupdate : timestamp since last modification (int)
  • timesubmit : timestamp for submission time (int)
  • timestart : timestamp for when job started (int)
  • timecomplete : timestamp for when job completed (int)

qb.Work

PurposeContainer for Qube's Work properties. Work is what is to be processed (i.e. frame or task) by a Subjob.
PrototypeWork(data={})
Parametersdatadict or Work initilization properties (optional)
ResultWork object.
CommentsKey properties include pid, subid, host, name, status, address, data, package, result, count, retry, retrydelay

Properties

  • pid : Parent job id (int)
  • subid : Subjob id that received the Work (int)
  • host : machine the Work is processing on (str)
  • name : name of the Work. Usually a frame number or range. Can be a label. (str)
  • status : Work state. See below for list of states. (str)
  • address : IP Address of the machine that received the Work (str)
  • data : Encoded string representing the Work package. Note: edit the package, not this. (str, internal)
  • package : Dict passed to Worker when processing the Work. Optional structure for custom jobtypes. Not currently used by cmdline or cmdrange. (dict(str, val))
  • result : Result package to be passed back to the supervisor. (dict(str,val))
  • count : Number of attempts used to process the Work, read-only (int)
  • retry : automatic retry limit (int)
  • retrydelay : delay before automatic retries (int)
  • resultpackage : Dict retrieved from Worker after processing Work. Useful for frame filenames, etc. (dict(str, val))
  • lastupdate : timestamp since last modification (int)
  • timesubmit : timestamp for submission time (int)
  • timestart : timestamp for when job started (int)
  • timecomplete : timestamp for when job completed (int)

Functions

qb.CONST

Purposereturn the integer value of the Qube command or admincommand constant with name:Since: Qube 6.9
Prototypeqb.CONST(name)
Parametersnamestr Name of the constant
ResultTrue when authdata is successfully sent, False otherwise.

qb.admincommand

PurposeExecute admincommand
Prototypeqb.admincommand(cmd, *result)
Parameterscmdstr the admincommand to execute
Resultresult

qb.archivejob

PurposeSave Job to file.:See: recoverjob
Prototypeqb.archivejob(filename, job, format=2)
Parametersfilenamestr file path to where to save Job.
jobJob or dict Job to save
formatint format to use for saving. (default: QB_API_XML) - Options: QB_API_XML, QB_API_BINARY
Resultfilesize in bytes (int)

Example

myjob = qb.jobinfo(id=277)[0]
loadedJob = qb.archivejob('c:/myjob.xml', myjob)

qb.bannedworkers

PurposeRetrieve a list of banned worker hosts.
Prototypeqb.bannedworkers()
ParametersNone
Result[Host]

Example

banned = qb.bannedworkers()
[print("name=%s, mac=%s, ip=%s" % (w['name'], w['macaddress'], w['address'])) for w in qb.bannedworkers()]

qb.binarySort

PurposeReturn a new list reordered with first, last, and then the recursed median values for the remaining items.:Since: Qube 5.3.
Prototypeqb.binarySort(origList)
ParametersorigListlist original list to be sorted
Resultnew sorted list

Example

qb.binarySort([1,2,3,4,5,6,7,8,9,10])

qb.block

PurposeSet job state to blocked.:See: unblock
Prototypeqb.block(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.blockwork

PurposeSets specified pending frames/tasks to blocked state.:See: unblockwork.
Prototypeqb.blockwork(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.blockwork('250:0')
qb.blockwork('250:0', '250:1')

qb.bottom

PurposeMove specified jobs to the end of the execution order queue, within the same priority.:See: joborder, top.
Prototypeqb.bottom(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultaffected jobids ([int])

Example

qb.bottom(250)

qb.checkpassword

PurposeCheck for valid password of current user. [Windows only]
Prototypeqb.checkpassword()
ParametersNone.
Resultsuccess of valid password (bool)

qb.complete

PurposeAlias for 'retire' function
Prototypeqb.complete(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.completework

PurposeAlias for 'retirework' function
Prototypeqb.completework(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.convertpath

Purposeconvert the given path to be suitable for the current worker, using the worker's pathmap:See: Developer docs for information on usage.
Prototypeqb.convertpath(*args)
Parameters*args*args
ResultSee function documentation / return value from Qube API.

qb.currenttime

Purposeget the current timestamp from the supervisor. This is useful for determining time offset from local clock and supervisor clock.
Prototypeqb.currenttime()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.deletepreference

Purposedelete a single preference:Since: Qube 6.8
Prototypeqb.deletepreference(preference_type, entity_path, tier, preset, user)
Parameterspreference_typestr type of the preference ("submission", etc)
entity_pathstr path to the preferences
ResultTrue when preference data is successfully deleted, False otherwise.

qb.deleteworkerproperties

PurposeDelete (undefine) named properties from the specified worker:Since: Qube 6.3
Prototypeqb.deleteworkerproperties(worker, props)
Parametersworkerstr worker name
propslist list of property strings
ResultTrue/False based on success

qb.deleteworkerresources

PurposeDelete (undefine) named resources from the specified worker:Since: Qube 6.3
Prototypeqb.deleteworkerresources(worker, resources)
Parametersworkerstr worker name
resourceslist list of resource strings
ResultTrue/False based on success

Example

qb.deleteworkerresources("host1", ["host.diskusage", "host.diskfree"])

qb.encryptpassword

PurposeEncrypts a password string:Since: Qube 5.5
Prototypeqb.encryptpassword(password)
Parameterspasswordstr password to encrypt
Resultencryped string (str)

qb.error

PurposeReturn the error reason.:Since: Qube 5.3.
Prototypeqb.error()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.genchunks

PurposeGenerate a work agenda (individual Work items) in frame chunks based upon range list. Automatically removes duplicate items in the list.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.genchunks(chunksize, range, *extraRanges, **kwargs)
Parameterschunksizeint number of frames per chunk
rangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order (default=False)
Resultlist of Work instances. ([Work])

Example

qb.genchunks(10, '1-100')
qb.genchunks(10, '-100--10')

qb.genframes

PurposeGenerate a work agenda (individual Work items) based upon range list. Automatically removes duplicate items in the list by default.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.genframes(range, *extraRanges, **kwargs)
Parametersrangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order [default = False]
removeDuplicatesbool remove duplicates in the returned list [default = True]
Resultlist of Work instances. ([Work])

Example

qb.genframes('1-10x2')
qb.genframes('-10--1x2')
qb.genframes('ls,set,echo HI')

qb.genpartitions

PurposeGenerate a work agenda (individual Work items) based upon range list splitting frame range into <n> partitions. Automatically removes duplicate items in the list.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.genpartitions(numPartitions, range, *extraRanges, **kwargs)
ParametersnumPartitionsint number of partitions to split the range into
rangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order (default=False)
Resultlist of Work instances. ([Work])

Example

qb.genpartitions(2, '1-10')
qb.genpartitions(2, '-10--1')

qb.getlogpath

PurposeReturns the client logpath (used to access the job logs directly). If the logpath override is '', then return the logpath specified in the config file. If the logpath override is 'USE_SUPERVISOR', then force the queries to ignore local access and retrieve data directly from the Supervisor.:Since: Qube 5.5.
Prototypeqb.getlogpath()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.getpreferences

Purposeget preferences specified by the entity_path:Since: Qube 6.8
Prototypeqb.getpreferences(preference_type, entity_path)
Parameterspreference_typestr type of the preference ("submission", etc)
entity_pathstr path to the preferences
Resultlist of dicts, each dict representing a DB row

qb.getresources

PurposeGet dict of global and license resources with an associated used/total count:Since: Qube 5.5
Prototypeqb.getresources()
ParametersNone.
ResultTrue/False based on success

Example

qb.getresources()

qb.getsupervisor

PurposeReturns the hostname or IP address of the current supervisor ('' means use default supervisor specified in qb.conf).
Prototypeqb.getsupervisor()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.gettimeout

PurposeReturns the current client timeout setting in milliseconds:Since: Qube 5.3.
Prototypeqb.gettimeout()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.getusers

PurposeGet the user and user group permissions from the Supervisor.:Since: Qube 5.5
Prototypeqb.getusers(convert=True)
Parametersconvertbool convert numeric permission to human readable string list 'all' used to denote "all non-admin permissions"
Resultlist of users and permissions {'<username>':{<group>:<permission>,},}

qb.hist

PurposeRetrieve history list of specified jobid/jobid.subjob.
Prototypeqb.hist(jobid, *extraJobids)
Parametersjobidint or str jobid or 'jobid.subjobid' to retrieve history for (additional jobids can be specified)
Resulthistory ([dict]) - Note: either subid or workid is specified, but not both. (value -1 used if not specified.)
- jobid -- Job id
- subid -- subjob id (int)
- workid -- task/frame id (int)
- comment -- String history event description
- stamp -- String date
- timestamp -- Int event time in seconds since the epoch

Example

loadedJob = qb.hist(250)      # retrieve all history for job 250
loadedJob = qb.hist('250.0') # retrieve history for job 250, subjob 0 only

qb.hostinfo

PurposeRetrieve information from specified hosts.
Prototypeqb.hostinfo(fields=[], filters={}, name=None, state=None, subjobs=False)
Parametersfieldslist additional info to retrieve. See below. (default=[]) - Options: subjobs
filtersdict host properties to filter hosts acted upon. See Host class properties for a full list of filters. (default=)
namestr or [str] filter shortcut. name=val -> filters={'name': val } (default=None)
statestr or [str] filter shortcut. state=val -> filters={'state': val } (default=None)
subjobsbool field shortcut. subjobs=True -> fields=['subjobs'] (default=False)
Result[Host]

Example

hosts = qb.hostinfo()               # all hosts
hosts = qb.hostinfo(name='myhost') # only host named myhost
hosts = qb.hostinfo(state='down') # only host that are active
hosts = qb.hostinfo(subjobs=True) # all hosts, include subjob info

qb.hostorder

PurposeGet list of hosts in the order that the system will likely assign the given job.
Prototypeqb.hostorder(id=None)
Parametersidint The jobID of the job we're interested in.
Result[Host]

Example

hosts = qb.hostorder(id=1234)

qb.interrupt

PurposeForces running jobs back to pending state without waiting for agenda items to finish.:See: preempt, migrate
Prototypeqb.interrupt(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.isadmin

PurposeQuery the supervisor to find out if the given user is a qube admin. Return TRUE if the user is a qube administrator, FALSE otherwise. In case of errors, FALSE is returned also.:Since: Qube 6.5
Prototypeqb.isadmin(user)
Parametersuserstr name of the user to be checked
ResultTrue if user is a Qube admin, False otherwise

qb.jobconfig

PurposeReturn specified paramaeter value from job.conf.
Prototypeqb.jobconfig(jobtype, parameter)
Parametersjobtypestr jobtype for the parameter
parameterstr name of parameter to retrieve :Return: parameter value
ResultSee function documentation / return value from Qube API.

qb.jobid

PurposeGet the job's id for the job process (jobtype backend):Since: Qube 5.3.
:See: Developer docs for information on usage.
Prototypeqb.jobid()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.jobinfo

PurposeGather job information from a list of jobs.
Prototypeqb.jobinfo(fields=[], filters={}, id=None, status=None, agenda=False, subjobs=False, callbacks=False, updatedAfter=None, updatedBefore=None, submittedAfter=None, submittedBefore=None, minid=None, maxid=None, limit=None, orderby=None)
Parametersfieldslist additional info to retrieve. See below. (default=[]) Options: agenda, subjobs, callbacks
filtersdict properties to filter retrived items. See below. (default=) Options: id, name, user, status, priority, pgrp, pid, todo, cluster, prototype, groups, cpus
idint or [int] filter shortcut. id=val -> filters={'id': val } (default=None)
statusstr filter shortcut. status=val -> filters={'status': val } (default=None)
Options: complete, failed, killed, blocked, waiting, suspended, pending, running, unknown, badlogin, registering, dying
agendabool field shortcut. agenda=True -> fields=['agenda'] (default=False)
subjobsbool field shortcut. subjobs=True -> fields=['subjobs'] (default=False)
callbacksbool field shortcut. callbacks=True -> fields=['callbacks'] (default=False)
updatedAfterint or datetime.datetime or datetime.date filter for jobs updated after a specific point in time
updatedBeforeint or datetime.datetime or datetime.date filter for jobs updated before a specific point in time
submittedAfterint or datetime.datetime or datetime.date filter for jobs submitted after a specific point in time
submittedBeforeint or datetime.datetime or datetime.date filter for jobs submitted before a specific point in time
minidint set the job ID lower bound for the query (only query for jobs >= id)
maxidint set the job ID upper bound for the query (only query for jobs <= id)
limitint limit the number of returned jobs for the query
orderbystr specify sorting field; i.e. this forms the ORDERBY clause used for the job query (like 'id' or 'id DESC')
Result[Job]

Example

jobs = qb.jobinfo(fields=['agenda', 'subjobs'], filters={'id':2024} )
jobs = qb.jobinfo(id=2024, agenda=True, subjobs=True)
jobs = qb.jobinfo(id=2024, agenda=True, subjobs=True)
jobs = qb.jobinfo(id=[2024,2025])

qb.jobobj

PurposeGet a dict for the job to process (jobtype backend):See: Developer docs for information on usage.
Prototypeqb.jobobj()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.joborder

PurposeGet jobs running or scheduled to run on the host.
Prototypeqb.joborder(filters={}, name=None)
Parametersfiltersdict host properties to filter hosts acted upon. See Host class properties for a full list of filters. (default=)
namestr or [str] filter shortcut. name=val -> filters={'name': val } (default=None)
Result[Job]

Example

jobs = qb.joborder(name='myhost')

qb.jobtagvalues

PurposeRetrieve a list of currently used values for tag, "tagname".
Prototypeqb.jobtagvalues(tagname)
Parameterstagnamestr name of tag (prod_show, prod_seq, prod_shot, prod_client, prod_dept, prod_custom1, ..., prod_custom5) for which to query
Result[Host]

Example

tagvalues = qb.jobtagvalues("prod_custom1")

qb.jobtypeavailable

PurposeReturn the list of available jobtypes on current host system.
Prototypeqb.jobtypeavailable(jobtypepath)
Parametersjobtypepathstr path to the jobtypes :Return: list of available jobtypes on current host system ([str])
ResultSee function documentation / return value from Qube API.

qb.kill

PurposeKills jobs or subjobs.
Prototypeqb.kill(jobid, *extraJobids)
Parametersjobidint jobid to kill (additional jobids can be specified)
Resultkilled subjobs (['jobid.subjobid'])

Example

qb.kill(250)        # kill all subjobs under job 250
qb.kill('250.0') # kill only subjob 250.0

qb.killwork

PurposeKills specified frames/tasks.:See: kill.
Prototypeqb.killwork(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.killwork('250:0')
qb.killwork('250:0', '250:1')

qb.localconfig

PurposeQuery the configuration of the local machine.:Since: Qube 5.5
:See: updatelocalconfig
Prototypeqb.localconfig()
ParametersNone.
Resultdict of parameters

qb.migrate

PurposeInterrupt a running job/subjob and force it to run on a different host.
Prototypeqb.migrate(jobid, *extraJobids)
Parametersjobidint or str jobid or 'jobid.subjobid' to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

Example

qb.migrate(250)    # migrate all subjobs for job 250
qb.migrate('250.1') # migrate subjob 250.1 to a different host

qb.mktime

Purposemktime(tuple) -> floating point number Convert a time tuple in local time to seconds since the Epoch. Note that mktime(gmtime(0)) will not generally return zero for most time zones; instead the returned value will either be equal to that of the timezone or altzone attributes on the time module.
Prototypeqb.mktime(...)
Parameters......
ResultSee function documentation / return value from Qube API.

qb.modify

PurposeRequests the supervisor to modify a list of jobs.
Prototypeqb.modify(modifyParamDict, jobid, *extrajobids)
ParametersmodifyParamDictdict items to modify (ie. {'priority':123})
Modifiable Parameters:
- priority
- timeout
- name
- account
- notes
- cluster
- restrictions
- requirements
- reservations
- groups
- hosts
- omithosts
- omitgroups
- hostorder
- pgrp
- data
- cpus
- max_cpus
- env
- prod_show
- prod_shot
- prod_seq
- prod_client
- prod_dept
- prod_custom1
- prod_custom2
- prod_custom3
- prod_custom4
- prod_custom5
- preflights
- postflights
- agenda_preflights
- agenda_postflights
jobidint jobid to affect (additional jobids can be specified)
Resultaffected jobids ([int])

Example

qb.modify({'priority':123}, 250)    # modify priority of job 250

qb.ping

PurposePing the current or specified Supervisor to confirm it is present and available.
Prototypeqb.ping(supervisor=None, asDict=False)
Parameterssupervisorstr or None Specify the explicit Supervisor to ping. If None value specified, then use the current default supervisor for the given machine
asDictbool return a dict containing details on the supervisor ping
ResultSee function documentation / return value from Qube API.

qb.preempt

PurposeForces running jobs back to pending state after agenda item is completed.:See: interrupt and migrate
Prototypeqb.preempt(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.qbadmin_reconfigureworkers

PurposePerforms call same as "qbadmin worker --reconfigure" to push out new qbwrk.conf to all workers :Note: This command requires qube 'admin' permissions to work.
Prototypeqb.qbadmin_reconfigureworkers()
ParametersNone.
Resultsuccess (bool)

qb.rangechunk

PurposeSplits frame range chunks each with <n> frames. Automatically removes duplicate items in the list.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.rangechunk(chunksize, range, *extraRanges, **kwargs)
Parameterschunksizeint number of frames per chunk
rangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order (default=False)
ResultList of range strings ([str])

Example

qb.rangechunk(5, '1-10')
qb.rangechunk(5, '-100--1')
qb.rangechunk(5, '1-20', binarySort=True)

qb.rangepartition

PurposeSplit frame range into <n> partitions. Automatically removes duplicate items in the list.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.rangepartition(numPartitions, range, *extraRanges, **kwargs)
ParametersnumPartitionsint number of partitions to split the range into
rangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order (default=False)
ResultList of range strings ([str])

Example

qb.rangepartition(2, '1-10')
qb.rangepartition(2, '-100--1')

qb.rangesplit

PurposeConvert a frame range into a list of frames. Automatically removes duplicate items in the list by default.:See: rangesplit, rangechunk, rangepartition
:See: genframes, genchunks, genpartitions
Prototypeqb.rangesplit(range, *extraRanges, **kwargs)
Parametersrangestr Frame range string (additional ranges can be specified)
- n1 (ie. 1)
- n1,n2,... -- comma separated list (i.e. 1,2,3,5,10)
- n1-n2 -- n1 through n2 (i.e. 1-10)
- n1-n2xStep -- n1 through n2, step Step (i.e. 1-10x2)
binarySortbool perform a binary sort (first, last, middle) on the resulting order [default = False]
removeDuplicatesbool remove duplicates in the returned list [default = True]
ResultList of range strings ([str])

qb.recoverjob

PurposeLoad Job from file.:See: archivejob
Prototypeqb.recoverjob(filename)
Parametersfilenamestr path to file containing saved Job
ResultJob on success, None on failure

Example

loadedJob = qb.recoverjob('c:/myjob.xml')

qb.remove

PurposeRemove specified jobids from database.
Prototypeqb.remove(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultaffected jobids ([int])

qb.reportjob

PurposeReturn updated job status to supervisor (jobtype backend):See: Developer docs for information on usage.
Prototypeqb.reportjob(*args)
Parameters*args*args
ResultSee function documentation / return value from Qube API.

qb.reportwork

PurposeReturns updated work agenda items to the supervisor (jobtype backend)
:See: Developer docs for information on usage.
Prototypeqb.reportwork(*args)
Parameters*args*args
ResultSee function documentation / return value from Qube API.

qb.requestwork

PurposeAsk supervisor for work agenda items (jobtype backend):See: Developer docs for information on usage.
Prototypeqb.requestwork()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.requeue

PurposeResets jobs in a terminal state (killed, failed, etc) back to a blocked state. Note that this command is very similar to the retry command, with a subtle yet significant difference-- retry puts the job in a "pending" state, while requeue puts it in a "blocked" state.:See: retry, which does a similar thing, but puts the job in a "pending" state.
Prototypeqb.requeue(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.requeuework

PurposeResets specified terminal frames/tasks (failed, killed, etc) to blocked state.:See: retrywork.
Prototypeqb.requeuework(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.requeuework('250:0')
qb.retrywork('250:25-29')
qb.requeuework('250:0', '250:1')

qb.resume

PurposeReturn suspended (unix) jobs to specified running jobs. (Linux Workers only):See: suspend.
Prototypeqb.resume(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.retire

PurposeForce specified jobs to exit and set status to "complete" after each subjob completes its current Work items. :Note: Works on jobs that are not complete, killed, or failed.
Prototypeqb.retire(jobid, *extraJobids)
Parametersjobidint jobid to retire (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

Example

qb.retire(250)

qb.retirework

PurposeRetire specified frames/tasks and set their status to "complete".:Since: Qube 5.3.
:Note: Works on frames/tasks that are not complete, killed, or failed.
:See: retire.
Prototypeqb.retirework(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.retirework('250:0')
qb.retirework('250:0', '250:1')

qb.retry

PurposeResets jobs in a terminal state (killed, failed, etc) back to a pending state. Note that this command is very similar to the requeue command, with a subtle yet significant difference-- requeue puts the job in a "blocked" state, while retry puts it in a "blocked" state.:See: requeue, which does a similar thing, but puts the job in a "blocked" state.
Prototypeqb.retry(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.retrywork

PurposeResets specified terminal frames/tasks (failed, killed, etc) to pending state. Return affected tasks/work items.:See: requeuework
Prototypeqb.retrywork(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.retrywork('250:0')
qb.retrywork('250:25-29')
qb.retrywork('250:0', '250:1')

qb.send_ML_authdata

PurposeDeprecated send Metered Licensing authorization data to the supervisor:Since: Qube 6.9
Prototypeqb.send_ML_authdata(authdata)
Parametersauthorizationstr properly formatted and keyed authorization data
ResultTrue when authdata is successfully sent, False otherwise.

qb.setlogpath

PurposeSet the client logpath to access the job logs directly. Set to '' to use the default logpath specified in the config file. Set to 'USE_SUPERVISOR' to force the queries to ignore local access and retrieve data directly from the Supervisor.:Since: Qube 5.5.
Prototypeqb.setlogpath(logpath)
Parameterslogpathstr directory path to the qube log
ResultSee function documentation / return value from Qube API.

qb.setpreference

Purposeset a single preference:Since: Qube 6.8
Prototypeqb.setpreference(preference_type, entity_path, entity_value, tier, preset, user, mandate)
Parameterspreference_typestr type of the preference ("submission", etc)
entity_pathstr path to the preferences
entity_valuestr value of the preferences
tierstr "common" or "specific"
presetstr preset
userstr user name
mandatebool if the preference is mandate or not
ResultTrue when preference data is successfully set, False otherwise.

qb.setsupervisor

PurposeSet the supervisor to use.
Prototypeqb.setsupervisor(supervisor)
Parameterssupervisorstr hostname or IP address of supervisor. '' means use default supervisor specified in qb.conf.
ResultSee function documentation / return value from Qube API.

qb.settimeout

PurposeSet the client timeout (in milliseconds).:Since: Qube 5.3.
Prototypeqb.settimeout(timeout)
Parameterstimeoutint length of timeout in milliseconds
ResultSee function documentation / return value from Qube API.

qb.setusers

PurposeSet the permissions for users and user groups. Requires administrator access.:Since: Qube 5.5
Prototypeqb.setusers(action, user, permissions=[], group='')
Parametersactionbool what action is to be performed on the specified users accepted values: add, delete, set, drop ('remove' also works for 'delete')
userstring username to set permissions for
groupstring group under username to set permissions for
permissionsint or [string] user and admin permissions to set for the user or a group for that user both int or a string list is accepted

Basic Permissions: ("all" is a shortcut for all of these)
- submit_job
- submit_callback
- submit_global_callback
- bump
- kill
- remove
- modify
- preempt
- block
- interrupt
- complete
- unblock
- suspend
- resume
- retry
- requeue
- migrate
- shove
- fail
- retire
- reset

Admin permissions:
- lock_host
- sudo_admin
- impersonate
- admin
ResultTrue/False based on success

Example

qb.setusers('add'   , 'myuser', permissions=['all', 'admin'])
qb.setusers('add' , 'myuser', group='mygroup', permissions=['all', 'admin'])
qb.setusers('set' , 'myuser', permissions=['all', 'admin'])
qb.setusers('remove', 'myuser', permissions=['preempt'])

qb.shove

PurposeForce the re-evaluation of a pending job for running on Workers:Since: Qube 5.5
Prototypeqb.shove(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected jobids (['jobid'])

Example

qb.shove(250)

qb.stats

PurposeRetrieve stats list for specified jobid.subjobid.
Prototypeqb.stats(subjobid, *extraSubjobids)
Parameterssubjobidstr jobid or 'jobid.subjobid' to retrieve info for (additional subjobids can be specified)
ResultStats ([dict])
- jobid -- Job id (int)
- subid -- subjob id (int)
- logtype -- (undefined)
- host -- (undefined)
- data -- stat info
- id -- (undefined)
- cls -- (undefined)

Example

qb.stats('250.0')  # retrieve stats for job 250, subjob 0 only

qb.stderr

PurposeRetrieve the list of stderr output of the specified range, for the specified subjob.
Prototypeqb.stderr(*subjobids, **kwargs)
Parameterssubjobidslist of str a list of 'jobid.subjobid' for which to retrieve info
posint position, in bytes, to start reading
lenint length, in bytes, to read
Resultoutput logs (dict)
- jobid -- Job id (int)
- subid -- subjob id (int)
- data -- log info (str)
- fullsize -- full size of the log file, in bytes (int)

qb.stdout

PurposeRetrieve the list of stdout output of the specified range, for the specified subjob.
Prototypeqb.stdout(*subjobids, **kwargs)
Parameterssubjobidslist of str a list of 'jobid.subjobid' to retrieve info for
posposition, in bytes, to start reading
lenlength, in bytes, to read
Resultoutput logs (dict)
- jobid -- Job id (int)
- subid -- subjob id (int)
- data -- log info (str)
- fullsize -- full size of the log file, in bytes (int)

qb.subid

PurposeGet the job's subjob id for the job process (jobtype backend):Since: Qube 5.3.
:See: Developer docs for information on usage.
Prototypeqb.subid()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.submit

PurposeSubmit a job or list of jobs to the Supervisor.
Prototypeqb.submit(*jobs, **kwargs)
ParametersjobsJob or dict job properties to submit (additional Jobs or lists of Jobs can be specified)
deferTableCreationbool whether the supervisor should defer the creation of DB tables [default = True]
Resultlist of submitted jobs ([Job])

Example

# Simple submission to run "set" command
myjob = qb.Job()
myjob['name'] = 'test submit'
myjob['prototype'] = 'cmdline'
myjob['package'] = {'cmdline' : 'set' }
qb.submit(myjob)# returns a [Job()]
#Simple multi-frame submission to echo the frame number
myjob = qb.Job()
myjob['name'] = 'test cmdrange submit'
myjob['prototype'] = 'cmdrange'
myjob['package'] = {'cmdline' : 'echo "Frame QB_FRAME_NUMBER"',
'padding' : 0,
'range' : '1-10', # QubeUI uses this if present
}
myjob['agenda'] = qb.genframes(myjob['package']['range'])
qb.submit(myjob) # returns a [Job()]
#Simple per-job multiple dependency example
myjob = qb.Job(name='dependency test', prototype='cmdline', package={'cmdline' : 'set' })
job1 = qb.submit(myjob)[0]
job2 = qb.submit(myjob)[0]
myjob3 = qb.Job(name='dependency test (waitfor)', prototype='cmdline', package={'cmdline' : 'set' })
myjob3['dependency'] = "%i,%i" % (job1.id(), job2.id())
job3 = qb.submit(myjob3)[0] # returns a Job() that will run after job1 and job2 complete

qb.supervisorconfig

PurposeQuery the configuration of the current Supervisor:Since: Qube 5.5
Prototypeqb.supervisorconfig()
ParametersNone.
Resultdict of parameters

qb.suspend

PurposeSends SUSPEND signal (unix suspend) to specified running jobs. (Linux Workers only):See: resume
Prototypeqb.suspend(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.top

PurposeMove specified jobs to the beginning of the execution order queue, within the same priority.:See: joborder, bottom
Prototypeqb.top(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultaffected jobids ([int])

Example

qb.top(260)

qb.unblock

PurposeSet job state to pending.:See: block
Prototypeqb.unblock(jobid, *extraJobids)
Parametersjobidint jobids to affect (additional jobids can be specified)
Resultlist of affected subjobids (['jobid.subjobid'])

qb.unblockwork

PurposeSets specified blocked frames/tasks to pending state.:See: unblockwork
Prototypeqb.unblockwork(workid, *extraWorkids)
Parametersworkidstr task/frame specifier 'jobid:workname' (additional workids can be specified)
Resultaffected tasks/work items (['jobid:workname'])

Example

qb.unblockwork('250:0')
qb.unblockwork('250:0', '250:1')

qb.updatelocalconfig

PurposeSaves the specified config parameters to local qb.conf file. Automatically prompt for authentication as needed on OSX.:Since: Qube 5.5
:See: localconfig
Prototypeqb.updatelocalconfig(configDict, auth=True)
ParametersconfigDictdict dict of configuration string parameters
authbool allow authentication dialog to prompt for Administrator password as needed (OSX only)
Resultsuccess (bool)

qb.updatepassword

PurposeUpdate supervisor with new Windows password information for a Windows user.
Prototypeqb.updatepassword(user=None, password=None, domain=None)
Parametersuserstr username
passwordstr new password
domainstr Windows domain
Result(bool) True on success, False on failure

qb.updateresources

PurposeUpdate used/total counts for a dynamic global license resource:Since: Qube 5.5
Prototypeqb.updateresources(resourceDict)
ParametersresourceDictdict {name:(used, total)} - name : of the resource to update - used : number of resources currently in use - total : total number of resources that can be used.
ResultTrue/False based on success

Example

qb.updateresource({'license.maya': (0, 100)})

qb.updateworkerconfig

PurposeSaves the specified config parameters to local qbwrk.conf file. This should be run on the Supervisor machine only. Automatically prompt for authentication as needed on OSX. One should call qbadmin_reconfigureworkers after this file has been updated to push out the configuration.:Since: Qube 5.5 :Note: Must be run from Supervisor machine.
:See: qbadmin_reconfigureworkers
Prototypeqb.updateworkerconfig(configDict, hostnames, auth=True)
ParametersconfigDictdict dict of configuration string parameters
hostnameslist list of Worker hostnames to update with these values
authbool allow authentication dialog to prompt for Administrator password as needed (OSX only)
Resultsuccess (bool)

qb.updateworkerproperties

PurposeUpdate value of worker properties:Since: Qube 6.3
Prototypeqb.updateworkerproperties(worker, properties)
Parametersworkerstr worker name
propertiesstr property string
ResultTrue/False based on success

Example

qb.updateworkerproperties("host1", "host.diskfree=4.5")

qb.updateworkerresources

PurposeUpdate used/total counts for worker resources:Since: Qube 6.3
Prototypeqb.updateworkerresources(worker, resources)
Parametersworkerstr worker name
resourcesstr resource string
ResultTrue/False based on success

Example

qb.updateworkerresources("host1", "host.diskusage=13210/80000")

qb.validatejob

PurposeTest that a qb.Job object does not have invalid or malformed values New in Qube 6.9-1
Prototypeqb.validatejob(jobid, agenda=False, subjobs=False, verbose=False)
ParametersjobidJob id - int
agendaif True, check each agenda item - Boolean
subjobsif True, check each job instance - Boolean
verboseif True, print the name of the malformed job field - Boolean
ResultBoolean

Example

qb.validatejob(123)
qb.validatejob(345, verbose=True)
qb.validatejob(345, agenda=True, subjobs=True, verbose=True)

qb.version

PurposeReturns version number for qube.
Prototypeqb.version()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.waitfor

PurposeWait for a specific event. This is useful for waiting for a specific event, to allow external scripts to wait for jobs before progressing.:Since: Qube 5.3.
Prototypeqb.waitfor(post, timeout)
Parameterspostpost
timeouttimeout
ResultSee function documentation / return value from Qube API.

qb.workblock

Purpose:Deprecated: Use 'blockwork'
Prototypeqb.workblock(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.workcomplete

Purpose:Deprecated: Use 'retirework'
Prototypeqb.workcomplete(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.workerconfig

PurposeQuery the configuration of the specified Worker:Since: Qube 5.5
Prototypeqb.workerconfig(name)
Parametersnamename
Resultdict of parameters

qb.workerlock

PurposeSets the locking string for machines used as Workers.
Prototypeqb.workerlock(filters=\{}, lockingString='', name=None, lock=None, purge=False)
Parametersfiltersdict properties to filter the workers to lock/unlock. Valid keys=['name'] (default={})
lockingStringstr comma-separated string used to control lock behavior of host. (default='')

- Options:
- host.processor_all=<val> -- specify action for all the processors
- host.processor_<#>=<val> -- specify action for processor n
- host.lock_mode=aggressive -- immediately purge running jobs off of processors locked
- Locking values <val>:
- For Off/On use: 0=Off, 1=On
- For Watchdog (Windows only): (delay is minutes before idle):: watchdog <delay>
- For Scheduling, use the week calendar to specify timeslots per hour (starts with Sunday)::
weekcalendar { 0 '0' '0' '0' '0' '0' '0' '0'
1 '0' '0' '0' '0' '0' '0' '0'
2 '0' '0' '0' '0' '0' '0' '0'
3 '0' '0' '0' '0' '0' '0' '0'
4 '0' '0' '0' '0' '0' '0' '0'
5 '0' '0' '0' '0' '0' '0' '0'
6 '0' '0' '0' '0' '0' '0' '0'
7 '1' '1' '1' '1' '1' '1' '0'
8 '1' '1' '1' '1' '1' '1' '0'
9 '1' '1' '1' '1' '1' '1' '0'
10 '1' '1' '1' '1' '1' '1' '0'
11 '1' '1' '1' '1' '1' '1' '0'
12 '1' '1' '1' '1' '1' '1' '0'
13 '1' '1' '1' '1' '1' '1' '0'
14 '1' '1' '1' '1' '1' '1' '0'
15 '0' '0' '0' '0' '0' '0' '0'
16 '0' '0' '0' '0' '0' '0' '0'
17 '0' '0' '0' '0' '0' '0' '0'
18 '0' '0' '0' '0' '0' '0' '0'
19 '0' '0' '0' '0' '0' '0' '0'
20 '0' '0' '0' '0' '0' '0' '0'
21 '0' '0' '0' '0' '0' '0' '0'
22 '0' '0' '0' '0' '0' '0' '0'
23 '0' '0' '0' '0' '0' '0' '0' }
namestr filter shortcut. name='myhost' -> filters={'name':'myhost'}
lockbool lockingString shortcut. lock=False/True -> lockingString='host.processor_all=0/1'
purgebool lockingString shortcut. purge=True -> lockingString += ',host.lock_mode=aggressive' :Return: hostnames of affected machines ([str])
ResultSee function documentation / return value from Qube API.

Example

qb.workerlock(name='myhost', lock=True)  # locks 'myhost'
qb.workerlock(name='myhost', lock=True, purge=True) # locks 'myhost' and purges running jobs from host
qb.workerlock(name='myhost', lock=False) # unlock 'myhost'
qb.workerlock(lockingString='host.processor_0=1,host.processor_1=1', name='myhost')

qb.workerpathmap

PurposeReturn the current worker's worker pathmap (jobtype backend):See: Developer docs for information on usage.
Prototypeqb.workerpathmap()
ParametersNone.
ResultSee function documentation / return value from Qube API.

qb.workerping

PurposePing the specified Worker to confirm it is present and available.:Since: Qube 5.5
Prototypeqb.workerping(worker, asDict=False)
Parametersworkerstr Specify the explicit IP address or hostname of the Worker to ping.
asDictbool return a dict containing details on the ping
ResultSee function documentation / return value from Qube API.

qb.workkill

Purpose:Deprecated: Use 'killwork'
Prototypeqb.workkill(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.workrequeue

Purpose:Deprecated: Use 'requeuework'
Prototypeqb.workrequeue(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.workretry

Purpose:Deprecated: Use 'retrywork'
Prototypeqb.workretry(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

qb.workunblock

Purpose:Deprecated: Use 'unblockwork'
Prototypeqb.workunblock(*args, **kwargs)
Parameters*args*args
**kwargs**kwargs
ResultSee function documentation / return value from Qube API.

Data / Constants

  • QB_API_BINARY = 1
  • QB_API_XML = 2
  • QB_CLIENT_DEFAULT_CONF = '/etc/qb.conf'
  • QB_SUPERVISOR_CONFIG_DEFAULT_LICENSE_FILE = '/etc/qb.lic'
  • QB_SUPERVISOR_CONFIG_DEFAULT_LOGFILE = '/var/log/supelog'
  • QB_SUPERVISOR_CONFIG_DEFAULT_LOGPATH = '/var/spool/qube'
  • QB_SUPERVISOR_CONFIG_DEFAULT_WORKER_CONFIGFILE = '/etc/qbwrk.conf'
  • QB_TIME_EPOCH_OFFSET = 946702800
  • QB_WORKER_CONFIG_DEFAULT_LOGFILE = '/var/log/workerlog'
  • __docformat__ = 'restructuredtext en'
  • qbPythonVer = '_qb<version>'