common

package
v1.5.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplianceImageKey  = "core"
	LinuxImageKey      = "linux"
	ApplianceImageName = "appliance.iso"
	LinuxImageName     = "bootstrap.iso"

	// An ISO 9660 sector is normally 2 KiB long. Although the specification allows for alternative sector sizes, you will rarely find anything other than 2 KiB.
	ISO9660SectorSize = 2048
	ISOVolumeSector   = 0x10
	PublisherOffset   = 318
)
View Source
const (

	// scheme string for nfs volume store targets
	NfsScheme = "nfs"

	// scheme string for ds volume store targets
	DsScheme = "ds"

	// scheme string for volume store targets without a scheme
	EmptyScheme = ""
)

Variables

This section is empty.

Functions

func BashComplete added in v1.4.3

func BashComplete(flagsFunc func() []cli.Flag, subcommands ...string) cli.BashCompleteFunc

BashComplete returns a cli.BashCompleteFunc for a cli.Command given its Flags function and subcommand names.

func CheckUnsupportedChars

func CheckUnsupportedChars(s string) error

CheckUnsupportedChars returns an error if string contains special characters

func CheckUnsupportedCharsDatastore

func CheckUnsupportedCharsDatastore(s string) error

CheckUnsupportedCharsDatastore returns an error if a datastore string contains special characters

func LogErrorIfAny

func LogErrorIfAny(op trace.Operation, clic *cli.Context, err error) error

func NewOperation

func NewOperation(clic *cli.Context, debug *int) trace.Operation

Types

type CNetworks

type CNetworks struct {
	ContainerNetworks         cli.StringSlice `arg:"container-network"`
	ContainerNetworksGateway  cli.StringSlice `arg:"container-network-gateway"`
	ContainerNetworksIPRanges cli.StringSlice `arg:"container-network-ip-range"`
	ContainerNetworksDNS      cli.StringSlice `arg:"container-network-dns"`
	ContainerNetworksFirewall cli.StringSlice `arg:"container-network-firewall"`
	IsSet                     bool
}

CNetworks holds user input from container network flags

func (*CNetworks) CNetworkFlags

func (c *CNetworks) CNetworkFlags() []cli.Flag

func (*CNetworks) ProcessContainerNetworks

func (c *CNetworks) ProcessContainerNetworks(op trace.Operation) (ContainerNetworks, error)

ProcessContainerNetworks parses container network settings and returns a struct containing all processed container network fields on success.

type CertFactory

type CertFactory struct {
	Networks

	CertPath     string
	DisplayName  string
	Scert        string
	Skey         string
	Ccert        string
	Ckey         string
	Cacert       string
	Cakey        string
	ClientCert   *tls.Certificate
	ClientCAsArg cli.StringSlice `arg:"tls-ca"`
	ClientCAs    []byte
	EnvFile      string
	Cname        string
	Org          cli.StringSlice
	KeySize      int
	NoTLS        bool
	NoTLSverify  bool
	KeyPEM       []byte
	CertPEM      []byte
	NoSaveToDisk bool
}

CertFactory has all input parameters for vic-machine certificate commands needed to create a certificate

func (*CertFactory) CertFlags

func (c *CertFactory) CertFlags() []cli.Flag

func (*CertFactory) ProcessCertificates

func (c *CertFactory) ProcessCertificates(op trace.Operation, displayName string, force bool, debug int) error

type Compute

type Compute struct {
	ComputeResourcePath string `cmd:"compute-resource"`
	DisplayName         string `cmd:"name"`
	UseVMGroup          bool   `cmd:"affinity-vm-group"`
	CreateVMGroup       bool
	DeleteVMGroup       bool
}

func (*Compute) AffinityFlags added in v1.4.1

func (c *Compute) AffinityFlags() []cli.Flag

func (*Compute) ComputeFlags

func (c *Compute) ComputeFlags() []cli.Flag

func (*Compute) ComputeFlagsNoName

func (c *Compute) ComputeFlagsNoName() []cli.Flag

type ContainerConfig

type ContainerConfig struct {
	// NameConvention
	ContainerNameConvention string `cmd:"container-name-convention"`
}

func (*ContainerConfig) ContainerFlags

func (c *ContainerConfig) ContainerFlags() []cli.Flag

type ContainerNetworks

type ContainerNetworks struct {
	MappedNetworks          map[string]string              `cmd:"parent" label:"key-value"`
	MappedNetworksGateways  map[string]net.IPNet           `cmd:"gateway" label:"key-value"`
	MappedNetworksIPRanges  map[string][]ip.Range          `cmd:"ip-range" label:"key-value"`
	MappedNetworksDNS       map[string][]net.IP            `cmd:"dns" label:"key-value"`
	MappedNetworksFirewalls map[string]executor.TrustLevel `cmd:"firewall" label:"key-value"`
}

ContainerNetworks holds container network data after processing

func (*ContainerNetworks) IsSet

func (c *ContainerNetworks) IsSet() bool

type DNS

type DNS struct {
	DNS   cli.StringSlice `arg:"dns-server"`
	IsSet bool
}

general dns

func (*DNS) DNSFlags

func (d *DNS) DNSFlags() []cli.Flag

func (*DNS) ProcessDNSServers

func (d *DNS) ProcessDNSServers(op trace.Operation) ([]net.IP, error)

processDNSServers parses DNS servers used for client, public, mgmt networks

