Issue #4191
closedPulp does not support all search query strings - only name works reliably
Description
Reproduce:
Query Pulp with a query string parameter other than name
Actual:
Pulp ignores most non-name parameters
Expected:
Pulp filters by any parameter
Examples ([httpie syntax](https://httpie.org/doc#querystring-parameters)):
Some of the following are not very useful, but filtering should be consistent.
GET /pulp/api/v3/publishers/file/ type=="foo" # this should always return 0 results
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 499
Content-Type: application/json
Date: Tue, 27 Nov 2018 13:54:49 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"_href": "/pulp/api/v3/publishers/file/1/",
"created": "2018-11-26T18:21:33.521797Z",
"distributions": [],
"last_published": null,
"last_updated": "2018-11-26T18:21:52.763045Z",
"manifest": "PULP_MANIFEST",
"name": "pdf",
"type": "file"
},
{
"_href": "/pulp/api/v3/publishers/file/2/",
"created": "2018-11-26T21:16:34.010881Z",
"distributions": [],
"last_published": null,
"last_updated": "2018-11-26T21:16:34.010913Z",
"manifest": "PULP_MANIFEST",
"name": "txt",
"type": "file"
}
]
}
GET /pulp/api/v3/publishers/file/ _href==/pulp/api/v3/publishers/file/1/ # this should always return 1 result
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 499
Content-Type: application/json
Date: Tue, 27 Nov 2018 14:02:29 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"_href": "/pulp/api/v3/publishers/file/1/",
"created": "2018-11-26T18:21:33.521797Z",
"distributions": [],
"last_published": null,
"last_updated": "2018-11-26T18:21:52.763045Z",
"manifest": "PULP_MANIFEST",
"name": "pdf",
"type": "file"
},
{
"_href": "/pulp/api/v3/publishers/file/2/",
"created": "2018-11-26T21:16:34.010881Z",
"distributions": [],
"last_published": null,
"last_updated": "2018-11-26T21:16:34.010913Z",
"manifest": "PULP_MANIFEST",
"name": "txt",
"type": "file"
}
]
}
GET /pulp/api/v3/publications/ publisher==/pulp/api/v3/publishers/file/2/
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 590
Content-Type: application/json
Date: Tue, 27 Nov 2018 14:04:30 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"_href": "/pulp/api/v3/publications/2/",
"created": "2018-11-26T18:42:17.866763Z",
"distributions": [],
"pass_through": true,
"publisher": "/pulp/api/v3/publishers/file/1/",
"repository_version": "/pulp/api/v3/repositories/1/versions/1/"
},
{
"_href": "/pulp/api/v3/publications/1/",
"created": "2018-11-26T18:32:02.020005Z",
"distributions": [
"http://centos7-pulp3-source.virbr0.akofink-desktop/pulp/api/v3/distributions/1/"
],
"pass_through": true,
"publisher": "/pulp/api/v3/publishers/file/1/",
"repository_version": "/pulp/api/v3/repositories/1/versions/1/"
}
]
}
There are many more! Try using any of the other non-name parameters in the above API output (i.e. manifest, pass_through, repository_version).
Updated by amacdona@redhat.com about 6 years ago
Filters with Pulp3 are not enabled for all fields. Each filterable field must be explicitly declared, and for the file publisher (which just uses the publisher base class), the only fields that are filterable are `name` and `last_updated`.
If you need other fields to be filterable, please file a story for those fields. Feel free to combine fields into 1 story, but it is probably simplest to file a separate story for each endpoint.
As a note, we did it this way to promote backwards compatibility. It is much easier to add new filters than to move/change filters that already exist.
Updated by CodeHeeler about 6 years ago
- Status changed from NEW to CLOSED - NOTABUG
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.