本文整理匯總了Golang中github.com/hooklift/terraform-provider-vix/provider/vix.VM.SharedFolders方法的典型用法代碼示例。如果您正苦於以下問題:Golang VM.SharedFolders方法的具體用法?Golang VM.SharedFolders怎麽用?Golang VM.SharedFolders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/hooklift/terraform-provider-vix/provider/vix.VM
的用法示例。
在下文中一共展示了VM.SharedFolders方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: tf_to_vix
// Maps Terraform attributes to provider's structs
func tf_to_vix(d *schema.ResourceData, vm *vix.VM) error {
var err error
vm.Name = d.Get("name").(string)
vm.Description = d.Get("description").(string)
vm.CPUs = uint(d.Get("cpus").(int))
vm.Memory = d.Get("memory").(string)
vm.UpgradeVHardware = d.Get("upgrade_vhardware").(bool)
vm.LaunchGUI = d.Get("gui").(bool)
vm.SharedFolders = d.Get("sharedfolders").(bool)
vm.ToolsInitTimeout, err = time.ParseDuration(d.Get("tools_init_timeout").(string))
// Maps any defined networks to VIX provider's data types
err = net_tf_to_vix(d, vm)
if err != nil {
return fmt.Errorf("Error mapping TF network adapter resource to VIX data types: %s", err)
}
if i := d.Get("image.#").(int); i > 0 {
prefix := "image.0."
vm.Image = vix.Image{
URL: d.Get(prefix + "url").(string),
Checksum: d.Get(prefix + "checksum").(string),
ChecksumType: d.Get(prefix + "checksum_type").(string),
Password: d.Get(prefix + "password").(string),
}
}
err = cdrom_tf_to_vix(d, vm)
if err != nil {
return fmt.Errorf("Error mapping TF cdrom resource to VIX data types: %s", err)
}
return nil
}