apis

package
v0.0.0-...-94e4715 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerInfoType                    = "dockerInfo"
	DockerInfoFieldArchitecture       = "architecture"
	DockerInfoFieldCgroupDriver       = "cgroupDriver"
	DockerInfoFieldDebug              = "debug"
	DockerInfoFieldDockerRootDir      = "dockerRootDir"
	DockerInfoFieldDriver             = "driver"
	DockerInfoFieldExperimentalBuild  = "experimentalBuild"
	DockerInfoFieldHTTPProxy          = "httpProxy"
	DockerInfoFieldHTTPSProxy         = "httpsProxy"
	DockerInfoFieldIndexServerAddress = "indexServerAddress"
	DockerInfoFieldKernelVersion      = "kernelVersion"
	DockerInfoFieldLabels             = "labels"
	DockerInfoFieldLoggingDriver      = "loggingDriver"
	DockerInfoFieldName               = "name"
	DockerInfoFieldNoProxy            = "noProxy"
	DockerInfoFieldOSType             = "osType"
	DockerInfoFieldOperatingSystem    = "operatingSystem"
	DockerInfoFieldServerVersion      = "serverVersion"
)
View Source
const (
	ResourceKindConfigMap               = "configmap"
	ResourceKindDaemonSet               = "daemonset"
	ResourceKindDeployment              = "deployment"
	ResourceKindEvent                   = "event"
	ResourceKindHorizontalPodAutoscaler = "horizontalpodautoscaler"
	ResourceKindIngress                 = "ingress"
	ResourceKindJob                     = "job"
	ResourceKindCronJob                 = "cronjob"
	ResourceKindLimitRange              = "limitrange"
	ResourceKindNamespace               = "namespace"
	ResourceKindNode                    = "node"
	ResourceKindPersistentVolumeClaim   = "persistentvolumeclaim"
	ResourceKindPersistentVolume        = "persistentvolume"
	ResourceKindPod                     = "pod"
	ResourceKindReplicaSet              = "replicaset"
	ResourceKindReplicationController   = "replicationcontroller"
	ResourceKindResourceQuota           = "resourcequota"
	ResourceKindSecret                  = "secret"
	ResourceKindService                 = "service"
	ResourceKindStatefulSet             = "statefulset"
	ResourceKindStorageClass            = "storageclass"
	ResourceKindRbacRole                = "role"
	ResourceKindRbacClusterRole         = "clusterrole"
	ResourceKindRbacRoleBinding         = "rolebinding"
	ResourceKindRbacClusterRoleBinding  = "clusterrolebinding"
	ResourceKindEndpoint                = "endpoint"
)

List of all resource kinds supported by the UI.

View Source
const (
	ClientTypeDefault           = "restclient"
	ClientTypeExtensionClient   = "extensionclient"
	ClientTypeAppsClient        = "appsclient"
	ClientTypeBatchClient       = "batchclient"
	ClientTypeBetaBatchClient   = "betabatchclient"
	ClientTypeAutoscalingClient = "autoscalingclient"
	ClientTypeStorageClient     = "storageclient"
)

List of client types supported by the UI.

Variables

View Source
var KindToAPIMapping = map[string]struct {
	// Kubernetes resource name.
	Resource string
	// Client type used by given resource, i.e. deployments are using extension client.
	ClientType ClientType
	// Is this object global scoped (not below a namespace).
	Namespaced bool
}{
	ResourceKindConfigMap:               {"configmaps", ClientTypeDefault, true},
	ResourceKindDaemonSet:               {"daemonsets", ClientTypeExtensionClient, true},
	ResourceKindDeployment:              {"deployments", ClientTypeExtensionClient, true},
	ResourceKindEvent:                   {"events", ClientTypeDefault, true},
	ResourceKindHorizontalPodAutoscaler: {"horizontalpodautoscalers", ClientTypeAutoscalingClient, true},
	ResourceKindIngress:                 {"ingresses", ClientTypeExtensionClient, true},
	ResourceKindJob:                     {"jobs", ClientTypeBatchClient, true},
	ResourceKindCronJob:                 {"cronjobs", ClientTypeBetaBatchClient, true},
	ResourceKindLimitRange:              {"limitrange", ClientTypeDefault, true},
	ResourceKindNamespace:               {"namespaces", ClientTypeDefault, false},
	ResourceKindNode:                    {"nodes", ClientTypeDefault, false},
	ResourceKindPersistentVolumeClaim:   {"persistentvolumeclaims", ClientTypeDefault, true},
	ResourceKindPersistentVolume:        {"persistentvolumes", ClientTypeDefault, false},
	ResourceKindPod:                     {"pods", ClientTypeDefault, true},
	ResourceKindReplicaSet:              {"replicasets", ClientTypeExtensionClient, true},
	ResourceKindReplicationController:   {"replicationcontrollers", ClientTypeDefault, true},
	ResourceKindResourceQuota:           {"resourcequotas", ClientTypeDefault, true},
	ResourceKindSecret:                  {"secrets", ClientTypeDefault, true},
	ResourceKindService:                 {"services", ClientTypeDefault, true},
	ResourceKindStatefulSet:             {"statefulsets", ClientTypeAppsClient, true},
	ResourceKindStorageClass:            {"storageclasses", ClientTypeStorageClient, false},
	ResourceKindEndpoint:                {"endpoints", ClientTypeDefault, true},
}

