package entity

import "time"

type InstanceDiagnostics struct {
	InstanceName string
	Namespace    string
	Pods         []InstancePodDiagnostics
	Services     []InstanceServiceDiagnostics
	Events       []InstanceEventDiagnostics
	Logs         []InstancePodLog
	CollectedAt  time.Time
}

type InstancePodDiagnostics struct {
	Name              string
	Namespace         string
	Phase             string
	NodeName          string
	PodIP             string
	HostIP            string
	RestartCount      int32
	Containers        []InstanceContainerDiagnostics
	Conditions        []InstanceConditionDiagnostics
	CreationTimestamp time.Time
}

type InstanceContainerDiagnostics struct {
	Name         string
	Image        string
	Ready        bool
	RestartCount int32
	State        string
	Reason       string
	Message      string
}

type InstanceConditionDiagnostics struct {
	Type    string
	Status  string
	Reason  string
	Message string
}

type InstanceServiceDiagnostics struct {
	Name      string
	Namespace string
	Type      string
	ClusterIP string
	Ports     []InstanceEntryPort
}

type InstanceEventDiagnostics struct {
	Type           string
	Reason         string
	Message        string
	InvolvedKind   string
	InvolvedName   string
	Count          int32
	FirstTimestamp time.Time
	LastTimestamp  time.Time
}

type InstancePodLog struct {
	Pod       string
	Container string
	TailLines int64
	Log       string
	Error     string
}
