[pve-devel] [PATCH pve-manager 1/2] Nodes: wakeonlan return MAC address send via WOL packet

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jan 18 21:45:41 CET 2019


On Fri, Jan 18, 2019 at 11:13:08AM +0100, Christian Ebner wrote:
> The wake on LAN call now returns a string containing the MAC address send in the
> WOL packet.
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
>  PVE/API2/Nodes.pm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
> index 7f829b29..2c8bfc35 100644
> --- a/PVE/API2/Nodes.pm
> +++ b/PVE/API2/Nodes.pm
> @@ -485,7 +485,7 @@ __PACKAGE__->register_method({
>  	    }),
>  	},
>      },
> -    returns => { type => "null" },
> +    returns => { type => 'string' },

slight nit: we know that this has a specific format, so why not mention
it? it's nicer for API users if they don't have to look into the code to
see whaat string this endpoint returns ;)

it might make sense to also unify the (now at least three) different
definitions for MAC addresses:

pve-manager's NodeConfig.pm
qemu-server's QemuServer.pm (as part of $net_fmt)
pve-container's LXC/Config.pm (as part of $netconf_desc)

they all have different RE's matching the same values, and could be
replaced with a unified version / standard option in pve-common. only
the description would need to be overwritten for each use case.

then this same standard option can also be re-used for the return
schema (all of the above can also be done as a follow-up series).




More information about the pve-devel mailing list