node-deadline
Version:
Module to interface with Deadline Compute Management System by Thinkbox Software
141 lines (91 loc) • 4.54 kB
Markdown
#Deadline.tasks NOT IMPLEMENTED
Ownes all functionality related to individual Deadline tasks.
###Deadline.tasks.get( options, callback )
Base function for retrieving tasks from Deadline, takes an options object defining which tasks to get.
With no options or an empty options object, this function returns all tasks.
**NOTE:** Deadline.tasks.get is also provided under Deadline.get.tasks for better code clarity if desired.
(ie: `deadline.tasks.get.by.id === deadline.get.tasks.by.id`)
####Options
**state:** *get only jobs matching the given state or states* ( enum )
```
{ state: Deadline.QUEUED | Deadline.COMPLETE }
```
**id:** *get only tasks with the given id(s)* ( string | array[string] )
```
{ id: "55b911f1ec46630980bba101" }
{ id: ["55b911f1ec46630980bba101", "55b911f1ec46630980bba102"] }
```
**jobID:** *get only tasks belonging to the given job id(s)* ( string | array[string] )
```
{ jobID: "55b911f1ec46630980bba101" }
{ jobID: ["55b911f1ec46630980bba101", "55b911f1ec46630980bba102"] }
```
**taskID:** *get only tasks with the given task id(s)* ( number | array[number] )
```
{ taskID : 1 }
{ taskID : [1, 2] }
```
**slave:** *get only tasks rendering/rendererd on the given slave(s)* ( string | array[string] )
```
{ slave : "mySlave" }
{ slave : ["mySlave1", "mySlave2] }
```
####Callback
Called when the query is complete, takes two parameters: error and results
- **error:** a Deadline.Error object or null if OK
- **results:** an array of tasks mathing the request, empty if none found, null if there was a fatal error
###Deadline.tasks.get.by
This object provides all of the above available options in Deadline.tasks.get
as individual functions for better code clarity, if applicable. Valid options here
mirrors the valid options for Deadline.tasks.get()
```javascript
deadline.tasks.get.by.state( Deadline.COMPLETE );
deadline.tasks.get.by.id( "55b911f1ec46630980bba101" );
```
###Deadline.tasks.get.any( properties, callback )
The same as Deadline.jobs.get() but mathches any of the given properties rather than all of them.
####Callback
Called when the query is complete, takes two parameters: error and results
- **error:** a Deadline.Error object or null if OK
- **results:** an array of jobs mathing the request, empty if none found, null if there was a fatal error
###Deadline.tasks.get.find( query, callback )
Accepts a raw MongoDB query to use in the
[collection.find](http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#find) method.<Br>
*This methond is used internally by all other get methods, and should not be used when another suitable get method exists for
the query in question*
##Deadline.tasks.Task
Represents a singular Task from the Deadline database.
####Properties
| Property | type | Maps to | Description
|---------------|--------|---------------|------------
| id | String | _id | The unique id of the task
**NOTE:** properties with no name have yet to be assigned, but are available in the *job._data* object.
There are also other properties on that object which are not listed here.
Be aware that changing these options directly requires that you add the property name to the *job._updated*
array in order to have the information change when the job is saved.
#vv INCOMPLETE vv
####Deadline.jobs.Job.set( properties )
Sets the given properties on this job. The **properties** object is a set of key-value pairs to update with.
```javasccript
job.set( {
name: "My new job name",
user: "newJobUser"
} );
```
##Deadline.jobs.FrameRange
A utility class for parsing and managing frame ranges in in Deadline.
####Deadline.jobs.FrameRange( string ) [CONSTRUCTOR]
If passed a string, it is parsed into this object
####Deadline.jobs.FrameRange.parse( string )
Takes a valid Deadline frame range string and expands it to set this object.
####Deadline.jobs.FrameRange.contains( numbers )
Takes a singular number or array of numbers and
returns true if those numbers are included in this frame range.
####Deadline.jobs.FrameRange.add( numbers )
Takes a singular number or array of numbers and
appends them to the current frame range.
####Deadline.jobs.FrameRange.remove( numbers )
Takes a singular number or array of numbers and removes them
from the current frame range if present.<br/>
**NOTE** this will force the frame range string to be expanded into a flat list:<Br>
( ie FrameRange("1-100").remove(50) will change the job string into a list of all number between 1 and 100, skipping 50 )