Project

Profile

Help

Issue #664

closed

Pulp API returns incorrect result from /plugins/distributors/<distributor_id> endpoint

Added by amacdona@redhat.com almost 10 years ago. Updated over 4 years ago.

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

Description

Description of problem:

The `/plugins/distributors/<distributor_id>/` endpoint should return the distributor that matches the distributor_id.

Version-Release number of selected component (if applicable):

Probably present in all currently supported versions of pulp.

How reproducible:

always

Steps to Reproduce:

1. curl -H "Accept: application/json" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/plugins/distributors/yum_distributor/"

Actual results:

{"display_name": "Pulp Nodes HTTP Distributor", "id": "nodes_http_distributor", "types": ["node"], "_href": "/pulp/api/v2/plugins/distributors/yum_distributor/"}%

Expected results:

{"display_name": "Yum Distributor", "id": "yum_distributor", "types": ["rpm", "srpm", "drpm", "erratum", "package_group", "package_category", "distribution", "yum_repo_metadata_file"], "_href": "/pulp/api/v2/plugins/distributors/yum_distributor/"}%

Additional info:

The Distributor controller creates a list of all distributors and simply returns the first of the list rather than matching the parameter.

+ This bug was cloned from Bugzilla Bug #1182768 +


Related issues

Related to Pulp - Task #1121: document /v2/plugins/* APICLOSED - CURRENTRELEASEipanova@redhat.com

Actions
Actions #1

Updated by amacdona@redhat.com almost 10 years ago

This will be fixed by the Django conversion unless there is a need to get to it sooner.

+ This comment was cloned from Bugzilla #1182768 comment 1 +

Actions #2

Updated by ipanova@redhat.com almost 10 years ago

I think this also should be added to the api docs. I looked through and did not see anything.

+ This comment was cloned from Bugzilla #1182768 comment 2 +

Actions #4

Updated by bmbouter over 9 years ago

  • Severity changed from Medium to 2. Medium

Added by dkliban@redhat.com over 9 years ago

Revision 398121ab | View on GitHub

Merge pull request #664 from dkliban/docs-url-change

Added message about new documentation

Actions #5

Updated by dkliban@redhat.com over 9 years ago

  • Platform Release set to 2.7.0
Actions #6

Updated by dkliban@redhat.com over 9 years ago

  • Status changed from MODIFIED to 5
Actions #7

Updated by igulina@redhat.com over 9 years ago

Is it documented? I couldn't find it.

Actions #8

Updated by igulina@redhat.com over 9 years ago

>> rpm -qa pulp-server
pulp-server-2.7.0-0.4.beta.el7.noarch

>> curl -H "Accept: application/json" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/plugins/distributors/yum_distributor/"
{"display_name": "Yum Distributor", "id": "yum_distributor", "types": ["rpm", "srpm", "drpm", "erratum", "package_group", "package_category", "distribution", "yum_repo_metadata_file"], "_href": "/pulp/api/v2/plugins/distributors/yum_distributor/"}

>> curl -H "Accept: application/json" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/plugins/distributors/puppet_file_distributor/"
{"display_name": "Puppet File Distributor", "id": "puppet_file_distributor", "types": ["puppet_module"], "_href": "/pulp/api/v2/plugins/distributors/puppet_file_distributor/"}

All distributors:

>> curl -H "Accept: applicalhost/pulp/api/v2/plugins/distributors/"
[{"display_name": "Yum Distributor", "id": "yum_distributor", "types": ["rpm", "srpm", "drpm", "erratum", "package_group", "package_category", "distribution", "yum_repo_metadata_file"], "_href": "/pulp/api/v2/plugins/distributors/yum_distributor/"}, {"display_name": "Puppet Distributor", "id": "puppet_distributor", "types": ["puppet_module"], "_href": "/pulp/api/v2/plugins/distributors/puppet_distributor/"}, {"display_name": "Puppet Install Distributor", "id": "puppet_install_distributor", "types": ["puppet_module"], "_href": "/pulp/api/v2/plugins/distributors/puppet_install_distributor/"}, {"display_name": "ISO Distributor", "id": "iso_distributor", "types": ["iso"], "_href": "/pulp/api/v2/plugins/distributors/iso_distributor/"}, {"display_name": "Export Distributor", "id": "export_distributor", "types": ["rpm", "srpm", "drpm", "erratum", "distribution", "package_category", "package_group"], "_href": "/pulp/api/v2/plugins/distributors/export_distributor/"}, {"display_name": "Puppet File Distributor", "id": "puppet_file_distributor", "types": ["puppet_module"], "_href": "/pulp/api/v2/plugins/distributors/puppet_file_distributor/"}]

Non-existing distributor:

curl -H "Accept: application/json" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/plugins/distributors/no_dist/"
{"http_request_method": "GET", "exception": null, "error_message": "Missing resource(s): distributor_type_id=no_dist", "_href": "/pulp/api/v2/plugins/distributors/no_dist/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"distributor_type_id": "no_dist"}}, "description": "Missing resource(s): distributor_type_id=no_dist", "sub_errors": []}, "traceback": null, "resources": {"distributor_type_id": "no_dist"}}
Actions #10

Updated by igulina@redhat.com over 9 years ago

  • Status changed from 5 to 6
Actions #11

Updated by amacdona@redhat.com over 9 years ago

  • Related to Task #1121: document /v2/plugins/* API added
Actions #12

Updated by amacdona@redhat.com about 9 years ago

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

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added
Actions #15

Updated by bmbouter over 4 years ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF