Documentation ¶
Index ¶
- func NewVimClient(ctx context.Context, config Config) (*vim25.Client, *session.Manager, error)
- func RestKeepAliveHandlerFn(ctx context.Context, c *rest.Client, userInfo *url.Userinfo) func() error
- func SoapKeepAliveHandlerFn(ctx context.Context, sc *soap.Client, sm *session.Manager, ...) func() error
- type Client
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVimClient ¶
NewVimClient creates a new vim25 client which is configured to use a custom keepalive handler function.
func RestKeepAliveHandlerFn ¶
func RestKeepAliveHandlerFn( ctx context.Context, c *rest.Client, userInfo *url.Userinfo) func() error
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( ctx context.Context, 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 (*Client) Datacenter ¶
func (c *Client) Datacenter() *object.Datacenter