cli

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 26 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

TODO (fanz): IsK8sNode validate if the given name refers to a node in kubernetes cluster

func ParseConfig

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

func ReadContent

func ReadContent(path string) (string, error)

Types

type ClientOption

type ClientOption struct {
	Client *govmomi.Client

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

func (*ClientOption) GetClient

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

func (*ClientOption) LoadCredential

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

func (*ClientOption) NewClient

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

func (*ClientOption) Userinfo

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

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
}

type Role

type Role struct {
	RoleName   string
	Privileges []string
}

type RolePermission

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

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
}

func (*User) Run

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

type VCCMSecret

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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