Skip to content

Cardinal API

goutern edited this page Aug 9, 2021 · 6 revisions

The following API endpoints can be used on a cardinal server

/api/submit_dataset

Submit a dataset to the database.

{                                                      
    "dataset_id": "HRI0",
    "source_bucket": "HRI0",                           
    "source_key": "HRIO/workflow/std_dev_HRI0.py",     
    "pid": 2,                                          
                                                       
}

/api/start_jiff_server

Submit workflow information to start a Jiff Server. Returns the started Jiff server's IP.

{                                                               
    "workflow_name": "test-workflow",                           
    "dataset_id": "HRI107",                                     
    "operation": "std-dev",                                     
    "PID": 1,                                                    
    "other_cardinals": [[2, "23.45.67.89"], [3, "34.56.78.90"]],
    "jiff_server": "45.67.89.01"                                
}                

/api/submit

Use to start processing the workflow. Chamberlain submits this information from its database.

{
    "workflow_name": computation_settings['workflow_name'],
    "dataset_id": computation_settings['dataset_id'],
    "operation": computation_settings['operation'],
    "cardinal_ip": IP,
    "workflow_source_bucket": computation_settings['workflow_source_bucket'],
    "workflow_source_key": computation_settings['workflow_source_key'],
    "PID": PID,
    "other_cardinals": [x for x in cardinals if not x == (PID, IP)],
    "jiff_server": jiff_server_IP,
    "bigNumber": False, 
    "negativeNumber":False, 
    "fixedPoint":False, 
    "integerDigits":0, 
    "decimalDigits": 0, 
    "ZP": 16777729
}                                                              

/api/submit_ip_address

This is internal and deprecated. Cardinal instances now submit directly to the database. Posting to this endpoint will still submit a pod to the database, but it should be unnecessary.

{                                    
    "workflow_name": "test-workflow",
    "from_pid": 2,                   
    "pod_ip_address": "xx.xx.xx.xx"  
}      

/api/submit_workflow

Deprecated

Submit a workflow to the database.

{                                                                                
    "source_key": "HRIO/workflow/std_dev_HRI0.py",
    "source_bucket": "HRI0",
    "operation": "stv_dev",
    "dataset_id": "HRI0",
    "big_number": true,
    "fixed_point": true,
    "decimal_digits": 2,
    "integer_digits": 2,
    "negative_number": 2,
    "zp: : true                                                                          
}
Clone this wiki locally