Documentation
¶
Overview ¶
Package vsphere holds utilities for bootstrapping a vSphere API client from the metadata injected by the VSphereSource. Within a receive adapter, users can create a new vSphere SOAP API client with automatic keep-alive:
client, err := vsphere.NewSOAPClient(ctx)
To properly release vSphere API resources, it is recommended to log out when the client is not needed anymore:
defer client.Logout(context.Background())
This is modeled after the Bindings pattern.
Index ¶
- Constants
- func NewAdapter(ctx context.Context, processed adapter.EnvConfigAccessor, ...) adapter.Adapter
- func NewEnvConfig() adapter.EnvConfigAccessor
- func NewRESTClient(ctx context.Context) (*rest.Client, error)
- func NewSOAPClient(ctx context.Context) (*govmomi.Client, error)
- func ReadKey(key string) (string, error)
- type EnvConfig
Constants ¶
View Source
const ( VolumeName = "vsphere-binding" DefaultMountPath = "/var/bindings/vsphere" // filepath.Join isn't const. )
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
func NewAdapter(ctx context.Context, processed adapter.EnvConfigAccessor, ceClient cloudevents.Client) adapter.Adapter
func NewEnvConfig ¶
func NewEnvConfig() adapter.EnvConfigAccessor
func NewRESTClient ¶ added in v0.19.0
NewRESTClient returns a vCenter REST API client with active keep-alive. Use Logout() to release resources and perform a clean logout from vCenter.
func NewSOAPClient ¶ added in v0.19.0
NewSOAPClient returns a vCenter SOAP API client with active keep-alive. Use Logout() to release resources and perform a clean logout from vCenter.
Types ¶
Click to show internal directories.
Click to hide internal directories.