From b9593ccd1281d97a20e0cd4c91a39d154b5fe01e Mon Sep 17 00:00:00 2001 From: Aakaash Meduri Date: Mon, 25 Mar 2024 19:20:11 -0400 Subject: [PATCH 1/4] user schema updated --- gateway/lab-bio-api-spec.json | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/gateway/lab-bio-api-spec.json b/gateway/lab-bio-api-spec.json index 5e071e8f6..c7ef90256 100644 --- a/gateway/lab-bio-api-spec.json +++ b/gateway/lab-bio-api-spec.json @@ -976,7 +976,38 @@ "type": "object", "properties": { "walletAddress": { - "type": "string" + "type": "string", + "format": "varchar(42)", + "description": "The user's wallet address, serving as the primary key." + }, + "did": { + "type": "string", + "format": "varchar(255)", + "description": "The user's decentralized identifier." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp indicating when the user was created." + }, + "apiKeys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/APIKey" + }, + "description": "The list of API keys associated with the user." + }, + "admin": { + "type": "boolean", + "default": false, + "description": "Indicates whether the user has admin privileges." + }, + "userDatafiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataFile" + }, + "description": "The list of data files associated with the user." } } }, From 7c817ce7ecd7b88ab9295b37766f8f236d95665f Mon Sep 17 00:00:00 2001 From: Aakaash Meduri Date: Mon, 25 Mar 2024 19:28:21 -0400 Subject: [PATCH 2/4] job schema updated --- gateway/lab-bio-api-spec.json | 86 +++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/gateway/lab-bio-api-spec.json b/gateway/lab-bio-api-spec.json index c7ef90256..e9b68c061 100644 --- a/gateway/lab-bio-api-spec.json +++ b/gateway/lab-bio-api-spec.json @@ -1115,41 +1115,109 @@ "Job": { "type": "object", "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The unique identifier of the job." + }, "bacalhauJobID": { - "type": "string" + "type": "string", + "format": "varchar(255)", + "description": "The ID of the associated Bacalhau job." }, "state": { - "type": "string" + "type": "string", + "format": "varchar(255)", + "enum": [ + "queued", + "running", + "failed", + "completed" + ], + "default": "queued", + "description": "The current state of the job." }, "error": { - "type": "string" + "type": "string", + "description": "The error message associated with the job, if any." }, "walletAddress": { - "type": "string" + "type": "string", + "format": "varchar(255)", + "description": "The wallet address associated with the job." }, "toolID": { - "type": "string" + "type": "string", + "format": "varchar(255)", + "description": "The ID of the tool used for the job." }, "tool": { "$ref": "#/components/schemas/Tool" }, "flowID": { - "type": "string" + "type": "integer", + "format": "int64", + "description": "The ID of the flow associated with the job." }, "flow": { "$ref": "#/components/schemas/Flow" }, "inputs": { + "type": "object", + "description": "The inputs for the job." + }, + "inputFiles": { "type": "array", "items": { "$ref": "#/components/schemas/DataFile" - } + }, + "description": "The list of input files for the job." }, - "outputs": { + "outputFiles": { "type": "array", "items": { "$ref": "#/components/schemas/DataFile" - } + }, + "description": "The list of output files generated by the job." + }, + "queue": { + "type": "string", + "format": "varchar(255)", + "enum": [ + "cpu", + "gpu" + ], + "description": "The queue type for the job." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp indicating when the job was created." + }, + "startedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp indicating when the job started." + }, + "completedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp indicating when the job was completed." + }, + "annotations": { + "type": "string", + "format": "varchar(255)", + "description": "Additional annotations associated with the job." + }, + "jobUUID": { + "type": "string", + "format": "uuid", + "description": "The unique identifier of the job." + }, + "public": { + "type": "boolean", + "default": false, + "description": "Indicates whether the job is publicly accessible." } } }, From ed20e322d00c530ea3ae9418e8dd5a625d538c23 Mon Sep 17 00:00:00 2001 From: Aakaash Meduri Date: Mon, 25 Mar 2024 19:41:25 -0400 Subject: [PATCH 3/4] datafile schema updated --- gateway/lab-bio-api-spec.json | 38 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/gateway/lab-bio-api-spec.json b/gateway/lab-bio-api-spec.json index e9b68c061..5e311f18b 100644 --- a/gateway/lab-bio-api-spec.json +++ b/gateway/lab-bio-api-spec.json @@ -1060,35 +1060,29 @@ "type": "object", "properties": { "cid": { - "type": "string" + "type": "string", + "format": "varchar(255)", + "description": "The content identifier of the data file, serving as the primary key." }, "walletAddress": { - "type": "string" + "type": "string", + "format": "varchar(42)", + "description": "The wallet address associated with the data file." }, "filename": { - "type": "string" - }, - "jobInputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Job" - } - }, - "jobOutputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Job" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - } + "type": "string", + "format": "varchar(255)", + "description": "The name of the data file." }, "timestamp": { "type": "string", - "format": "date-time" + "format": "date-time", + "description": "The timestamp associated with the data file." + }, + "public": { + "type": "boolean", + "default": false, + "description": "Indicates whether the data file is publicly accessible." } } }, From 41e438847c0e2c9555cd4da2ac21936223114c8c Mon Sep 17 00:00:00 2001 From: Aakaash Meduri Date: Mon, 25 Mar 2024 19:43:31 -0400 Subject: [PATCH 4/4] user and job schemas refactored to exclude join table declarations in spec schema definitions --- gateway/lab-bio-api-spec.json | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/gateway/lab-bio-api-spec.json b/gateway/lab-bio-api-spec.json index 5e311f18b..4c32f1abd 100644 --- a/gateway/lab-bio-api-spec.json +++ b/gateway/lab-bio-api-spec.json @@ -1001,13 +1001,6 @@ "type": "boolean", "default": false, "description": "Indicates whether the user has admin privileges." - }, - "userDatafiles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataFile" - }, - "description": "The list of data files associated with the user." } } }, @@ -1160,20 +1153,6 @@ "type": "object", "description": "The inputs for the job." }, - "inputFiles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataFile" - }, - "description": "The list of input files for the job." - }, - "outputFiles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataFile" - }, - "description": "The list of output files generated by the job." - }, "queue": { "type": "string", "format": "varchar(255)",