feat: Add cluster config endpoint to rest api

This commit is contained in:
2024-03-08 16:35:30 +01:00
parent 9fd839fad8
commit 99d55f05f8
4 changed files with 756 additions and 4 deletions

View File

@@ -68,6 +68,14 @@ definitions:
description: Statustext of Errorcode
type: string
type: object
api.GetClustersApiResponse:
properties:
clusters:
description: Array of clusters
items:
$ref: '#/definitions/schema.Cluster'
type: array
type: object
api.GetJobApiResponse:
properties:
data:
@@ -133,6 +141,28 @@ definitions:
- jobState
- stopTime
type: object
schema.Accelerator:
properties:
id:
type: string
model:
type: string
type:
type: string
type: object
schema.Cluster:
properties:
metricConfig:
items:
$ref: '#/definitions/schema.MetricConfig'
type: array
name:
type: string
subClusters:
items:
$ref: '#/definitions/schema.SubCluster'
type: array
type: object
schema.Job:
description: Information of a HPC job.
properties:
@@ -448,6 +478,31 @@ definitions:
unit:
$ref: '#/definitions/schema.Unit'
type: object
schema.MetricConfig:
properties:
aggregation:
type: string
alert:
type: number
caution:
type: number
name:
type: string
normal:
type: number
peak:
type: number
scope:
$ref: '#/definitions/schema.MetricScope'
subClusters:
items:
$ref: '#/definitions/schema.SubClusterConfig'
type: array
timestep:
type: integer
unit:
$ref: '#/definitions/schema.Unit'
type: object
schema.MetricScope:
enum:
- invalid_scope
@@ -475,6 +530,13 @@ definitions:
min:
type: number
type: object
schema.MetricValue:
properties:
unit:
$ref: '#/definitions/schema.Unit'
value:
type: number
type: object
schema.Resource:
description: A resource used by a job
properties:
@@ -529,6 +591,44 @@ definitions:
type: array
type: object
type: object
schema.SubCluster:
properties:
coresPerSocket:
type: integer
flopRateScalar:
$ref: '#/definitions/schema.MetricValue'
flopRateSimd:
$ref: '#/definitions/schema.MetricValue'
memoryBandwidth:
$ref: '#/definitions/schema.MetricValue'
name:
type: string
nodes:
type: string
processorType:
type: string
socketsPerNode:
type: integer
threadsPerCore:
type: integer
topology:
$ref: '#/definitions/schema.Topology'
type: object
schema.SubClusterConfig:
properties:
alert:
type: number
caution:
type: number
name:
type: string
normal:
type: number
peak:
type: number
remove:
type: boolean
type: object
schema.Tag:
description: Defines a tag using name and type.
properties:
@@ -544,6 +644,41 @@ definitions:
example: Debug
type: string
type: object
schema.Topology:
properties:
accelerators:
items:
$ref: '#/definitions/schema.Accelerator'
type: array
core:
items:
items:
type: integer
type: array
type: array
die:
items:
items:
type: integer
type: array
type: array
memoryDomain:
items:
items:
type: integer
type: array
type: array
node:
items:
type: integer
type: array
socket:
items:
items:
type: integer
type: array
type: array
type: object
schema.Unit:
properties:
base:
@@ -564,6 +699,43 @@ info:
title: ClusterCockpit REST API
version: 1.0.0
paths:
/clusters/:
get:
description: Get a list of all cluster configs. Specific cluster can be requested
using query parameter.
parameters:
- description: Job Cluster
in: query
name: cluster
type: string
produces:
- application/json
responses:
"200":
description: Array of clusters
schema:
$ref: '#/definitions/api.GetClustersApiResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.ErrorResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/api.ErrorResponse'
"403":
description: Forbidden
schema:
$ref: '#/definitions/api.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/api.ErrorResponse'
security:
- ApiKeyAuth: []
summary: Lists all cluster configs
tags:
- Cluster query
/jobs/:
get:
description: |-