diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 55274cfec..f5c5b6fde 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -9,6 +9,7 @@ - [Health/Orphan VDIs] Improve heuristic and list both VDI snapshots and normal VDIs (PR [#5228](https://github.com/vatesfr/xen-orchestra/pull/5228)) - [VM/Console] Hide missing ISOs in selector [#5222](https://github.com/vatesfr/xen-orchestra/issues/5222) +- [Host/Network] Button to refresh the list of physical interfaces [#5230](https://github.com/vatesfr/xen-orchestra/issues/5230) ### Bug fixes diff --git a/packages/xo-server/src/api/host.js b/packages/xo-server/src/api/host.js index de1d4c258..d9acebfaf 100644 --- a/packages/xo-server/src/api/host.js +++ b/packages/xo-server/src/api/host.js @@ -298,3 +298,19 @@ isHyperThreadingEnabled.params = { isHyperThreadingEnabled.resolve = { host: ['id', 'host', 'administrate'], } + +// ------------------------------------------------------------------- + +export async function scanPifs({ host }) { + await this.getXapi(host).callAsync('PIF.scan', host._xapiRef) +} + +scanPifs.description = 'Refresh the list of physical interfaces for this host' + +scanPifs.params = { + id: { type: 'string' }, +} + +scanPifs.resolve = { + host: ['id', 'host', 'administrate'], +} diff --git a/packages/xo-web/src/common/xo/index.js b/packages/xo-web/src/common/xo/index.js index 61bdf2dda..622e04272 100644 --- a/packages/xo-web/src/common/xo/index.js +++ b/packages/xo-web/src/common/xo/index.js @@ -1907,6 +1907,8 @@ export const getIpv4ConfigModes = () => _call('pif.getIpv4ConfigurationModes') export const editPif = (pif, { vlan }) => _call('pif.editPif', { pif: resolveId(pif), vlan }) +export const scanHostPifs = hostId => _call('host.scanPifs', { host: hostId }) + // SR ---------------------------------------------------------------- export const deleteSr = sr => diff --git a/packages/xo-web/src/xo-app/host/tab-network.js b/packages/xo-web/src/xo-app/host/tab-network.js index 7d985ff9c..5737258c4 100644 --- a/packages/xo-web/src/xo-app/host/tab-network.js +++ b/packages/xo-web/src/xo-app/host/tab-network.js @@ -27,6 +27,7 @@ import { editPif, getIpv4ConfigModes, reconfigurePifIp, + scanHostPifs, } from 'xo' const EDIT_BUTTON_STYLE = { color: '#999', cursor: 'pointer' } @@ -372,7 +373,17 @@ export default ({ host, networks, pifs, privateNetworks }) => ( -

{_('poolNetworkPif')}

+

+ {_('poolNetworkPif')} + + {_('refresh')} + +