Actions
Bug #7975
closedQuerying subnets by name no longer works
Description
When querying subnets via the API, only querying by ID works, not querying by name. Example:
curl -s -k -u admin:changeme https://r6-staypuft/api/subnets | python -m json.tool
[
{
"subnet": {
"dhcp_id": 1,
"dns_id": 1,
"dns_primary": "192.168.130.5",
"dns_secondary": null,
"domain_ids": [
1
],
"from": "192.168.130.100",
"gateway": "192.168.130.1",
"id": 1,
"ipam": "DHCP",
"mask": "255.255.255.0",
"name": "default",
"network": "192.168.130.0",
"priority": null,
"tftp_id": 1,
"to": "192.168.130.254",
"vlanid": null
}
}
]
[root@r6-staypuft ~]# curl -s -k -u admin:changeme https://r6-staypuft/api/subnets/1 | python -m json.tool
{
"subnet": {
"cidr": 24,
"dhcp": {
"id": 1,
"name": "r6-staypuft.example.org",
"url": "https://r6-staypuft.example.org:8443"
},
"dhcp_id": 1,
"dns": {
"id": 1,
"name": "r6-staypuft.example.org",
"url": "https://r6-staypuft.example.org:8443"
},
"dns_id": 1,
"dns_primary": "192.168.130.5",
"dns_secondary": null,
"domain_ids": [
1
],
"from": "192.168.130.100",
"gateway": "192.168.130.1",
"id": 1,
"ipam": "DHCP",
"mask": "255.255.255.0",
"name": "default",
"network": "192.168.130.0",
"priority": null,
"tftp": {
"id": 1,
"name": "r6-staypuft.example.org",
"url": "https://r6-staypuft.example.org:8443"
},
"tftp_id": 1,
"to": "192.168.130.254",
"vlanid": null
}
}
[root@r6-staypuft ~]# curl -s -k -u admin:changeme https://r6-staypuft/api/subnets/default | python -m json.tool
{
"message": "Resource subnet not found by id 'default'"
}
Actions