Contents
Get the Plow server time in msec since the epoch
Returns: | long - msec since epoch |
---|
Re-establish the connection to the Plow server
Get the current host and port of the Plow server
Returns: | (str host, int port) |
---|
Set the host and port of the Plow server
Parameters: |
|
---|
Test if a string is a valid UUID
Parameters: | identifier (str) – string to test |
---|---|
Returns: | bool - True if valid UUID |
Get a Project by id
Parameters: | guid – str - project id |
---|---|
Returns: | Project |
Look up a Project by its code
Parameters: | code – str |
---|---|
Returns: | Project |
Create a new Project with a title and code
Parameters: |
|
---|---|
Returns: |
Folder()
A Folder
Variables: |
|
---|
Delete this Folder
Refresh the attributes from the server
Set the maximum cores
Parameters: | value – int - cores |
---|
Set the minimum cores
Parameters: | value – int - cores |
---|
Get a list of Folders by project id
Parameters: | project – Project |
---|---|
Returns: | list[Folder] |
Create a folder
Parameters: |
|
---|---|
Returns: |
Set the minimum cores for a Folder
Parameters: |
|
---|
Set the maximum cores for a Folder
Parameters: |
|
---|
Job()
A Job
Variables: |
|
---|
Eat all dead tasks on a job
Parameters: | callback – Optional callback function to run if tasks were eaten |
---|
Get a list of outputs
Returns: | list[plowOutput] |
---|
Get a list of tasks for this job, optionally filtered by a list of task stats
Parameters: | stats – list[TaskState] = None |
---|---|
Returns: | list[Task] |
Kill the job
Parameters: | reason – str - reason for killing |
---|
Kill all tasks on a job
Parameters: | callback – Optional callback function to run if tasks were killed |
---|
Set the pause state of the job
Parameters: | paused – bool |
---|
Refresh the attributes from the server
Retry all dead tasks on a job
Parameters: | callback – Optional callback function to run if tasks were retried |
---|
Set the maximum cores the job should use
Parameters: | value – int |
---|
Set the minimum cores the job should use
Parameters: | value – int |
---|
JobSpec(**kwargs)
A JobSpec specifies the parameters for launching a job
Variables: |
|
---|
logPath: ‘string’
name: ‘string’
paused: ‘int’
project: ‘string’
uid: ‘int’
username: ‘string’
Data structure representing stats for a Job
Variables: |
|
---|
Launch a job with a JobSpec.
Parameters: | spec – JobSpec |
---|---|
Returns: | Job |
Kill a job
Parameters: |
|
---|
Set the pause state of a job
Parameters: |
|
---|
Get a list of jobs matching a criteria.
Parameters: |
|
---|---|
Returns: | list[Job] |
Get the outputs of all layers of a Job
Parameters: | job – Job or str id |
---|---|
Returns: | list[Output] |
Set the minimum number of cores a job should get
Parameters: |
|
---|
Set the maximum number of cores a job should get
Parameters: |
|
---|
Represents an existing Task
Variables: |
---|
Eats the task. This is different than a kill, indicating that the work should simply be “completed”
Get a log path for the task
Optionally you may request a log from a specific retry of the task. The default is 0, which is the first run of a task. Subsequent retries will produce new log files.
If the task never started, then a log will not have been created yet, and this function will return an invalid path using a -1 as the retry number.
Parameters: | retryNum – int task.retries number (default -1 == latest) |
---|---|
Returns: | str log path |
Kill the task
Refresh the attributes from the server
Retry the task
TaskSpec(**kwargs)
Defines a task specification
Variables: |
|
---|
name: ‘string’
Data structure representing stats for a Task
Variables: |
|
---|
Data structure representing counts for a task
Variables: |
|
---|
Get a list of task stats from an existing task id
Parameters: | taskId – str |
---|---|
Returns: | list[TaskStats] |
Get a list of tasks by providing various filtering parameters.
Parameters: | |
---|---|
Returns: | list[Task] |
Get a log path by task
Optionally you may request a log from a specific retry of the task. The default is 0, which is the first run of a task. Subsequent retries will produce new log files.
If the task never started, then a log will not have been created yet, and this function will return an invalid path using a -1 as the retry number.
Parameters: |
|
---|---|
Returns: | str log path |
Retry tasks matching various keyword filter params
Parameters: |
---|
Eat tasks matching various keyword filter params
Parameters: |
---|
Layer()
Represents an existing layer
Variables: |
|
---|
Add an output to the layer
Parameters: |
|
---|---|
Returns: |
Refresh the attributes from the server
Parameters: | maxCores – int |
---|
Parameters: | minCores – int |
---|
Parameters: | minRam – int |
---|
Set the tags for the layer
Parameters: | tags – list(str) |
---|
Parameters: | threadable – bool |
---|
LayerSpec(**kwargs)
Defines a new layer
Variables: |
|
---|
Data structure representing stats for a Layer
Variables: |
|
---|
Data structure representing an existing Layer Service
Variables: |
|
---|
Create this service, if it is a new object. Does nothing if the object already exists (already has an id)
Deletes this instance, if it was created (has an id)
Commit any changes to this existing service
Create a new service. Updates the original service object passed in, and returns it.
Parameters: | src – Service |
---|---|
Returns: | Service |
Delete an existing Service instance
Parameters: | src – Service |
---|
Update an existing Service to reflect changes made to the object
Parameters: | src – Service |
---|
Get a layer by its id
Parameters: | layerId – str |
---|---|
Returns: | Layer |
Get layer by its name
Parameters: |
|
---|---|
Returns: |
Get layers by a job or job id
Parameters: | job – Job or str job id |
---|---|
Returns: | list[Layer] |
A an output to a layer
Parameters: |
|
---|---|
Returns: |
Get the outputs for a layer
Parameters: | layer – Layer or str id |
---|---|
Returns: | list[Layer] |
Parameters: |
|
---|
Parameters: |
|
---|
Parameters: |
|
---|
Update the dict attributes of an existing Output
Parameters: |
|
---|
Node()
Represents an existing Node (system) that can perform tasks
Variables: |
|
---|
Set the lock state of the node
Parameters: | locked – bool |
---|
Refresh the attributes from the server
Set the slot mode for a node
Parameters: |
|
---|
Set the tags for the node
Parameters: | tags – set(str) |
---|
Defines properties of the hardware specs of a Node at a sampled moment in time
Variables: |
|
---|
cpuModel: ‘string’
freeRamMb: ‘int’
freeSwapMb: ‘int’
logicalCores: ‘int’
physicalCores: ‘int’
platform: ‘string’
totalRamMb: ‘int’
totalSwapMb: ‘int’
Get nodes matching keyword filter parameters
Parameters: | |
---|---|
Returns: | list[Node] |
Set the lock state of the node
Parameters: |
|
---|
Assign the node to a cluster
Parameters: |
---|
Set the tags for the node
Parameters: |
|
---|
Represents an existing Proc on a Node
Variables: |
|
---|
Get a list of procs matching a criteria.
Parameters: |
|
---|---|
Returns: | list[Proc] |
Cluster()
A Cluster
Variables: |
|
---|
Delete the cluster
Returns: | bool - was deleted |
---|
Lock the cluster
Parameters: | locked – bool - True to lock / False to unlock |
---|---|
Returns: | bool - locked |
Refresh the attributes from the server
Set this cluster to be the default cluster
Set the name of the cluster
Parameters: | name – str - name |
---|
Set the tags for the cluster
Parameters: | tags – set - a set of string tags |
---|
Contains various status counts about a plow.Cluster
Variables: |
|
---|
cores: ‘int’
downCores: ‘int’
downNodes: ‘int’
idleCores: ‘int’
lockedCores: ‘int’
lockedNodes: ‘int’
nodes: ‘int’
repairCores: ‘int’
repairNodes: ‘int’
runCores: ‘int’
unlockedCores: ‘int’
unlockedNodes: ‘int’
upCores: ‘int’
upNodes: ‘int’
Return a Cluster by name
Parameters: | name – str - name of a cluster |
---|---|
Returns: | plow.Cluster |
Return a list of all Clusters
Returns: | list of Clusters |
---|
Return a list of Clusters matching a tag
Parameters: | tag – str - tag |
---|---|
Returns: | list of Clusters |
Create a Cluster with a name and set of tags
Parameters: | name – str - Name of Cluster |
---|---|
Returns: | Cluster |
Delete a Cluster
Parameters: | cluster – Cluster |
---|---|
Returns: | bool - True if deleted |
Lock a Cluster
Parameters: |
|
---|---|
Returns: | bool - locked |
Set the tags for a Cluster
Parameters: |
|
---|
Represents an existing Quota object, set on a project and cluster.
Variables: |
---|
Refresh the attributes from the server
Parameters: | burst – int |
---|
Set the lock state
Parameters: | locked – bool |
---|
Parameters: | size – int |
---|
Get quotas matching various keyword filter params
Parameters: | |
---|---|
Returns: | list[Quota] |
Create a quota for a project and cluster
Parameters: | |
---|---|
Returns: |
Set the quota size
Parameters: |
|
---|
Constants definging match types
A matcher is a combination of a type a field and a value
Variables: |
|
---|
Delete the matcher
Refresh the attributes from the server
An Action is represents a type and a value
Variables: |
|
---|
Delete the action
Refresh the attributes from the server
Filter(**kwargs)
A filter combines matcher and actions instances
Variables: |
---|
Decrease the order
Delete this filter
Increase the order
Refresh the attributes from the server
Set the filter name
Parameters: | name – str |
---|
Set the order
Parameters: | order – int |
---|
Create a field Matcher
Parameters: |
|
---|---|
Returns: |
Create an attribute Matcher
Parameters: |
|
---|---|
Returns: |
Get a matcher by id
Parameters: | id – str Filter id |
---|---|
Returns: | Matcher |
Get a list of Matchers by a filter
Parameters: | filter – Filter |
---|---|
Returns: | list[Matcher] |
Create an action
Parameters: |
|
---|---|
Returns: |
Get an action by id
Parameters: | actionId – str Action id |
---|---|
Returns: | Action |
Get a list of actions from a filter
Parameters: | filter – Filter |
---|---|
Returns: | list[Action] |
Create a filter for a project
Parameters: |
|
---|---|
Returns: |
Get a list of filters for a project
Parameters: | project – Project |
---|---|
Returns: | list[Filter] |
Get a filter by id
Parameters: | filterId – str Filter.id |
---|---|
Returns: | Filter |
Set a filter name
Parameters: |
|
---|
Depend
Represents an existing dependency between two types
Variables: |
|
---|
Activate the dependency
Drop the dependency
DependSpec(int type=0, **kwargs)
DependSpec
Specify the dependency between two types
Variables: |
---|
Create the dependency from the current settings Return the newly created Depend instance.
Ensure that a valid DependType is set, as well as the corresponding dependent and dependsOn id.
Returns: | Depend |
---|
Make one job dependent on another This call is async and does not return anything.
Parameters: |
---|
Make one layer dependent on another This call is async and does not return anything.
Parameters: |
---|
Make one layer dependent on another task This call is async and does not return anything.
Parameters: |
---|
Make each task of a layer dependent on the corresponding task of another layer, one by one. This call is async and does not return anything.
Parameters: |
---|
Make one task dependent on another layer This call is async and does not return anything.
Parameters: |
---|
Make one task dependent on another This call is async and does not return anything.
Parameters: |
---|
Get a list of depends that others have on this job
Parameters: | job – Job |
---|---|
Returns: | list[Depend] |
Get a list of depends that this job has on others
Parameters: | job – Job |
---|---|
Returns: | list[Depend] |
Get a list of depends that others have on this layer
Parameters: | layer – Layer |
---|---|
Returns: | list[Depend] |
Get a list of depends that this layer has on others
Parameters: | layer – Layer |
---|---|
Returns: | list[Depend] |
Get a list of depends that others have on this task
Parameters: | task – Task |
---|---|
Returns: | list[Depend] |