[ZBX-5032] add support of "selectMediatypes" for "user.get" and fix support of "userids,mediaids" for "mediatype.get" Created: 2012 May 22 Updated: 2017 May 30 Resolved: 2012 May 28 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A), Documentation (D) |
Affects Version/s: | 1.8.13, 2.0.0 |
Fix Version/s: | 1.8.14rc1, 2.0.1rc1, 2.1.0 |
Type: | Incident report | Priority: | Critical |
Reporter: | Oleksii Zagorskyi | Assignee: | Martins Valkovskis |
Resolution: | Fixed | Votes: | 0 |
Labels: | API | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() |
||||||||
Issue Links: |
|
Description |
See attached patch (based on just released 2.0.0) (1) Apply the patch to add all time documented but missing in the code parameter "selectMediatypes" for user.get method along with a fix for parameters userids,mediaids for mediatype.get (dummy typo in a table name) (2) Also consider to apply patch to the 1.8 (and also add support of selectMedias from 2.0 to 1.8) or remove declaration of parameters select_medias, select_mediatypes from 1.8 documentation. Because it misleads users all these years: After patch: Request: { "userids":[3, 7], "selectMediatypes":"refer" }Response: ] , { "mediatypeid":"2" }] ALL is correct - TESTED |
Comments |
Comment by Eduards Samersovs (Inactive) [ 2012 May 23 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5032 <zalex> See issue description where I said "(and also add support of selectMedias from 2.0 to 1.8)" <Eduard> RESOLVED <zalex> See (3) CLOSED |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 23 ] |
(1) Please review my changes in r27782. <Eduard> OK, CLOSED <pavels> I've reverted some changes in 27847. The options parameter should not be modified during the creation of the query. It will create a mix of dependencies that may be hard to handle. |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 23 ] |
(2) For 1.8: if the user has no media defined, select_mediatypes should return an empty array. <Eduard> RESOLVED <pavels> CLOSED. |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 23 ] |
(3) The "selectMedias" parameter is not implemented in neither trunk, nor 1.8. It should be removed from the code and the docs. <zalex> NO, it IS implemented in the trunk, but missing in the 1.8 <pavels> It's only defined in the trunk, it's not implemented (it only returns ids). But, if you think we need id, then let's add it. But rename to "selectMedia", because that's the correct plural form. <zalex> I personally do not have any objections for any parameter names, but note that 1.8 API and its doc uses another parameters naming, not Camel Case but uses underscore for spaces. You can compare with other get methods. Now (and all time before) that parameter had name "select_medias" So I suppose for 1.8 (as you have decided to restore for 1.8 as well) would be better to use old parameter names: select_medias and select_mediatypes (ok already in the dev dbanch) and DO NOT TOUCH 1.8 DOCUMENTATION for the user.get <Eduard> RESOLVED <zalex> it worth to mention here that "select_medias" NOT added to 1.8 and finally removed from 1.8 documentation. <pavels> CLOSED. |
Comment by Oleksii Zagorskyi [ 2012 May 25 ] |
(4) Response: ], ] ] As you see the array "mediatypes" repeated twice and second time on wrong level. <Eduard> RESOLVED <pavels> CLOSED. |
Comment by Oleksii Zagorskyi [ 2012 May 25 ] |
FYI: Changes reflected in the doc http://www.zabbix.com/documentation/2.0/manual/appendix/api/changes_1.8_-_2.0#user |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 25 ] |
(5) Please review my changes for the trunk fix in 27847-27849. If everything is ok, you can merge. |
Comment by Pavels Jelisejevs (Inactive) [ 2012 May 25 ] |
The fix for 1.8 is TESTED. |
Comment by Oleksii Zagorskyi [ 2012 May 25 ] |
dev branches of 1.8 and trunk additionally successfully TESTED. |
Comment by Eduards Samersovs (Inactive) [ 2012 May 28 ] |
Fixed in versions pre-2.1.0 (beta) r27864, pre-2.0.1 r27863, pre-1.8.14rc1 r27865 |