__init__(self,
connection=None,
update=0)
(Constructor)
| source code
|
This class provides an interface to an Xgrid controller.
An Xgrid controller is a single machine that manages a set of of
grids. Each grid in turn, consists of a set of agents and jobs running
on the agents.
This class provides access to the grids and jobs managed by the
controller. In Xgrid, both grids and jobs have identifiers, which are
unicode strings, like u'0', but this module can take identifiers as
strings or integers as well.
Controller and Grid objects can be used to submit Xgrid jobs, but the
Job class is used to retrieve job results.
The Controller is only the JobManager for the default Grid. To access
the jobs of other grids, create instances of their Grid objects.
Examples
>>> cn = Connection('myhost','mypassword')
>>> c = Controller(cn)
>>> c.jobIDs()
(1, 2, 3)
>>> j1 = c.job('1')
>>> j1
<Job with id = 1>
>>> c.grid_ids()
('0',)
>>> c.grid('10')
<Grid with gridID = 10>
>>> c.grid()
- Parameters:
connection (Connection) - Instance of Connection class. If empty a default Connection
object is used.
update (boolean) - A boolean flag that determines whether or not the internal state
is updated upon creation. This involves a call to the Xgrid
controller.
- Overrides:
object.__init__
|