type Debug

type Debug struct {
	Debug *int `cmd:"debug"`
}

func (*Debug) DebugFlags

func (d *Debug) DebugFlags(hidden bool) []cli.Flag

type Help added in v1.5.0

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

func (*Help) HelpFlags added in v1.5.0

func (h *Help) HelpFlags() []cli.Flag

func (*Help) Print added in v1.5.0

func (h *Help) Print(clic *cli.Context) bool

type Images

type Images struct {
	ApplianceISO string
	BootstrapISO string
	OSType       string
}

func (*Images) CheckImagesFiles

func (i *Images) CheckImagesFiles(op trace.Operation, force bool) (map[string]string, error)

func (*Images) GetImageVersion

func (i *Images) GetImageVersion(op trace.Operation, img string) (string, error)

GetImageVersion will read iso file version from Primary Volume Descriptor, field "Publisher Identifier"

func (*Images) ImageFlags

func (i *Images) ImageFlags(hidden bool) []cli.Flag

type Networks

type Networks struct {
	ClientNetworkName    string
	ClientNetworkIP      string
	ClientNetworkGateway string

	PublicNetworkName    string
	PublicNetworkIP      string
	PublicNetworkGateway string

	ManagementNetworkName    string
	ManagementNetworkIP      string
	ManagementNetworkGateway string
}

type OpsCredentials

type OpsCredentials struct {
	OpsUser     *string `cmd:"ops-user"`
	OpsPassword *string
	GrantPerms  *bool
	IsSet       bool
}

OpsCredentials holds credentials for the VCH operations user

func (*OpsCredentials) Flags

func (o *OpsCredentials) Flags() []cli.Flag

func (*OpsCredentials) ProcessOpsCredentials

func (o *OpsCredentials) ProcessOpsCredentials(op trace.Operation, isCreateOp bool, adminUser string, adminPassword *string) error

ProcessOpsCredentials processes fields for the VCH operations user. When invoked during a VCH create operation, adminUser and adminPassword must be supplied to be used as ops credentials if they are not specified by the user. For a configure operation, adminUser and adminPassword are not needed.

type Proxies

type Proxies struct {
	HTTPSProxy *string
	HTTPProxy  *string
	NoProxy    *string
	IsSet      bool
}

func (*Proxies) ProcessProxies

func (p *Proxies) ProcessProxies() (hproxy, sproxy *url.URL, nproxy *string, err error)

func (*Proxies) ProxyFlags

func (p *Proxies) ProxyFlags() []cli.Flag

type Registries

type Registries struct {
	RegistryCAsArg         cli.StringSlice `arg:"registry-ca"`
	InsecureRegistriesArg  cli.StringSlice `arg:"insecure-registry"`
	WhitelistRegistriesArg cli.StringSlice `arg:"whitelist-registry"`

	RegistryCAs []byte

	InsecureRegistries  []string `cmd:"insecure-registry"`
	WhitelistRegistries []string `cmd:"whitelist-registry"`
}

Registries contains metadata used to create/configure registry CA data

func (*Registries) Flags

func (r *Registries) Flags() []cli.Flag

Flags generates command line flags

func (*Registries) ProcessRegistries

func (r *Registries) ProcessRegistries(op trace.Operation) error

type ResourceLimits

type ResourceLimits struct {
	VCHCPULimitsMHz       *int              `cmd:"cpu"`
	VCHCPUReservationsMHz *int              `cmd:"cpu-reservation"`
	VCHCPUShares          *types.SharesInfo `cmd:"cpu-shares"`

	VCHMemoryLimitsMB       *int              `cmd:"memory"`
	VCHMemoryReservationsMB *int              `cmd:"memory-reservation"`
	VCHMemoryShares         *types.SharesInfo `cmd:"memory-shares"`

	StorageQuotaGB *int `cmd:"storage-quota"`

	IsSet bool
}

func (*ResourceLimits) VCHCPULimitFlags

func (r *ResourceLimits) VCHCPULimitFlags() []cli.Flag

func (*ResourceLimits) VCHMemoryLimitFlags

func (r *ResourceLimits) VCHMemoryLimitFlags() []cli.Flag

func (*ResourceLimits) VCHStorageQuotaFlag added in v1.5.0

func (r *ResourceLimits) VCHStorageQuotaFlag() []cli.Flag

type Target

type Target struct {
	URL *url.URL `cmd:"target"`

	User        string
	Password    *string
	CloneTicket string
	Thumbprint  string `cmd:"thumbprint"`
}

func NewTarget

func NewTarget() *Target

func (*Target) HasCredentials

func (t *Target) HasCredentials(op trace.Operation) error

HasCredentials check that the credentials have been supplied by any of the permitted mechanisms

func (*Target) TargetFlags

func (t *Target) TargetFlags() []cli.Flag

type VCHID

type VCHID struct {
	// VCH id
	ID string
}

func (*VCHID) IDFlags

func (i *VCHID) IDFlags() []cli.Flag

type VolumeStores

type VolumeStores struct {
	VolumeStores cli.StringSlice `arg:"volume-store"`
}

func (*VolumeStores) Flags

func (v *VolumeStores) Flags() []cli.Flag

func (*VolumeStores) ProcessVolumeStores

func (v *VolumeStores) ProcessVolumeStores() (map[string]*url.URL, error)

Jump to

Keyboard shortcuts

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