diff --git a/docs/http-api/images.rst b/docs/http-api/images.rst index 601ed4b8..34cb47dc 100644 --- a/docs/http-api/images.rst +++ b/docs/http-api/images.rst @@ -9,9 +9,9 @@ Request .. code-block:: - GET /images?model_id=1 + GET /images?task_id=1 -* `model_id`: id of model to get images for +* `task_id`: id of task to get images for Response ^^^^^^^^ @@ -94,6 +94,15 @@ Request "model_id": 1 } +* Can be either provided with model or pipeline id + +.. code-block:: json + + { + "name": "image_name", + "pipeline_id": 1 + } + Response ^^^^^^^^^^^^^^ @@ -155,6 +164,7 @@ Request * `id`: id of image to delete * `cascade`: (optional, default - `0`) delete cascadely (stops and deletes running instances of image) +* `meta_only`: (optional, default - `0`) delete image from metadata repository only if 1, if 0 also deletes image from host too Response ^^^^^^^^^^^^^^ diff --git a/docs/http-api/models.rst b/docs/http-api/models.rst index ab25ddb7..b17cf29b 100644 --- a/docs/http-api/models.rst +++ b/docs/http-api/models.rst @@ -74,7 +74,7 @@ Response "artifacts": ["model.pkl", "methods.json"] } -* `404`: if given task doesn't exist +* `404`: if given model doesn't exist Get model artifact @@ -138,11 +138,9 @@ Request DELETE /models/<:id>?cascade=1 * `id`: id of model to delete -* `cascade`: (optional, default - `0`) delete cascadely (with referenced images, etc) Response ^^^^^^^^^^^^^^ * `204`: OK -* `400`: if `cascade` is not `1` and given model has images in it * `404`: if given model doesn't exist diff --git a/docs/http-api/pipelines.rst b/docs/http-api/pipelines.rst new file mode 100644 index 00000000..6fd604e1 --- /dev/null +++ b/docs/http-api/pipelines.rst @@ -0,0 +1,177 @@ +Pipelines +============ + +Get list of pipelines +------------------------ + +Request +^^^^^^^ + +.. code-block:: + + GET /pipelines?task_id=1 + +* `task_id`: id of task to get pipelines for + +Response +^^^^^^^^ + +* `200`: + +.. code-block:: json + + [ + { + "name": "pipe_1", + "id": 1, + "task_id": 1, + "creation_date": "1970-01-01 00:00:00.000000 ", + "author": "user_name", + "input_data": "array", + "output_data": "array", + "steps": [ + {"model_name": "model1", "method_name": "method1"}, + {"model_name": "model2", "method_name": "method2"} + ], + "models": + { "model1":{ + "name": "model1", + "id": 1, + "task_id": 1, + "author": "user_name", + "creation_date": "1970-01-01 00:00:00.000000 ", + "wrapper_meta": {"type": "ebonite.ext.sklearn.model.SklearnModelWrapper"}, + "requirements": [ + {"module": "numpy", "version": "1.17.3", "type": "installable"}, + {"module": "sklearn", "version": "0.22", "type": "installable"} + ], + "params": {"python_version": "3.7.5"}, + "artifacts": ["model.pkl", "methods.json"] + }, + "model2":{ + "name": "model2", + "id": 2, + "task_id": 1, + "author": "user_name", + "creation_date": "1970-01-01 00:00:00.000000 ", + "wrapper_meta": {"type": "ebonite.ext.sklearn.model.SklearnModelWrapper"}, + "requirements": [ + {"module": "numpy", "version": "1.17.3", "type": "installable"}, + {"module": "sklearn", "version": "0.22", "type": "installable"} + ], + "params": {"python_version": "3.7.5"}, + "artifacts": ["model.pkl", "methods.json"] + } + } + } + ] + +* `404`: if given task doesn't exist + +Get pipeline +------------ + +Request +^^^^^^^ + +.. code-block:: + + GET /pipelines/<:id> + +* `id`: id of pipeline to get + +Response +^^^^^^^^ + +* `200`: + +.. code-block:: json + + { + "name": "pipe_1", + "id": 1, + "task_id": 1, + "creation_date": "1970-01-01 00:00:00.000000 ", + "author": "user_name", + "input_data": "array", + "output_data": "array", + "steps": [ + {"model_name": "model1", "method_name": "method1"}, + {"model_name": "model2", "method_name": "method2"} + ], + "models": + { "model1":{ + "name": "model1", + "id": 1, + "task_id": 1, + "author": "user_name", + "creation_date": "1970-01-01 00:00:00.000000 ", + "wrapper_meta": {"type": "ebonite.ext.sklearn.model.SklearnModelWrapper"}, + "requirements": [ + {"module": "numpy", "version": "1.17.3", "type": "installable"}, + {"module": "sklearn", "version": "0.22", "type": "installable"} + ], + "params": {"python_version": "3.7.5"}, + "artifacts": ["model.pkl", "methods.json"] + }, + "model2":{ + "name": "model2", + "id": 2, + "task_id": 1, + "author": "user_name", + "creation_date": "1970-01-01 00:00:00.000000 ", + "wrapper_meta": {"type": "ebonite.ext.sklearn.model.SklearnModelWrapper"}, + "requirements": [ + {"module": "numpy", "version": "1.17.3", "type": "installable"}, + {"module": "sklearn", "version": "0.22", "type": "installable"} + ], + "params": {"python_version": "3.7.5"}, + "artifacts": ["model.pkl", "methods.json"] + } + } + } + +* `404`: if given pipeline doesn't exist + +Update pipeline +--------------- + +Request +^^^^^^^ + +.. code-block:: + + PATCH /pipelines/<:id> + +* `id`: id of pipeline to update + +.. code-block:: json + + { + "name": "first pipeline" + } + +Response +^^^^^^^^^^^^^^ + +* `204`: OK +* `404`: if given pipeline doesn't exist + +Delete pipeline +--------------- + +Request +^^^^^^^ + +.. code-block:: + + DELETE /pipelines/<:id> + +* `id`: id of pipeline to delete + +Response +^^^^^^^^^^^^^^ + +* `204`: OK +* `404`: if given pipeline doesn't exist +