push_cache
Description
This endpoint writes a data record, containing 'key' and 'val' fields, into the cache database.
The cache database is for ephemeral working data that experiments use during their execution, in contrast to the data database which is for permanent data produced by an experiment which is to be saved in the long term.
Arguments:
'key' -- is used to retrieve the record using the pull_cache endpoint 'val' -- other data in the record. Can be any type of object MongoDB accepts.
Simple Example
keyval = "unit_test"+str(uuid.uuid1())
dataval = str(uuid.uuid1())
resp = pq.push_cache({'key':keyval,'val':dataval},remote=True)
Simple Example Output
Failure Examples
keyval = "unit_test"+str(uuid.uuid1())
resp = pq.push_cache({'key':keyval},remote=True)
Failure Examples Output
Three Examples
keyval = "unit_test"+str(uuid.uuid1())
dataval = ['10','12','14','16']
resp = pq.push_cache({'key':keyval,'val':dataval, 'spurious':'asdf'},remote=True)
####################################
keyval = "unit_test"+str(uuid.uuid1())
dataval = {'field1':'asdf','field2':{'subfield1':'jkl;','subfield2':1234}}
resp = pq.push_cache({'key':keyval,'val':dataval},remote=True)