cli

package
v1.23.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVSphereConfig

func CheckVSphereConfig(ctx context.Context, o *ClientOption) error

CheckVSphereConfig performs vSphere health check on VMs TODO (fanz) : support checking network

func CreateRole

func CreateRole(ctx context.Context, o *ClientOption, role *Role) error

CreateRole creates vSphere role

func CreateSolutionUser

func CreateSolutionUser(ctx context.Context, o *ClientOption) error

CreateSolutionUser creates a default solution user (k8s-vcp) for CCM with Administrator role and WSTrust permissions

func IsClusterNode

func IsClusterNode(name string) bool

IsClusterNode returns a flag indicating whether or not the name of a cluster node is valie. TODO (fanz): IsK8sNode validate if the given name refers to a node in kubernetes cluster

func ParseConfig

func ParseConfig(configFile string) (*config.Config, error)

ParseConfig returns a config.Config object initialized with the values from the supplied configuration file.

func ReadContent

func ReadContent(path string) (string, error)

ReadContent reads a file from disk and returns its contents as a string.

Types

type ClientOption

type ClientOption struct {
	Client *govmomi.Client

	// config Config
	Config config.Config
	// contains filtered or unexported fields
}

ClientOption is the configuration options used to create a new govmomi.Client.

func (*ClientOption) GetClient

func (o *ClientOption) GetClient() (*vim25.Client, error)

GetClient returns the underlying vim25.Client.

func (*ClientOption) LoadCredential

func (o *ClientOption) LoadCredential(username, password, cert, role string, insecure bool)

LoadCredential initializes this object's credentials fields with the supplied information.

func (*ClientOption) NewClient

func (o *ClientOption) NewClient(ctx context.Context, hostURL string) (*govmomi.Client, error)

NewClient returns a new govmomi.Client.

func (*ClientOption) Userinfo

func (o *ClientOption) Userinfo() *url.Userinfo

Userinfo returns the user information with which the client was created.

type CreateUserFunc

type CreateUserFunc func(c *ssoadmin.Client) error

CreateUserFunc is function to create person user or solution user

type Credential

type Credential struct {
	Secret VCCMSecret
	// contains filtered or unexported fields
}

Credential are used when connecting to a vSphere endpoint.

type Role

type Role struct {
	RoleName   string
	Privileges []string
}

Role represents a role and its privileges.

type RolePermission

type RolePermission struct {
	Roles       object.AuthorizationRoleList `json:",omitempty"`
	Permissions []vimType.Permission         `json:",omitempty"`
	// contains filtered or unexported fields
}

RolePermission represents the permissions to assign to a role.

func GetRolePermission

func GetRolePermission(ctx context.Context, c *ClientOption) (*RolePermission, error)

GetRolePermission returns RolePermission by User

type User

type User struct {
	types.AdminPersonDetails
	// contains filtered or unexported fields
}

User contains information about a person added to the system as a user.

func (*User) Run

func (u *User) Run(ctx context.Context, c *ClientOption, fn CreateUserFunc) error

Run executes the supplied CreateUserFunc.

type VCCMSecret

type VCCMSecret struct {
	Name string
	Data map[string]string
}

VCCMSecret represents credential data stored as a Kubernetes secret.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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