mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
266 lines
6.3 KiB
Go
266 lines
6.3 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
"time"
|
|
|
|
"github.com/ClusterCockpit/cc-backend/pkg/schema"
|
|
)
|
|
|
|
type Count struct {
|
|
Name string `json:"name"`
|
|
Count int `json:"count"`
|
|
}
|
|
|
|
type FloatRange struct {
|
|
From float64 `json:"from"`
|
|
To float64 `json:"to"`
|
|
}
|
|
|
|
type Footprints struct {
|
|
Timeweights []schema.Float `json:"timeweights"`
|
|
Metrics []*MetricFootprints `json:"metrics"`
|
|
}
|
|
|
|
type HistoPoint struct {
|
|
Count int `json:"count"`
|
|
Value int `json:"value"`
|
|
}
|
|
|
|
type IntRangeOutput struct {
|
|
From int `json:"from"`
|
|
To int `json:"to"`
|
|
}
|
|
|
|
type JobFilter struct {
|
|
Tags []string `json:"tags,omitempty"`
|
|
JobID *StringInput `json:"jobId,omitempty"`
|
|
ArrayJobID *int `json:"arrayJobId,omitempty"`
|
|
User *StringInput `json:"user,omitempty"`
|
|
Project *StringInput `json:"project,omitempty"`
|
|
JobName *StringInput `json:"jobName,omitempty"`
|
|
Cluster *StringInput `json:"cluster,omitempty"`
|
|
Partition *StringInput `json:"partition,omitempty"`
|
|
Duration *schema.IntRange `json:"duration,omitempty"`
|
|
MinRunningFor *int `json:"minRunningFor,omitempty"`
|
|
NumNodes *schema.IntRange `json:"numNodes,omitempty"`
|
|
NumAccelerators *schema.IntRange `json:"numAccelerators,omitempty"`
|
|
NumHWThreads *schema.IntRange `json:"numHWThreads,omitempty"`
|
|
StartTime *schema.TimeRange `json:"startTime,omitempty"`
|
|
State []schema.JobState `json:"state,omitempty"`
|
|
FlopsAnyAvg *FloatRange `json:"flopsAnyAvg,omitempty"`
|
|
MemBwAvg *FloatRange `json:"memBwAvg,omitempty"`
|
|
LoadAvg *FloatRange `json:"loadAvg,omitempty"`
|
|
MemUsedMax *FloatRange `json:"memUsedMax,omitempty"`
|
|
Exclusive *int `json:"exclusive,omitempty"`
|
|
Node *StringInput `json:"node,omitempty"`
|
|
}
|
|
|
|
type JobLink struct {
|
|
ID string `json:"id"`
|
|
JobID int `json:"jobId"`
|
|
}
|
|
|
|
type JobLinkResultList struct {
|
|
ListQuery *string `json:"listQuery,omitempty"`
|
|
Items []*JobLink `json:"items"`
|
|
Count *int `json:"count,omitempty"`
|
|
}
|
|
|
|
type JobMetricWithName struct {
|
|
Name string `json:"name"`
|
|
Scope schema.MetricScope `json:"scope"`
|
|
Metric *schema.JobMetric `json:"metric"`
|
|
}
|
|
|
|
type JobResultList struct {
|
|
Items []*schema.Job `json:"items"`
|
|
Offset *int `json:"offset,omitempty"`
|
|
Limit *int `json:"limit,omitempty"`
|
|
Count *int `json:"count,omitempty"`
|
|
}
|
|
|
|
type JobsStatistics struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
TotalJobs int `json:"totalJobs"`
|
|
RunningJobs int `json:"runningJobs"`
|
|
ShortJobs int `json:"shortJobs"`
|
|
TotalWalltime int `json:"totalWalltime"`
|
|
TotalNodeHours int `json:"totalNodeHours"`
|
|
TotalCoreHours int `json:"totalCoreHours"`
|
|
TotalAccHours int `json:"totalAccHours"`
|
|
HistDuration []*HistoPoint `json:"histDuration"`
|
|
HistNumNodes []*HistoPoint `json:"histNumNodes"`
|
|
}
|
|
|
|
type MetricFootprints struct {
|
|
Metric string `json:"metric"`
|
|
Data []schema.Float `json:"data"`
|
|
}
|
|
|
|
type NodeMetrics struct {
|
|
Host string `json:"host"`
|
|
SubCluster string `json:"subCluster"`
|
|
Metrics []*JobMetricWithName `json:"metrics"`
|
|
}
|
|
|
|
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,omitempty"`
|
|
Neq *string `json:"neq,omitempty"`
|
|
Contains *string `json:"contains,omitempty"`
|
|
StartsWith *string `json:"startsWith,omitempty"`
|
|
EndsWith *string `json:"endsWith,omitempty"`
|
|
In []string `json:"in,omitempty"`
|
|
}
|
|
|
|
type TimeRangeOutput struct {
|
|
From time.Time `json:"from"`
|
|
To time.Time `json:"to"`
|
|
}
|
|
|
|
type User struct {
|
|
Username string `json:"username"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
}
|
|
|
|
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 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()))
|
|
}
|
|
|
|
type Weights string
|
|
|
|
const (
|
|
WeightsNodeCount Weights = "NODE_COUNT"
|
|
WeightsNodeHours Weights = "NODE_HOURS"
|
|
)
|
|
|
|
var AllWeights = []Weights{
|
|
WeightsNodeCount,
|
|
WeightsNodeHours,
|
|
}
|
|
|
|
func (e Weights) IsValid() bool {
|
|
switch e {
|
|
case WeightsNodeCount, WeightsNodeHours:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e Weights) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *Weights) UnmarshalGQL(v interface{}) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = Weights(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid Weights", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e Weights) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|