Project

General

Profile

Bug #25835

API: Search constraints don't work on "hosts/:host_id/interfaces" endpoint.

Added by Alex Kinneer 6 months ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Specifying a "search" query parameter on this endpoint does not produce filtered results, as with various other API query methods. For example, I have a host with two interfaces in Foreman, and I issue this query:

https://FOREMAN:443 GET /api/hosts/2/interfaces?search=identifier%3D%22enp129s0f0%22

Expected result:

{
"total": 1,
"subtotal": 1,
"page": 1,
"per_page": 20,
"search": "identifier=\"enp129s0f0\"",
"sort": {
"by": null,
"order": null
},
"results": [ {
"subnet_id": 1,
"subnet_name": "SUBNET",
"subnet6_id": null,
"subnet6_name": null,
"domain_id": 1,
"domain_name": "MY.DOMAIN",
"created_at": "2018-11-30 17:50:48 UTC",
"updated_at": "2018-11-30 20:14:53 UTC",
"managed": true,
"identifier": "enp129s0f0",
"id": 3,
"name": "HOST.MY.DOMAIN",
"ip": "10.0.1.11",
"ip6": "",
"mac": "0c:c4:7a:8f:c7:b0",
"mtu": 1500,
"fqdn": "HOST.MY.DOMAIN",
"primary": true,
"provision": true,
"type": "interface",
"virtual": false
}
]
}

Actual result:

{
"total": 1,
"subtotal": 1,
"page": 1,
"per_page": 20,
"search": "identifier=\"enp129s0f0\"",
"sort": {
"by": null,
"order": null
},
"results": [ {
"subnet_id": 1,
"subnet_name": "SUBNET",
"subnet6_id": null,
"subnet6_name": null,
"domain_id": 1,
"domain_name": "MY.DOMAIN",
"created_at": "2018-11-30 17:50:48 UTC",
"updated_at": "2018-11-30 20:14:53 UTC",
"managed": true,
"identifier": "enp129s0f0",
"id": 3,
"name": "HOST.MY.DOMAIN",
"ip": "10.0.1.11",
"ip6": "",
"mac": "0c:c4:7a:8f:c7:b0",
"mtu": 1500,
"fqdn": "HOST.MY.DOMAIN",
"primary": true,
"provision": true,
"type": "interface",
"virtual": false
}, {
"subnet_id": 1,
"subnet_name": "SUBNET",
"subnet6_id": null,
"subnet6_name": null,
"domain_id": null,
"domain_name": null,
"created_at": "2018-11-30 17:50:50 UTC",
"updated_at": "2018-12-20 22:38:01 UTC",
"managed": false,
"identifier": "ipmi",
"id": 5,
"name": "",
"ip": "10.0.1.15",
"ip6": "",
"mac": "0c:c4:7a:8b:4b:55",
"mtu": 1500,
"fqdn": "",
"primary": false,
"provision": false,
"type": "bmc",
"username": "USER",
"password": "CONTENT",
"provider": "IPMI",
"virtual": false
}
]
}

History

#1 Updated by Alex Kinneer 6 months ago

  • Found in Releases 1.20.0 added

#2 Updated by Alex Kinneer 6 months ago

  • Category set to Search

Also available in: Atom PDF