Skip to content

Chamberlain API

Vidya Akavoor edited this page Aug 30, 2021 · 4 revisions

Workflow Initiation end points

/api/submit

  • POST

This will send requests to start a workflow and cardinals

request format:

{
  "party_count": 3,
  "party_list": [1,2,3],
  "dataset_id": "HRI107",
  "operation": "std-dev"
}

response:

{
  "MSG" : null
}

Database CRUD end points

Workflows

/api/workflow

  • POST

This will insert into the workflows table in the database

request format:

{
  "worklowId":"WK103",
  "operationName": "SUM",
  "datasetId":"HRI0",
  "sourceBucket":"test-bucket",
  "sourceKey":"some/path/here",
  "description":"some description"
}

response:

{
  "MSG" : "successful"
}
  • GET

This will return all entries in the workflows table from the database.

response:


{
  "workflows" : list of all workflows 
}

  • PUT

This will modify the entry with the provided workflowId in the workflows table in the database. All fields that need to be modified should be included in the request.

request format:

{
  "worklowId":"WK104",
  "operationName": "MEAN"
}

response:

{
  "MSG" : "successful"
}

/api/workflow/<workflowId>

  • GET

This will return the entry with the workflowId from the workflows table in the database.

response:

{
  "workflow" : workflow in json
}
  • DELETE

This will delete the entry with the workflowId in the workflows table in the database.

response:

{
  "MSG" : "successful"
}

Datasets

/api/dataset

  • POST

This will insert into the datasets table in the database

request format:

{
  "pid": 1,
  "datasetId":"HRI101",
  "datasetSchema": "age,location,height",
  "sourceBucket":"bucket-name",
  "sourceKey":"path/to/data/",
  "backend":"backend-name",
  "parameters":"{ "bigNumber": False, "negativeNumber":False, "fixedPoint":False, "integerDigits":0, "decimalDigits": 0, "ZP": 16777729}", # stringified dict of parameters
  "description":"some description"
}

response:

{
  "MSG" : "successful"
}
  • GET

This will return all entries in the datasets table from the database.

response:

{
  "datasets" : list of all datasets
}

  • PUT

This will modify the entry with the provided datasetId in the datasets table in the database. All fields that need to be modified should be included in the request.

request format:

{
  "datasetId":"HRI004",
  "datasetSchema": "a,b,c"
}

response:

{
  "MSG" : "successful"
}

/api/dataset/<datasetId>

  • GET

This will return the entry with the datasetId from the datasets table in the database.

response:

{
  "dataset" : dataset in json
}
  • DELETE

This will delete the entries with the datasetId in the datasets table in the database.

response:

{
  "MSG" : "successful"
}

Cardinals

/api/cardinal

  • POST

This will insert into the cardinals table in the database

request format:

{
  "cardinalId":"cardinal007",
  "cardinalIp": "12.334.56.78",
  "description": "some description",
  "destination": "bucket-name"
}

response:

{
  "MSG" : "successful"
}
  • GET

This will return all entries in the cardinals table from the database.

response:

{
  "cardinals" : list of all cardinals
}

  • PUT

This will modify the entry with the provided cardinalId in the cardinals table in the database. All fields that need to be modified should be included in the request.

request format:

{
  "cardinalId":"cardinal004",
  "cardinalIp": "123.456.7.8"
}

response:

{
  "MSG" : "successful"
}

/api/cardinal/<cardinalId>

  • GET

This will return the entry with the cardinalId from the cardinals table in the database.

response:

{
  "cardinal" : cardinal in json
}
  • DELETE

This will delete the entry with the cardinalId in the cardinals table in the database.

response:

{
  "MSG" : "successful"
}

Workflow Relationships

/api/workflow-relationship

  • POST

This will insert into the workflowRelationships table in the database

request format:

{
  "datasetId": "HRI001",
  "workflowId": "WK103",
  "description": "some description"
}

response:

{
  "MSG" : "successful"
}
  • GET

This will return all entries in the workflowRelationships table from the database.

response:

{
  "workflow_relationships" : list of all workflowRelationships
}

  • PUT

This will modify the entry with the provided workflowRelationshipId in the workflowRelationships table in the database. All fields that need to be modified should be included in the request.

request format:

{
  "workflowRelationshipId":"WR007",
  "datasetId": "HRI001",
  "workflowId": "WK103"
}

response:

{
  "MSG" : "successful"
}

/api/workflow-relationship/<workflowRelationshipId>

  • GET

This will return the entry with the workflowRelationshipId from the workflowRelationships table in the database.

response:

{
  "workflow_relationship" : workflowRelationship in json
}
  • DELETE

This will delete the entry with the workflowRelationshipId in the workflowRelationships table in the database.

response:

{
  "MSG" : "successful"
}

Storage Relationships

/api/storage-relationship

  • POST

This will insert into the storageRelationships table in the database

request format:

{
  "storageRelationshipId":"ST007",
  "datasetId": "HRI001",
  "cardinals":"cardinal023,cardinal346,cardinal541",
  "description":"some description""
}

response:

{
  "MSG" : "successful"
}
  • GET

This will return all entries in the storageRelationships table from the database.

response:

{
  "storage_relationships" : list of all storageRelationships
}

  • PUT

This will modify the entry with the provided storageRelationshipId in the storageRelationships table in the database. All fields that need to be modified should be included in the request.

request format:

{
  "storageRelationshipId":"ST007",
  "datasetId": "HRI001"
}

response:

{
  "MSG" : "successful"
}

/api/storage-relationship/<storageRelationshipId>

  • GET

This will return the entry with the storageRelationshipId from the storageRelationships table in the database.

response:

{
  "storage_relationship" : storageRelationship in json
}
  • DELETE

This will delete the entry with the storageRelationshipId in the storageRelationships table in the database.

response:

{
  "MSG" : "successful"
}