Project

Profile

Help

Issue #4191

closed

Pulp does not support all search query strings - only name works reliably

Added by akofink over 5 years ago. Updated almost 4 years ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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).

Also available in: Atom PDF