cmd

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

This section is empty.

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"}
)

Functions

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 added in v0.0.2

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

func GetConfig added in v0.0.2

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 added in v0.0.2

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

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

func GetRESTClientAndConfig added in v0.1.0

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

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

func GetRancherTokenMap added in v0.1.1

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

func GetResourceType added in v0.0.2

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

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

func GetSelectionFromInput added in v0.1.1

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

func HandleCPUOverCommittment added in v0.2.0

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 added in v0.2.0

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 added in v0.0.5

func ImageCommand() *cli.Command

TemplateCommand defines the CLI command that lists VM templates in Harvester

func ImportCommand added in v0.2.0

func ImportCommand() *cli.Command

Manages VM imports using vm-import-controller of Harvester

func KeypairCommand added in v0.0.5

func KeypairCommand() *cli.Command

TemplateCommand defines the CLI command that lists VM templates in Harvester

func LoginCommand added in v0.0.2

func LoginCommand() *cli.Command

func Lookup added in v0.0.2

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

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 added in v0.0.2

func RandomLetters(n int) string

RandomLetters returns a string with random letters of length n

func RandomName added in v0.0.2

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 added in v0.0.2

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

func SplitOnColon added in v0.0.2

func SplitOnColon(s string) []string

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

func TemplateCommand added in v0.0.5

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 added in v0.0.2

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

type Catalog added in v0.1.1

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

type CatalogEntry added in v0.1.1

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 added in v0.0.6

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 added in v0.0.5

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

type Interface added in v0.0.6

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

type KeypairData added in v0.0.5

type KeypairData struct {
	Name              string
	Fingerprint       string
	CreationTimestamp string
}

type LoginData added in v0.0.2

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 added in v0.0.2

type MemberData struct {
	Name       string
	MemberType string
	AccessType string
}

type Os added in v0.1.1

type Os struct {
	Id             int64
	Name           string
	NumberOfImages string
}

type PersistentVolumeClaimObject added in v0.0.6

type PersistentVolumeClaimObject struct {
	ClaimName string
	Size      string
}

type RoleTemplate added in v0.0.2

type RoleTemplate struct {
	ID          string
	Name        string
	Description string
}

type RoleTemplateBinding added in v0.0.2

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

type TemplateData added in v0.0.5

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

type VMImportData added in v0.2.0

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 added in v0.0.6

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