Comment 0 for bug 1573660

Revision history for this message
Blake Rouse (blake-rouse) wrote : [2.0b4] ipranges create type field should not be required

I went to reserve an IP range and when I didn't specify the type it gave errors for start_ip and end_ip, but also type should not be required. type should default to reserved.
ubuntu@region-1:~$ maas admin ipranges create start_ip=192.168.122.1 end_ip=192.168.122.39
{"start_ip": ["No range can be created at requested start IP."], "type": ["This field is required.", "No range can be created at requested start IP."]}
ubuntu@region-1:~$ maas admin ipranges create start_ip=192.168.122.1 end_ip=192.168.122.39 type=reserved
Success.
Machine-readable output follows:
{
    "id": 2,
    "resource_uri": "/MAAS/api/2.0/ipranges/2/",
    "type": "reserved",
    "start_ip": "192.168.122.1",
    "end_ip": "192.168.122.39",
    "comment": "",
    "user": {
        "username": "admin",
        "email": "noreply@maas",
        "is_superuser": true
    },
    "subnet": {
        "resource_uri": "/MAAS/api/2.0/subnets/1/",
        "gateway_ip": "192.168.122.1",
        "allow_proxy": true,
        "dns_servers": [],
        "space": "space-0",
        "cidr": "192.168.122.0/24",
        "id": 1,
        "rdns_mode": 2,
        "name": "192.168.122.0/24",
        "vlan": {
            "resource_uri": "/MAAS/api/2.0/vlans/5001/",
            "dhcp_on": true,
            "secondary_rack": "4y3h7s",
            "mtu": 1500,
            "fabric": "fabric-0",
            "external_dhcp": null,
            "id": 5001,
            "primary_rack": "4y3h7r",
            "name": "untagged",
            "vid": 0
        }
    }
}