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 almost 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
}
Actions #1

Updated by dkliban@redhat.com about 9 years ago

  • Severity set to Low
  • Triaged changed from No to Yes
Actions #2

Updated by bmbouter almost 9 years ago

  • Severity changed from Low to 1. Low
Actions #3

Updated by ipanova@redhat.com almost 9 years ago

  • Status changed from NEW to ASSIGNED
  • Platform Release set to 2.7.0
Actions #4

Updated by ipanova@redhat.com almost 9 years ago

  • Status changed from ASSIGNED to POST
Actions #5

Updated by ipanova@redhat.com almost 9 years ago

  • Assignee set to ipanova@redhat.com

Added by ipanova@redhat.com almost 9 years ago

Revision 7c2e70b1 | View on GitHub

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

closes #768 This issue also was present in update/delete methods in schedule sync/publish and in consumer schedule content install/update/uninstall.

Added by ipanova@redhat.com almost 9 years ago

Revision 7c2e70b1 | View on GitHub

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

closes #768 This issue also was present in update/delete methods in schedule sync/publish and in consumer schedule content install/update/uninstall.

Actions #6

Updated by ipanova@redhat.com almost 9 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #7

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #8

Updated by pthomas@redhat.com over 8 years ago

  • Status changed from 5 to 6

verified

[root@qe-blade-10 ~]# rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el6.noarch
[root@qe-blade-10 ~]# 
<\pre>

<pre>
[root@qe-blade-10 ~]# 
[root@qe-blade-10 ~]# 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/zoo/distributors/9ce77df7-63b6-405a-a6ae-15332efcb433/schedules/publish/fake_sched/
HTTP/1.1 404 NOT FOUND
Date: Thu, 02 Jul 2015 15:50:16 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 586
Connection: close
Content-Type: application/json

{"http_request_method": "PUT", "exception": null, "error_message": "Missing resource(s): distributor=9ce77df7-63b6-405a-a6ae-15332efcb433", "_href": "/pulp/api/v2/repositories/zoo/distributors/9ce77df7-63b6-405a-a6ae-15332efcb433/schedules/publish/fake_sched/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"distributor": "9ce77df7-63b6-405a-a6ae-15332efcb433"}}, "description": "Missing resource(s): distributor=9ce77df7-63b6-405a-a6ae-15332efcb433", "sub_errors": []}, "traceback": null, "resources": {"distributor": "9ce77df7-63b6-405a-a6ae-15332efcb433"}}[root@qe-blade-10 ~]# 
[root@qe-blade-10 ~]# 
[root@qe-blade-10 ~]# 

<\pre>
Actions #9

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #11

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF