Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoSuchKeyFound is an error primarily thrown by the Read method of the resource. // The error doesn't display the key itself for security reasons. ErrNoSuchKeyFound = errors.New("The key was not found") // ErrKeyCannotBeDeleted is an error which occurs when a key that is used by VMs is // being removed ErrKeyCannotBeDeleted = errors.New("The key wasn't deleted") )
var DefaultDNSServers = []string{
"8.8.8.8",
"8.8.4.4",
}
var DefaultDNSSuffixes = []string{
"vsphere.local",
}
var DiskControllerTypes = []string{
"scsi",
"scsi-lsi-parallel",
"scsi-buslogic",
"scsi-paravirtual",
"scsi-lsi-sas",
"ide",
}
Functions ¶
func DecodeError ¶ added in v0.2.0
func DecodeError(info types.LicenseManagerLicenseInfo) error
DecodeError tries to find a specific error which occurs when an invalid key is passed to the server
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a terraform.ResourceProvider.
Types ¶
type Config ¶
type Config struct { User string Password string VSphereServer string InsecureFlag bool Debug bool DebugPath string DebugPathRun string }
Config holds the provider configuration, and delivers a populated VSphereClient based off the contained settings.
func (*Config) Client ¶
func (c *Config) Client() (*VSphereClient, error)
Client returns a new client for accessing VMWare vSphere.
func (*Config) EnableDebug ¶
EnableDebug turns on govmomi API operation logging, if appropriate settings are set on the provider.
type VSphereClient ¶ added in v0.4.0
type VSphereClient struct {
// contains filtered or unexported fields
}
VSphereClient is the client connection manager for the vSphere provider. It holds the connections to the various API endpoints we need to interface with, such as the VMODL API through govmomi, and the REST SDK through alternate libraries.
func (*VSphereClient) TagsClient ¶ added in v0.4.0
func (c *VSphereClient) TagsClient() (*tags.RestClient, error)
TagsClient returns the embedded REST client used for tags, after determining if the connection is eligible:
* The connection information in vimClient is valid vCenter connection * The provider has a connection to the CIS REST client. This is true if tagsClient != nil.
This function should be used whenever possible to return the client from the provider meta variable for use, to determine if it can be used at all.
The nil value that is returned on an unsupported connection can be considered stable behavior for read purposes on resources that need to be able to read tags if they are present. You can use the snippet below in a Read call to determine if tags are supported on this connection, and if they are, read them from the object and save them in the resource:
if tagsClient, _ := meta.(*VSphereClient).TagsClient(); tagsClient != nil { if err := readTagsForResource(tagsClient, obj, d); err != nil { return err } }
Source Files ¶
- config.go
- data_source_vsphere_datacenter.go
- data_source_vsphere_host.go
- data_source_vsphere_tag.go
- data_source_vsphere_tag_category.go
- data_source_vsphere_vmfs_disks.go
- datacenter_helper.go
- datastore_helper.go
- datastore_summary_structure.go
- event_helper.go
- folder_helper.go
- host_data_store_system_helper.go
- host_nas_volume_structure.go
- host_network_policy_structure.go
- host_network_system_helper.go
- host_port_group_structure.go
- host_storage_system_helper.go
- host_system_helper.go
- host_virtual_switch_structure.go
- nas_datastore_helper.go
- provider.go
- resource_vsphere_datacenter.go
- resource_vsphere_file.go
- resource_vsphere_folder.go
- resource_vsphere_folder_migrate.go
- resource_vsphere_host_port_group.go
- resource_vsphere_host_virtual_switch.go
- resource_vsphere_license.go
- resource_vsphere_nas_datastore.go
- resource_vsphere_tag.go
- resource_vsphere_tag_category.go
- resource_vsphere_virtual_disk.go
- resource_vsphere_virtual_machine.go
- resource_vsphere_virtual_machine_migrate.go
- resource_vsphere_virtual_machine_snapshot.go
- resource_vsphere_vmfs_datastore.go
- structure_helper.go
- tags_helper.go
- vim_helper.go
- virtual_machine_helper.go