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 {
|
2022-09-12 13:33:01 +02:00
|
|
|
From float64 `json:"from"`
|
|
|
|
To float64 `json:"to"`
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
|
2024-07-11 17:23:59 +02:00
|
|
|
type FootprintValue struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Stat string `json:"stat"`
|
|
|
|
Value float64 `json:"value"`
|
|
|
|
}
|
|
|
|
|
2022-03-16 16:11:28 +01:00
|
|
|
type Footprints struct {
|
2023-08-24 11:52:36 +02:00
|
|
|
TimeWeights *TimeWeights `json:"timeWeights"`
|
2023-07-21 16:33:53 +02:00
|
|
|
Metrics []*MetricFootprints `json:"metrics"`
|
2022-03-16 16:11:28 +01:00
|
|
|
}
|
|
|
|
|
2021-03-31 08:50:53 +02:00
|
|
|
type HistoPoint struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Value int `json:"value"`
|
|
|
|
}
|
|
|
|
|
2021-05-06 08:36:24 +02:00
|
|
|
type IntRangeOutput struct {
|
|
|
|
From int `json:"from"`
|
|
|
|
To int `json:"to"`
|
|
|
|
}
|
|
|
|
|
2021-03-31 08:50:53 +02:00
|
|
|
type JobFilter struct {
|
2023-08-21 08:49:42 +02:00
|
|
|
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"`
|
2024-07-12 13:21:19 +02:00
|
|
|
MetricStats []*MetricStatItem `json:"metricStats,omitempty"`
|
2023-08-21 08:49:42 +02:00
|
|
|
Exclusive *int `json:"exclusive,omitempty"`
|
|
|
|
Node *StringInput `json:"node,omitempty"`
|
2023-04-28 12:34:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type JobLink struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
JobID int `json:"jobId"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type JobLinkResultList struct {
|
2023-08-21 08:49:42 +02:00
|
|
|
ListQuery *string `json:"listQuery,omitempty"`
|
2023-06-28 13:35:41 +02:00
|
|
|
Items []*JobLink `json:"items"`
|
2023-08-21 08:49:42 +02:00
|
|
|
Count *int `json:"count,omitempty"`
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
|
2021-04-07 09:19:21 +02:00
|
|
|
type JobMetricWithName struct {
|
2023-03-24 15:10:23 +01:00
|
|
|
Name string `json:"name"`
|
|
|
|
Scope schema.MetricScope `json:"scope"`
|
|
|
|
Metric *schema.JobMetric `json:"metric"`
|
2021-12-17 15:49:22 +01:00
|
|
|
}
|
|
|
|
|
2021-03-31 08:50:53 +02:00
|
|
|
type JobResultList struct {
|
2024-03-26 15:56:07 +01:00
|
|
|
Items []*schema.Job `json:"items"`
|
|
|
|
Offset *int `json:"offset,omitempty"`
|
|
|
|
Limit *int `json:"limit,omitempty"`
|
|
|
|
Count *int `json:"count,omitempty"`
|
2024-03-26 16:27:04 +01:00
|
|
|
HasNextPage *bool `json:"hasNextPage,omitempty"`
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type JobsStatistics struct {
|
2023-12-01 13:22:01 +01:00
|
|
|
ID string `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
TotalJobs int `json:"totalJobs"`
|
|
|
|
RunningJobs int `json:"runningJobs"`
|
|
|
|
ShortJobs int `json:"shortJobs"`
|
|
|
|
TotalWalltime int `json:"totalWalltime"`
|
|
|
|
TotalNodes int `json:"totalNodes"`
|
|
|
|
TotalNodeHours int `json:"totalNodeHours"`
|
|
|
|
TotalCores int `json:"totalCores"`
|
|
|
|
TotalCoreHours int `json:"totalCoreHours"`
|
|
|
|
TotalAccs int `json:"totalAccs"`
|
|
|
|
TotalAccHours int `json:"totalAccHours"`
|
|
|
|
HistDuration []*HistoPoint `json:"histDuration"`
|
|
|
|
HistNumNodes []*HistoPoint `json:"histNumNodes"`
|
|
|
|
HistNumCores []*HistoPoint `json:"histNumCores"`
|
|
|
|
HistNumAccs []*HistoPoint `json:"histNumAccs"`
|
|
|
|
HistMetrics []*MetricHistoPoints `json:"histMetrics"`
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
|
2021-10-26 10:22:02 +02:00
|
|
|
type MetricFootprints struct {
|
2022-03-16 16:11:28 +01:00
|
|
|
Metric string `json:"metric"`
|
|
|
|
Data []schema.Float `json:"data"`
|
2021-10-26 10:22:02 +02:00
|
|
|
}
|
|
|
|
|
2023-12-05 11:59:01 +01:00
|
|
|
type MetricHistoPoint struct {
|
2023-12-08 12:03:04 +01:00
|
|
|
Bin *int `json:"bin,omitempty"`
|
|
|
|
Count int `json:"count"`
|
|
|
|
Min *int `json:"min,omitempty"`
|
|
|
|
Max *int `json:"max,omitempty"`
|
2023-12-05 11:59:01 +01:00
|
|
|
}
|
|
|
|
|
2023-12-01 13:22:01 +01:00
|
|
|
type MetricHistoPoints struct {
|
2023-12-05 11:59:01 +01:00
|
|
|
Metric string `json:"metric"`
|
2023-12-05 15:30:40 +01:00
|
|
|
Unit string `json:"unit"`
|
2024-07-22 15:41:33 +02:00
|
|
|
Stat *string `json:"stat,omitempty"`
|
2023-12-05 11:59:01 +01:00
|
|
|
Data []*MetricHistoPoint `json:"data,omitempty"`
|
2023-12-01 13:22:01 +01:00
|
|
|
}
|
|
|
|
|
2024-07-12 13:21:19 +02:00
|
|
|
type MetricStatItem struct {
|
|
|
|
MetricName string `json:"metricName"`
|
|
|
|
Range *FloatRange `json:"range"`
|
|
|
|
}
|
|
|
|
|
2024-03-26 15:56:07 +01:00
|
|
|
type Mutation struct {
|
|
|
|
}
|
|
|
|
|
2021-12-09 16:25:48 +01:00
|
|
|
type NodeMetrics struct {
|
2022-03-24 14:34:42 +01:00
|
|
|
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"`
|
2024-07-22 15:41:33 +02:00
|
|
|
Type string `json:"type"`
|
2021-10-26 10:22:02 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-03-26 15:56:07 +01:00
|
|
|
type Query struct {
|
|
|
|
}
|
|
|
|
|
2022-03-14 10:18:56 +01:00
|
|
|
type StringInput struct {
|
2023-08-21 08:49:42 +02:00
|
|
|
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"`
|
2022-03-14 10:18:56 +01:00
|
|
|
}
|
|
|
|
|
2021-05-06 08:36:24 +02:00
|
|
|
type TimeRangeOutput struct {
|
|
|
|
From time.Time `json:"from"`
|
|
|
|
To time.Time `json:"to"`
|
|
|
|
}
|
|
|
|
|
2023-08-24 11:52:36 +02:00
|
|
|
type TimeWeights struct {
|
|
|
|
NodeHours []schema.Float `json:"nodeHours"`
|
|
|
|
AccHours []schema.Float `json:"accHours"`
|
|
|
|
CoreHours []schema.Float `json:"coreHours"`
|
|
|
|
}
|
|
|
|
|
2022-03-15 11:04:54 +01:00
|
|
|
type User struct {
|
|
|
|
Username string `json:"username"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Email string `json:"email"`
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
type SortByAggregate string
|
2021-03-31 08:50:53 +02:00
|
|
|
|
|
|
|
const (
|
2023-08-29 17:38:17 +02:00
|
|
|
SortByAggregateTotalwalltime SortByAggregate = "TOTALWALLTIME"
|
|
|
|
SortByAggregateTotaljobs SortByAggregate = "TOTALJOBS"
|
|
|
|
SortByAggregateTotalnodes SortByAggregate = "TOTALNODES"
|
|
|
|
SortByAggregateTotalnodehours SortByAggregate = "TOTALNODEHOURS"
|
|
|
|
SortByAggregateTotalcores SortByAggregate = "TOTALCORES"
|
|
|
|
SortByAggregateTotalcorehours SortByAggregate = "TOTALCOREHOURS"
|
|
|
|
SortByAggregateTotalaccs SortByAggregate = "TOTALACCS"
|
|
|
|
SortByAggregateTotalacchours SortByAggregate = "TOTALACCHOURS"
|
2021-03-31 08:50:53 +02:00
|
|
|
)
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
var AllSortByAggregate = []SortByAggregate{
|
2023-08-29 17:38:17 +02:00
|
|
|
SortByAggregateTotalwalltime,
|
2023-08-29 14:01:01 +02:00
|
|
|
SortByAggregateTotaljobs,
|
2023-08-25 17:38:25 +02:00
|
|
|
SortByAggregateTotalnodes,
|
2023-08-29 17:38:17 +02:00
|
|
|
SortByAggregateTotalnodehours,
|
2023-08-25 17:38:25 +02:00
|
|
|
SortByAggregateTotalcores,
|
2023-08-29 17:38:17 +02:00
|
|
|
SortByAggregateTotalcorehours,
|
2023-08-25 17:38:25 +02:00
|
|
|
SortByAggregateTotalaccs,
|
2023-08-29 17:38:17 +02:00
|
|
|
SortByAggregateTotalacchours,
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortByAggregate) IsValid() bool {
|
2021-03-31 08:50:53 +02:00
|
|
|
switch e {
|
2023-08-29 17:38:17 +02:00
|
|
|
case SortByAggregateTotalwalltime, SortByAggregateTotaljobs, SortByAggregateTotalnodes, SortByAggregateTotalnodehours, SortByAggregateTotalcores, SortByAggregateTotalcorehours, SortByAggregateTotalaccs, SortByAggregateTotalacchours:
|
2021-03-31 08:50:53 +02:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortByAggregate) String() string {
|
2021-03-31 08:50:53 +02:00
|
|
|
return string(e)
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e *SortByAggregate) UnmarshalGQL(v interface{}) error {
|
2021-03-31 08:50:53 +02:00
|
|
|
str, ok := v.(string)
|
|
|
|
if !ok {
|
|
|
|
return fmt.Errorf("enums must be strings")
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
*e = SortByAggregate(str)
|
2021-03-31 08:50:53 +02:00
|
|
|
if !e.IsValid() {
|
2023-08-25 13:14:34 +02:00
|
|
|
return fmt.Errorf("%s is not a valid SortByAggregate", str)
|
2021-03-31 08:50:53 +02:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortByAggregate) MarshalGQL(w io.Writer) {
|
2021-03-31 08:50:53 +02:00
|
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
|
|
}
|
2022-03-25 10:20:33 +01:00
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
type SortDirectionEnum string
|
2022-03-25 10:20:33 +01:00
|
|
|
|
|
|
|
const (
|
2023-08-25 13:14:34 +02:00
|
|
|
SortDirectionEnumDesc SortDirectionEnum = "DESC"
|
|
|
|
SortDirectionEnumAsc SortDirectionEnum = "ASC"
|
2022-03-25 10:20:33 +01:00
|
|
|
)
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
var AllSortDirectionEnum = []SortDirectionEnum{
|
|
|
|
SortDirectionEnumDesc,
|
|
|
|
SortDirectionEnumAsc,
|
2022-03-25 10:20:33 +01:00
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortDirectionEnum) IsValid() bool {
|
2022-03-25 10:20:33 +01:00
|
|
|
switch e {
|
2023-08-25 13:14:34 +02:00
|
|
|
case SortDirectionEnumDesc, SortDirectionEnumAsc:
|
2022-03-25 10:20:33 +01:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortDirectionEnum) String() string {
|
2022-03-25 10:20:33 +01:00
|
|
|
return string(e)
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e *SortDirectionEnum) UnmarshalGQL(v interface{}) error {
|
2022-03-25 10:20:33 +01:00
|
|
|
str, ok := v.(string)
|
|
|
|
if !ok {
|
|
|
|
return fmt.Errorf("enums must be strings")
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
*e = SortDirectionEnum(str)
|
2022-03-25 10:20:33 +01:00
|
|
|
if !e.IsValid() {
|
2023-08-25 13:14:34 +02:00
|
|
|
return fmt.Errorf("%s is not a valid SortDirectionEnum", str)
|
2022-03-25 10:20:33 +01:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-08-25 13:14:34 +02:00
|
|
|
func (e SortDirectionEnum) MarshalGQL(w io.Writer) {
|
2022-03-25 10:20:33 +01:00
|
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
|
|
}
|