mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
265 lines
5.8 KiB
Go
265 lines
5.8 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
"time"
|
|
|
|
"github.com/ClusterCockpit/cc-jobarchive/schema"
|
|
)
|
|
|
|
type FilterRanges struct {
|
|
Duration *IntRangeOutput `json:"duration"`
|
|
NumNodes *IntRangeOutput `json:"numNodes"`
|
|
StartTime *TimeRangeOutput `json:"startTime"`
|
|
}
|
|
|
|
type FloatRange struct {
|
|
From float64 `json:"from"`
|
|
To float64 `json:"to"`
|
|
}
|
|
|
|
type HistoPoint struct {
|
|
Count int `json:"count"`
|
|
Value int `json:"value"`
|
|
}
|
|
|
|
type IntRange struct {
|
|
From int `json:"from"`
|
|
To int `json:"to"`
|
|
}
|
|
|
|
type IntRangeOutput struct {
|
|
From int `json:"from"`
|
|
To int `json:"to"`
|
|
}
|
|
|
|
type Job struct {
|
|
ID string `json:"id"`
|
|
JobID string `json:"jobId"`
|
|
UserID string `json:"userId"`
|
|
ProjectID string `json:"projectId"`
|
|
ClusterID string `json:"clusterId"`
|
|
StartTime time.Time `json:"startTime"`
|
|
Duration int `json:"duration"`
|
|
NumNodes int `json:"numNodes"`
|
|
Nodes []string `json:"nodes"`
|
|
HasProfile bool `json:"hasProfile"`
|
|
State JobState `json:"state"`
|
|
Tags []*JobTag `json:"tags"`
|
|
LoadAvg *float64 `json:"loadAvg"`
|
|
MemUsedMax *float64 `json:"memUsedMax"`
|
|
FlopsAnyAvg *float64 `json:"flopsAnyAvg"`
|
|
MemBwAvg *float64 `json:"memBwAvg"`
|
|
NetBwAvg *float64 `json:"netBwAvg"`
|
|
FileBwAvg *float64 `json:"fileBwAvg"`
|
|
}
|
|
|
|
type JobFilter struct {
|
|
Tags []string `json:"tags"`
|
|
JobID *StringInput `json:"jobId"`
|
|
UserID *StringInput `json:"userId"`
|
|
ProjectID *StringInput `json:"projectId"`
|
|
ClusterID *StringInput `json:"clusterId"`
|
|
Duration *IntRange `json:"duration"`
|
|
NumNodes *IntRange `json:"numNodes"`
|
|
StartTime *TimeRange `json:"startTime"`
|
|
IsRunning *bool `json:"isRunning"`
|
|
FlopsAnyAvg *FloatRange `json:"flopsAnyAvg"`
|
|
MemBwAvg *FloatRange `json:"memBwAvg"`
|
|
LoadAvg *FloatRange `json:"loadAvg"`
|
|
MemUsedMax *FloatRange `json:"memUsedMax"`
|
|
}
|
|
|
|
type JobMetricWithName struct {
|
|
Name string `json:"name"`
|
|
Metric *schema.JobMetric `json:"metric"`
|
|
}
|
|
|
|
type JobResultList struct {
|
|
Items []*Job `json:"items"`
|
|
Offset *int `json:"offset"`
|
|
Limit *int `json:"limit"`
|
|
Count *int `json:"count"`
|
|
}
|
|
|
|
type JobsStatistics struct {
|
|
ID string `json:"id"`
|
|
TotalJobs int `json:"totalJobs"`
|
|
ShortJobs int `json:"shortJobs"`
|
|
TotalWalltime int `json:"totalWalltime"`
|
|
TotalCoreHours int `json:"totalCoreHours"`
|
|
HistWalltime []*HistoPoint `json:"histWalltime"`
|
|
HistNumNodes []*HistoPoint `json:"histNumNodes"`
|
|
}
|
|
|
|
type MetricConfig struct {
|
|
Name string `json:"name"`
|
|
Unit string `json:"unit"`
|
|
Sampletime int `json:"sampletime"`
|
|
Peak int `json:"peak"`
|
|
Normal int `json:"normal"`
|
|
Caution int `json:"caution"`
|
|
Alert int `json:"alert"`
|
|
}
|
|
|
|
type MetricFootprints struct {
|
|
Name string `json:"name"`
|
|
Footprints []schema.Float `json:"footprints"`
|
|
}
|
|
|
|
type OrderByInput struct {
|
|
Field string `json:"field"`
|
|
Order SortDirectionEnum `json:"order"`
|
|
}
|
|
|
|
type PageRequest struct {
|
|
ItemsPerPage int `json:"itemsPerPage"`
|
|
Page int `json:"page"`
|
|
}
|
|
|
|
type StringInput struct {
|
|
Eq *string `json:"eq"`
|
|
Contains *string `json:"contains"`
|
|
StartsWith *string `json:"startsWith"`
|
|
EndsWith *string `json:"endsWith"`
|
|
}
|
|
|
|
type TimeRange struct {
|
|
From *time.Time `json:"from"`
|
|
To *time.Time `json:"to"`
|
|
}
|
|
|
|
type TimeRangeOutput struct {
|
|
From time.Time `json:"from"`
|
|
To time.Time `json:"to"`
|
|
}
|
|
|
|
type Aggregate string
|
|
|
|
const (
|
|
AggregateUser Aggregate = "USER"
|
|
AggregateProject Aggregate = "PROJECT"
|
|
AggregateCluster Aggregate = "CLUSTER"
|
|
)
|
|
|
|
var AllAggregate = []Aggregate{
|
|
AggregateUser,
|
|
AggregateProject,
|
|
AggregateCluster,
|
|
}
|
|
|
|
func (e Aggregate) IsValid() bool {
|
|
switch e {
|
|
case AggregateUser, AggregateProject, AggregateCluster:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e Aggregate) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *Aggregate) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = Aggregate(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid Aggregate", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e Aggregate) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
type JobState string
|
|
|
|
const (
|
|
JobStateRunning JobState = "running"
|
|
JobStateCompleted JobState = "completed"
|
|
)
|
|
|
|
var AllJobState = []JobState{
|
|
JobStateRunning,
|
|
JobStateCompleted,
|
|
}
|
|
|
|
func (e JobState) IsValid() bool {
|
|
switch e {
|
|
case JobStateRunning, JobStateCompleted:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e JobState) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *JobState) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = JobState(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid JobState", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e JobState) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
type SortDirectionEnum string
|
|
|
|
const (
|
|
SortDirectionEnumDesc SortDirectionEnum = "DESC"
|
|
SortDirectionEnumAsc SortDirectionEnum = "ASC"
|
|
)
|
|
|
|
var AllSortDirectionEnum = []SortDirectionEnum{
|
|
SortDirectionEnumDesc,
|
|
SortDirectionEnumAsc,
|
|
}
|
|
|
|
func (e SortDirectionEnum) IsValid() bool {
|
|
switch e {
|
|
case SortDirectionEnumDesc, SortDirectionEnumAsc:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e SortDirectionEnum) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *SortDirectionEnum) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = SortDirectionEnum(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid SortDirectionEnum", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e SortDirectionEnum) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|