This project has retired. For details please refer to its Attic page.
Model Version REST API | Apache Submarine
Skip to main content
Version: 0.8.0

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 NameTypeInDescriptionRequired
baseDirStringpathexperiment directory path.o
nameStringbodyregistered model name.o
experimentIdStringbodyAdd a tag for the registered model.o
descriptionStringbodyAdd description for the version of model.x
tagsList<String>bodyAdd tags for the version of model.x

Example

List model versions under a registered model

GET /api/v1/model-version/{name}

Parameters

Field NameTypeInDescriptionRequired
nameStringpathregistered 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 NameTypeInDescriptionRequired
nameStringpathRegistered model name.o
versionStringpathRegistered 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 NameTypeInDescriptionRequired
nameStringbodyRegistered model name.o
versionStringbodyRegistered model version.o
descriptionStringbodyNew description.x
currentStageStringbodyStage of the model.x
datasetStringbodyDataset 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 NameTypeInDescriptionRequired
nameStringpathRegistered model name.o
versionStringpathRegistered 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 NameTypeInDescriptionRequired
nameStringqueryRegistered model name.o
versionStringqueryRegistered model version.o
tagStringqueryTag 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 NameTypeInDescriptionRequired
nameStringqueryRegistered model name.o
versionStringqueryRegistered model version.o
tagStringqueryTag 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":{}
}