Model Version REST API
caution
The Model Version API is in the alpha stage which is subjected to incompatible changes in future releases.
Create a model versionβ
POST /api/v1/model-version?baseDir={baseDir}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
baseDir | String | path | experiment directory path. | o |
name | String | body | registered model name. | o |
experimentId | String | body | Add a tag for the registered model. | o |
description | String | body | Add description for the version of model. | x |
tags | List<String> | body | Add tags for the version of model. | x |
Exampleβ
List model versions under a registered modelβ
GET /api/v1/model-version/{name}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | path | registered model name. | o |
Exampleβ
Example Request
curl -X GET http://127.0.0.1:32080/api/v1/model-version/register
Example Response
{
"attributes" : {},
"code" : 200,
"message" : "List all model version instances",
"result" : [
{
"creationTime" : "2021-12-12 02:27:05",
"currentStage" : "None",
"dataset" : null,
"description" : null,
"experimentId" : "experiment-1639276018590-0001",
"lastUpdatedTime" : "2021-12-12 02:27:05",
"modelType" : "tensorflow",
"name" : "register",
"source" : "s3://submarine/experiment-1639276018590-0001/example/1",
"tags" : [],
"userId" : "",
"version" : 1
},
{
"creationTime" : "2021-12-12 02:27:05",
"currentStage" : "None",
"dataset" : null,
"description" : null,
"experimentId" : "experiment-1639276018590-0001",
"lastUpdatedTime" : "2021-12-12 02:27:05",
"modelType" : "tensorflow",
"name" : "register",
"source" : "s3://submarine/experiment-1639276018590-0001/example/2",
"tags" : [],
"userId" : "",
"version" : 2
},
],
"status" : "OK",
"success" : true
}
Get a model versionβ
GET /api/v1/model-version/{name}/{version}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | path | Registered model name. | o |
version | String | path | Registered model version. | o |
Exampleβ
Example Request
curl -X GET http://127.0.0.1:32080/api/v1/model-version/register/1
Example Response
{
"attributes" : {},
"code" : 200,
"message" : "Get the model version instance",
"result" : {
"creationTime" : "2021-12-12 02:27:05",
"currentStage" : "None",
"dataset" : null,
"description" : null,
"experimentId" : "experiment-1639276018590-0001",
"lastUpdatedTime" : "2021-12-12 02:27:05",
"modelType" : "tensorflow",
"name" : "register",
"source" : "s3://submarine/experiment-1639276018590-0001/example/1",
"tags" : [],
"userId" : "",
"version" : 1
},
"status" : "OK",
"success" : true
}
Patch a model versionβ
PATCH /api/v1/model-version
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | body | Registered model name. | o |
version | String | body | Registered model version. | o |
description | String | body | New description. | x |
currentStage | String | body | Stage of the model. | x |
dataset | String | body | Dataset use in the model. | x |
Exampleβ
Example Request
curl -X PATCH -H "Content-Type: application/json" -d '
{
"name": "register",
"version": 1,
"description": "new_description",
"currentStage": "production",
"dataset": "new_dataset"
}' http://127.0.0.1:32080/api/v1/model-version
Example Response
{
"attributes" : {},
"code" : 200,
"message" : "Update the model version instance",
"result" : null,
"status" : "OK",
"success" : true
}
Delete a model versionβ
DELETE /api/v1/model-version/{name}/{version}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | path | Registered model name. | o |
version | String | path | Registered model version. | o |
Exampleβ
Example Request
curl -X DELETE http://127.0.0.1:32080/api/v1/model-version/register/1
Example Response
{
"attributes" : {},
"code" : 200,
"message" : "Delete the model version instance",
"result" : null,
"status" : "OK",
"success" : true
}
Create a model version tagβ
POST /api/v1/model-version/tag?name={name}&version={version}&tag={tag}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | query | Registered model name. | o |
version | String | query | Registered model version. | o |
tag | String | query | Tag of the registered model version. | o |
Exampleβ
Example Request
curl -X POST http://127.0.0.1:32080/api/v1/model-version/tag?name=register&version=2&tag=789
Example Response
{
"attributes" : {},
"code" : 200,
"message" : "Create a model version tag instance",
"result" : null,
"status" : "OK",
"success" : true
}
Delete a model version tagβ
DELETE /api/v1/model-version/tag?name={name}&version={version}&tag={tag}
Parametersβ
Field Name | Type | In | Description | Required |
---|---|---|---|---|
name | String | query | Registered model name. | o |
version | String | query | Registered model version. | o |
tag | String | query | Tag of the registered model version. | o |
Exampleβ
Example Request
curl -X DELETE http://127.0.0.1:32080/api/v1/model-version/tag?name=register&version=2&tag=789
Example Response
{
"status":"OK",
"code":200,
"success":true,
"message":"Delete a registered model tag instance",
"result":null,
"attributes":{}
}