Documentation ¶
Index ¶
- func CheckVSphereConfig(ctx context.Context, o *ClientOption) error
- func CreateRole(ctx context.Context, o *ClientOption, role *Role) error
- func CreateSolutionUser(ctx context.Context, o *ClientOption) error
- func IsClusterNode(name string) bool
- func ParseConfig(configFile string) (*config.Config, error)
- func ReadContent(path string) (string, error)
- type ClientOption
- type CreateUserFunc
- type Credential
- type Role
- type RolePermission
- type User
- type VCCMSecret
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 ¶
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 ¶
ParseConfig returns a config.Config object initialized with the values from the supplied configuration file.
func ReadContent ¶
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) Userinfo ¶
func (o *ClientOption) Userinfo() *url.Userinfo
Userinfo returns the user information with which the client was created.
type CreateUserFunc ¶
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 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 ¶
VCCMSecret represents credential data stored as a Kubernetes secret.