Project

Profile

Help

Story #4087

Updated by daviddavis about 6 years ago

Currently, users have to submit three requests to upload an rpm to a repository: 

 <pre> 
 $ http --form POST :8000/pulp/api/v3/artifacts/ file@dog-4.23-1.noarch.rpm     
 $ http POST :8000/pulp/api/v3/content/rpm/packages/ ... 
 $ http POST ':8000'$REPO_HREF'versions/' add_content_units:="[\"$CONTENT_HREF\"]" 
 </pre> 

 The goal of this story is to allow users to upload rpm packages in a single call: 

 <pre> 
 $ http --form POST :8000/pulp_rpm/upload/ repository=$REPO_HREF file@dog-4.23-1.noarch.rpm 
 </pre> 

 See this proof of concept in pulp_ansible as an example: 

 https://github.com/pulp/pulp_ansible/pull/65 

 Data to create the rpm will need to be parsed from the rpm's headers. See here how We do this in pulp 2. Here's where to do this: start looking: 

 https://github.com/pulp/pulp_rpm/blob/f79ec2965db6667c30ad6ce528b99eb8b831b797/pulp_rpm/app/viewsets.py#L91-L96 https://github.com/pulp/pulp_rpm/blob/2-master/plugins/pulp_rpm/plugins/importers/yum/upload.py#L382-L385 

 However, it looks like we use this python package: 

 https://github.com/rpm-software-management/yum/tree/master/rpmUtils 

 Which isn't available on PyPI. We'll either need to release it or find another alternative.

Back