diff --git a/api/openapi.json b/api/openapi.json index 7965ae50..2f12ad9a 100644 --- a/api/openapi.json +++ b/api/openapi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.2", + "openapi": "3.1.0", "info": { "title": "osparc.io public API", "description": "osparc-simcore public API specifications", @@ -316,26 +316,38 @@ "summary": "Upload File", "description": "Uploads a single file to the system", "operationId": "upload_file", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "content-length", + "in": "header", "required": false, "schema": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Content-Length" - }, - "name": "content-length", - "in": "header" + } } ], "requestBody": { + "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_file_v0_files_content_put" } } - }, - "required": true + } }, "responses": { "200": { @@ -418,12 +430,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } }, "post": { "tags": [ @@ -432,15 +439,20 @@ "summary": "Get Upload Links", "description": "Get upload links for uploading a file to storage", "operationId": "get_upload_links", + "security": [ + { + "HTTPBasic": [] + } + ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientFile" } } - }, - "required": true + } }, "responses": { "200": { @@ -523,12 +535,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/files/{file_id}": { @@ -539,16 +546,21 @@ "summary": "Get File", "description": "Gets metadata for a given file resource", "operationId": "get_file", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "file_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" - }, - "name": "file_id", - "in": "path" + } } ], "responses": { @@ -632,12 +644,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } }, "delete": { "tags": [ @@ -645,16 +652,21 @@ ], "summary": "Delete File", "operationId": "delete_file", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "file_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" - }, - "name": "file_id", - "in": "path" + } } ], "responses": { @@ -736,12 +748,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/files:search": { @@ -752,49 +759,68 @@ "summary": "Search Files Page", "description": "Search files", "operationId": "search_files_page", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "sha256_checksum", + "in": "query", "required": false, "schema": { - "type": "string", - "pattern": "^[a-fA-F0-9]{64}$", + "anyOf": [ + { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$" + }, + { + "type": "null" + } + ], "title": "Sha256 Checksum" - }, - "name": "sha256_checksum", - "in": "query" + } }, { + "name": "file_id", + "in": "query", "required": false, "schema": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "File Id" - }, - "name": "file_id", - "in": "query" + } }, { + "name": "limit", + "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, - "title": "Limit", - "default": 50 - }, - "name": "limit", - "in": "query" + "default": 50, + "title": "Limit" + } }, { + "name": "offset", + "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, - "title": "Offset", - "default": 0 - }, - "name": "offset", - "in": "query" + "default": 0, + "title": "Offset" + } } ], "responses": { @@ -878,12 +904,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/files/{file_id}:abort": { @@ -893,27 +914,32 @@ ], "summary": "Abort Multipart Upload", "operationId": "abort_multipart_upload", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "file_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" - }, - "name": "file_id", - "in": "path" + } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Body_abort_multipart_upload_v0_files__file_id__abort_post" } } - }, - "required": true + } }, "responses": { "200": { @@ -984,12 +1010,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/files/{file_id}:complete": { @@ -999,27 +1020,32 @@ ], "summary": "Complete Multipart Upload", "operationId": "complete_multipart_upload", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "file_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" - }, - "name": "file_id", - "in": "path" + } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Body_complete_multipart_upload_v0_files__file_id__complete_post" } } - }, - "required": true + } }, "responses": { "200": { @@ -1102,12 +1128,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/files/{file_id}/content": { @@ -1117,16 +1138,21 @@ ], "summary": "Download File", "operationId": "download_file", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "file_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "File Id" - }, - "name": "file_id", - "in": "path" + } } ], "responses": { @@ -1194,7 +1220,6 @@ } }, "200": { - "description": "Returns a arbitrary binary data", "content": { "application/octet-stream": { "schema": { @@ -1207,7 +1232,8 @@ "type": "string" } } - } + }, + "description": "Returns a arbitrary binary data" }, "422": { "description": "Validation Error", @@ -1219,12 +1245,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers": { @@ -1417,16 +1438,21 @@ "summary": "Get Latest Release of a Solver", "description": "Gets latest release of a solver", "operationId": "get_solver", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } } ], "responses": { @@ -1510,12 +1536,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases": { @@ -1526,16 +1547,21 @@ "summary": "List Solver Releases", "description": "Lists all releases of a given (one) solver\n\nSEE get_solver_releases_page for a paginated version of this function", "operationId": "list_solver_releases", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } } ], "responses": { @@ -1544,10 +1570,10 @@ "content": { "application/json": { "schema": { + "type": "array", "items": { "$ref": "#/components/schemas/Solver" }, - "type": "array", "title": "Response List Solver Releases V0 Solvers Solver Key Releases Get" } } @@ -1623,12 +1649,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}": { @@ -1639,26 +1660,31 @@ "summary": "Get Solver Release", "description": "Gets a specific release of a solver", "operationId": "get_solver_release", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } } ], "responses": { @@ -1742,12 +1768,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/ports": { @@ -1758,26 +1779,31 @@ "summary": "List Solver Ports", "description": "Lists inputs and outputs of a given solver\n\nNew in *version 0.5.0*", "operationId": "list_solver_ports", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } } ], "responses": { @@ -1861,12 +1887,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/pricing_plan": { @@ -1877,26 +1898,31 @@ "summary": "Get Solver Pricing Plan", "description": "Gets solver pricing plan\n\nNew in *version 0.7*", "operationId": "get_solver_pricing_plan", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } } ], "responses": { @@ -1980,55 +2006,105 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs": { - "get": { + "post": { "tags": [ "solvers" ], - "summary": "List Jobs", - "description": "List of jobs in a specific released solver (limited to 20 jobs)\n\n- DEPRECATION: This implementation and returned values are deprecated and the will be replaced by that of get_jobs_page\n- SEE `get_jobs_page` for paginated version of this function", - "operationId": "list_jobs", + "summary": "Create Job", + "description": "Creates a job in a specific release with given inputs.\n\nNOTE: This operation does **not** start the job", + "operationId": "create_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } + }, + { + "name": "hidden", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "default": true, + "title": "Hidden" + } + }, + { + "name": "x-simcore-parent-project-uuid", + "in": "header", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "title": "X-Simcore-Parent-Project-Uuid" + } + }, + { + "name": "x-simcore-parent-node-id", + "in": "header", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "title": "X-Simcore-Parent-Node-Id" + } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobInputs" + } + } + } + }, "responses": { - "200": { + "201": { "description": "Successful Response", "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/Job" - }, - "type": "array", - "title": "Response List Jobs V0 Solvers Solver Key Releases Version Jobs Get" + "$ref": "#/components/schemas/Job" } } } @@ -2113,89 +2189,53 @@ } } } - }, + } + }, + "get": { + "tags": [ + "solvers" + ], + "summary": "List Jobs", + "description": "List of jobs in a specific released solver (limited to 20 jobs)\n\n- DEPRECATION: This implementation and returned values are deprecated and the will be replaced by that of get_jobs_page\n- SEE `get_jobs_page` for paginated version of this function", + "operationId": "list_jobs", "security": [ { "HTTPBasic": [] } - ] - }, - "post": { - "tags": [ - "solvers" ], - "summary": "Create Job", - "description": "Creates a job in a specific release with given inputs.\n\nNOTE: This operation does **not** start the job", - "operationId": "create_job", "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" - }, - { - "required": false, - "schema": { - "type": "boolean", - "title": "Hidden", - "default": true - }, - "name": "hidden", - "in": "query" - }, - { - "required": false, - "schema": { - "type": "string", - "format": "uuid", - "title": "X-Simcore-Parent-Project-Uuid" - }, - "name": "x-simcore-parent-project-uuid", - "in": "header" - }, - { - "required": false, - "schema": { - "type": "string", - "format": "uuid", - "title": "X-Simcore-Parent-Node-Id" - }, - "name": "x-simcore-parent-node-id", - "in": "header" + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JobInputs" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Job" + "type": "array", + "items": { + "$ref": "#/components/schemas/Job" + }, + "title": "Response List Jobs V0 Solvers Solver Key Releases Version Jobs Get" } } } @@ -2280,64 +2320,57 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}": { - "get": { + "delete": { "tags": [ "solvers" ], - "summary": "Get Job", - "description": "Gets job of a given solver", - "operationId": "get_job", + "summary": "Delete Job", + "description": "Deletes an existing solver job\n\nNew in *version 0.7*", + "operationId": "delete_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Job" - } - } - } + "204": { + "description": "Successful Response" }, "402": { "description": "Payment required", @@ -2419,55 +2452,62 @@ } } } - }, + } + }, + "get": { + "tags": [ + "solvers" + ], + "summary": "Get Job", + "description": "Gets job of a given solver", + "operationId": "get_job", "security": [ { "HTTPBasic": [] } - ] - }, - "delete": { - "tags": [ - "solvers" ], - "summary": "Delete Job", - "description": "Deletes an existing solver job\n\nNew in *version 0.7*", - "operationId": "delete_job", "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { - "204": { - "description": "Successful Response" + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Job" + } + } + } }, "402": { "description": "Payment required", @@ -2549,12 +2589,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:start": { @@ -2565,46 +2600,58 @@ "summary": "Start Job", "description": "Starts job job_id created with the solver solver_key:version\n\nAdded in *version 0.4.3*: query parameter `cluster_id`\nAdded in *version 0.6*: responds with a 202 when successfully starting a computation", "operationId": "start_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } }, { + "name": "cluster_id", + "in": "query", "required": false, "schema": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Cluster Id" - }, - "name": "cluster_id", - "in": "query" + } } ], "responses": { @@ -2718,12 +2765,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:stop": { @@ -2733,36 +2775,41 @@ ], "summary": "Stop Job", "operationId": "stop_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -2856,12 +2903,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}:inspect": { @@ -2871,36 +2913,41 @@ ], "summary": "Inspect Job", "operationId": "inspect_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -2994,54 +3041,64 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/metadata": { - "get": { + "patch": { "tags": [ "solvers" ], - "summary": "Get Job Custom Metadata", - "description": "Gets custom metadata from a job\n\nNew in *version 0.7*", - "operationId": "get_job_custom_metadata", + "summary": "Replace Job Custom Metadata", + "description": "Updates custom metadata from a job\n\nNew in *version 0.7*", + "operationId": "replace_job_custom_metadata", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobMetadataUpdate" + } + } + } + }, "responses": { "200": { "description": "Successful Response", @@ -3123,62 +3180,52 @@ } } } - }, + } + }, + "get": { + "tags": [ + "solvers" + ], + "summary": "Get Job Custom Metadata", + "description": "Gets custom metadata from a job\n\nNew in *version 0.7*", + "operationId": "get_job_custom_metadata", "security": [ { "HTTPBasic": [] } - ] - }, - "patch": { - "tags": [ - "solvers" ], - "summary": "Replace Job Custom Metadata", - "description": "Updates custom metadata from a job\n\nNew in *version 0.7*", - "operationId": "replace_job_custom_metadata", "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/JobMetadataUpdate" - } - } - }, - "required": true - }, "responses": { "200": { "description": "Successful Response", @@ -3260,12 +3307,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/page": { @@ -3276,49 +3318,54 @@ "summary": "Get Jobs Page", "description": "List of jobs on a specific released solver (includes pagination)\n\nNew in *version 0.7*", "operationId": "get_jobs_page", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "limit", + "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, - "title": "Limit", - "default": 50 - }, - "name": "limit", - "in": "query" + "default": 50, + "title": "Limit" + } }, { + "name": "offset", + "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, - "title": "Offset", - "default": 0 - }, - "name": "offset", - "in": "query" + "default": 0, + "title": "Offset" + } } ], "responses": { @@ -3412,12 +3459,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs": { @@ -3427,36 +3469,41 @@ ], "summary": "Get Job Outputs", "operationId": "get_job_outputs", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -3550,12 +3597,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/outputs/logfile": { @@ -3566,36 +3608,41 @@ "summary": "Get Job Output Logfile", "description": "Special extra output with persistent logs file for the solver run.\n\n**NOTE**: this is not a log stream but a predefined output that is only\navailable after the job is done.\n\nNew in *version 0.4.0*", "operationId": "get_job_output_logfile", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -3603,7 +3650,6 @@ "description": "Successful Response" }, "200": { - "description": "Returns a log file", "content": { "application/octet-stream": { "schema": { @@ -3622,7 +3668,8 @@ "type": "string" } } - } + }, + "description": "Returns a log file" }, "404": { "description": "Log not found" @@ -3687,12 +3734,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/wallet": { @@ -3703,36 +3745,41 @@ "summary": "Get Job Wallet", "description": "Get job wallet\n\nNew in *version 0.7*", "operationId": "get_job_wallet", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -3826,12 +3873,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/pricing_unit": { @@ -3842,36 +3884,41 @@ "summary": "Get Job Pricing Unit", "description": "Get job pricing unit\n\nNew in *version 0.7*", "operationId": "get_job_pricing_unit", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -3955,12 +4002,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/solvers/{solver_key}/releases/{version}/jobs/{job_id}/logstream": { @@ -3970,36 +4012,41 @@ ], "summary": "Get Log Stream", "operationId": "get_log_stream", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "solver_key", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^simcore/services/comp/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$", "title": "Solver Key" - }, - "name": "solver_key", - "in": "path" + } }, { + "name": "version", + "in": "path", "required": true, "schema": { "type": "string", "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$", "title": "Version" - }, - "name": "version", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4008,6 +4055,7 @@ "content": { "application/x-ndjson": { "schema": { + "type": "string", "anyOf": [ { "$ref": "#/components/schemas/JobLog" @@ -4016,7 +4064,6 @@ "$ref": "#/components/schemas/ErrorGet" } ], - "type": "string", "title": "Response 200 Get Log Stream V0 Solvers Solver Key Releases Version Jobs Job Id Logstream Get" } } @@ -4092,12 +4139,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies": { @@ -4108,29 +4150,34 @@ "summary": "List Studies", "description": "New in *version 0.5.0*", "operationId": "list_studies", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "limit", + "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, - "title": "Limit", - "default": 50 - }, - "name": "limit", - "in": "query" + "default": 50, + "title": "Limit" + } }, { + "name": "offset", + "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, - "title": "Offset", - "default": 0 - }, - "name": "offset", - "in": "query" + "default": 0, + "title": "Offset" + } } ], "responses": { @@ -4154,12 +4201,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}": { @@ -4170,16 +4212,21 @@ "summary": "Get Study", "description": "New in *version 0.5.0*", "operationId": "get_study", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } } ], "responses": { @@ -4213,12 +4260,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}:clone": { @@ -4228,36 +4270,55 @@ ], "summary": "Clone Study", "operationId": "clone_study", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "x-simcore-parent-project-uuid", + "in": "header", "required": false, "schema": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "X-Simcore-Parent-Project-Uuid" - }, - "name": "x-simcore-parent-project-uuid", - "in": "header" + } }, { + "name": "x-simcore-parent-node-id", + "in": "header", "required": false, "schema": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "X-Simcore-Parent-Node-Id" - }, - "name": "x-simcore-parent-node-id", - "in": "header" + } } ], "responses": { @@ -4291,12 +4352,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/ports": { @@ -4307,16 +4363,21 @@ "summary": "List Study Ports", "description": "Lists metadata on ports of a given study\n\nNew in *version 0.5.0*", "operationId": "list_study_ports", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } } ], "responses": { @@ -4350,12 +4411,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs": { @@ -4366,57 +4422,76 @@ "summary": "Create Study Job", "description": "hidden -- if True (default) hides project from UI", "operationId": "create_study_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "hidden", + "in": "query", "required": false, "schema": { "type": "boolean", - "title": "Hidden", - "default": true - }, - "name": "hidden", - "in": "query" + "default": true, + "title": "Hidden" + } }, { + "name": "x-simcore-parent-project-uuid", + "in": "header", "required": false, "schema": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "X-Simcore-Parent-Project-Uuid" - }, - "name": "x-simcore-parent-project-uuid", - "in": "header" + } }, { + "name": "x-simcore-parent-node-id", + "in": "header", "required": false, "schema": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "X-Simcore-Parent-Node-Id" - }, - "name": "x-simcore-parent-node-id", - "in": "header" + } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobInputs" } } - }, - "required": true + } }, "responses": { "200": { @@ -4439,12 +4514,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}": { @@ -4455,26 +4525,31 @@ "summary": "Delete Study Job", "description": "Deletes an existing study job", "operationId": "delete_study_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4482,14 +4557,14 @@ "description": "Successful Response" }, "404": { - "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorGet" } } - } + }, + "description": "Not Found" }, "422": { "description": "Validation Error", @@ -4501,12 +4576,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}:start": { @@ -4517,36 +4587,48 @@ "summary": "Start Study Job", "description": "Changed in *version 0.6.0*: Now responds with a 202 when successfully starting a computation", "operationId": "start_study_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } }, { + "name": "cluster_id", + "in": "query", "required": false, "schema": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Cluster Id" - }, - "name": "cluster_id", - "in": "query" + } } ], "responses": { @@ -4660,12 +4742,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}:stop": { @@ -4675,26 +4752,31 @@ ], "summary": "Stop Study Job", "operationId": "stop_study_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4718,12 +4800,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}:inspect": { @@ -4733,26 +4810,31 @@ ], "summary": "Inspect Study Job", "operationId": "inspect_study_job", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4776,12 +4858,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}/outputs": { @@ -4791,26 +4868,31 @@ ], "summary": "Get Study Job Outputs", "operationId": "get_study_job_outputs", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4834,12 +4916,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}/outputs/log-links": { @@ -4849,26 +4926,31 @@ ], "summary": "Get download links for study job log files", "operationId": "get_study_job_output_logfile", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4892,12 +4974,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/studies/{study_id}/jobs/{job_id}/metadata": { @@ -4908,26 +4985,31 @@ "summary": "Get Study Job Custom Metadata", "description": "Get custom metadata from a study's job\n\nNew in *version 0.7*", "operationId": "get_study_job_custom_metadata", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "responses": { @@ -4951,12 +5033,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } }, "put": { "tags": [ @@ -4965,37 +5042,42 @@ "summary": "Replace Study Job Custom Metadata", "description": "Changes custom metadata of a study's job\n\nNew in *version 0.7*", "operationId": "replace_study_job_custom_metadata", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "study_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Study Id" - }, - "name": "study_id", - "in": "path" + } }, { + "name": "job_id", + "in": "path", "required": true, "schema": { "type": "string", "format": "uuid", "title": "Job Id" - }, - "name": "job_id", - "in": "path" + } } ], "requestBody": { + "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobMetadataUpdate" } } - }, - "required": true + } }, "responses": { "200": { @@ -5018,12 +5100,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/wallets/default": { @@ -5131,15 +5208,20 @@ "summary": "Get Wallet", "description": "Get wallet\n\nNew in *version 0.7*", "operationId": "get_wallet", + "security": [ + { + "HTTPBasic": [] + } + ], "parameters": [ { + "name": "wallet_id", + "in": "path", "required": true, "schema": { "type": "integer", "title": "Wallet Id" - }, - "name": "wallet_id", - "in": "path" + } } ], "responses": { @@ -5233,12 +5315,7 @@ } } } - }, - "security": [ - { - "HTTPBasic": [] - } - ] + } } }, "/v0/credits/price": { @@ -5322,6 +5399,7 @@ }, "filesize": { "type": "integer", + "minimum": 0, "title": "Filesize", "description": "File size in bytes" }, @@ -5350,12 +5428,7 @@ "description": "The file resource id" }, "upload_schema": { - "allOf": [ - { - "$ref": "#/components/schemas/FileUploadData" - } - ], - "title": "Upload Schema", + "$ref": "#/components/schemas/FileUploadData", "description": "Schema for uploading file" } }, @@ -5400,18 +5473,39 @@ "description": "Name of the file with extension" }, "content_type": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Content Type", "description": "Guess of type content [EXPERIMENTAL]" }, "checksum": { - "type": "string", - "pattern": "^[a-fA-F0-9]{64}$", + "anyOf": [ + { + "type": "string", + "pattern": "^[a-fA-F0-9]{64}$" + }, + { + "type": "null" + } + ], "title": "Checksum", "description": "SHA256 hash of the file's content" }, "e_tag": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "E Tag", "description": "S3 entity tag" } @@ -5444,6 +5538,7 @@ "properties": { "chunk_size": { "type": "integer", + "minimum": 0, "title": "Chunk Size" }, "urls": { @@ -5475,14 +5570,28 @@ "title": "Productname" }, "usdPerCredit": { - "type": "number", - "minimum": 0.0, + "anyOf": [ + { + "type": "number", + "minimum": 0.0 + }, + { + "type": "null" + } + ], "title": "Usdpercredit", "description": "Price of a credit in USD. If None, then this product's price is UNDEFINED" }, "minPaymentAmountUsd": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Minpaymentamountusd", "description": "Minimum amount (included) in USD that can be paid for this productCan be None if this product's price is UNDEFINED" } @@ -5501,10 +5610,17 @@ "$ref": "#/components/schemas/UsersGroup" }, "organizations": { - "items": { - "$ref": "#/components/schemas/UsersGroup" - }, - "type": "array", + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/UsersGroup" + }, + "type": "array" + }, + { + "type": "null" + } + ], "title": "Organizations", "default": [] }, @@ -5562,26 +5678,47 @@ "description": "Runner that executes job" }, "url": { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], "title": "Url", "description": "Link to get this resource (self)" }, "runner_url": { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], "title": "Runner Url", "description": "Link to the solver's job (parent collection)" }, "outputs_url": { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], "title": "Outputs Url", "description": "Link to the job outputs (sub-collection)" } @@ -5599,14 +5736,14 @@ ], "title": "Job", "example": { + "created_at": "2021-01-22T23:59:52.322176", "id": "f622946d-fd29-35b9-a193-abdd1095167c", + "inputs_checksum": "12345", "name": "solvers/isolve/releases/1.3.4/jobs/f622946d-fd29-35b9-a193-abdd1095167c", + "outputs_url": "https://api.osparc.io/v0/solvers/isolve/releases/1.3.4/jobs/f622946d-fd29-35b9-a193-abdd1095167c/outputs", "runner_name": "solvers/isolve/releases/1.3.4", - "inputs_checksum": "12345", - "created_at": "2021-01-22T23:59:52.322176", - "url": "https://api.osparc.io/v0/solvers/isolve/releases/1.3.4/jobs/f622946d-fd29-35b9-a193-abdd1095167c", "runner_url": "https://api.osparc.io/v0/solvers/isolve/releases/1.3.4", - "outputs_url": "https://api.osparc.io/v0/solvers/isolve/releases/1.3.4/jobs/f622946d-fd29-35b9-a193-abdd1095167c/outputs" + "url": "https://api.osparc.io/v0/solvers/isolve/releases/1.3.4/jobs/f622946d-fd29-35b9-a193-abdd1095167c" } }, "JobInputs": { @@ -5632,6 +5769,9 @@ { "items": {}, "type": "array" + }, + { + "type": "null" } ] }, @@ -5646,14 +5786,14 @@ "title": "JobInputs", "example": { "values": { - "x": 4.33, - "n": 55, - "title": "Temperature", "enabled": true, "input_file": { "filename": "input.txt", "id": "0a3b2c56-dbcd-4871-b93b-d454b7883f9f" - } + }, + "n": 55, + "title": "Temperature", + "x": 4.33 } } }, @@ -5665,8 +5805,15 @@ "title": "Job Id" }, "node_id": { - "type": "string", - "format": "uuid", + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], "title": "Node Id" }, "log_level": { @@ -5690,11 +5837,11 @@ "title": "JobLog", "example": { "job_id": "145beae4-a3a8-4fde-adbb-4e8257c2c083", - "node_id": "3742215e-6756-48d2-8b73-4d043065309f", "log_level": 10, "messages": [ "PROGRESS: 5/10" - ] + ], + "node_id": "3742215e-6756-48d2-8b73-4d043065309f" } }, "JobLogsMap": { @@ -5744,10 +5891,17 @@ "description": "Custom key-value map" }, "url": { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], "title": "Url", "description": "Link to get this resource (self)" } @@ -5758,7 +5912,17 @@ "metadata", "url" ], - "title": "JobMetadata" + "title": "JobMetadata", + "example": { + "job_id": "3497e4de-0e69-41fb-b08f-7f3875a1ac4b", + "metadata": { + "bool": "true", + "float": "3.14", + "int": "42", + "str": "hej med dig" + }, + "url": "https://f02b2452-1dd8-4882-b673-af06373b41b3.fake" + } }, "JobMetadataUpdate": { "properties": { @@ -5785,7 +5949,15 @@ } }, "type": "object", - "title": "JobMetadataUpdate" + "title": "JobMetadataUpdate", + "example": { + "metadata": { + "bool": "true", + "float": "3.14", + "int": "42", + "str": "hej med dig" + } + } }, "JobOutputs": { "properties": { @@ -5816,6 +5988,9 @@ { "items": {}, "type": "array" + }, + { + "type": "null" } ] }, @@ -5832,14 +6007,14 @@ "example": { "job_id": "99d9ac65-9f10-4e2f-a433-b5e412bb037b", "results": { + "enabled": false, "maxSAR": 4.33, "n": 55, - "title": "Specific Absorption Rate", - "enabled": false, "output_file": { "filename": "sar_matrix.txt", "id": "0a3b2c56-dbcd-4871-b93b-d454b7883f9f" - } + }, + "title": "Specific Absorption Rate" } } }, @@ -5867,14 +6042,28 @@ "description": "Last modification timestamp of the solver job" }, "started_at": { - "type": "string", - "format": "date-time", + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], "title": "Started At", "description": "Timestamp that indicate the moment the solver starts execution or None if the event did not occur" }, "stopped_at": { - "type": "string", - "format": "date-time", + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], "title": "Stopped At", "description": "Timestamp at which the solver finished or killed execution or None if the event did not occur" } @@ -5888,41 +6077,78 @@ "title": "JobStatus", "example": { "job_id": "145beae4-a3a8-4fde-adbb-4e8257c2c083", - "state": "STARTED", "progress": 3, - "submitted_at": "2021-04-01 07:15:54.631007", - "started_at": "2021-04-01 07:16:43.670610" + "started_at": "2021-04-01 07:16:43.670610", + "state": "STARTED", + "submitted_at": "2021-04-01 07:15:54.631007" } }, "Links": { "properties": { "first": { - "type": "string", - "title": "First", - "example": "/api/v1/users?limit=1&offset1" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "First" }, "last": { - "type": "string", - "title": "Last", - "example": "/api/v1/users?limit=1&offset1" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last" }, "self": { - "type": "string", - "title": "Self", - "example": "/api/v1/users?limit=1&offset1" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Self" }, "next": { - "type": "string", - "title": "Next", - "example": "/api/v1/users?limit=1&offset1" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next" }, "prev": { - "type": "string", - "title": "Prev", - "example": "/api/v1/users?limit=1&offset1" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Prev" } }, "type": "object", + "required": [ + "first", + "last", + "self", + "next", + "prev" + ], "title": "Links" }, "LogLink": { @@ -5958,11 +6184,18 @@ "title": "Version" }, "released": { - "additionalProperties": { - "type": "string", - "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$" - }, - "type": "object", + "anyOf": [ + { + "additionalProperties": { + "type": "string", + "pattern": "^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*)){2}(-(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*)(\\.(0|[1-9]\\d*|\\d*[-a-zA-Z][-\\da-zA-Z]*))*)?(\\+[-\\da-zA-Z]+(\\.[-\\da-zA-Z-]+)*)?$" + }, + "type": "object" + }, + { + "type": "null" + } + ], "title": "Released", "description": "Maps every route's path tag with a released version" }, @@ -5990,14 +6223,14 @@ ], "title": "Meta", "example": { + "docs_dev_url": "https://api.osparc.io/dev/doc", + "docs_url": "https://api.osparc.io/dev/doc", "name": "simcore_service_foo", - "version": "2.4.45", "released": { "v1": "1.3.4", "v2": "2.4.45" }, - "docs_url": "https://api.osparc.io/dev/doc", - "docs_dev_url": "https://api.osparc.io/dev/doc" + "version": "2.4.45" } }, "OnePage_SolverPort_": { @@ -6010,8 +6243,15 @@ "title": "Items" }, "total": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Total" } }, @@ -6019,8 +6259,7 @@ "required": [ "items" ], - "title": "OnePage[SolverPort]", - "description": "A single page is used to envelope a small sequence that does not require\npagination\n\nIf total > MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE, we should consider extending this\nentrypoint to proper pagination" + "title": "OnePage[SolverPort]" }, "OnePage_StudyPort_": { "properties": { @@ -6032,8 +6271,15 @@ "title": "Items" }, "total": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Total" } }, @@ -6041,8 +6287,7 @@ "required": [ "items" ], - "title": "OnePage[StudyPort]", - "description": "A single page is used to envelope a small sequence that does not require\npagination\n\nIf total > MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE, we should consider extending this\nentrypoint to proper pagination" + "title": "OnePage[StudyPort]" }, "Page_File_": { "properties": { @@ -6054,18 +6299,39 @@ "title": "Items" }, "total": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Total" }, "limit": { - "type": "integer", - "minimum": 1, + "anyOf": [ + { + "type": "integer", + "minimum": 1 + }, + { + "type": "null" + } + ], "title": "Limit" }, "offset": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Offset" }, "links": { @@ -6075,6 +6341,9 @@ "type": "object", "required": [ "items", + "total", + "limit", + "offset", "links" ], "title": "Page[File]" @@ -6089,18 +6358,39 @@ "title": "Items" }, "total": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Total" }, "limit": { - "type": "integer", - "minimum": 1, + "anyOf": [ + { + "type": "integer", + "minimum": 1 + }, + { + "type": "null" + } + ], "title": "Limit" }, "offset": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Offset" }, "links": { @@ -6110,6 +6400,9 @@ "type": "object", "required": [ "items", + "total", + "limit", + "offset", "links" ], "title": "Page[Job]" @@ -6124,18 +6417,39 @@ "title": "Items" }, "total": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Total" }, "limit": { - "type": "integer", - "minimum": 1, + "anyOf": [ + { + "type": "integer", + "minimum": 1 + }, + { + "type": "null" + } + ], "title": "Limit" }, "offset": { - "type": "integer", - "minimum": 0, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], "title": "Offset" }, "links": { @@ -6145,6 +6459,9 @@ "type": "object", "required": [ "items", + "total", + "limit", + "offset", "links" ], "title": "Page[Study]" @@ -6154,8 +6471,8 @@ "enum": [ "TIER" ], - "title": "PricingPlanClassification", - "description": "An enumeration." + "const": "TIER", + "title": "PricingPlanClassification" }, "PricingUnitGet": { "properties": { @@ -6170,8 +6487,7 @@ "title": "Unitname" }, "unitExtraInfo": { - "type": "object", - "title": "Unitextrainfo" + "$ref": "#/components/schemas/UnitExtraInfo" }, "currentCostPerUnit": { "type": "number", @@ -6195,16 +6511,28 @@ "Profile": { "properties": { "first_name": { - "type": "string", - "maxLength": 255, - "title": "First Name", - "example": "James" + "anyOf": [ + { + "type": "string", + "maxLength": 255 + }, + { + "type": "null" + } + ], + "title": "First Name" }, "last_name": { - "type": "string", - "maxLength": 255, - "title": "Last Name", - "example": "Maxwell" + "anyOf": [ + { + "type": "string", + "maxLength": 255 + }, + { + "type": "null" + } + ], + "title": "Last Name" }, "id": { "type": "integer", @@ -6221,11 +6549,25 @@ "$ref": "#/components/schemas/UserRoleEnum" }, "groups": { - "$ref": "#/components/schemas/Groups" + "anyOf": [ + { + "$ref": "#/components/schemas/Groups" + }, + { + "type": "null" + } + ] }, "gravatar_id": { - "type": "string", - "maxLength": 40, + "anyOf": [ + { + "type": "string", + "maxLength": 40 + }, + { + "type": "null" + } + ], "title": "Gravatar Id", "description": "md5 hash value of email to retrieve an avatar image from https://www.gravatar.com" } @@ -6238,40 +6580,52 @@ ], "title": "Profile", "example": { - "id": "20", "first_name": "James", - "last_name": "Maxwell", - "login": "james-maxwell@itis.swiss", - "role": "USER", + "gravatar_id": "9a8930a5b20d7048e37740bac5c1ca4f", "groups": { + "all": { + "description": "all users", + "gid": "1", + "label": "Everyone" + }, "me": { + "description": "primary group", "gid": "123", - "label": "maxy", - "description": "primary group" + "label": "maxy" }, - "organizations": [], - "all": { - "gid": "1", - "label": "Everyone", - "description": "all users" - } + "organizations": [] }, - "gravatar_id": "9a8930a5b20d7048e37740bac5c1ca4f" + "id": "20", + "last_name": "Maxwell", + "login": "james-maxwell@itis.swiss", + "role": "USER" } }, "ProfileUpdate": { "properties": { "first_name": { - "type": "string", - "maxLength": 255, - "title": "First Name", - "example": "James" + "anyOf": [ + { + "type": "string", + "maxLength": 255 + }, + { + "type": "null" + } + ], + "title": "First Name" }, "last_name": { - "type": "string", - "maxLength": 255, - "title": "Last Name", - "example": "Maxwell" + "anyOf": [ + { + "type": "string", + "maxLength": 255 + }, + { + "type": "null" + } + ], + "title": "Last Name" } }, "type": "object", @@ -6362,7 +6716,14 @@ "description": "Human readable name" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description" }, "maintainer": { @@ -6370,10 +6731,17 @@ "title": "Maintainer" }, "url": { - "type": "string", - "maxLength": 2083, - "minLength": 1, - "format": "uri", + "anyOf": [ + { + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" + }, + { + "type": "null" + } + ], "title": "Url", "description": "Link to get this resource" } @@ -6389,12 +6757,12 @@ "title": "Solver", "description": "A released solver with a specific version", "example": { - "id": "simcore/services/comp/isolve", - "version": "2.1.1", - "title": "iSolve", "description": "EM solver", + "id": "simcore/services/comp/isolve", "maintainer": "info@itis.swiss", - "url": "https://api.osparc.io/v0/solvers/simcore%2Fservices%2Fcomp%2Fisolve/releases/2.1.1" + "title": "iSolve", + "url": "https://api.osparc.io/v0/solvers/simcore%2Fservices%2Fcomp%2Fisolve/releases/2.1.1", + "version": "2.1.1" } }, "SolverPort": { @@ -6414,7 +6782,14 @@ "title": "Kind" }, "content_schema": { - "type": "object", + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], "title": "Content Schema", "description": "jsonschema for the port's value. SEE https://json-schema.org" } @@ -6426,15 +6801,15 @@ ], "title": "SolverPort", "example": { - "key": "input_2", - "kind": "input", "content_schema": { + "maximum": 5, + "minimum": 0, "title": "Sleep interval", "type": "integer", - "x_unit": "second", - "minimum": 0, - "maximum": 5 - } + "x_unit": "second" + }, + "key": "input_2", + "kind": "input" } }, "Study": { @@ -6445,11 +6820,25 @@ "title": "Uid" }, "title": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Title" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description" } }, @@ -6476,7 +6865,14 @@ "title": "Kind" }, "content_schema": { - "type": "object", + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], "title": "Content Schema", "description": "jsonschema for the port's value. SEE https://json-schema.org" } @@ -6488,16 +6884,44 @@ ], "title": "StudyPort", "example": { - "key": "input_2", - "kind": "input", "content_schema": { + "maximum": 5, + "minimum": 0, "title": "Sleep interval", "type": "integer", - "x_unit": "second", + "x_unit": "second" + }, + "key": "f763658f-a89a-4a90-ace4-c44631290f12", + "kind": "input" + } + }, + "UnitExtraInfo": { + "properties": { + "CPU": { + "type": "integer", + "minimum": 0, + "title": "Cpu" + }, + "RAM": { + "type": "integer", + "minimum": 0, + "title": "Ram" + }, + "VRAM": { + "type": "integer", "minimum": 0, - "maximum": 5 + "title": "Vram" } - } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "CPU", + "RAM", + "VRAM" + ], + "title": "UnitExtraInfo", + "description": "Custom information that is propagated to the frontend. Defined fields are mandatory." }, "UploadLinks": { "properties": { @@ -6547,8 +6971,7 @@ "PRODUCT_OWNER", "ADMIN" ], - "title": "UserRoleEnum", - "description": "An enumeration." + "title": "UserRoleEnum" }, "UsersGroup": { "properties": { @@ -6561,7 +6984,14 @@ "title": "Label" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description" } }, @@ -6620,7 +7050,14 @@ "title": "Name" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description" }, "owner": { @@ -6630,7 +7067,14 @@ "minimum": 0 }, "thumbnail": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Thumbnail" }, "status": { @@ -6655,7 +7099,9 @@ "required": [ "walletId", "name", + "description", "owner", + "thumbnail", "status", "created", "modified", @@ -6669,8 +7115,7 @@ "ACTIVE", "INACTIVE" ], - "title": "WalletStatus", - "description": "An enumeration." + "title": "WalletStatus" } }, "securitySchemes": { diff --git a/clients/python/Makefile b/clients/python/Makefile index aad3decc..57d4393d 100644 --- a/clients/python/Makefile +++ b/clients/python/Makefile @@ -116,8 +116,8 @@ _check_venv_active: .PHONY: install-dev install-dev: _check_venv_active .install-dev-reqs python-client ## installs osparc_client and osparc in edit mode - uv pip install -e artifacts/client - uv pip install -e . + # for some reason this command refuses to run with uv. Looks related to https://github.com/astral-sh/uv/issues/1661 + pip install --editable artifacts/client --editable . uv pip list .PHONY: install-unit-test @@ -129,6 +129,10 @@ install-e2e-test: _check_venv_active guard-OSPARC_VERSION ## install packages fo $(eval version := $(shell bash $(CLIENTS_PYTHON_DIR)/test/e2e/ci/bash/osparc_version.bash $(OSPARC_VERSION))) uv pip install -r $(CLIENTS_PYTHON_DIR)/requirements/e2e-test.txt osparc-client==$(version) osparc==$(version) +.PHONY: install-e2e-test-local +install-e2e-test-local: _check_venv_active python-client ## install packages for e2e testing with local (repo) client [e2e] + pip install -r $(CLIENTS_PYTHON_DIR)/requirements/e2e-test.txt --editable artifacts/client --editable . + .PHONY: install-doc install-doc: _check_venv_active .install-dev-reqs ## install packages for generating documentation uv pip install -r $(CLIENTS_PYTHON_DIR)/requirements/doc.txt diff --git a/clients/python/requirements/dev.txt b/clients/python/requirements/dev.txt index 13ce4643..50bca975 100644 --- a/clients/python/requirements/dev.txt +++ b/clients/python/requirements/dev.txt @@ -1,4 +1,3 @@ -r ../../../requirements.txt -r unit-test.txt --r e2e-test.txt pylint diff --git a/clients/python/requirements/unit-test.txt b/clients/python/requirements/unit-test.txt index 91a9931b..609a8c9f 100644 --- a/clients/python/requirements/unit-test.txt +++ b/clients/python/requirements/unit-test.txt @@ -1,8 +1,11 @@ -r ../../../requirements.txt black faker +openapi-spec-validator #installed as backend for prance +parse pipdeptree pipreqs +prance pytest pytest-asyncio pytest-mock diff --git a/clients/python/setup.py b/clients/python/setup.py index 36499be2..8a471eda 100644 --- a/clients/python/setup.py +++ b/clients/python/setup.py @@ -30,6 +30,7 @@ "tenacity", "tqdm>=4.48.0", f"osparc_client=={VERSION}", + "urllib3", "aiofiles", ] diff --git a/clients/python/src/osparc/_api_client.py b/clients/python/src/osparc/_api_client.py index 70cc5b40..76d6693c 100644 --- a/clients/python/src/osparc/_api_client.py +++ b/clients/python/src/osparc/_api_client.py @@ -3,9 +3,8 @@ from typing import Optional from osparc_client.api_client import ApiClient as _ApiClient -from osparc_client import Configuration +from ._configuration import Configuration from pydantic import ValidationError - from ._settings import ConfigurationEnvVars @@ -16,7 +15,6 @@ def __init__( header_name=None, header_value=None, cookie=None, - pool_threads=1, ): if configuration is None: try: @@ -36,4 +34,4 @@ def __init__( "osparc.Configuration object explicitly" ) from exc - super().__init__(configuration, header_name, header_value, cookie, pool_threads) + super().__init__(configuration, header_name, header_value, cookie) diff --git a/clients/python/src/osparc/_api_files_api.py b/clients/python/src/osparc/_api_files_api.py index d96d586a..8931cd5a 100644 --- a/clients/python/src/osparc/_api_files_api.py +++ b/clients/python/src/osparc/_api_files_api.py @@ -5,7 +5,8 @@ import logging import math from pathlib import Path -from typing import Any, Iterator, List, Optional, Tuple, Union, Set, Final +from typing import Any, Iterator, List, Optional, Tuple, Union, Final, Set +from tempfile import NamedTemporaryFile import httpx from httpx import Response @@ -27,7 +28,6 @@ ) from urllib.parse import urljoin import aiofiles -from tempfile import NamedTemporaryFile import shutil from ._utils import ( DEFAULT_TIMEOUT_SECONDS, diff --git a/clients/python/src/osparc/_api_solvers_api.py b/clients/python/src/osparc/_api_solvers_api.py index 71c64f1d..3c9ca36d 100644 --- a/clients/python/src/osparc/_api_solvers_api.py +++ b/clients/python/src/osparc/_api_solvers_api.py @@ -4,7 +4,17 @@ import httpx from osparc_client.api.solvers_api import SolversApi as _SolversApi -from .models import JobInputs, OnePageSolverPort, SolverPort +from .models import ( + JobInputs, + OnePageSolverPort, + SolverPort, + Job, + JobOutputs, + JobMetadata, + JobMetadataUpdate, +) +from osparc_client import JobInputs as _JobInputs +from osparc_client import JobMetadataUpdate as _JobMetadataUpdate from ._api_client import ApiClient from ._settings import ParentProjectInfo @@ -13,8 +23,11 @@ _DEFAULT_PAGINATION_OFFSET, PaginationIterable, ) - import warnings +from tempfile import NamedTemporaryFile +from pathlib import Path +from pydantic import validate_call +from pydantic import StrictStr class SolversApi(_SolversApi): @@ -88,8 +101,59 @@ def jobs(self, solver_key: str, version: str, **kwargs) -> PaginationIterable: ) return self.iter_jobs(solver_key, version, **kwargs) + @validate_call def create_job( self, solver_key: str, version: str, job_inputs: JobInputs, **kwargs - ): + ) -> Job: + _job_inputs = _JobInputs.from_json(job_inputs.model_dump_json()) + assert _job_inputs is not None kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)} - return super().create_job(solver_key, version, job_inputs, **kwargs) + return super().create_job(solver_key, version, _job_inputs, **kwargs) + + def get_job_output_logfile( + self, + solver_key: str, + version: str, + job_id: StrictStr, + **kwargs, + ): + data = super().get_job_output_logfile( + solver_key=solver_key, version=version, job_id=job_id, **kwargs + ) + with NamedTemporaryFile(delete=False) as tmp_file: + log_file = Path(tmp_file.name) + log_file.write_bytes(data) + return log_file + + def get_job_outputs( + self, + solver_key: str, + version: str, + job_id: StrictStr, + **kwargs, + ) -> JobOutputs: + _osparc_client_outputs = super().get_job_outputs( + solver_key=solver_key, version=version, job_id=job_id, **kwargs + ) + return JobOutputs.model_validate_json(_osparc_client_outputs.to_json()) + + def get_job_custom_metadata(self, *args, **kwargs) -> JobMetadata: + metadata = super().get_job_custom_metadata(*args, **kwargs) + return JobMetadata.model_validate_json(metadata.to_json()) + + @validate_call + def replace_job_custom_metadata( + self, + solver_key: str, + version: str, + job_id: str, + job_metadata_update: JobMetadataUpdate, + ) -> JobMetadata: + _job_metadata_update = _JobMetadataUpdate.from_json( + job_metadata_update.model_dump_json() + ) + assert _job_metadata_update is not None + _job_custom_metadata = super().replace_job_custom_metadata( + solver_key, version, job_id, _job_metadata_update + ) + return JobMetadata.model_validate_json(_job_custom_metadata.to_json()) diff --git a/clients/python/src/osparc/_api_studies_api.py b/clients/python/src/osparc/_api_studies_api.py index 1d14a11a..65aa91d0 100644 --- a/clients/python/src/osparc/_api_studies_api.py +++ b/clients/python/src/osparc/_api_studies_api.py @@ -7,8 +7,19 @@ from typing import Optional import httpx -from .models import JobInputs, JobLogsMap, PageStudy +from pydantic import StrictStr + +from .models import ( + JobInputs, + JobLogsMap, + PageStudy, + JobOutputs, + JobMetadata, + JobMetadataUpdate, +) from osparc_client.api.studies_api import StudiesApi as _StudiesApi +from osparc_client import JobInputs as _JobInputs +from osparc_client import JobMetadataUpdate as _JobMetadataUpdate from tqdm.asyncio import tqdm_asyncio from ._api_client import ApiClient @@ -58,8 +69,18 @@ def __init__(self, api_client: ApiClient): ) def create_study_job(self, study_id: str, job_inputs: JobInputs, **kwargs): + _job_inputs = _JobInputs.from_json(job_inputs.model_dump_json()) + assert _job_inputs is not None kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)} - return super().create_study_job(study_id, job_inputs, **kwargs) + return super().create_study_job(study_id, _job_inputs, **kwargs) + + def get_study_job_outputs( + self, study_id: StrictStr, job_id: StrictStr, **kwargs + ) -> JobOutputs: + _job_outputs = super().get_study_job_outputs( + study_id=study_id, job_id=job_id, **kwargs + ) + return JobOutputs.model_validate_json(_job_outputs.to_json()) def clone_study(self, study_id: str, **kwargs): kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)} @@ -140,3 +161,22 @@ async def _download(unique_node_name: str, download_link: str) -> None: ) return folder + + def get_study_job_custom_metadata(self, study_id: str, job_id: str) -> JobMetadata: + _job_metadata = super().get_study_job_custom_metadata(study_id, job_id) + return JobMetadata.model_validate_json(_job_metadata.to_json()) + + def replace_study_job_custom_metadata( + self, + study_id: StrictStr, + job_id: StrictStr, + job_metadata_update: JobMetadataUpdate, + ) -> JobMetadata: + _job_metadata_update = _JobMetadataUpdate.from_json( + job_metadata_update.model_dump_json() + ) + assert _job_metadata_update is not None + _job_metadata = super().replace_study_job_custom_metadata( + study_id, job_id, _job_metadata_update + ) + return JobMetadata.model_validate_json(_job_metadata.to_json()) diff --git a/clients/python/src/osparc/_configuration.py b/clients/python/src/osparc/_configuration.py new file mode 100644 index 00000000..a2c8c210 --- /dev/null +++ b/clients/python/src/osparc/_configuration.py @@ -0,0 +1,45 @@ +from osparc_client import Configuration as _Configuration +from typing import Set +from urllib3 import Retry + + +class Configuration(_Configuration): + def __init__( + self, + host="https://api.osparc.io", + api_key=None, + api_key_prefix=None, + username=None, + password=None, + *, + retry_max_count: int = 4, + retry_methods: Set[str] = { + "DELETE", + "GET", + "HEAD", + "OPTIONS", + "PUT", + "TRACE", + "POST", + "PATCH", + "CONNECT", + }, + retry_status_codes: Set[int] = {429, 503, 504}, + retry_backoff_factor=4.0, + ): + retries = Retry( + total=retry_max_count, + backoff_factor=retry_backoff_factor, + status_forcelist=retry_status_codes, + allowed_methods=retry_methods, + respect_retry_after_header=True, + raise_on_status=True, + ) + super().__init__( + host=host, + api_key=api_key, + api_key_prefix=api_key_prefix, + username=username, + password=password, + retries=retries, + ) diff --git a/clients/python/src/osparc/_models.py b/clients/python/src/osparc/_models.py new file mode 100644 index 00000000..21f19e73 --- /dev/null +++ b/clients/python/src/osparc/_models.py @@ -0,0 +1,45 @@ +from osparc_client import JobInputs as _JobInputs +from osparc_client import JobOutputs as _JobOutputs +from osparc_client import JobMetadata as _JobMetadata +from osparc_client import JobMetadataUpdate as _JobMetadataUpdate +from .models import File +from typing import Dict, Union, List, Optional +from pydantic import BaseModel, StrictStr, Field + + +class JobInputs(BaseModel): + values: Dict[str, Union[File, List[object], bool, float, int, str, None]] + + def __init__( + self, values: Dict[str, Union[File, List[object], bool, float, int, str, None]] + ): + super().__init__(values=values) + + +assert set(_JobInputs.model_fields.keys()) == set(JobInputs.model_fields.keys()) + + +class JobOutputs(BaseModel): + job_id: StrictStr = Field(description="Job that produced this output") + results: Dict[str, Union[File, List[object], bool, float, int, str, None]] + + +assert set(_JobOutputs.model_fields.keys()) == set(JobOutputs.model_fields.keys()) + + +class JobMetadata(BaseModel): + job_id: StrictStr + metadata: Dict[str, Union[bool, float, int, str, None]] + url: Optional[str] + + +assert set(_JobMetadata.model_fields.keys()) == set(JobMetadata.model_fields.keys()) + + +class JobMetadataUpdate(BaseModel): + metadata: Dict[str, Union[bool, float, int, str, None]] + + +assert set(_JobMetadataUpdate.model_fields.keys()) == set( + JobMetadataUpdate.model_fields.keys() +) diff --git a/clients/python/src/osparc/api.py b/clients/python/src/osparc/api.py index 24a07c0d..b3d751da 100644 --- a/clients/python/src/osparc/api.py +++ b/clients/python/src/osparc/api.py @@ -4,7 +4,7 @@ # NOTE: this is an interface. Keep it clean! -from osparc_client.configuration import Configuration as Configuration +from ._configuration import Configuration as Configuration from ._api_client import ApiClient as ApiClient diff --git a/clients/python/src/osparc/models.py b/clients/python/src/osparc/models.py index 9c4aa508..f15551ea 100644 --- a/clients/python/src/osparc/models.py +++ b/clients/python/src/osparc/models.py @@ -12,9 +12,6 @@ from osparc_client.models.body_complete_multipart_upload_v0_files_file_id_complete_post import ( BodyCompleteMultipartUploadV0FilesFileIdCompletePost as BodyCompleteMultipartUploadV0FilesFileIdCompletePost, ) -from osparc_client.models.body_upload_file_v0_files_content_put import ( - BodyUploadFileV0FilesContentPut as BodyUploadFileV0FilesContentPut, -) from osparc_client.models.client_file import ClientFile as ClientFile from osparc_client.models.client_file_upload_data import ( ClientFileUploadData as ClientFileUploadData, @@ -31,13 +28,8 @@ HTTPValidationError as HTTPValidationError, ) from osparc_client.models.job import Job as Job -from osparc_client.models.job_inputs import JobInputs as JobInputs from osparc_client.models.job_logs_map import JobLogsMap as JobLogsMap -from osparc_client.models.job_metadata import JobMetadata as JobMetadata -from osparc_client.models.job_metadata_update import ( - JobMetadataUpdate as JobMetadataUpdate, -) -from osparc_client.models.job_outputs import JobOutputs as JobOutputs +from osparc_client.models.values_value import ValuesValue as ValuesValue from osparc_client.models.job_status import JobStatus as JobStatus from osparc_client.models.links import Links as Links from osparc_client.models.log_link import LogLink as LogLink @@ -48,6 +40,7 @@ from osparc_client.models.one_page_study_port import ( OnePageStudyPort as OnePageStudyPort, ) +from osparc_client import MetadataValue as MetadataValue from osparc_client.models.page_file import PageFile as PageFile from osparc_client.models.page_job import PageJob as PageJob from osparc_client.models.page_study import PageStudy as PageStudy @@ -75,6 +68,10 @@ ) from osparc_client.models.wallet_status import WalletStatus as WalletStatus +from ._models import JobInputs as JobInputs +from ._models import JobOutputs as JobOutputs +from ._models import JobMetadata as JobMetadata +from ._models import JobMetadataUpdate as JobMetadataUpdate # renames TaskStates = _RunningState diff --git a/clients/python/test/e2e/conftest.py b/clients/python/test/e2e/conftest.py index e919083a..505abd7d 100644 --- a/clients/python/test/e2e/conftest.py +++ b/clients/python/test/e2e/conftest.py @@ -99,7 +99,7 @@ def pytest_configure(config): @pytest.fixture(scope="session") def api_client() -> Iterable[osparc.ApiClient]: - if Version(osparc.__version__) >= Version("8.0.0"): + if Version(osparc.__version__) >= Version("0.8.0"): with osparc.ApiClient() as api_client: yield api_client else: diff --git a/clients/python/test/test_osparc/conftest.py b/clients/python/test/test_osparc/conftest.py index 0b47d8b3..4412fea6 100644 --- a/clients/python/test/test_osparc/conftest.py +++ b/clients/python/test/test_osparc/conftest.py @@ -6,6 +6,17 @@ import osparc import pytest from faker import Faker +from pytest_mock import MockerFixture +from urllib3 import HTTPResponse +from pydantic import BaseModel +from typing import Callable, Generator +from prance import ResolvingParser +import json +from tempfile import NamedTemporaryFile +from pathlib import Path +from typing import Any, TypeVar, NamedTuple, Final, cast, Dict, Type, Set +from urllib.parse import urlparse +from parse import parse, with_pattern @pytest.fixture @@ -17,12 +28,136 @@ def cfg(faker: Faker) -> osparc.Configuration: ) +@pytest.fixture +def osparc_openapi_specs() -> Generator[Dict[str, Any], None, None]: + with NamedTemporaryFile(suffix=".json") as file: + file = Path(file.name) + file.write_text(json.dumps(osparc.openapi())) + osparc_spec = ResolvingParser(f"{file.resolve()}").specification + assert osparc_spec is not None + yield osparc_spec + + @pytest.fixture def api_client(cfg: osparc.Configuration) -> osparc.ApiClient: return osparc.ApiClient(configuration=cfg) @pytest.fixture +def uuid(faker: Faker): + return cast(str, faker.uuid4()) + + +@pytest.fixture +def dev_mode_enabled(monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("OSPARC_DEV_FEATURES_ENABLED", "1") + + +@with_pattern(pattern=r"[^/]+") +def _path_segment(text): + return text + + +class ServerPath(NamedTuple): + path: str + formatted_path: str + + +_PATH_SEGMENT_CONVERTER: Final[str] = "path_segment" + + +@pytest.fixture +def all_server_paths(osparc_openapi_specs: Dict[str, Any]) -> Set[ServerPath]: + server_paths = set() + for path in osparc_openapi_specs["paths"]: + for method in osparc_openapi_specs["paths"][path]: + if params := osparc_openapi_specs["paths"][path][method].get("parameters"): + formatted_path = path + for p in params: + pname = p.get("name") + assert pname is not None + formatted_path = formatted_path.replace( + "{" + f"{pname}" + "}", + "{" + f"{pname}:{_PATH_SEGMENT_CONVERTER}" + "}", + ) + server_paths.add(ServerPath(path=path, formatted_path=formatted_path)) + return server_paths + + +T = TypeVar("T", bound=BaseModel) + + +@pytest.fixture +def create_osparc_response_model( + osparc_openapi_specs: Dict[str, Any], +) -> Callable[[Type[T]], T]: + def _create_model(model_type: Type[T]) -> T: + schemas = osparc_openapi_specs.get("components", {}).get("schemas", {}) + example_data = schemas.get(model_type.__name__, {}).get("example") + error_msg = "Could not extract example data for" + error_msg += f" '{model_type.__name__}' from openapi specs" + assert example_data, error_msg + return model_type.model_validate(example_data) + + return _create_model + + +@pytest.fixture +def create_server_mock( + mocker: MockerFixture, + osparc_openapi_specs: Dict[str, Any], + all_server_paths: Set[ServerPath], + create_osparc_response_model: Callable[[str], BaseModel], +) -> Callable[[int], None]: + def _mock_server(_status: int) -> None: + def _sideeffect( + method: str, + url: str, + body=None, + fields=None, + headers=None, + json=None, + **urlopen_kw, + ) -> HTTPResponse: + matching_paths = set( + p.path + for p in all_server_paths + if parse( + p.formatted_path, + urlparse(url=url).path, + {_PATH_SEGMENT_CONVERTER: _path_segment}, + ) + ) + assert len(matching_paths) == 1 + matching_path = list(matching_paths)[0] + responses = ( + osparc_openapi_specs["paths"] + .get(matching_path, {}) + .get(method.lower(), {}) + .get("responses") + ) + assert responses is not None + schema = ( + responses.get(f"{_status}", {}) + .get("content", {}) + .get("application/json", {}) + .get("schema") + ) + assert ( + schema is not None + ), f"probably status code {_status} is not a return code of {method.upper()} {matching_path}" + response_model_type = getattr(osparc, schema.get("title")) + response_model = create_osparc_response_model(response_model_type) + response = HTTPResponse( + status=_status, body=response_model.model_dump_json().encode() + ) + return response + + mocker.patch("urllib3.PoolManager.request", side_effect=_sideeffect) + + return _mock_server + + def page_file(faker: Faker) -> osparc.PageFile: items = [] for _ in range(5): diff --git a/clients/python/test/test_osparc/test_apis.py b/clients/python/test/test_osparc/test_apis.py index c7ea1d35..ba43906a 100644 --- a/clients/python/test/test_osparc/test_apis.py +++ b/clients/python/test/test_osparc/test_apis.py @@ -8,7 +8,7 @@ import pytest from faker import Faker -from osparc import ApiClient, SolversApi, StudiesApi +from osparc import ApiClient, SolversApi, StudiesApi, JobInputs from pytest_mock import MockerFixture @@ -59,11 +59,13 @@ def check_headers(**kwargs): ) solvers_api = SolversApi(api_client=api_client) - solvers_api.create_job(solver_key="mysolver", version="1.2.3", job_inputs={}) + solvers_api.create_job( + solver_key="mysolver", version="1.2.3", job_inputs=JobInputs({}) + ) studies_api = StudiesApi(api_client=api_client) - studies_api.create_study_job(study_id=faker.uuid4(), job_inputs={}) - studies_api.clone_study(study_id=faker.uuid4()) + studies_api.create_study_job(study_id=f"{faker.uuid4()}", job_inputs=JobInputs({})) + studies_api.clone_study(study_id=f"{faker.uuid4()}") @pytest.mark.parametrize( diff --git a/clients/python/test/test_osparc/test_basic.py b/clients/python/test/test_osparc/test_basic.py index 8f8e54c6..536b2811 100644 --- a/clients/python/test/test_osparc/test_basic.py +++ b/clients/python/test/test_osparc/test_basic.py @@ -1,15 +1,14 @@ import json -import os import subprocess from pathlib import Path from typing import Any, Dict, List, Set, cast +from faker import Faker import osparc import osparc._settings import pydantic import pytest import respx -from faker import Faker import httpx from urllib.parse import urlparse from osparc._utils import PaginationIterable @@ -82,16 +81,18 @@ def test_dependencies(tmp_path: Path): @pytest.mark.parametrize("valid", [True, False]) -def test_parent_project_validation(faker, valid: bool): +def test_parent_project_validation( + faker: Faker, monkeypatch: pytest.MonkeyPatch, valid: bool, uuid: str +): if valid: - os.environ["OSPARC_STUDY_ID"] = f"{faker.uuid4()}" - os.environ["OSPARC_NODE_ID"] = f"{faker.uuid4()}" + monkeypatch.setenv("OSPARC_STUDY_ID", uuid) + monkeypatch.setenv("OSPARC_NODE_ID", uuid) parent_info = osparc._settings.ParentProjectInfo() assert parent_info.x_simcore_parent_project_uuid is not None assert parent_info.x_simcore_parent_node_id is not None else: - os.environ["OSPARC_STUDY_ID"] = f"{faker.text()}" - os.environ["OSPARC_NODE_ID"] = f"{faker.text()}" + monkeypatch.setenv("OSPARC_STUDY_ID", faker.text()) + monkeypatch.setenv("OSPARC_NODE_ID", faker.text()) with pytest.raises(pydantic.ValidationError): _ = osparc._settings.ParentProjectInfo() diff --git a/clients/python/test/test_osparc/test_osparc_client/__init__.py b/clients/python/test/test_osparc/test_osparc_client/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/clients/python/test/test_osparc/test_osparc_client/test_body_upload_file_v0_files_content_put.py b/clients/python/test/test_osparc/test_osparc_client/test_body_upload_file_v0_files_content_put.py deleted file mode 100644 index f46560f2..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_body_upload_file_v0_files_content_put.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import BodyUploadFileV0FilesContentPut # noqa: E501 - - -class TestBodyUploadFileV0FilesContentPut(unittest.TestCase): - """BodyUploadFileV0FilesContentPut unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test BodyUploadFileV0FilesContentPut - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.body_upload_file_v0_files_content_put.BodyUploadFileV0FilesContentPut() # noqa: E501 - if include_optional: - return BodyUploadFileV0FilesContentPut(file=bytes(b"blah")) - else: - return BodyUploadFileV0FilesContentPut( - file=bytes(b"blah"), - ) - - def testBodyUploadFileV0FilesContentPut(self): - """Test BodyUploadFileV0FilesContentPut""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_file.py b/clients/python/test/test_osparc/test_osparc_client/test_file.py deleted file mode 100644 index f2882aa3..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_file.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import File # noqa: E501 - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test File - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.file.File() # noqa: E501 - if include_optional: - return File( - id="0", - filename="0", - content_type="0", - checksum="333daca44bef79b1af3126bb4925bca5c86e7de27f69679913104b9f6d1a40fb", - ) - else: - return File( - id="0", - filename="0", - ) - - def testFile(self): - """Test File""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_files_api.py b/clients/python/test/test_osparc/test_osparc_client/test_files_api.py deleted file mode 100644 index d08ccad7..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_files_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ApiClient, Configuration, FilesApi # noqa: E501 - - -class TestFilesApi(unittest.TestCase): - """FilesApi unit test stubs""" - - def setUp(self): - self.api = FilesApi( - api_client=ApiClient(configuration=Configuration()) - ) # noqa: E501 - - def tearDown(self): - pass - - def test_download_file(self): - """Test case for download_file - - Download File # noqa: E501 - """ - pass - - def test_get_file(self): - """Test case for get_file - - Get File # noqa: E501 - """ - pass - - def test_list_files(self): - """Test case for list_files - - List Files # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - Upload File # noqa: E501 - """ - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_groups.py b/clients/python/test/test_osparc/test_osparc_client/test_groups.py deleted file mode 100644 index 794b0221..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_groups.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import Groups, UsersGroup # noqa: E501 - - -class TestGroups(unittest.TestCase): - """Groups unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Groups - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.groups.Groups() # noqa: E501 - if include_optional: - return Groups( - me=UsersGroup( - gid="0", - label="0", - description="0", - ), - organizations=[ - UsersGroup( - gid="0", - label="0", - description="0", - ) - ], - all=UsersGroup( - gid="0", - label="0", - description="0", - ), - ) - else: - return Groups( - me=UsersGroup( - gid="0", - label="0", - description="0", - ), - all=UsersGroup( - gid="0", - label="0", - description="0", - ), - ) - - def testGroups(self): - """Test Groups""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_http_validation_error.py b/clients/python/test/test_osparc/test_osparc_client/test_http_validation_error.py deleted file mode 100644 index c6699821..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_http_validation_error.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import HTTPValidationError # noqa: E501 -from osparc import ValidationError - - -class TestHTTPValidationError(unittest.TestCase): - """HTTPValidationError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test HTTPValidationError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.http_validation_error.HTTPValidationError() # noqa: E501 - if include_optional: - return HTTPValidationError( - errors=[ - ValidationError( - loc=["0"], - msg="0", - type="0", - ) - ] - ) - else: - return HTTPValidationError() - - def testHTTPValidationError(self): - """Test HTTPValidationError""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_job.py b/clients/python/test/test_osparc/test_osparc_client/test_job.py deleted file mode 100644 index 3c9754eb..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_job.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import datetime -import unittest - -from osparc import Job # noqa: E501 - - -class TestJob(unittest.TestCase): - """Job unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Job - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.job.Job() # noqa: E501 - if include_optional: - return Job( - id="0", - name="a", - inputs_checksum="0", - created_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - runner_name="a", - url="0", - runner_url="0", - outputs_url="0", - ) - else: - return Job( - id="0", - name="a", - inputs_checksum="0", - created_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - runner_name="a", - url="0", - runner_url="0", - outputs_url="0", - ) - - def testJob(self): - """Test Job""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_job_inputs.py b/clients/python/test/test_osparc/test_osparc_client/test_job_inputs.py deleted file mode 100644 index 6390b43a..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_job_inputs.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import JobInputs # noqa: E501 - - -class TestJobInputs(unittest.TestCase): - """JobInputs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test JobInputs - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.job_inputs.JobInputs() # noqa: E501 - if include_optional: - return JobInputs(values={"key": 42}) - else: - return JobInputs( - values={"key": 3.14}, - ) - - def testJobInputs(self): - """Test JobInputs""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_job_outputs.py b/clients/python/test/test_osparc/test_osparc_client/test_job_outputs.py deleted file mode 100644 index 77d40ee9..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_job_outputs.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import JobOutputs # noqa: E501 - - -class TestJobOutputs(unittest.TestCase): - """JobOutputs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test JobOutputs - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.job_outputs.JobOutputs() # noqa: E501 - if include_optional: - return JobOutputs(job_id="0", results={"key": 3.14}) - else: - return JobOutputs( - job_id="0", - results={"key": 42}, - ) - - def testJobOutputs(self): - """Test JobOutputs""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_job_status.py b/clients/python/test/test_osparc/test_osparc_client/test_job_status.py deleted file mode 100644 index 2cc5e301..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_job_status.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import datetime -import unittest - -from osparc import JobStatus # noqa: E501 - - -class TestJobStatus(unittest.TestCase): - """JobStatus unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test JobStatus - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.job_status.JobStatus() # noqa: E501 - if include_optional: - return JobStatus( - job_id="0", - state="UNKNOWN", - progress=0.0, - submitted_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - started_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - stopped_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - ) - else: - return JobStatus( - job_id="0", - state="UNKNOWN", - submitted_at=datetime.datetime.strptime( - "2013-10-20 19:20:30.00", "%Y-%m-%d %H:%M:%S.%f" - ), - ) - - def testJobStatus(self): - """Test JobStatus""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_meta.py b/clients/python/test/test_osparc/test_osparc_client/test_meta.py deleted file mode 100644 index 37b4fc97..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_meta.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import Meta # noqa: E501 - - -class TestMeta(unittest.TestCase): - """Meta unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Meta - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.meta.Meta() # noqa: E501 - if include_optional: - return Meta( - name="0", - version="0.5.0", - released={"key": "a"}, - docs_url="https://docs.osparc.io", - docs_dev_url="https://api.osparc.io/dev/docs", - ) - else: - return Meta( - name="0", - version="0.5.0", - docs_url="https://docs.osparc.io", - docs_dev_url="https://api.osparc.io/dev/docs", - ) - - def testMeta(self): - """Test Meta""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_meta_api.py b/clients/python/test/test_osparc/test_osparc_client/test_meta_api.py deleted file mode 100644 index 3499ff77..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_meta_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ApiClient, Configuration, MetaApi # noqa: E501 - - -class TestMetaApi(unittest.TestCase): - """MetaApi unit test stubs""" - - def setUp(self): - self.api = MetaApi( - api_client=ApiClient(configuration=Configuration()) - ) # noqa: E501 - - def tearDown(self): - pass - - def test_get_service_metadata(self): - """Test case for get_service_metadata - - Get Service Metadata # noqa: E501 - """ - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_profile.py b/clients/python/test/test_osparc/test_osparc_client/test_profile.py deleted file mode 100644 index 5f9209fe..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_profile.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import Profile # noqa: E501 -from osparc import Groups, UsersGroup - - -class TestProfile(unittest.TestCase): - """Profile unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Profile - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.profile.Profile() # noqa: E501 - if include_optional: - return Profile( - first_name="James", - last_name="Maxwell", - id=4, - login="0", - role="ANONYMOUS", - groups=Groups( - me=UsersGroup( - gid="0", - label="0", - description="0", - ), - organizations=[ - UsersGroup( - gid="0", - label="0", - description="0", - ) - ], - all=UsersGroup( - gid="0", - label="0", - description="0", - ), - ), - gravatar_id="0", - ) - else: - return Profile(login="0", role="ANONYMOUS", id=4) - - def testProfile(self): - """Test Profile""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_profile_update.py b/clients/python/test/test_osparc/test_osparc_client/test_profile_update.py deleted file mode 100644 index 2abbcd35..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_profile_update.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ProfileUpdate # noqa: E501 - - -class TestProfileUpdate(unittest.TestCase): - """ProfileUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ProfileUpdate - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.profile_update.ProfileUpdate() # noqa: E501 - if include_optional: - return ProfileUpdate(first_name="James", last_name="Maxwell") - else: - return ProfileUpdate() - - def testProfileUpdate(self): - """Test ProfileUpdate""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_solver.py b/clients/python/test/test_osparc/test_osparc_client/test_solver.py deleted file mode 100644 index 2cdeef1a..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_solver.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import Solver # noqa: E501 - - -class TestSolver(unittest.TestCase): - """Solver unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test Solver - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.solver.Solver() # noqa: E501 - if include_optional: - return Solver( - id="simcore/services/comp/sleeper", - version="0.5.0", - title="0", - description="0", - maintainer="0", - url="0", - ) - else: - return Solver( - id="simcore/services/comp/sleeper", - version="0.5.0", - title="0", - maintainer="0", - url="0", - ) - - def testSolver(self): - """Test Solver""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_solvers_api.py b/clients/python/test/test_osparc/test_osparc_client/test_solvers_api.py deleted file mode 100644 index 71078984..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_solvers_api.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ApiClient, Configuration, SolversApi # noqa: E501 - - -class TestSolversApi(unittest.TestCase): - """SolversApi unit test stubs""" - - def setUp(self): - self.api = SolversApi( - api_client=ApiClient(configuration=Configuration()) - ) # noqa: E501 - - def tearDown(self): - pass - - def test_create_job(self): - """Test case for create_job - - Create Job # noqa: E501 - """ - pass - - def test_get_job(self): - """Test case for get_job - - Get Job # noqa: E501 - """ - pass - - def test_get_job_output_logfile(self): - """Test case for get_job_output_logfile - - Get Job Output Logfile # noqa: E501 - """ - pass - - def test_get_job_outputs(self): - """Test case for get_job_outputs - - Get Job Outputs # noqa: E501 - """ - pass - - def test_get_solver(self): - """Test case for get_solver - - Get Latest Release of a Solver # noqa: E501 - """ - pass - - def test_get_solver_release(self): - """Test case for get_solver_release - - Get Solver Release # noqa: E501 - """ - pass - - def test_inspect_job(self): - """Test case for inspect_job - - Inspect Job # noqa: E501 - """ - pass - - def test_list_jobs(self): - """Test case for list_jobs - - List Jobs # noqa: E501 - """ - pass - - def test_list_solver_releases(self): - """Test case for list_solver_releases - - List Solver Releases # noqa: E501 - """ - pass - - def test_list_solvers(self): - """Test case for list_solvers - - List Solvers # noqa: E501 - """ - pass - - def test_list_solvers_releases(self): - """Test case for list_solvers_releases - - Lists All Releases # noqa: E501 - """ - pass - - def test_start_job(self): - """Test case for start_job - - Start Job # noqa: E501 - """ - pass - - def test_stop_job(self): - """Test case for stop_job - - Stop Job # noqa: E501 - """ - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_task_states.py b/clients/python/test/test_osparc/test_osparc_client/test_task_states.py deleted file mode 100644 index 549c4bcf..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_task_states.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import TaskStates # noqa: E501 - - -class TestTaskStates(unittest.TestCase): - """TaskStates unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test TaskStates - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.task_states.TaskStates() # noqa: E501 - if include_optional: - return TaskStates() - else: - return TaskStates() - - def testTaskStates(self): - """Test TaskStates""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_user_role_enum.py b/clients/python/test/test_osparc/test_osparc_client/test_user_role_enum.py deleted file mode 100644 index 9e50ef03..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_user_role_enum.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import UserRoleEnum # noqa: E501 - - -class TestUserRoleEnum(unittest.TestCase): - """UserRoleEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UserRoleEnum - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.user_role_enum.UserRoleEnum() # noqa: E501 - if include_optional: - return UserRoleEnum() - else: - return UserRoleEnum() - - def testUserRoleEnum(self): - """Test UserRoleEnum""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_users_api.py b/clients/python/test/test_osparc/test_osparc_client/test_users_api.py deleted file mode 100644 index ae4073c6..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_users_api.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ApiClient, Configuration, UsersApi # noqa: E501 - - -class TestUsersApi(unittest.TestCase): - """UsersApi unit test stubs""" - - def setUp(self): - self.api = UsersApi( - api_client=ApiClient(configuration=Configuration()) - ) # noqa: E501 - - def tearDown(self): - pass - - def test_get_my_profile(self): - """Test case for get_my_profile - - Get My Profile # noqa: E501 - """ - pass - - def test_update_my_profile(self): - """Test case for update_my_profile - - Update My Profile # noqa: E501 - """ - pass - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_users_group.py b/clients/python/test/test_osparc/test_osparc_client/test_users_group.py deleted file mode 100644 index 4516ba28..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_users_group.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import UsersGroup # noqa: E501 - - -class TestUsersGroup(unittest.TestCase): - """UsersGroup unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test UsersGroup - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.users_group.UsersGroup() # noqa: E501 - if include_optional: - return UsersGroup(gid="0", label="0", description="0") - else: - return UsersGroup( - gid="0", - label="0", - ) - - def testUsersGroup(self): - """Test UsersGroup""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_osparc_client/test_validation_error.py b/clients/python/test/test_osparc/test_osparc_client/test_validation_error.py deleted file mode 100644 index b3ac303f..00000000 --- a/clients/python/test/test_osparc/test_osparc_client/test_validation_error.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - osparc.io web API - - osparc-simcore public web API specifications # noqa: E501 - - The version of the OpenAPI document: 0.4.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -from osparc import ValidationError # noqa: E501 - - -class TestValidationError(unittest.TestCase): - """ValidationError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ValidationError - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # model = osparc.models.validation_error.ValidationError() # noqa: E501 - if include_optional: - return ValidationError(loc=["0"], msg="0", type="0") - else: - return ValidationError( - loc=["0"], - msg="0", - type="0", - ) - - def testValidationError(self): - """Test ValidationError""" - self.make_instance(include_optional=False) - self.make_instance(include_optional=True) - - -if __name__ == "__main__": - unittest.main() diff --git a/clients/python/test/test_osparc/test_solvers_api.py b/clients/python/test/test_osparc/test_solvers_api.py new file mode 100644 index 00000000..cb4056ff --- /dev/null +++ b/clients/python/test/test_osparc/test_solvers_api.py @@ -0,0 +1,89 @@ +from osparc import ( + JobMetadata, + ApiClient, + SolversApi, + JobMetadataUpdate, + JobInputs, + Job, + JobOutputs, +) +from faker import Faker +from typing import Callable, Generator +from pydantic import BaseModel +import pytest +from typing import TypeVar + +T = TypeVar("T", bound=BaseModel) + + +@pytest.fixture +def solvers_api(api_client: ApiClient) -> Generator[SolversApi, None, None]: + yield SolversApi(api_client=api_client) + + +def test_create_job( + create_server_mock: Callable[[int], None], + create_osparc_response_model: Callable, + solvers_api: SolversApi, +): + job_inputs = create_osparc_response_model(JobInputs) + + create_server_mock(201) + + _job = solvers_api.create_job( + solver_key="mysolver", version="1.2.3", job_inputs=job_inputs + ) + assert isinstance(_job, Job) + + +def test_get_job_outputs( + create_server_mock: Callable[[int], None], + solvers_api: SolversApi, + faker: Faker, +): + create_server_mock(200) + + _job_outputs = solvers_api.get_job_outputs( + solver_key="mysolver", version="1.2.3", job_id=faker.uuid4() + ) + assert isinstance(_job_outputs, JobOutputs) + + +def test_get_job_custom_metadata( + create_server_mock: Callable[[int], None], + faker: Faker, + solvers_api: SolversApi, + create_osparc_response_model: Callable, +): + _job_metadata = create_osparc_response_model(JobMetadata) + create_server_mock(200) + + metadata = solvers_api.get_job_custom_metadata( + solver_key="mysolver", version="1.2.3", job_id=f"{faker.uuid4()}" + ) + assert isinstance(metadata, JobMetadata) + assert ( + _job_metadata == metadata + ) # check fix for https://github.com/ITISFoundation/osparc-simcore/issues/6556 + + +def test_replace_job_custom_metadata( + create_server_mock: Callable[[int], None], + create_osparc_response_model: Callable, + solvers_api: SolversApi, + faker: Faker, +): + job_metadata = create_osparc_response_model(JobMetadata) + job_metadata_update = create_osparc_response_model(JobMetadataUpdate) + create_server_mock(200) + + _job_metadata = solvers_api.replace_job_custom_metadata( + solver_key="mysolver", + version="1.2.3", + job_id=f"{faker.uuid4()}", + job_metadata_update=job_metadata_update, + ) + assert isinstance(_job_metadata, JobMetadata) + assert ( + _job_metadata == job_metadata + ) # check fix for https://github.com/ITISFoundation/osparc-simcore/issues/6556 diff --git a/clients/python/test/test_osparc/test_studies_api.py b/clients/python/test/test_osparc/test_studies_api.py new file mode 100644 index 00000000..4945f995 --- /dev/null +++ b/clients/python/test/test_osparc/test_studies_api.py @@ -0,0 +1,76 @@ +import pytest +from osparc import ( + ApiClient, + StudiesApi, + JobInputs, + Job, + JobOutputs, + JobMetadata, + JobMetadataUpdate, +) +from typing import Callable + + +@pytest.fixture +def studies_api(api_client: ApiClient) -> StudiesApi: + return StudiesApi(api_client=api_client) + + +def test_create_study_job( + create_server_mock: Callable[[int], None], + create_osparc_response_model: Callable, + studies_api: StudiesApi, + uuid: str, +): + job_inputs = create_osparc_response_model(JobInputs) + + create_server_mock(200) + + _job = studies_api.create_study_job(study_id=uuid, job_inputs=job_inputs) + assert isinstance(_job, Job) + + +def test_get_study_job_outputs( + create_server_mock: Callable[[int], None], studies_api: StudiesApi, uuid: str +): + create_server_mock(200) + + _study_job_outputs = studies_api.get_study_job_outputs(study_id=uuid, job_id=uuid) + assert isinstance(_study_job_outputs, JobOutputs) + + +def test_get_study_job_custom_metadata( + create_osparc_response_model: Callable, + create_server_mock: Callable[[int], None], + studies_api: StudiesApi, + uuid: str, +): + _job_metadata: JobMetadata = create_osparc_response_model(JobMetadata) + create_server_mock(200) + metadata = studies_api.get_study_job_custom_metadata(study_id=uuid, job_id=uuid) + assert isinstance(metadata, JobMetadata) + assert ( + _job_metadata == metadata + ) # check fix for https://github.com/ITISFoundation/osparc-simcore/issues/6556 + + +def test_replace_study_job_custom_metadata( + create_server_mock: Callable[[int], None], + create_osparc_response_model: Callable, + studies_api: StudiesApi, + uuid: str, +): + create_server_mock(200) + _job_metadata: JobMetadata = create_osparc_response_model(JobMetadata) + job_metadata_update: JobMetadataUpdate = create_osparc_response_model( + JobMetadataUpdate + ) + job_metadata = studies_api.replace_study_job_custom_metadata( + study_id=uuid, + job_id=uuid, + job_metadata_update=job_metadata_update, + ) + assert isinstance(job_metadata, JobMetadata) + assert ( + _job_metadata == job_metadata + ) # check fix for https://github.com/ITISFoundation/osparc-simcore/issues/6556 diff --git a/scripts/common.Makefile b/scripts/common.Makefile index 7a89fdfa..879ac796 100644 --- a/scripts/common.Makefile +++ b/scripts/common.Makefile @@ -13,9 +13,8 @@ NOW_TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") APP_NAME := $(notdir $(CURDIR)) # Specify which openapi generator should be used to generate the clients in this repo -# Build from modified fork https://github.com/ITISFoundation/openapi-generator/tree/openapi-generator-v4.2.3 -OPENAPI_GENERATOR_NAME := itisfoundation/openapi-generator-cli-openapi-generator-v4.2.3 -OPENAPI_GENERATOR_TAG := v0 +OPENAPI_GENERATOR_NAME := openapitools/openapi-generator-cli +OPENAPI_GENERATOR_TAG := latest OPENAPI_GENERATOR_IMAGE := $(OPENAPI_GENERATOR_NAME):$(OPENAPI_GENERATOR_TAG) # openapi specification