POST /mltk/register_model
POST /mltk/register_model
Register a new SageMaker endpoint as an MLTK model.
Description. Register a new SageMaker endpoint as an MLTK model. The credentials go to Splunk's password store (realm sagemaker); the model metadata becomes a __mlspl_{model_name}.mlmodel lookup. If lookup creation fails the credentials are rolled back.
Body (JSON).
{
"model_name": "my_sagemaker_model",
"endpoint_name":"my-endpoint-123",
"aws_credentials": {
"region": "us-east-1",
"access_key_id": "AKIA...",
"secret_access_key": "...",
"role_arn": "arn:aws:iam::123456789012:role/SageMakerRole"
},
"input_feature_map": { "cpu": "instances[*].cpu", "memory": "instances[*].memory" },
"output_prediction_map": { "predictions[*]": "result" },
"openapi_spec": { /* OpenAPI 3.0 schema with /invocations POST */ },
"batch_size": 1
}
batch_size. Integer 1–10000.
Validations.
model_nameis a valid Python identifier (no path traversal).- Feature/output maps validated against the OpenAPI request/response schema. Empty maps allowed only when the OpenAPI spec uses
text/csvcontent. - AWS endpoint must exist and be
InService.
Response (200).
{
"success": true,
"message": "Model 'my_sagemaker_model' registered successfully",
"model_name": "my_sagemaker_model",
"endpoint_name":"my-endpoint-123",
"warnings": []
}
Example.
curl -sk -u "$SPLUNK_USER:$SPLUNK_PASSWORD" -X POST
-H "Content-Type: application/json"
--data @register.json
"$SPLUNK_HOST/servicesNS/nobody/Splunk_ML_Toolkit/mltk/register_model?output_mode=json"