Acquire.Access._jobsheet module

class JobSheet(job=None, authorisation=None)[source]

Bases: object

This class holds a complete record of a job that the access service has been asked to perform.

authorisation()[source]

Return the original authorisation for this job

Returns:If no uid set None, else Authorisation
Return type:None or Authorisation
static from_data(data)[source]

Return a JobSheet constructed from the passed JSON-deserialised dictionary

Parameters:data – JSON data from which to create object
is_null()[source]

Return whether or not this JobSheet is null

Returns:True if uid is set, False otherwise
Return type:bool
job()[source]

Return the original job request

Returns:If no uid set None, else job request
Return type:None or Request
static load(uid)[source]

Return the JobSheet with specified uid loaded from the ObjectStore

Returns:
JobSheet: an instance of a JobSheet with the specified uid
request_services()[source]

Request all of the services needed to perform the job. This will contract a compute service and a storage service to run the job.

The storage service will provide (1) a file upload pre-authenticated request (PAR) to enable the user to upload the input, and (2) a bucket write PAR to enable the compute service to write the output

The compute service will be supplied with the bucket write PAR from the storage service and will supply a run calculation PAR to enable the user to trigger the start of the job

This returns the upload PAR the user must use to upload the input, the run PAR that the user must call after uploading input to trigger the start of the calculation, and the expiry date when both of these PARs will become invalid (i.e. the user must trigger both of them before that date)

Returns:file upload PAR, bucket write PAR and a datetime object set to 1 hour in the future
Return type:tuple (PAR, PAR, datetime)
save()[source]

Save this JobSheet to the object store

Returns:None
set_payment(cheque)[source]

Pass in and cash that contains the source of value of paying for this job. This will cash the cheque and store the value within credit notes held in this job sheet

Parameters:cheque – transfer method for paying for service
to_data()[source]

Get a JSON-serialisable dictionary of this object

Returns:this JobSheet converted into a JSON serialisable dictionary
Return type:dict
total_cost()[source]

Return the total maximum quoted cost for this job. The total cost to run the job must not exceed this

TODO - should this just return constants?

Returns:0 if no uid is set, else 10
Return type:int
uid()[source]

Return the UID of this JobSheet

Returns:UID of the object
Return type:str