Project

Profile

Help

Issue #768

closed

API call to Update a scheduled publish returns 400 with invalid schedule_id

Added by amacdona@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

A PUT request to /v2/repositories/<repo_id>/distributors/<distributor_id>/schedules/publish/invalid_schedule_id/ returns a 400. Since the invalid param is in the URL, this should be a 404.

Unfortunately the problem is in the manager so this will not be fixed by the Django conversion.

https://github.com/pulp/pulp/blob/master/server/pulp/server/managers/schedule/utils.py#L147

curl -s -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X PUT -d '{"schedule": "P1DT"}' -D- -k -u admin:admin https://localhost/pulp/api/v2/repositories/test/distributors/9ce77df7-63b6-405a-a6ae-15332efcb433/schedules/publish/fake_sched/

HTTP/1.1 400 BAD REQUEST
Date: Tue, 17 Mar 2015 14:14:03 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1k-fips mod_wsgi/4.3.2 Python/2.7.8
Content-Encoding: utf-8
Content-Length: 482
Connection: close
Content-Type: application/json
{
    "_href": "/pulp/api/v2/repositories/test/distributors/9ce77df7-63b6-405a-a6ae-15332efcb433/schedules/publish/fake_sched/",
    "error": {
        "code": "PLP0015",
        "data": {
            "properties": "['schedule_id']",
            "property_names": [
                "schedule_id"
            ]
        },
        "description": "Invalid properties: ['schedule_id']",
        "sub_errors": []
    },
    "error_message": "Invalid properties: ['schedule_id']",
    "exception": null,
    "http_request_method": "PUT",
    "http_status": 400,
    "property_names": [
        "schedule_id"
    ],
    "traceback": null
}

Also available in: Atom PDF