PUT /v1/services/mlmodelServices
curl -X PUT "{base_url}/api/v1/services/mlmodelServices" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Production MLflow tracking server",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://localhost:8088",
"registryUri": "http://localhost:8088",
"supportsMetadataExtraction": true
}
}
}'
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
AuthProvider,
OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.mlmodelService import MlModelService
metadata = OpenMetadata(
OpenMetadataConnection(
hostPort="https://your-company.open-metadata.org/api",
authProvider=AuthProvider.openmetadata,
securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
)
)
# Retrieve, modify, and update
svc = metadata.get_by_id(entity=MlModelService, entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9")
modified = svc.model_copy(deep=True)
modified.description = "Updated: Production MLflow tracking server with model registry"
modified.connection.config.trackingUri = "http://mlflow-prod:8088"
modified.connection.config.registryUri = "http://mlflow-prod:8088"
updated = metadata.patch(entity=MlModelService, source=svc, destination=modified)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.MlModelService;
import org.openmetadata.sdk.fluent.MlModelServices;
// Retrieve, modify, and update
MlModelService service = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9");
service.setDescription("Updated: Production MLflow tracking server with model registry");
MlModelService updated = MlModelServices.update(service);
# Update by ID
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
{
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Updated: Production MLflow tracking server with model registry",
"version": 0.2,
"updatedAt": 1769982621618,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://mlflow-prod:8088",
"registryUri": "http://mlflow-prod:8088",
"supportsMetadataExtraction": true
}
},
"owners": [],
"tags": [],
"deleted": false,
"domains": []
}
Update an ML Model Service
Create or update an ML model service with a full request body
PUT
/
v1
/
services
/
mlmodelServices
PUT /v1/services/mlmodelServices
curl -X PUT "{base_url}/api/v1/services/mlmodelServices" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Production MLflow tracking server",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://localhost:8088",
"registryUri": "http://localhost:8088",
"supportsMetadataExtraction": true
}
}
}'
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
AuthProvider,
OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.mlmodelService import MlModelService
metadata = OpenMetadata(
OpenMetadataConnection(
hostPort="https://your-company.open-metadata.org/api",
authProvider=AuthProvider.openmetadata,
securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
)
)
# Retrieve, modify, and update
svc = metadata.get_by_id(entity=MlModelService, entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9")
modified = svc.model_copy(deep=True)
modified.description = "Updated: Production MLflow tracking server with model registry"
modified.connection.config.trackingUri = "http://mlflow-prod:8088"
modified.connection.config.registryUri = "http://mlflow-prod:8088"
updated = metadata.patch(entity=MlModelService, source=svc, destination=modified)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.MlModelService;
import org.openmetadata.sdk.fluent.MlModelServices;
// Retrieve, modify, and update
MlModelService service = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9");
service.setDescription("Updated: Production MLflow tracking server with model registry");
MlModelService updated = MlModelServices.update(service);
# Update by ID
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
{
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Updated: Production MLflow tracking server with model registry",
"version": 0.2,
"updatedAt": 1769982621618,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://mlflow-prod:8088",
"registryUri": "http://mlflow-prod:8088",
"supportsMetadataExtraction": true
}
},
"owners": [],
"tags": [],
"deleted": false,
"domains": []
}
Update an ML Model Service
Create an ML model service or update it if it already exists, usingPUT /v1/services/mlmodelServices with the full request body. Send the complete definition, not just the fields you want to change. To change only some fields, use PATCH with a JSON Patch array and the application/json-patch+json content type, as shown in the PATCH examples below.
Body Parameters
string
required
Name of the ML model service. Must be unique across all ML model services.
string
required
Type of ML model service, for example
Mlflow, Sklearn, SageMaker, CustomMlModel.object
required
Connection configuration specific to the service type.
Show properties
Show properties
object
Service-specific connection configuration, for example
trackingUri, registryUri for Mlflow.string
Human-readable display name for the ML model service.
string
Description of the ML model service in Markdown format.
array
array
Fully qualified names of the domains to assign for governance purposes.
array
PUT /v1/services/mlmodelServices
curl -X PUT "{base_url}/api/v1/services/mlmodelServices" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"name": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Production MLflow tracking server",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://localhost:8088",
"registryUri": "http://localhost:8088",
"supportsMetadataExtraction": true
}
}
}'
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
AuthProvider,
OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
OpenMetadataJWTClientConfig,
)
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.mlmodelService import MlModelService
metadata = OpenMetadata(
OpenMetadataConnection(
hostPort="https://your-company.open-metadata.org/api",
authProvider=AuthProvider.openmetadata,
securityConfig=OpenMetadataJWTClientConfig(jwtToken="your-jwt-token"),
)
)
# Retrieve, modify, and update
svc = metadata.get_by_id(entity=MlModelService, entity_id="ca22d46e-81b9-4e48-85b5-0adc44980da9")
modified = svc.model_copy(deep=True)
modified.description = "Updated: Production MLflow tracking server with model registry"
modified.connection.config.trackingUri = "http://mlflow-prod:8088"
modified.connection.config.registryUri = "http://mlflow-prod:8088"
updated = metadata.patch(entity=MlModelService, source=svc, destination=modified)
print(f"Updated to version {updated.version.root}")
import org.openmetadata.schema.entity.services.MlModelService;
import org.openmetadata.sdk.fluent.MlModelServices;
// Retrieve, modify, and update
MlModelService service = MlModelServices.retrieve("ca22d46e-81b9-4e48-85b5-0adc44980da9");
service.setDescription("Updated: Production MLflow tracking server with model registry");
MlModelService updated = MlModelServices.update(service);
# Update by ID
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
# Update by name
curl -X PATCH "{base_url}/api/v1/services/mlmodelServices/name/mlflow_svc" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json-patch+json" \
-d '[
{"op": "replace", "path": "/description", "value": "Updated: Production MLflow tracking server with model registry"}
]'
{
"id": "ca22d46e-81b9-4e48-85b5-0adc44980da9",
"name": "mlflow_svc",
"fullyQualifiedName": "mlflow_svc",
"serviceType": "Mlflow",
"description": "Updated: Production MLflow tracking server with model registry",
"version": 0.2,
"updatedAt": 1769982621618,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/services/mlmodelServices/ca22d46e-81b9-4e48-85b5-0adc44980da9",
"connection": {
"config": {
"type": "Mlflow",
"trackingUri": "http://mlflow-prod:8088",
"registryUri": "http://mlflow-prod:8088",
"supportsMetadataExtraction": true
}
},
"owners": [],
"tags": [],
"deleted": false,
"domains": []
}
Returns
Returns the updated ML model service object with the new version number.Response
string
Unique identifier for the ML model service (UUID format).
string
ML model service name.
string
Fully qualified name of the service.
string
Updated description.
number
Incremented version number.
Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid or malformed request body |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to update this ML model service |
409 | CONFLICT | Concurrent modification detected |
Was this page helpful?