Package schrodinger :: Package job :: Module jobapi :: Class JobAPI
[hide private]
[frames] | no frames]

Class JobAPI

object --+
         |
        JobAPI

Provide access to the Schrodinger Job API.

Instance Methods [hide private]
 
__init__(self, root_url)
x.__init__(...) initializes x; see help(type(x)) for signature
 
responsive(self)
Verify the API is available by making a HEAD request on the root endpoint.
 
jobids(self)
Get a list of the jobids in the job server jobdb.
 
jobdb_index(self)
Get index for the job server jobdb.
 
jobdb_index_file(self)
Get the complete jobdb index in the standard disk format
 
job(self, jobid)
Get the job record for a particular job.
 
delete_job(self, jobid, force=False)
Delete the job record for the specified job, and any files stored for that job.
 
job_record(self, jobid)
Get the job record for a particular job, in the standard disk format.
 
create_jobid(self)
Request a new jobid from the server.
 
upload_job_file(self, jobid, filename, content=None)
Upload a file for the given job.
 
job_files(self, jobid)
Get a list of the files stored for a particular job.
 
get(self, endpoint, **kwargs)
Submit a GET request to the specified endpoint.
 
delete(self, endpoint, **kwargs)
Submit a DELETE request to the specified endpoint.
 
head(self, endpoint, **kwargs)
Submit a HEAD request to the specified endpoint.
 
post(self, endpoint, body, **kwargs)
Submit a POST request to the specified endpoint, with the given request body.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, root_url)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

jobdb_index(self)

 

Get index for the job server jobdb.

The response is a list of dicts, each dict representing the index data for a single job.

job(self, jobid)

 

Get the job record for a particular job.

The job record contents are returned as a dict.

delete_job(self, jobid, force=False)

 

Delete the job record for the specified job, and any files stored for that job.

Only completed jobs can be deleted, by default. Specify force=True to delete an uncompleted job.

create_jobid(self)

 

Request a new jobid from the server. The new job record is returned as a dict.

upload_job_file(self, jobid, filename, content=None)

 

Upload a file for the given job. A file-like object from which the content can be read may be specified; otherwise, the file is read from disk. The metadata for the stored file is returned as a dict. (see job_files(), below.)

job_files(self, jobid)

 

Get a list of the files stored for a particular job.

A list of dicts is returned. The dict for each file will include the following keys: Pathname ... the absolute pathname for the file on the launch machine Size ....... the file size in bytes Hash ....... the SHA1 hash of the file's contents Type ....... 'input', 'output', or 'other' Link ....... the download URL for the file

get(self, endpoint, **kwargs)

 

Submit a GET request to the specified endpoint. Query parameters can be passed in as keyword arguments.

delete(self, endpoint, **kwargs)

 

Submit a DELETE request to the specified endpoint. Query parameters can be passed in as keyword arguments.

head(self, endpoint, **kwargs)

 

Submit a HEAD request to the specified endpoint. Query parameters can be passed in as keyword arguments.

post(self, endpoint, body, **kwargs)

 

Submit a POST request to the specified endpoint, with the given request body. Query parameters can be passed in as keyword arguments.

The body may be a file-like object.