Bug 747151 - [RFE] Need a way to update arbitrary key value pairs in a pulp repository
Summary: [RFE] Need a way to update arbitrary key value pairs in a pulp repository
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 29
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-18 22:57 UTC by Partha Aji
Modified: 2015-03-23 01:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-24 20:13:18 UTC


Attachments (Terms of Use)

Description Partha Aji 2011-10-18 22:57:28 UTC
At the present time a pulp repository has a "notes" attribute where one can store arbitrary key value pairs. Pulp lets you create notes, but unfortunately fails on update with the following exception


 "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py\", line 48, in report_error\n    return method(self, *args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py\", line 127, in _auth_decorator\n    value = method(self, *args, **kwargs)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/repositories.py\", line 334, in PUT\n    repo = api.update(id, delta)\n  File \"/usr/lib/python2.7/site-packages/pulp/server/api/repo.py\", line 682, in update\n    'update keyword \"%s\", not-supported' % key\nException: update keyword \"notes\", not-supported\n" (PUT /pulp/api/repositories/1317917077453-syncer-ACME_Corporation/)

Comment 1 Sayli Karmarkar 2011-10-20 08:13:07 UTC
commit 9a2c3513812f2dddb8a30157546ac9a1fa225c54
Author: Sayli Karmarkar <skarmark>
Date:   Thu Oct 20 00:52:50 2011 -0700

    747151 - Added api and cli to add, update and delete a key-value pair to repository notes along with wiki documentation for api and unit tests


Add - POST /repositories/<id>/notes/
Update - PUT /repositories/<id>/notes/<key>/
Delete - DELETE /repositories/<id>/notes/<key>/

You can also list all repositories containing particular key-values by calling GET on /repositories/ with notes as the filter.

Comment 2 Jeff Ortel 2011-10-21 22:30:30 UTC
build: 0.241

Comment 3 Preethi Thomas 2011-10-26 15:06:42 UTC
Fails_qa
root@preethi ~]# rpm -q pulp
pulp-0.0.241-1.fc15.noarch

Failing as the output needs to be neater

Now the notes are shown as

Notes              	{u'key1': u'value1'}

Comment 4 Sayli Karmarkar 2011-10-26 20:11:10 UTC
This bug is about api rather than cli. There were no changes made to displaying notes in cli. Moving to on_qa and opening new bug for neater display of notes.

Comment 5 Preethi Thomas 2011-11-22 19:37:43 UTC
verified

[root@preethi ~]# curl -k  -u admin:admin -X POST https://localhost/pulp/api/repositories/f15/notes/ -d '{"key":"key1","value":"value1"}'
true[root@preethi curl -k  -u admin:admin -X DELETE https://localhost/pulp/api/repositories/f15/notes/key1/ 
true[root@preethi curl -k  -u admin:admin -X POST https://localhost/pulp/api/repositories/f15/notes/ -d '{"key":"key1","value":"value1"}'
true[root@preethi ~]#

Comment 6 Preethi Thomas 2012-02-24 20:13:18 UTC
Pulp v1.0 is released
Closed Current Release.


Note You need to log in before you can comment on or make changes to this bug.