Mapping from resource kind to K8s apiserver API path. This is mostly pluralization, because K8s apiserver uses plural paths and this project singular. Must be kept in sync with the list of supported kinds.

View Source
var ListEverything = metaV1.ListOptions{
	LabelSelector: labels.Everything().String(),
	FieldSelector: fields.Everything().String(),
}

ListEverything is a list options used to list all resources without any filtering.

Functions

func GetResourceKinds

func GetResourceKinds() sets.String

func IsLabelSelectorMatching

func IsLabelSelectorMatching(selector map[string]string, labelSelector *v1.LabelSelector) bool

IsLabelSelectorMatching returns true when a resource with the given selector targets the same Resources(or subset) that a tested object selector with the given selector.

func IsSelectorMatching

func IsSelectorMatching(labelSelector map[string]string, testedObjectLabels map[string]string) bool

IsSelectorMatching returns true when an object with the given selector targets the same Resources (or subset) that the tested object with the given selector.

Types

type AgentConfig

type AgentConfig struct {
	ServerUrl string `json:"serverUrl"`
	Token     string `json:"token"`
	ClusterId string `json:"clusterId"`
	NodeId    string `json:"nodeId"`
}

type ClientType

type ClientType string

ClientType represents type of client that is used to perform generic operations on resources. Different resources belong to different client, i.e. Deployments belongs to extension client and StatefulSets to apps client.

type CloudHost

type CloudHost struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	ManagerUrl string `json:"manager_uri"`
	HostType   string `json:"host_type"`
	HostStatus string `json:"host_status"`
	AccessIp   string `json:"access_ip"`
	Status     string `json:"status"`
	Enabled    bool   `json:"enabled"`
}

type DockerInfo

type DockerInfo struct {
	Architecture       string   `json:"architecture"`
	CgroupDriver       string   `json:"cgroupDriver"`
	Debug              bool     `json:"debug"`
	DockerRootDir      string   `json:"dockerRootDir"`
	Driver             string   `json:"driver"`
	ExperimentalBuild  bool     `json:"experimentalBuild"`
	HTTPProxy          string   `json:"httpProxy"`
	HTTPSProxy         string   `json:"httpsProxy"`
	IndexServerAddress string   `json:"indexServerAddress"`
	KernelVersion      string   `json:"kernelVersion"`
	Labels             []string `json:"labels"`
	LoggingDriver      string   `json:"loggingDriver"`
	Name               string   `json:"name"`
	NoProxy            string   `json:"noProxy"`
	OSType             string   `json:"osType"`
	OperatingSystem    string   `json:"operatingSystem"`
	ServerVersion      string   `json:"serverVersion"`
}

type DockerdConfig

type DockerdConfig struct {
	LiveRestore        bool     `json:"live-restore"`
	RegistryMirrors    []string `json:"registry-mirrors"`
	InsecureRegistries []string `json:"insecure-registries"`
	Graph              string   `json:"graph"`
	Bip                string   `json:"bip,omitempty"`
}

type HostRegisterConfig

type HostRegisterConfig struct {
	AgentConfig   AgentConfig   `json:"agentConfig"`
	DockerdConfig DockerdConfig `json:"dockerdConfig"`
}

type IListMeta

type IListMeta interface {
	GetLimit() int
	GetTotal() int
	GetOffset() int
}

type ListMeta

type ListMeta struct {
	Total  int `json:"total"`
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

ListMeta describes list of objects, i.e. holds information about pagination options set for the list.

func (ListMeta) GetLimit

func (l ListMeta) GetLimit() int

func (ListMeta) GetOffset

func (l ListMeta) GetOffset() int

func (ListMeta) GetTotal

func (l ListMeta) GetTotal() int

type NodeAddOption

type NodeAddOption struct {
	Cluster          string        `json:"cluster"`
	Roles            []string      `json:"roles"`
	Name             string        `json:"name,omitempty"`
	Host             string        `json:"host,omitempty"`
	HostnameOverride string        `json:"hostname_override,omitempty"`
	DockerdConfig    DockerdConfig `json:"dockerd_config,omitempty"`
}

Jump to

Keyboard shortcuts

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