SpriteLink/NIPAP — pull request #663 by plajjan (2014-11-05 08:22:09+00:00)
Title: cli: add option to add hosts to network

This allows the user to add hosts in to a new network when assigning from a
pool or other prefix.

For example, we have pool 'core-links' containing IPv4 and IPv6 networks. Now
we want to grab a new link network and we can do that for both IPv4 and IPv6
and adding hosts in each with the command:

kll@lingloi320 ~ $ nipap address add from-pool core-links family dual-stack description "my link" add-hosts foo-core-1,bar-core-1
Network 1.3.3.20/31 added to VRF 'default' [RT: -]: my link
Host 1.3.3.20/31 added to VRF 'default' [RT: -]: foo-core-1
Host 1.3.3.21/31 added to VRF 'default' [RT: -]: bar-core-1
Network 2a00:800:0:2::5:0/112 added to VRF 'default' [RT: -]: my link
Host 2a00:800:0:2::5:1/112 added to VRF 'default' [RT: -]: foo-core-1
Host 2a00:800:0:2::5:2/112 added to VRF 'default' [RT: -]: bar-core-1
kll@lingloi320 ~ $ nipap address list 1.3.3.20/31
Searching for prefixes in any VRF...
VRF Prefix # Node Order Customer Description
================================================================================================================
- 1.3.3.0/24 R - None None None Core Link networks
- 1.3.3.20/31 A - None None None my link
- 1.3.3.20/31 H - foo-core-1 None None None
- 1.3.3.21/31 H - bar-core-1 None None None

The output of the add command has changed somewhat and it is now printed
if the new prefix is a host or network.

Fixes #661.