vsphere

package
v0.0.0-...-e5c8c29 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const Datacenter = "VSPHERE_DATACENTER"
View Source
const Datastore = "VSPHERE_DATASTORE"
View Source
const ManagementApiServerEndpoint = "VSPHERE_MANAGEMENT_CLUSTER_ENDPOINT"
View Source
const Network = "VSPHERE_NETWORK"
View Source
const Password = "VSPHERE_PASSWORD"
View Source
const ResourcePool = "VSPHERE_RESOURCE_POOL"
View Source
const SshKeys = "VSPHERE_SSH_AUTHORIZED_KEY"
View Source
const Url = "VSPHERE_SERVER"
View Source
const Username = "VSPHERE_USERNAME"
View Source
const VmFolder = "VSPHERE_FOLDER"
View Source
const WorkloadApiServerEndpoint = "VSPHERE_WORKLOAD_CLUSTER_ENDPOINT"

Variables

View Source
var PROVIDER utils.Provider = &Provider{}

TODO: Change name?

Functions

func CreateFolder

func CreateFolder(client *vim25.Client, folderName string) error

Can be used for dynamic folder creation To be tested

func CreateLibrary

func CreateLibrary(libraryName string, rc *rest.Client, client *vim25.Client)

func CreateResourcePool

func CreateResourcePool(client *vim25.Client, ResourcePool string) error

Can be used for dynamic resource pool creation To be tested

func DeleteFolder

func DeleteFolder(client *vim25.Client, folderName string) error

Can be used for dynamic folder Deletion To be tested

func DeleteLibrary

func DeleteLibrary(libraryName *library.Library, rc *rest.Client)

To Delete Libary after create OVF templates

func DeleteResourcePool

func DeleteResourcePool(client *vim25.Client, ResourcePool string) error

Can be used for dynamic resource pool deletion To be tested

func DeleteVM

func DeleteVM(client *vim25.Client, vmName string) error

func DeployVmFromLibrary

func DeployVmFromLibrary(rc *rest.Client, client *vim25.Client, lib *library.Library) (*object.VirtualMachine, error)

func GetGovmomiClient

func GetGovmomiClient() *vim25.Client

NewClient creates a vim25.Client

func GetLibrary

func GetLibrary(libraryName string, rc *rest.Client) *library.Library

To Get Library as Library Struct

func GetLibraryItem

func GetLibraryItem(rc *rest.Client) ([]string, error)

func GetOvaFileNameFromTanzuFramework

func GetOvaFileNameFromTanzuFramework() []string

func GetRestClient

func GetRestClient(client *vim25.Client) *rest.Client

Rest Client this is being used by library module

func GetTanzuBomConfigPath

func GetTanzuBomConfigPath() (string, error)

Todo: to be moved to common utils file

func GetTanzuConfigPath

func GetTanzuConfigPath() (string, error)

Todo: to be moved to common utils file

func ImportOVAFromLibrary

func ImportOVAFromLibrary(rc *rest.Client, client *vim25.Client, item *library.Library, file string) error

To Upload OVA to Library

func ListVms

func ListVms(client *vim25.Client) []string

func ListVmsTemplates

func ListVmsTemplates(client *vim25.Client) []string

func MarkAsTemplate

func MarkAsTemplate(client *vim25.Client, vmName string) error

func RetrieveAndDownload

func RetrieveAndDownload(version, dir, fileName string)

Rename to RetrieveAndDownload

func RetriveVersion

func RetriveVersion(version string) []string

Types

type Cc

type Cc []string

type Files

type Files struct {
	// TODO: Extract out this struct into a type for brevity and clarity
	DownloadFiles []struct {
		FileName       string `json:"fileName"`
		Sha1Checksum   string `json:"sha1checksum"`
		Sha256Checksum string `json:"sha256checksum"`
		Md5Checksum    string `json:"md5checksum"`
		Build          string `json:"build"`
		ReleaseDate    string `json:"releaseDate"`
		FileType       string `json:"fileType"`
		Description    string `json:"description"`
		FileSize       string `json:"fileSize"`
		Title          string `json:"title"`
		Version        string `json:"version"`
		Status         string `json:"status"`
		Uuid           string `json:"uuid"`
		Header         bool   `json:"header"`
		DisplayOrder   int    `json:"displayOrder"`
		Relink         bool   `json:"relink"`
		Rsync          bool   `json:"rsync"`
	} `json:"downloadFiles"`
}

type Provider

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

TODO: Change name?

func (*Provider) CleanupCluster

func (provider *Provider) CleanupCluster(ctx context.Context, clusterName string) error

func (*Provider) GetTanzuConfig

func (provider *Provider) GetTanzuConfig(clusterName string) tanzu.TanzuConfig

TODO: Maybe make use of https://github.com/spf13/viper to set env vars and make some values as default and parameterised.

func (*Provider) Init

func (provider *Provider) Init() error

func (*Provider) Name

func (provider *Provider) Name() string

func (*Provider) PreClusterCreationTasks

func (provider *Provider) PreClusterCreationTasks(clusterName string, clusterType utils.ClusterType) error

func (*Provider) RequiredEnvVars

func (provider *Provider) RequiredEnvVars() []string

type TestSecrets

type TestSecrets struct {
	ManagementApiServerEndpoint string
	WorkloadApiServerEndpoint   string
	SshKeys                     string
	Url                         string
	Username                    string
	Password                    string
	Datastore                   string
	Datacenter                  string
	VmFolder                    string
	Network                     string
	ResourcePool                string
}

func ExtractVsphereTestSecretsFromEnvVars

func ExtractVsphereTestSecretsFromEnvVars() TestSecrets

type Tkr

type Tkr struct {
	// TODO: Extract out this struct into a type for brevity and clarity
	Ova []struct {
		Name   string `yaml:"name"`
		Osinfo struct {
			Name    string `yaml:"name"`
			Version string `yaml:"version"`
			Arch    string `yaml:"arch"`
		} `json:"osinfo"`
		Version string `yaml:"version"`
	} `yaml:"ova"`
	// TODO: Extract out this struct into a type for brevity and clarity
	Azure []struct {
		Sku             string `yaml:"sku"`
		Publisher       string `yaml:"publisher"`
		Offer           string `yaml:"offer"`
		Version         string `yaml:"version"`
		ThirdPartyImage bool   `yaml:"thirdPartyImage"`
		// TODO: Extract out this struct into a type for brevity and clarity
		Osinfo struct {
			Name    string `yaml:"name"`
			Version string `yaml:"version"`
			Arch    string `yaml:"arch"`
		} `yaml:"osinfo"`
	} `yaml:"azure"`
}

Jump to

Keyboard shortcuts

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