Documentation ¶
Index ¶
- Variables
- func HandleCredentialError(err error, env *sessionEnviron, ctx context.ProviderCallContext)
- func IsAuthorisationFailure(err error) bool
- func NewEnvironProvider(config EnvironProviderConfig) environs.CloudEnvironProvider
- type Client
- type DialFunc
- type EnvironProviderConfig
- type OvaFileMetadata
- type VsphereRenderer
Constants ¶
This section is empty.
Variables ¶
var Bootstrap = common.Bootstrap
Bootstrap is exported, because it has to be rewritten in external unit tests
var DestroyEnv = common.Destroy
DestroyEnv is exported, because it has to be rewritten in external unit tests.
var FinishInstanceConfig = instancecfg.FinishInstanceConfig
FinishInstanceConfig is exported, because it has to be rewritten in external unit tests
Functions ¶
func HandleCredentialError ¶
func HandleCredentialError(err error, env *sessionEnviron, ctx context.ProviderCallContext)
HandleCredentialError marks the current credential as invalid if the passed vsphere error indicates it should be.
func IsAuthorisationFailure ¶
IsAuthorisationFailure determines whether the given error indicates that the vsphere credential used is bad.
func NewEnvironProvider ¶
func NewEnvironProvider(config EnvironProviderConfig) environs.CloudEnvironProvider
NewEnvironProvider returns a new environs.EnvironProvider that will dial vSphere connectons with the given dial function.
Types ¶
type Client ¶
type Client interface { Close(context.Context) error ComputeResources(context.Context) ([]vsphereclient.ComputeResource, error) ResourcePools(context.Context, string) ([]*object.ResourcePool, error) CreateVirtualMachine(context.Context, vsphereclient.CreateVirtualMachineParams) (*mo.VirtualMachine, error) Folders(ctx context.Context) (*object.DatacenterFolders, error) Datastores(context.Context) ([]mo.Datastore, error) DeleteDatastoreFile(context.Context, string) error DestroyVMFolder(context.Context, string) error EnsureVMFolder(context.Context, string, string) (*object.Folder, error) MoveVMFolderInto(context.Context, string, string) error MoveVMsInto(context.Context, string, ...types.ManagedObjectReference) error RemoveVirtualMachines(context.Context, string) error UpdateVirtualMachineExtraConfig(context.Context, *mo.VirtualMachine, map[string]string) error VirtualMachines(context.Context, string) ([]*mo.VirtualMachine, error) UserHasRootLevelPrivilege(context.Context, string) (bool, error) FindFolder(ctx context.Context, folderPath string) (vmFolder *object.Folder, err error) }
Client is an interface for interacting with the vSphere API.
type EnvironProviderConfig ¶
type EnvironProviderConfig struct { // Dial is a function used for dialing connections to vCenter/ESXi. Dial DialFunc }
EnvironProviderConfig contains configuration for the EnvironProvider.
type OvaFileMetadata ¶
type VsphereRenderer ¶
type VsphereRenderer struct{}
func (VsphereRenderer) Render ¶
func (VsphereRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |