Small additions to swagger docs

This commit is contained in:
Christoph Kluge 2022-09-21 14:12:24 +02:00
parent 05a84cb95c
commit 94c77d8a67
4 changed files with 42 additions and 28 deletions

View File

@ -389,7 +389,7 @@
} }
}, },
"schema.Job": { "schema.Job": {
"description": "Meta data information of a HPC job.", "description": "Information of a HPC job.",
"type": "object", "type": "object",
"properties": { "properties": {
"arrayJobId": { "arrayJobId": {
@ -409,11 +409,11 @@
"example": 43200 "example": 43200
}, },
"exclusive": { "exclusive": {
"description": "Specifies how nodes are shared. 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of same user", "description": "Specifies how nodes are shared: 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple jobs of same user",
"type": "integer", "type": "integer",
"maximum": 2, "maximum": 2,
"minimum": 0, "minimum": 0,
"example": 2 "example": 1
}, },
"id": { "id": {
"description": "The unique identifier of a job in the database", "description": "The unique identifier of a job in the database",
@ -445,8 +445,10 @@
} }
}, },
"monitoringStatus": { "monitoringStatus": {
"description": "State of monitoring system during job run", "description": "State of monitoring system during job run: 0 - Disabled, 1 - Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull",
"type": "integer", "type": "integer",
"maximum": 3,
"minimum": 0,
"example": 1 "example": 1
}, },
"numAcc": { "numAcc": {
@ -538,11 +540,11 @@
"example": 43200 "example": 43200
}, },
"exclusive": { "exclusive": {
"description": "Specifies how nodes are shared. 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of same user", "description": "Specifies how nodes are shared: 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple jobs of same user",
"type": "integer", "type": "integer",
"maximum": 2, "maximum": 2,
"minimum": 0, "minimum": 0,
"example": 2 "example": 1
}, },
"id": { "id": {
"description": "The unique identifier of a job in the database", "description": "The unique identifier of a job in the database",
@ -574,8 +576,10 @@
} }
}, },
"monitoringStatus": { "monitoringStatus": {
"description": "State of monitoring system during job run", "description": "State of monitoring system during job run: 0 - Disabled, 1 - Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull",
"type": "integer", "type": "integer",
"maximum": 3,
"minimum": 0,
"example": 1 "example": 1
}, },
"numAcc": { "numAcc": {

View File

@ -64,7 +64,7 @@ definitions:
type: string type: string
type: object type: object
schema.Job: schema.Job:
description: Meta data information of a HPC job. description: Information of a HPC job.
properties: properties:
arrayJobId: arrayJobId:
description: The unique identifier of an array job description: The unique identifier of an array job
@ -80,10 +80,10 @@ definitions:
minimum: 0 minimum: 0
type: integer type: integer
exclusive: exclusive:
description: Specifies how nodes are shared. 0 - Shared among multiple jobs description: 'Specifies how nodes are shared: 0 - Shared among multiple jobs
of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple
same user jobs of same user'
example: 2 example: 1
maximum: 2 maximum: 2
minimum: 0 minimum: 0
type: integer type: integer
@ -111,8 +111,11 @@ definitions:
description: Additional information about the job description: Additional information about the job
type: object type: object
monitoringStatus: monitoringStatus:
description: State of monitoring system during job run description: 'State of monitoring system during job run: 0 - Disabled, 1 -
Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull'
example: 1 example: 1
maximum: 3
minimum: 0
type: integer type: integer
numAcc: numAcc:
description: Number of accelerators used description: Number of accelerators used
@ -184,10 +187,10 @@ definitions:
minimum: 0 minimum: 0
type: integer type: integer
exclusive: exclusive:
description: Specifies how nodes are shared. 0 - Shared among multiple jobs description: 'Specifies how nodes are shared: 0 - Shared among multiple jobs
of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple
same user jobs of same user'
example: 2 example: 1
maximum: 2 maximum: 2
minimum: 0 minimum: 0
type: integer type: integer
@ -215,8 +218,11 @@ definitions:
description: Additional information about the job description: Additional information about the job
type: object type: object
monitoringStatus: monitoringStatus:
description: State of monitoring system during job run description: 'State of monitoring system during job run: 0 - Disabled, 1 -
Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull'
example: 1 example: 1
maximum: 3
minimum: 0
type: integer type: integer
numAcc: numAcc:
description: Number of accelerators used description: Number of accelerators used

View File

@ -1,6 +1,6 @@
// Package api GENERATED BY SWAG; DO NOT EDIT // Package api GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag at // This file was generated by swaggo/swag at
// 2022-09-21 11:45:40.164979895 +0200 CEST m=+0.117799537 // 2022-09-21 14:11:26.478228557 +0200 CEST m=+0.132083534
package api package api
import "github.com/swaggo/swag" import "github.com/swaggo/swag"
@ -397,7 +397,7 @@ const docTemplate = `{
} }
}, },
"schema.Job": { "schema.Job": {
"description": "Meta data information of a HPC job.", "description": "Information of a HPC job.",
"type": "object", "type": "object",
"properties": { "properties": {
"arrayJobId": { "arrayJobId": {
@ -417,11 +417,11 @@ const docTemplate = `{
"example": 43200 "example": 43200
}, },
"exclusive": { "exclusive": {
"description": "Specifies how nodes are shared. 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of same user", "description": "Specifies how nodes are shared: 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple jobs of same user",
"type": "integer", "type": "integer",
"maximum": 2, "maximum": 2,
"minimum": 0, "minimum": 0,
"example": 2 "example": 1
}, },
"id": { "id": {
"description": "The unique identifier of a job in the database", "description": "The unique identifier of a job in the database",
@ -453,8 +453,10 @@ const docTemplate = `{
} }
}, },
"monitoringStatus": { "monitoringStatus": {
"description": "State of monitoring system during job run", "description": "State of monitoring system during job run: 0 - Disabled, 1 - Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull",
"type": "integer", "type": "integer",
"maximum": 3,
"minimum": 0,
"example": 1 "example": 1
}, },
"numAcc": { "numAcc": {
@ -546,11 +548,11 @@ const docTemplate = `{
"example": 43200 "example": 43200
}, },
"exclusive": { "exclusive": {
"description": "Specifies how nodes are shared. 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of same user", "description": "Specifies how nodes are shared: 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple jobs of same user",
"type": "integer", "type": "integer",
"maximum": 2, "maximum": 2,
"minimum": 0, "minimum": 0,
"example": 2 "example": 1
}, },
"id": { "id": {
"description": "The unique identifier of a job in the database", "description": "The unique identifier of a job in the database",
@ -582,8 +584,10 @@ const docTemplate = `{
} }
}, },
"monitoringStatus": { "monitoringStatus": {
"description": "State of monitoring system during job run", "description": "State of monitoring system during job run: 0 - Disabled, 1 - Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull",
"type": "integer", "type": "integer",
"maximum": 3,
"minimum": 0,
"example": 1 "example": 1
}, },
"numAcc": { "numAcc": {

View File

@ -26,8 +26,8 @@ type BaseJob struct {
NumNodes int32 `json:"numNodes" db:"num_nodes" example:"2" minimum:"0"` // Number of nodes used NumNodes int32 `json:"numNodes" db:"num_nodes" example:"2" minimum:"0"` // Number of nodes used
NumHWThreads int32 `json:"numHwthreads" db:"num_hwthreads" example:"20" minimum:"0"` // Number of HWThreads used NumHWThreads int32 `json:"numHwthreads" db:"num_hwthreads" example:"20" minimum:"0"` // Number of HWThreads used
NumAcc int32 `json:"numAcc" db:"num_acc" example:"2" minimum:"0"` // Number of accelerators used NumAcc int32 `json:"numAcc" db:"num_acc" example:"2" minimum:"0"` // Number of accelerators used
Exclusive int32 `json:"exclusive" db:"exclusive" example:"2" minimum:"0" maximum:"2"` // Specifies how nodes are shared. 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive, 2 - Shared among multiple jobs of same user Exclusive int32 `json:"exclusive" db:"exclusive" example:"1" minimum:"0" maximum:"2"` // Specifies how nodes are shared: 0 - Shared among multiple jobs of multiple users, 1 - Job exclusive (Default), 2 - Shared among multiple jobs of same user
MonitoringStatus int32 `json:"monitoringStatus" db:"monitoring_status" example:"1"` // State of monitoring system during job run MonitoringStatus int32 `json:"monitoringStatus" db:"monitoring_status" example:"1" minimum:"0" maximum:"3"` // State of monitoring system during job run: 0 - Disabled, 1 - Running or Archiving (Default), 2 - Archiving Failed, 3 - Archiving Successfull
SMT int32 `json:"smt" db:"smt" example:"4"` // SMT threads used by job SMT int32 `json:"smt" db:"smt" example:"4"` // SMT threads used by job
State JobState `json:"jobState" db:"job_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"` // Final state of job State JobState `json:"jobState" db:"job_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"` // Final state of job
Duration int32 `json:"duration" db:"duration" example:"43200" minimum:"0"` // Duration of job in seconds Duration int32 `json:"duration" db:"duration" example:"43200" minimum:"0"` // Duration of job in seconds