cc-backend/internal/graph/model/models_gen.go

248 lines
5.5 KiB
Go
Raw Normal View History

2021-03-31 08:50:53 +02:00
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
"time"
2021-10-26 10:22:02 +02:00
2022-06-21 17:52:36 +02:00
"github.com/ClusterCockpit/cc-backend/pkg/schema"
2021-03-31 08:50:53 +02:00
)
2022-02-19 10:28:29 +01:00
type Count struct {
Name string `json:"name"`
Count int `json:"count"`
}
2021-03-31 08:50:53 +02:00
type FloatRange struct {
From float64 `json:"from"`
To float64 `json:"to"`
2021-03-31 08:50:53 +02:00
}
type Footprints struct {
Nodehours []schema.Float `json:"nodehours"`
Metrics []*MetricFootprints `json:"metrics"`
}
2021-03-31 08:50:53 +02:00
type HistoPoint struct {
Count int `json:"count"`
Value int `json:"value"`
}
type IntRangeOutput struct {
From int `json:"from"`
To int `json:"to"`
}
2021-03-31 08:50:53 +02:00
type JobFilter struct {
Tags []string `json:"tags"`
JobID *StringInput `json:"jobId"`
ArrayJobID *int `json:"arrayJobId"`
User *StringInput `json:"user"`
Project *StringInput `json:"project"`
JobName *StringInput `json:"jobName"`
Cluster *StringInput `json:"cluster"`
Partition *StringInput `json:"partition"`
Duration *schema.IntRange `json:"duration"`
2022-03-02 10:48:52 +01:00
MinRunningFor *int `json:"minRunningFor"`
NumNodes *schema.IntRange `json:"numNodes"`
NumAccelerators *schema.IntRange `json:"numAccelerators"`
NumHWThreads *schema.IntRange `json:"numHWThreads"`
StartTime *schema.TimeRange `json:"startTime"`
State []schema.JobState `json:"state"`
FlopsAnyAvg *FloatRange `json:"flopsAnyAvg"`
MemBwAvg *FloatRange `json:"memBwAvg"`
LoadAvg *FloatRange `json:"loadAvg"`
MemUsedMax *FloatRange `json:"memUsedMax"`
2021-03-31 08:50:53 +02:00
}
2021-04-07 09:19:21 +02:00
type JobMetricWithName struct {
2021-12-20 10:48:58 +01:00
Name string `json:"name"`
Metric *schema.JobMetric `json:"metric"`
2021-12-17 15:49:22 +01:00
}
2021-03-31 08:50:53 +02:00
type JobResultList struct {
2021-12-17 15:49:22 +01:00
Items []*schema.Job `json:"items"`
Offset *int `json:"offset"`
Limit *int `json:"limit"`
Count *int `json:"count"`
2021-03-31 08:50:53 +02:00
}
type JobsStatistics struct {
2021-10-26 10:22:02 +02:00
ID string `json:"id"`
Name *string `json:"name"`
2021-03-31 08:50:53 +02:00
TotalJobs int `json:"totalJobs"`
ShortJobs int `json:"shortJobs"`
TotalWalltime int `json:"totalWalltime"`
TotalCoreHours int `json:"totalCoreHours"`
HistDuration []*HistoPoint `json:"histDuration"`
2021-03-31 08:50:53 +02:00
HistNumNodes []*HistoPoint `json:"histNumNodes"`
}
2021-10-26 10:22:02 +02:00
type MetricFootprints struct {
Metric string `json:"metric"`
Data []schema.Float `json:"data"`
2021-10-26 10:22:02 +02:00
}
2021-12-09 16:25:48 +01:00
type NodeMetrics struct {
Host string `json:"host"`
SubCluster string `json:"subCluster"`
Metrics []*JobMetricWithName `json:"metrics"`
2021-12-09 16:25:48 +01:00
}
2021-03-31 08:50:53 +02:00
type OrderByInput struct {
2021-10-26 10:22:02 +02:00
Field string `json:"field"`
Order SortDirectionEnum `json:"order"`
2021-03-31 08:50:53 +02:00
}
type PageRequest struct {
2021-09-23 11:45:20 +02:00
ItemsPerPage int `json:"itemsPerPage"`
Page int `json:"page"`
2021-03-31 08:50:53 +02:00
}
type StringInput struct {
Eq *string `json:"eq"`
Contains *string `json:"contains"`
StartsWith *string `json:"startsWith"`
EndsWith *string `json:"endsWith"`
In []string `json:"in"`
}
type TimeRangeOutput struct {
From time.Time `json:"from"`
To time.Time `json:"to"`
}
2022-03-15 11:04:54 +01:00
type User struct {
Username string `json:"username"`
Name string `json:"name"`
Email string `json:"email"`
2022-03-15 11:04:54 +01:00
}
2021-10-26 10:22:02 +02:00
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()))
2021-09-23 11:45:20 +02:00
}
2021-03-31 08:50:53 +02:00
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()))
}
2022-03-25 10:20:33 +01:00
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()))
}