// SetExternalPort will attach an external ethernet port to this switch.
// This operation will make this VMswitch an "external" VM switch.
SetExternalPort will attach an external ethernet port to this switch.
This operation will make this VMswitch an "external" VM switch.
// SetExternalPort will attach an external ethernet port to this switch . // This operation will make this VMswitch an " external " VM switch .
func (v VirtualSwitch) SetExternalPort(interfaceID string) error {
	_, err := v.getSwitchExternalPortAllocSettings()
	if err != nil {
		if err != wmi.ErrNotFound {
			return errors.Wrap(err, "getSwitchExternalPortAllocSettings")
		}
	}
	externalPort, err := v.getExternalPort(interfaceID)
	if err != nil {
		return errors.Wrap(err, "getExternalPort")
	}
	extPortPath, err := externalPort.Path()
	if err != nil {
		return fmt.Errorf("Could not call path_: %v", err)
	}
	extText, err := v.getExternalPortAllocationText(extPortPath)
	if err != nil {
		return errors.Wrap(err, "getExternalPortAllocationText")
	}
	resources := []string{
		extText,
	}
	err = v.setSwitchResources(resources)
	if err != nil {
		return errors.Wrap(err, "setSwitchResources")
	}
	return nil
}
func ( v VirtualSwitch ) SetExternalPort ( interfaceID string ) error { _ , err := v . getSwitchExternalPortAllocSettings ( ) if err != nil { if err != wmi . ErrNotFound { return errors . Wrap ( err , " " ) } } externalPort , err := v . getExternalPort ( interfaceID ) if err != nil { return errors . Wrap ( err , " " ) } extPortPath , err := externalPort . Path ( ) if err != nil { return fmt . Errorf ( " " , err ) } extText , err := v . getExternalPortAllocationText ( extPortPath ) if err != nil { return errors . Wrap ( err , " " ) } resources := [ ] string { extText , } err = v . setSwitchResources ( resources ) if err != nil { return errors . Wrap ( err , " " ) } return nil }
SetExternalPort will attach an external ethernet port to this switch.
SetExternalPort will attach an external ethernet port to this switch .