← Back to team overview

maas-devel team mailing list archive

Re: Allow API to use <system_id | hostname> for all operations that currently require the system_id

 

On 2014-05-28 20:40, Blake Rouse wrote:
Do we need to modify the API?

Would it be okay to just modify the maas-cli to accept a hostname, then
that hostname could be used to look up the system_id. So the action is
transparent to the user, making the cli easier, without requiring a
large change to the API.

That might work specifically for operations on nodes, where you have a system ID in the resource URL. But then to keep things sensible, we also ought to support the same thing wherever we accept system IDs as parameters to calls. I'm not sure the CLI client could get all the information it would need.

What we did in the case of networks was to support prefixes. So you can identify a network as e.g. ‘ip:10.9.8.7’ or ‘vlan:6’, as well as by name.

The ‘:’ is not valid in a network name, so there's no ambiguity. One option would be to have a similar ‘host:foo.local’ notation for nodes. Another would be to forbid node hostnames that clash with existing system IDs, so that there's never any mistake.


Jeroen


References