Cardinal API - multiparty/cardinal GitHub Wiki

The following API endpoints can be used on a cardinal server

POST: /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,                                          
                                                       
}

response:

{
    "MSG": "OK"
}

OR

{
    "ERR": {error from server}
}

POST: /api/delete_dataset

Submit a dataset to the database.

{                                                      
    "dataset_id": "HRI0",    
    "PID": 2,                                          
                                                       
}

response:

{
    "MSG": "OK"
}

OR

{
    "ERR": "Error deleting dataset"
}

POST: /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"](/multiparty/cardinal/wiki/2,-"23.45.67.89"],-[3,-"34.56.78.90"),
    "jiff_server": "45.67.89.01"                                
}                

response:

{
    "MSG": "Party X cannot start a JIFF server. Send request to party 1."
}

OR

{
    "MSG": "Workflow with name X already has a JIFF server."
}

OR

{
    "JIFF_SERVER_IP": IP
}

POST: /api/submit

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

{
    "workflow_name": "name",
    "dataset_id": "dataset_id",
    "operation": "operation",
    "cardinal_ip": IP (with port),
    "workflow_source_bucket": "bucket-name",
    "workflow_source_key": "file/path/within/bucket",
    "PID": PID,
    "other_cardinals": [2, "12.34.56:80"], [3, "98.76.54:80"](/multiparty/cardinal/wiki/2,-"12.34.56:80"],-[3,-"98.76.54:80"),
    "jiff_server": jiff_server_IP (returned from submit_jiff_server endpoint),
    "bigNumber": False, 
    "negativeNumber":False, 
    "fixedPoint":False, 
    "integerDigits":0, 
    "decimalDigits": 0, 
    "ZP": 16777729
}                                                              

response:

{
    "ID": workflow name
    "DESTINATION": S3 URI (only sent back by party 1)
}

OR

{
    "MSG": ERR:{error from server}
}

GET: /api/status

Use to query whether a workflow is still running

{                                    
    "workflow_name": "test-workflow",
}      

response:

{
    "status": {one of "Still running" or "Not running"}
}

POST: /api/submit_ip_address

Deprecated

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"  
}