Documentation ¶
Index ¶
- Constants
- Variables
- func BaseVMKernelSchema() map[string]*schema.Schema
- func DecodeError(info types.LicenseManagerLicenseInfo) error
- func NewOvfHelperParamsFromVMDatasource(d *schema.ResourceData) *ovfdeploy.OvfHelperParams
- func NewOvfHelperParamsFromVMResource(d *schema.ResourceData) *ovfdeploy.OvfHelperParams
- func Provider() *schema.Provider
- func UpdateLabel(ctx context.Context, m *license.Manager, licenseKey string, key string, ...) error
- type Client
- type Config
- func (c *Config) Client() (*Client, error)
- func (c *Config) EnableDebug() error
- func (c *Config) LoadAndVerifyRestSession(client *govmomi.Client) (*rest.Client, bool, error)
- func (c *Config) LoadVimClient() (*govmomi.Client, error)
- func (c *Config) SaveRestClient(client *rest.Client, s *cache.Session) error
- func (c *Config) SaveVimClient(client *govmomi.Client) error
- func (c *Config) SavedRestSessionOrNew(s *cache.Session) (*rest.Client, error)
- func (c *Config) SavedVimSessionOrNew(u *url.URL) (*govmomi.Client, error)
- type HostAccessManager
Constants ¶
const SystemRole = "System"
const TagNamespace = "http://www.vmware.com/storage/tag"
const TagPlacement = "Tag based placement"
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") )
Functions ¶
func BaseVMKernelSchema ¶
BaseVMKernelSchema returns the schema required to represent a vNIC adapter on an ESX Host. We make this public so we can pull this from the host resource as well.
func DecodeError ¶
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 NewOvfHelperParamsFromVMDatasource ¶
func NewOvfHelperParamsFromVMDatasource(d *schema.ResourceData) *ovfdeploy.OvfHelperParams
func NewOvfHelperParamsFromVMResource ¶
func NewOvfHelperParamsFromVMResource(d *schema.ResourceData) *ovfdeploy.OvfHelperParams
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 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 (*Client) TagsManager ¶
TagsManager returns the embedded tags manager used for tags, after determining if the REST 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 restClient != 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 tm, _ := meta.(*VSphereClient).TagsManager(); tm != nil { if err := readTagsForResource(restClient, obj, d); err != nil { return err } }
type Config ¶
type Config struct { InsecureFlag bool Debug bool Persist bool User string Password string VSphereServer string DebugPath string DebugPathRun string VimSessionPath string RestSessionPath string KeepAlive int APITimeout time.Duration }
Config holds the provider configuration, and delivers a populated VSphereClient based off the contained settings.
func NewConfig ¶
func NewConfig(d *schema.ResourceData) (*Config, error)
NewConfig returns a new Config from a supplied ResourceData.
func (*Config) EnableDebug ¶
EnableDebug turns on govmomi API operation logging, if appropriate settings are set on the provider.
func (*Config) LoadAndVerifyRestSession ¶
func (*Config) LoadVimClient ¶
LoadVimClient loads a saved vSphere SOAP API session from disk, previously saved by SaveVimClient, checking it for validity before returning it. A nil client means that the session is no longer valid and should be created from scratch.
Note the logic in this function has been largely adapted from govc and is designed to be compatible with it - if a session has already been saved with govc, Terraform will attempt to use that session first.
func (*Config) SaveRestClient ¶
func (*Config) SaveVimClient ¶
SaveVimClient saves a client to the supplied path. This facilitates re-use of the session at a later date.
Note the logic in this function has been largely adapted from govc and is designed to be compatible with it.
func (*Config) SavedRestSessionOrNew ¶
type HostAccessManager ¶
func NewHostAccessManager ¶
func NewHostAccessManager(c *vim25.Client, ref types.ManagedObjectReference) *HostAccessManager
func (HostAccessManager) ChangeLockdownMode ¶
func (h HostAccessManager) ChangeLockdownMode(ctx context.Context, mode types.HostLockdownMode) error
Source Files ¶
- config.go
- data_source_vsphere_compute_cluster.go
- data_source_vsphere_compute_cluster_host_group.go
- data_source_vsphere_content_library.go
- data_source_vsphere_content_library_item.go
- data_source_vsphere_custom_attribute.go
- data_source_vsphere_datacenter.go
- data_source_vsphere_datastore.go
- data_source_vsphere_datastore_cluster.go
- data_source_vsphere_distributed_virtual_switch.go
- data_source_vsphere_dynamic.go
- data_source_vsphere_folder.go
- data_source_vsphere_host.go
- data_source_vsphere_host_pci_device.go
- data_source_vsphere_host_thumbprint.go
- data_source_vsphere_license.go
- data_source_vsphere_network.go
- data_source_vsphere_ovf_vm_template.go
- data_source_vsphere_resource_pool.go
- data_source_vsphere_role.go
- data_source_vsphere_storage_policy.go
- data_source_vsphere_tag.go
- data_source_vsphere_tag_category.go
- data_source_vsphere_vapp_container.go
- data_source_vsphere_virtual_machine.go
- data_source_vsphere_vmfs_disks.go
- datacenter_helper.go
- datastore_structure.go
- distributed_port_group_structure.go
- distributed_virtual_port_setting_structure.go
- distributed_virtual_switch_helper.go
- distributed_virtual_switch_structure.go
- event_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_virtual_switch_structure.go
- nas_datastore_helper.go
- provider.go
- resource_vsphere_compute_cluster.go
- resource_vsphere_compute_cluster_host_group.go
- resource_vsphere_compute_cluster_vm_affinity_rule.go
- resource_vsphere_compute_cluster_vm_anti_affinity_rule.go
- resource_vsphere_compute_cluster_vm_dependency_rule.go
- resource_vsphere_compute_cluster_vm_group.go
- resource_vsphere_compute_cluster_vm_host_rule.go
- resource_vsphere_content_library.go
- resource_vsphere_content_library_item.go
- resource_vsphere_content_library_item_migrate.go
- resource_vsphere_custom_attribute.go
- resource_vsphere_datacenter.go
- resource_vsphere_datastore_cluster.go
- resource_vsphere_datastore_cluster_vm_anti_affinity_rule.go
- resource_vsphere_distributed_port_group.go
- resource_vsphere_distributed_virtual_switch.go
- resource_vsphere_dpm_host_override.go
- resource_vsphere_drs_vm_override.go
- resource_vsphere_entity_permissions.go
- resource_vsphere_file.go
- resource_vsphere_folder.go
- resource_vsphere_folder_migrate.go
- resource_vsphere_ha_vm_override.go
- resource_vsphere_host.go
- resource_vsphere_host_port_group.go
- resource_vsphere_host_virtual_switch.go
- resource_vsphere_license.go
- resource_vsphere_nas_datastore.go
- resource_vsphere_resource_pool.go
- resource_vsphere_role.go
- resource_vsphere_storage_drs_vm_override.go
- resource_vsphere_tag.go
- resource_vsphere_tag_category.go
- resource_vsphere_vapp_container.go
- resource_vsphere_vapp_entity.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_vm_storage_policy.go
- resource_vsphere_vmfs_datastore.go
- resource_vsphere_vnic.go
- tags_helper.go
- util.go
- virtual_machine_config_structure.go
- virtual_machine_guest_structure.go