vsphere/host_nas_volume_structure.go
func schemaHostNasVolumeSpec() map[string]*schema.Schema {
	return map[string]*schema.Schema{
		// HostNasVolumeSpec
		// Skipped attributes: localPath (this is the name attribute)
		// All CIFS attributes (we currently do not support CIFS as it's not
		// available in the vSphere client and there is not much data about how to
		// get it working)
		"access_mode": {
			Type:        schema.TypeString,
			Default:     hostNasVolumeAccessModeReadWrite,
			Description: "Access mode for the mount point. Can be one of readOnly or readWrite.",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					hostNasVolumeAccessModeReadOnly,
					hostNasVolumeAccessModeReadWrite,
				},
				false,
			),
		},
		"remote_hosts": {
			Type:        schema.TypeList,
			Description: "The hostnames or IP addresses of the remote server or servers. Only one element should be present for NFS v3 but multiple can be present for NFS v4.1.",
			Elem:        &schema.Schema{Type: schema.TypeString},
			ForceNew:    true,
			MinItems:    1,
			Required:    true,
		},
		"remote_path": {
			Type:        schema.TypeString,
			Description: "The remote path of the mount point.",
			ForceNew:    true,
			Required:    true,
		},
		"security_type": {
			Type:        schema.TypeString,
			Description: "The security type to use.",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					hostNasVolumeSecurityTypeAuthSys,
					hostNasVolumeSecurityTypeSecKrb5,
					hostNasVolumeSecurityTypeSecKrb5i,
				},
				false,
			),
		},
		"type": {
			Type:        schema.TypeString,
			Default:     "NFS",
			Description: "The type of NAS volume. Can be one of NFS (to denote v3) or NFS41 (to denote NFS v4.1).",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					string(types.HostFileSystemVolumeFileSystemTypeNFS),
					string(types.HostFileSystemVolumeFileSystemTypeNFS41),
				},
				false,
			),
		},
		"protocol_endpoint": {
			Type:        schema.TypeString,
			Description: "Indicates that this NAS volume is a protocol endpoint. This field is only populated if the host supports virtual datastores.",
			Computed:    true,
		},
	}
}
func schemaHostNasVolumeSpec() map[string]*schema.Schema {
	return map[string]*schema.Schema{
		// HostNasVolumeSpec
		// Skipped attributes: localPath (this is the name attribute)
		// All CIFS attributes (we currently do not support CIFS as it's not
		// available in the vSphere client and there is not much data about how to
		// get it working)
		"access_mode": {
			Type:        schema.TypeString,
			Default:     hostNasVolumeAccessModeReadWrite,
			Description: "Access mode for the mount point. Can be one of readOnly or readWrite.",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					hostNasVolumeAccessModeReadOnly,
					hostNasVolumeAccessModeReadWrite,
				},
				false,
			),
		},
		"remote_hosts": {
			Type:        schema.TypeList,
			Description: "The hostnames or IP addresses of the remote server or servers. Only one element should be present for NFS v3 but multiple can be present for NFS v4.1.",
			Elem:        &schema.Schema{Type: schema.TypeString},
			ForceNew:    true,
			MinItems:    1,
			Required:    true,
		},
		"remote_path": {
			Type:        schema.TypeString,
			Description: "The remote path of the mount point.",
			ForceNew:    true,
			Required:    true,
		},
		"security_type": {
			Type:        schema.TypeString,
			Description: "The security type to use.",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					hostNasVolumeSecurityTypeAuthSys,
					hostNasVolumeSecurityTypeSecKrb5,
					hostNasVolumeSecurityTypeSecKrb5i,
				},
				false,
			),
		},
		"type": {
			Type:        schema.TypeString,
			Default:     "NFS",
			Description: "The type of NAS volume. Can be one of NFS (to denote v3) or NFS41 (to denote NFS v4.1).",
			ForceNew:    true,
			Optional:    true,
			ValidateFunc: validation.StringInSlice(
				[]string{
					string(types.HostFileSystemVolumeFileSystemTypeNFS),
					string(types.HostFileSystemVolumeFileSystemTypeNFS41),
				},
				false,
			),
		},
		"protocol_endpoint": {
			Type:        schema.TypeString,
			Description: "Indicates that this NAS volume is a protocol endpoint. This field is only populated if the host supports virtual datastores.",
			Computed:    true,
		},
	}
}
// schemaHostNasVolumeSpec returns schema items for resources that need to work
// with a HostNasVolumeSpec.