|
|
@@ -15,7 +15,7 @@ func GetResourceSpec(ctx *context.APIContext) { |
|
|
|
aiCenterCode := ctx.Query("center") |
|
|
|
if jobType == "" || computeResource == "" || cluster == "" { |
|
|
|
log.Info("GetResourceSpec api.param error") |
|
|
|
ctx.JSON(200, response.ResponseBizError(response.PARAM_ERROR)) |
|
|
|
ctx.JSON(200, response.OuterBizError(response.PARAM_ERROR)) |
|
|
|
return |
|
|
|
} |
|
|
|
specs, err := resource.FindAvailableSpecs4Show(ctx.User.ID, models.FindSpecsOptions{ |
|
|
@@ -26,11 +26,11 @@ func GetResourceSpec(ctx *context.APIContext) { |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetResourceSpec api error. %v", err) |
|
|
|
ctx.JSON(200, response.ResponseError(err)) |
|
|
|
ctx.JSON(200, response.OuterServerError(err.Error())) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
specMap := make(map[string]interface{}, 0) |
|
|
|
specMap["Specs"] = specs |
|
|
|
ctx.JSON(200, response.SuccessWithData(specMap)) |
|
|
|
specMap["specs"] = specs |
|
|
|
ctx.JSON(200, response.OuterSuccessWithData(specMap)) |
|
|
|
} |