MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / GetDeployServerless

Method GetDeployServerless

api/handler/model.go:1413–1431  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1411// @Failure 500 {object} types.APIInternalServerError "Internal server error"
1412// @Router /models/{namespace}/{name}/serverless [get]
1413func (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}

Callers

nothing calls this directly

Calls 7

GetCurrentUserFunction · 0.92
BadRequestFunction · 0.92
ServerErrorFunction · 0.92
OKFunction · 0.92
ErrorMethod · 0.80
GetServerlessMethod · 0.80

Tested by

no test coverage detected