vsphere_api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeNotSynced  = errors.New("server time is not in sync with client")
	ErrSessionInvalid = errors.New("current client does NOT have active logged-in session")
	ErrDataInCtx404   = errors.New("data in context not exist")
)
View Source
var (
	ErrNoObjectInMoList  = errors.New("no managed object ref in array")
	ErrFuzzyResultInList = errors.New("multiple result returned with single-result filter expected")
	ErrPropertiesIsNil   = errors.New("properties retrieving finished with nil result")
)
View Source
var (
	ErrDatetimeUnknown           = errors.New("unknown error when try to build time range")
	ErrPrerequisitesNotSatisfied = errors.New("dependencies not initialized")
)
View Source
var (
	ErrCreateGenerationTaskFailed = errors.New("create task for bundle generation failed")
)
View Source
var (
	GlobalClient = &vSphereClient{}
)

Functions

func FormatAndSave

func FormatAndSave(machineName string, cateName string, resp *esxcli.Response) (err error)

func GetNanoID

func GetNanoID(length int) (string, error)

func SortWrappedEvents

func SortWrappedEvents(wvies wrappedViEventList)

Types

type ESXAuthenticationInfo

type ESXAuthenticationInfo struct {
	Type    string                                    `json:"type"`
	Enabled bool                                      `json:"enabled"`
	ADInfo  *esxHostAcitveDirectoryAuthenticationInfo `json:"active_directory_info,omitempty"`
}

type ESXHostBasicInfo

type ESXHostBasicInfo struct {
	InventoryPath string `json:"inventory_path"`

	// esxi service
	Services []*ESXHostService `json:"services"`
	// esxi authentication info
	AuthInfo []*ESXAuthenticationInfo `json:"auth_info"`
	// esxi product info
	ProductAbout string `json:"product"`
	// esxi dns config
	DNSIPAddrs []string `json:"dns_ip_addrs"`
	// esxi v-iofilters
	VIOFilters []*ESXIOFilter `json:"vio_filters"`
	// esxi host certificate
	CertificateInfo *ESXHostCert `json:"tls_certificates"`
	// esxi interface ips
	NetIfs []*ESXNetNIC `json:"net_ifs"`
	// esxi v-switch list
	NetVSwitches   []*ESXHostVSW  `json:"net_v_switches"`
	NetVPortGroups []*ESXHostPGrp `json:"net_v_port_groups"`
	// contains filtered or unexported fields
}

func (*ESXHostBasicInfo) ExposeESXCliv2

func (esxhbi *ESXHostBasicInfo) ExposeESXCliv2() (err error)

func (*ESXHostBasicInfo) GetInfoFunc1

func (esxhbi *ESXHostBasicInfo) GetInfoFunc1() (err error)

func (*ESXHostBasicInfo) GetInfoFunc2

func (esxhbi *ESXHostBasicInfo) GetInfoFunc2() (err error)

func (*ESXHostBasicInfo) Init

func (esxhbi *ESXHostBasicInfo) Init(h *object.HostSystem, invtpath string) error

type ESXHostCert

type ESXHostCert struct {
	ThumbprintSHA1   string `json:"thumbprint_sha_1,omitempty"`
	ThumbprintSHA256 string `json:"thumbprint_sha_256,omitempty"`
	SubjectName      string `json:"subject_name,omitempty"`
	IssuerName       string `json:"issuer_name,omitempty"`
	NotAfter         string `json:"not_after,omitempty"`
	NotBefore        string `json:"not_before,omitempty"`
}

type ESXHostPGrp

type ESXHostPGrp struct {
	Key               string             `json:"key,omitempty"`
	VSwitch           string             `json:"v_switch,omitempty"`
	AllowPromisc      bool               `json:"allow_promisc,omitempty"`
	AllowMacChange    bool               `json:"allow_mac_change,omitempty"`
	AllowTransitForge bool               `json:"allow_transit_forge,omitempty"`
	Ports             []*ESXHostPGrpPort `json:"ports,omitempty"`
}

type ESXHostPGrpPort

type ESXHostPGrpPort struct {
	Key         string   `json:"key"`
	MacAddr     []string `json:"mac_addr"`
	Type        string   `json:"type"`
	ActiveNICs  []string `json:"active_nics"`
	StandbyNICs []string `json:"standby_nics"`
}

type ESXHostService

type ESXHostService struct {
	Key            string   `json:"key"`
	Label          string   `json:"label"`
	Required       bool     `json:"required"`
	Running        bool     `json:"running"`
	Policy         string   `json:"policy,omitempty"`
	SourcePkgName  string   `json:"source_pkg_name,omitempty"`
	FWRuleSetNames []string `json:"fw_ruleset_names,omitempty"`
	Uninstallable  bool     `json:"uninstallable"`
}

type ESXHostVSW

type ESXHostVSW struct {
	Name      string   `json:"name,omitempty"`
	MTU       int32    `json:"mtu,omitempty"`
	BridgedTo []string `json:"bridged_to,omitempty"`
	PortGroup []string `json:"port_group,omitempty"`
}

type ESXIOFilter

type ESXIOFilter struct {
	Id          string `json:"id"`
	Vendor      string `json:"vendor"`
	Version     string `json:"version"`
	ReleaseDate string `json:"release_date"`
	Summary     string `json:"summary"`
	Type        string `json:"type"`
}

type ESXNetNIC

type ESXNetNIC struct {
	Name       string `json:"name,omitempty"`
	MacAddr    string `json:"mac_addr,omitempty"`
	Type       string `json:"type,omitempty"`
	IsVirtual  bool   `json:"is_virtual,omitempty"`
	IpAddr     string `json:"ip_addr,omitempty"`
	SubnetMask string `json:"subnet_mask,omitempty"`
	UsingDHCP  bool   `json:"using_dhcp,omitempty"`
	GatewayIP  string `json:"gateway_ip,omitempty"`
}

type VCBasicInfo

type VCBasicInfo struct {
	IsVCenter             bool                   `json:"is_vcenter"`
	ESXHostList           []string               `json:"esx_host_names,omitempty"`
	ESXHostObjs           []*object.HostSystem   `json:"-"`
	VCAuthoriRole         []*vcAuthorizationRole `json:"vc_authorization_roles,omitempty"`
	VCAuthoriPerm         []*vcPermission        `json:"vc_authorization_permissions,omitempty"`
	EventMaxAge           int                    `json:"event_max_age,omitempty"`
	SSOPasswordPolicyDesc string                 `json:"sso_password_policy,omitempty"`
	SSOIDPDesc            []*vcIdentityProvider  `json:"sso_idp,omitempty"`
	SSOGroups             []*vcGroup             `json:"sso_groups,omitempty"`
	SSOUsers              []*vcUser              `json:"sso_users,omitempty"`
}

Jump to

Keyboard shortcuts

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