add more features

This commit is contained in:
behrooz
2025-09-27 17:01:54 +03:30
parent 98481d56eb
commit 44c75b2f5c
3 changed files with 2704 additions and 44 deletions

View File

@@ -29,12 +29,32 @@ 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:name`
Namespace string `json:namespace`
Status string `json:status`
Restart int32 `json:restart`
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 {
@@ -48,12 +68,17 @@ type Service struct {
}
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`
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 {
@@ -78,6 +103,16 @@ type Jobs struct {
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`
@@ -158,3 +193,65 @@ type Uptime struct {
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"`
}