Skip to content

Commit

Permalink
Add parentResourceID param for FindInferenceService
Browse files Browse the repository at this point in the history
  • Loading branch information
lampajr committed Feb 15, 2024
1 parent 90f7ddc commit b598085
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions api/openapi/model-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ paths:
parameters:
- $ref: "#/components/parameters/name"
- $ref: "#/components/parameters/externalID"
- $ref: "#/components/parameters/parentResourceID"
"/api/model_registry/v1alpha1/inference_services/{inferenceserviceId}":
summary: Path used to manage a single InferenceService.
description: >-
Expand Down
2 changes: 1 addition & 1 deletion internal/server/openapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type ModelRegistryServiceAPIServicer interface {
CreateRegisteredModel(context.Context, model.RegisteredModelCreate) (ImplResponse, error)
CreateRegisteredModelVersion(context.Context, string, model.ModelVersion) (ImplResponse, error)
CreateServingEnvironment(context.Context, model.ServingEnvironmentCreate) (ImplResponse, error)
FindInferenceService(context.Context, string, string) (ImplResponse, error)
FindInferenceService(context.Context, string, string, string) (ImplResponse, error)
FindModelArtifact(context.Context, string, string, string) (ImplResponse, error)
FindModelVersion(context.Context, string, string, string) (ImplResponse, error)
FindRegisteredModel(context.Context, string, string) (ImplResponse, error)
Expand Down
3 changes: 2 additions & 1 deletion internal/server/openapi/api_model_registry_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ func (c *ModelRegistryServiceAPIController) FindInferenceService(w http.Response
query := r.URL.Query()
nameParam := query.Get("name")
externalIDParam := query.Get("externalID")
result, err := c.service.FindInferenceService(r.Context(), nameParam, externalIDParam)
parentResourceIDParam := query.Get("parentResourceID")
result, err := c.service.FindInferenceService(r.Context(), nameParam, externalIDParam, parentResourceIDParam)
// If an error occurred, encode the error with the status code
if err != nil {
c.errorHandler(w, r, err, &result)
Expand Down
4 changes: 2 additions & 2 deletions internal/server/openapi/api_model_registry_service_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func (s *ModelRegistryServiceAPIService) CreateServingEnvironment(ctx context.Co
}

// FindInferenceService - Get an InferenceServices that matches search parameters.
func (s *ModelRegistryServiceAPIService) FindInferenceService(ctx context.Context, name string, externalID string) (ImplResponse, error) {
result, err := s.coreApi.GetInferenceServiceByParams(&name, nil, &externalID)
func (s *ModelRegistryServiceAPIService) FindInferenceService(ctx context.Context, name string, externalID string, parentResourceID string) (ImplResponse, error) {
result, err := s.coreApi.GetInferenceServiceByParams(&name, &parentResourceID, &externalID)
if err != nil {
return Response(500, model.Error{Message: err.Error()}), nil
}
Expand Down
18 changes: 14 additions & 4 deletions pkg/openapi/api_model_registry_service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b598085

Please sign in to comment.