258 lines
7.4 KiB
Go
258 lines
7.4 KiB
Go
package models
|
|
|
|
import (
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type User struct {
|
|
ID string `json:"id,omitempty"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Password string `json:"password,omitempty"`
|
|
}
|
|
|
|
type Cluster struct {
|
|
ID primitive.ObjectID `bson:"_id,omitempty"`
|
|
Name string `json:"name"`
|
|
Namespace string `json:"namespace"`
|
|
ControlPlane string `json:"controlPlane"`
|
|
PlatformVersion string `json:"platformversion"`
|
|
Cpu string `json:"cpu"`
|
|
Memory string `json:"memory"`
|
|
CreatedAt string `json:"createdAt"`
|
|
UserID primitive.ObjectID `json:"userId"`
|
|
Cluster_config string `json:"clusterconfig"`
|
|
EndPoint string `json:"endPoint"`
|
|
}
|
|
|
|
type Header struct {
|
|
Authorization string `bson:"token"`
|
|
}
|
|
|
|
type Namespace struct {
|
|
Name string `json:name`
|
|
Status string `json:status`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type PodLog struct {
|
|
Podname string `json:name`
|
|
Namespace string `json:namespace`
|
|
Clustername string `json:clustername`
|
|
Manifest string `json:clustername`
|
|
Replicasetname string `json:replicasetname`
|
|
Statefulset string `json:Statefulset`
|
|
Daemonsetsname string `json:Daemonsetsname`
|
|
}
|
|
|
|
type Pod struct {
|
|
Name string `json:name`
|
|
Namespace string `json:namespace`
|
|
Status string `json:status`
|
|
Age string `json:age`
|
|
Ready string `json:ready`
|
|
Restarts int32 `json:restars`
|
|
Ip string `json:ip`
|
|
Node string `json:node`
|
|
Image string `json:iamge`
|
|
}
|
|
|
|
type Service struct {
|
|
Name string `json:name`
|
|
Namespace string `json:name`
|
|
Type string `json:type`
|
|
ClusterIP string `json:clusterIp`
|
|
ExternalIP string `json:externalIp`
|
|
Ports string `json:ports`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type Deployment struct {
|
|
Name string `json:name`
|
|
Namespace string `json:namespace`
|
|
Available string `json:available`
|
|
Replicas int32 `json:replicas`
|
|
Message string `json:message`
|
|
Reason string `json:reason`
|
|
Ready string `json:ready`
|
|
UpdateToDate int32 `json:uptodate`
|
|
Age string `json:age`
|
|
Image string `json:iamge`
|
|
Strategy string `json:iamge`
|
|
}
|
|
|
|
type Daemonset struct {
|
|
Name string `json:name`
|
|
Namespace string `json:namespace`
|
|
Ready int32 `json:Ready`
|
|
Age string `json:age`
|
|
DESIRED int32 `json:desired`
|
|
CURRENT int32 `json:current`
|
|
UpdateToDate int32 `json:uptodate`
|
|
Available int32 `json:available`
|
|
Node string `json:node`
|
|
Selector string `json:selector`
|
|
}
|
|
|
|
type Jobs struct {
|
|
Namespace string `json:name`
|
|
Name string `json:name`
|
|
Status string `json:status`
|
|
Completion string `json:completion`
|
|
Duration string `json:duration`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type CronJob struct {
|
|
Name string `json:name`
|
|
Namespace string `json:namespace`
|
|
Schedule string `json:schedule`
|
|
Suspend bool `json:suspend`
|
|
Active int `json:active`
|
|
LastScheduleTime string `json:lastScheduleTime`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type Replicaset struct {
|
|
Name string `json:name`
|
|
Desired int32 `json:desired`
|
|
Current int32 `json:current`
|
|
Ready int32 `json:Ready`
|
|
Age string `json:age`
|
|
Namespace string `json:name`
|
|
}
|
|
|
|
type ReplicationController struct {
|
|
Namespace string `json:name`
|
|
Name string `json:name`
|
|
Desired int32 `json:desired`
|
|
Current int32 `json:current`
|
|
Ready int32 `json:Ready`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type StatefulSet struct {
|
|
Namespace string `json:name`
|
|
Name string `json:name`
|
|
Ready string `json:Ready`
|
|
Age string `json:age`
|
|
}
|
|
|
|
type WorkerNodesPlans struct {
|
|
Plan string `json:plan`
|
|
Cpu string `json:cpu`
|
|
Memory string `json:memory`
|
|
Storage string `;sjon:storage`
|
|
}
|
|
|
|
type ClusterStats struct {
|
|
ResourceUsage ResourceUsage `json:"resourceUsage"`
|
|
Performance Performance `json:"performance"`
|
|
Health Health `json:"health"`
|
|
Uptime Uptime `json:"uptime"`
|
|
Name string `json:"name"`
|
|
ClusterId string `json:"clusterId"`
|
|
Status string `json:"status"`
|
|
Version string `json:"version"`
|
|
Alerts string `json:"alerts"`
|
|
Endpoint string `json:"endpoint"`
|
|
}
|
|
|
|
type ResourceUsage struct {
|
|
CPU Usage `json:"cpu"`
|
|
Memory Usage `json:"memory"`
|
|
Storage Usage `json:"storage"`
|
|
Network Usage `json:"network"`
|
|
}
|
|
|
|
type Usage struct {
|
|
Used float64 `json:"used"`
|
|
Total float64 `json:"total"`
|
|
Unit string `json:"unit"`
|
|
}
|
|
|
|
type Performance struct {
|
|
PodStartupTime string `json:"podStartupTime"`
|
|
APILatency string `json:"apiLatency"`
|
|
EtcdLatency string `json:"etcdLatency"`
|
|
SchedulerLatency string `json:"schedulerLatency"`
|
|
}
|
|
|
|
type Health struct {
|
|
NodesHealthy int `json:"nodesHealthy"`
|
|
NodesTotal int `json:"nodesTotal"`
|
|
PodsRunning int `json:"podsRunning"`
|
|
PodsTotal int `json:"podsTotal"`
|
|
Alerts int `json:"alerts"`
|
|
Warnings int `json:"warnings"`
|
|
Status string `json:"healthy"`
|
|
}
|
|
|
|
type Uptime struct {
|
|
ClusterUptime string `json:"clusterUptime"`
|
|
LastMaintenance string `json:"lastMaintenance"`
|
|
NextMaintenance string `json:"nextMaintenance"`
|
|
}
|
|
|
|
type ReplicasetScaleReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Replicasetname string `json:"Replicasetname"`
|
|
Replicas int32 `json:"Replicas"`
|
|
}
|
|
|
|
type ReplicasetRolloutReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Replicasetname string `json:"Replicasetname"`
|
|
Action string `json:"Action"` // "restart" | "status"
|
|
}
|
|
|
|
type DeploymentScaleReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Deployment string `json:"Deployment"`
|
|
Replicas int32 `json:"Replicas"`
|
|
}
|
|
|
|
type DeploymentRolloutReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Deployment string `json:"Deployment"`
|
|
Action string `json:"Action"` // "restart" | "status"
|
|
}
|
|
|
|
type DeamonSetsRolloutReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Daemonsetsname string `json:"Daemonsetsname"`
|
|
Action string `json:"Action"` // "restart" | "status"
|
|
}
|
|
|
|
type StatefulsetRolloutReq struct {
|
|
Clustername string `json:"Clustername"`
|
|
Namespace string `json:"Namespace"`
|
|
Statefulset string `json:"Statefulset"`
|
|
Action string `json:"Action"` // "restart" | "status"
|
|
Replicas int32 `json:"Replicas"`
|
|
}
|
|
|
|
type DeploymentRolloutStatus struct {
|
|
Deployment string `json:"deployment"`
|
|
Namespace string `json:"namespace"`
|
|
ObservedGeneration int64 `json:"observedGeneration"`
|
|
Replicas int32 `json:"replicas"`
|
|
UpdatedReplicas int32 `json:"updatedReplicas"`
|
|
ReadyReplicas int32 `json:"readyReplicas"`
|
|
AvailableReplicas int32 `json:"availableReplicas"`
|
|
UnavailableReplicas int32 `json:"unavailableReplicas"`
|
|
ConditionProgressing string `json:"conditionProgressing,omitempty"`
|
|
ConditionAvailable string `json:"conditionAvailable,omitempty"`
|
|
}
|
|
|
|
type DeploymentRolloutResp struct {
|
|
Clustername string `json:"cluster"`
|
|
Message string `json:"message"`
|
|
Status *DeploymentRolloutStatus `json:"status,omitempty"`
|
|
}
|