dashboard

package
v0.0.0-...-e7c744b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocatable

type Allocatable struct {
	Cpu              string `json:"cpu"`
	EphemeralStorage string `json:"ephemeralStorage"`
	Memory           string `json:"memory"`
	Pods             int64  `json:"pods"`
}

type Capacity

type Capacity struct {
	Cpu              string `json:"cpu"`
	EphemeralStorage string `json:"ephemeralStorage"`
	Memory           string `json:"memory"`
	Pods             int64  `json:"pods"`
}

type ClusterInfo

type ClusterInfo struct {
	Name                string              `json:"name"`
	Id                  string              `json:"id"`
	Status              string              `json:"status"`
	StatusMessage       string              `json:"statusMessage"`
	Cloud               string              `json:"cloud"`
	Distribution        string              `json:"distribution"`
	Region              string              `json:"region"`
	Location            string              `json:"location"`
	Endpoint            string              `json:"endpoint,omitempty"`
	MasterVersion       string              `json:"masterVersion,omitempty"`
	Project             string              `json:"project,omitempty"`
	ResourceGroup       string              `json:"resourceGroup,omitempty"`
	ClusterGroup        string              `json:"clusterGroup,omitempty"`
	SecretName          string              `json:"secretName,omitempty"`
	Nodes               []Node              `json:"nodes"`
	NodePools           map[string]NodePool `json:"nodePools,omitempty"`
	CreatedAt           time.Time           `json:"createdAt,omitempty"`
	CreatorName         string              `json:"creatorName,omitempty"`
	CreatorId           uint                `json:"creatorId,omitempty"`
	CpuUsagePercent     float64             `json:"cpuUsagePercent"`
	StorageUsagePercent float64             `json:"storageUsagePercent"`
	MemoryUsagePercent  float64             `json:"memoryUsagePercent"`
	OIDC                OIDC                `json:"oidc"`
}

type DashboardAPI

type DashboardAPI struct {
	// contains filtered or unexported fields
}

DashboardAPI implements the Dashboard API actions.

func NewDashboardAPI

func NewDashboardAPI(
	clusterManager *cluster.Manager,
	clusterGroupManager *clustergroup.Manager,
	logger logrus.FieldLogger,
	errorHandler emperror.Handler,
	authConfig auth.Config,
	clientSecretGetter clusterAuth.ClusterClientSecretGetter,
) *DashboardAPI

func (*DashboardAPI) GetClusterDashboard

func (d *DashboardAPI) GetClusterDashboard(c *gin.Context)

@Summary Get Dashboard info for a cluster @Description returns dashboard metrics for selected cluster @Tags dashboard @Produce json @Param orgid path int true "Organization ID" @Param id path int true "C~luster ID" @Success 200 {object} dashboard.GetDashboardResponse @Success 206 {object} dashboard.GetDashboardResponse @Failure 400 {object} common.ErrorResponse @Router /dashboard/{orgid}/clusters/{id} [get] @Security bearerAuth

func (*DashboardAPI) GetDashboard

func (d *DashboardAPI) GetDashboard(c *gin.Context)

@Summary Get Dashboard info for all clusters of an organization @Description returns dashboard metrics for selected/all clusters of an organization @Tags dashboard @Produce json @Param orgid path int true "Organization ID" @Success 200 {object} dashboard.GetDashboardResponse @Success 206 {object} dashboard.GetDashboardResponse @Failure 400 {object} common.ErrorResponse @Router /dashboard/{orgid}/clusters [get] @Security bearerAuth

type GetDashboardPathParams

type GetDashboardPathParams struct {
	// in:path
	OrgId string `json:"orgid"`
}

GetProviderPathParams is a placeholder for the GetDashboard route path parameters swagger:parameters GetDashboard

type GetDashboardResponse

type GetDashboardResponse struct {
	Clusters []ClusterInfo `json:"clusters"`
}

GetDashboardResponse Api object to be mapped to Get dashboard request swagger:model GetDashboardResponse

type Node

type Node struct {
	Name              string  `json:"name"`
	CreationTimestamp string  `json:"creationTimestamp"`
	Status            *Status `json:"status"`
}

type NodePool

type NodePool struct {
	Autoscaling     bool                           `json:"autoscaling"`
	Count           int                            `json:"count,omitempty"`
	InstanceType    string                         `json:"instanceType,omitempty"`
	SpotPrice       string                         `json:"spotPrice,omitempty"`
	Preemptible     bool                           `json:"preemptible,omitempty"`
	MinCount        int                            `json:"minCount,omitempty"`
	MaxCount        int                            `json:"maxCount,omitempty"`
	Image           string                         `json:"image,omitempty"`
	Version         string                         `json:"version,omitempty"`
	Labels          map[string]string              `json:"labels,omitempty"`
	ResourceSummary map[string]NodeResourceSummary `json:"resourceSummary,omitempty"`
	Vcpu            int                            `json:"vcpu,omitempty"`
	Ram             int                            `json:"ram,omitempty"`
	Template        string                         `json:"template,omitempty"`
	CreatedAt       time.Time                      `json:"createdAt,omitempty"`
	CreatorName     string                         `json:"creatorName,omitempty"`
	CreatorID       uint                           `json:"creatorId,omitempty"`
}

NodePool describes a cluster's node pool.

type NodeResourceSummary

type NodeResourceSummary struct {
	ResourceSummary

	Status string `json:"status,omitempty"`
}

type OIDC

type OIDC struct {
	Enabled      bool   `json:"enabled"`
	IdpURL       string `json:"idpUrl,omitempty"`
	ClientID     string `json:"clientId,omitempty"`
	ClientSecret string `json:"clientSecret,omitempty"`
}

type Resource

type Resource struct {
	Capacity    string `json:"capacity,omitempty"`
	Allocatable string `json:"allocatable,omitempty"`
	Limit       string `json:"limit,omitempty"`
	Request     string `json:"request,omitempty"`
}

Resource describes a resource summary with capacity/request/limit/allocatable

type ResourceSummary

type ResourceSummary struct {
	CPU    *Resource `json:"cpu,omitempty"`
	Memory *Resource `json:"memory,omitempty"`
}

ResourceSummary describes a node's resource summary with CPU and Memory capacity/request/limit/allocatable

type Status

type Status struct {
	Capacity                    *Capacity    `json:"capacity"`
	Allocatable                 *Allocatable `json:"allocatable"`
	Ready                       string       `json:"ready"`
	LastHeartbeatTime           string       `json:"lastHeartbeatTime"`
	FrequentUnregisterNetDevice string       `json:"frequentUnregisterNetDevice"`
	KernelDeadlock              string       `json:"kernelDeadlock"`
	NetworkUnavailable          string       `json:"networkUnavailable"`
	OutOfDisk                   string       `json:"outOfDisk"`
	MemoryPressure              string       `json:"memoryPressure"`
	DiskPressure                string       `json:"diskPressure"`
	PIDPressure                 string       `json:"pidPressure"`
	CpuUsagePercent             float64      `json:"cpuUsagePercent"`
	StorageUsagePercent         float64      `json:"storageUsagePercent"`
	MemoryUsagePercent          float64      `json:"memoryUsagePercent"`
	InstanceType                string       `json:"instanceType"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL