aggregator.pumproom.faucet

class aggregator.pumproom.faucet.Faucet(task, *args, **kwargs)[source]

Bases: ambassador.transport.Transport

endpoint

Pipe

emissary

Plumber

user

AppUser

cargo

Cargo

record

Invoice

task

str

create_record(stamp, obj)[source]

Create a record of the response

Parameters:
Returns:

Return type:

None

is_obsolete()[source]

Returns a Boolean indicating whether a more recent call has been made to the same endpoint with the same credentials.

load_cargo(data)[source]
process_request(obj)[source]
Parameters:obj (ReservoirQuery) –
Returns:
Return type:Cargo

Takes an a ReservoirQuery, formats and submits it to the API, returns a Cargo object. This method needs to be implemented in derived classes so it can be customized for specific APIs.

process_results()[source]
send_to_chutes(data)[source]
stash_data(data)[source]

For ad hoc searches, data from each endpoint should be temporarily saved in a separate collection associated with the user making the request.