Documentation ¶
Index ¶
- func NewVimClient(ctx context.Context, config *config.VSphereVMProviderConfig) (*vim25.Client, *session.Manager, error)
- func RestKeepAliveHandlerFn(c *rest.Client, userInfo *url.Userinfo) func() error
- func SoapKeepAliveHandlerFn(sc *soap.Client, sm *session.Manager, userInfo *url.Userinfo) func() error
- type Client
- func (c *Client) ClusterModuleClient() clustermodules.Provider
- func (c *Client) Config() *config.VSphereVMProviderConfig
- func (c *Client) ContentLibClient() contentlibrary.Provider
- func (c *Client) Datacenter() *object.Datacenter
- func (c *Client) Finder() *find.Finder
- func (c *Client) Logout(ctx context.Context)
- func (c *Client) RestClient() *rest.Client
- func (c *Client) VimClient() *vim25.Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVimClient ¶
func NewVimClient(ctx context.Context, config *config.VSphereVMProviderConfig) (*vim25.Client, *session.Manager, error)
NewVimClient creates a new vim25 client which is configured to use a custom keepalive handler function. Making this public to allow access from other packages when only VimClient is needed.
func RestKeepAliveHandlerFn ¶
RestKeepAliveHandlerFn returns a keepalive handler function suitable for use with the REST handler. Similar to the SOAP handler, we customize the handler here so we can re-login the client in case the REST session expires due to connectivity issues.
func SoapKeepAliveHandlerFn ¶
func SoapKeepAliveHandlerFn(sc *soap.Client, sm *session.Manager, userInfo *url.Userinfo) func() error
SoapKeepAliveHandlerFn returns a keepalive handler function suitable for use with the SOAP handler. In case the connectivity to VC is down long enough, the session expires. Further attempts to use the client yield NotAuthenticated fault. This handler ensures that we re-login the client in those scenarios.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient creates a new Client. As a side effect, it creates a vim25 client and a REST client.
func (*Client) ClusterModuleClient ¶
func (c *Client) ClusterModuleClient() clustermodules.Provider
func (*Client) Config ¶
func (c *Client) Config() *config.VSphereVMProviderConfig
func (*Client) ContentLibClient ¶
func (c *Client) ContentLibClient() contentlibrary.Provider
func (*Client) Datacenter ¶
func (c *Client) Datacenter() *object.Datacenter