mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-08-03 17:50:35 +02:00
Fix and regenerate Swagger and GraphQL
This commit is contained in:
@@ -1261,9 +1261,27 @@ const docTemplate = `{
|
||||
"api.Node": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cpusAllocated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"cpusTotal": {
|
||||
"type": "integer"
|
||||
},
|
||||
"gpusAllocated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"gpusTotal": {
|
||||
"type": "integer"
|
||||
},
|
||||
"hostname": {
|
||||
"type": "string"
|
||||
},
|
||||
"memoryAllocated": {
|
||||
"type": "integer"
|
||||
},
|
||||
"memoryTotal": {
|
||||
"type": "integer"
|
||||
},
|
||||
"states": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -1379,7 +1397,8 @@ const docTemplate = `{
|
||||
"energyFootprint": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "number"
|
||||
"type": "number",
|
||||
"format": "float64"
|
||||
}
|
||||
},
|
||||
"exclusive": {
|
||||
@@ -1391,7 +1410,8 @@ const docTemplate = `{
|
||||
"footprint": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "number"
|
||||
"type": "number",
|
||||
"format": "float64"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
@@ -1482,6 +1502,10 @@ const docTemplate = `{
|
||||
"type": "string",
|
||||
"example": "main"
|
||||
},
|
||||
"submitTime": {
|
||||
"type": "integer",
|
||||
"example": 1649723812
|
||||
},
|
||||
"tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -1547,24 +1571,32 @@ const docTemplate = `{
|
||||
"schema.JobState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"running",
|
||||
"completed",
|
||||
"failed",
|
||||
"boot_fail",
|
||||
"cancelled",
|
||||
"stopped",
|
||||
"timeout",
|
||||
"completed",
|
||||
"deadline",
|
||||
"failed",
|
||||
"node_fail",
|
||||
"out_of_memory",
|
||||
"pending",
|
||||
"preempted",
|
||||
"out_of_memory"
|
||||
"running",
|
||||
"suspended",
|
||||
"timeout"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"JobStateRunning",
|
||||
"JobStateCompleted",
|
||||
"JobStateFailed",
|
||||
"JobStateBootFail",
|
||||
"JobStateCancelled",
|
||||
"JobStateStopped",
|
||||
"JobStateTimeout",
|
||||
"JobStateCompleted",
|
||||
"JobStateDeadline",
|
||||
"JobStateFailed",
|
||||
"JobStateNodeFail",
|
||||
"JobStateOutOfMemory",
|
||||
"JobStatePending",
|
||||
"JobStatePreempted",
|
||||
"JobStateOutOfMemory"
|
||||
"JobStateRunning",
|
||||
"JobStateSuspended",
|
||||
"JobStateTimeout"
|
||||
]
|
||||
},
|
||||
"schema.JobStatistics": {
|
||||
@@ -1763,7 +1795,8 @@ const docTemplate = `{
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "number"
|
||||
"type": "number",
|
||||
"format": "float64"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/ClusterCockpit/cc-backend/internal/archiver"
|
||||
"github.com/ClusterCockpit/cc-backend/internal/config"
|
||||
"github.com/ClusterCockpit/cc-backend/internal/graph"
|
||||
"github.com/ClusterCockpit/cc-backend/internal/graph/model"
|
||||
"github.com/ClusterCockpit/cc-backend/internal/importer"
|
||||
@@ -142,7 +143,7 @@ func (api *RestApi) getJobs(rw http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
ufrom, uto := time.Unix(from, 0), time.Unix(to, 0)
|
||||
filter.StartTime = &schema.TimeRange{From: &ufrom, To: &uto}
|
||||
filter.StartTime = &config.TimeRange{From: &ufrom, To: &uto}
|
||||
case "page":
|
||||
x, err := strconv.Atoi(vals[0])
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user