blob: 04ada5204fdc3caf4a2560d06fae74be8299a2c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# frozen_string_literal: true
module API
module Ml
module Mlflow
class ModelVersions < ::API::Base
feature_category :mlops
resource 'model-versions' do
desc 'Fetch model version by name and version' do
success Entities::Ml::Mlflow::ModelVersions::Responses::Get
detail 'https://mlflow.org/docs/2.6.0/rest-api.html#get-modelversion'
end
params do
requires :name, type: String, desc: 'Model version name'
requires :version, type: String, desc: 'Model version number'
end
get 'get', urgency: :low do
check_api_model_registry_read!
resource_not_found! unless params[:name] && params[:version]
model_version = ::Ml::ModelVersions::GetModelVersionService.new(
user_project, params[:name], params[:version]
).execute
resource_not_found! unless model_version
response = { model_version: model_version }
present response, with: Entities::Ml::Mlflow::ModelVersions::Responses::Get
end
end
end
end
end
end
|