GetServerless godoc @Security JWT token @Summary get model serverless @Tags Model @Accept json @Produce json @Param namespace path string true "namespace" @Param name path string true "name" @Success 200 {object} string "OK" @Failure 400 {object
(ctx *gin.Context)
| 1411 | // @Failure 500 {object} types.APIInternalServerError "Internal server error" |
| 1412 | // @Router /models/{namespace}/{name}/serverless [get] |
| 1413 | func (h *ModelHandler) GetDeployServerless(ctx *gin.Context) { |
| 1414 | currentUser := httpbase.GetCurrentUser(ctx) |
| 1415 | namespace, name, err := common.GetNamespaceAndNameFromContext(ctx) |
| 1416 | if err != nil { |
| 1417 | slog.Error("failed to get namespace from context", "error", err) |
| 1418 | httpbase.BadRequest(ctx, err.Error()) |
| 1419 | return |
| 1420 | } |
| 1421 | |
| 1422 | response, err := h.c.GetServerless(ctx, namespace, name, currentUser) |
| 1423 | if err != nil { |
| 1424 | slog.Error("failed to get model serverless endpoint", slog.String("namespace", namespace), |
| 1425 | slog.String("name", name), slog.Any("currentUser", currentUser), slog.Any("error", err)) |
| 1426 | httpbase.ServerError(ctx, err) |
| 1427 | return |
| 1428 | } |
| 1429 | |
| 1430 | httpbase.OK(ctx, response) |
| 1431 | } |
nothing calls this directly
no test coverage detected