Documentation for API fetchzone_records?
Could someone point me to the API doc page for the function "fetchzone_records"? I tried searching that function at but it doesn't return any results.
Thanks!
-
Thanks -- I did see that, but I am currently using several API functions successfully that I know I looked up in the cPanel docs some time ago in order to get their usage. Here are some URLs that currently work but I can't seem to find in the API docs any more. I'm searching the docs using only the function name (i.e. fetchzone_records, remove_zone_record, add_zone_record, fetchdiskusagewithextras), but not coming up with anything: /json-api/cpanel?user=$user&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_version=2 /json-api/cpanel?user=$user&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=remove_zone_record&cpanel_jsonapi_version=2 /json-api/cpanel?user=$user&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=add_zone_record&cpanel_jsonapi_version=2 /json-api/cpanel?cpanel_jsonapi_user=$user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=DiskUsage&cpanel_jsonapi_func=fetchdiskusagewithextras
Thanks!0 -
I saw that article as well when I googled. I have many functions in use from API version 2. Some said (at the time I saw the docs on them) something like "we recommend using the UAPI, but no UAPI function exists for this...". Do the *new* alternatives to these functions return the same data structures or do I need to now rewrite all of the code that calls these functions to use their newer alternatives? Oddly, when I view the "dumpzone" API, the URL version lists it as "version 1" whereas the functions I'm using are listed as version 2 (at least they were in the original docs when I got those URLs: https://hostname.example.com:2087/cpsess##########/json-api/dumpzone?api.version=1&domain=example.com
The doc page for dumpzone also says this on it: "This function is deprecated. Use WHM's parse_dns_zone function." However, even parse_dns_zone shows as version 1 API:https://hostname.example.com:2087/cpsess##########/json-api/parse_dns_zone?api.version=1&zone=example.com
This seems confusing that the api.version=1 URL is in the documentation and is the current function, whereas the cpanel_jsonapi_version=2 URL is considered older?0 -
Any clarification on these API versions (per my last post above)? 0 -
Hello again! I apologize for the delay; I will look into this and get back to you. 0 -
@swbrains - it looks like Anthony wasn't able to get much information on this one. I see the docs for the functions you mentioned here: Is that what you were looking for? 0 -
I have seen these functions in the API docs. So dumpzone is deprecated, but what about fetchzone_records mentioned earlier (which is what I'm using now) -- it's not even listed in the docs, yet it still works. Also, when looking at parse_dns_zone (and others that I assume are the "new/current" functions), I see it returns metadata saying Version=1. This is confusing as I thought version 1 of the API was deprecated. Finally, is there a cross reference that will tell developers which new functions to use in place of deprecated ones. I see that dumpzone's docs refer to parse_dns_zone, but what about the others I listed above? They don't even exist in the docs to tell me what I should be replacing them with: fetchzone_records remove_zone_record add_zone_record fetchdiskusagewithextras 0 -
Thanks -- the link to the old docs certainly helps. Unfortunately, the message on that page indicates that no UAPI function exists to replace it (which is true), but doesn't mention something like parse_zone (or parse_dns_zone), which, while not an exact replacement, seems to be the closest function when looking to replace the original fetchzone_records The version numbers are confusing. I thought I had read that version 1 API functions were deprecated, but it seems there's a distinction between *WHM* API functions and *cPanel* functions and their versioning, and which ones are deprecated at version 1. On a related side note, I wish the developers would have considered using an identifying prefix on the WHM vs cPanel API functions: something like "whm_function_name" vs "cpanel_function_name". It would make it much clearer when searching the docs for "dns zone" and you get two results in the list that are both titled "Return a Parsed DNS Zone", but each leads to a function in a different API. After clicking the result link, one needs to scroll through the vertical function reference panel on the left to determine which API the current function belongs to: WHM or cPanel. At a bare minimum, if the docs for both APIs are going to be combined as they are, adding a line to the top of each function's details page that indicates clearly which API it belongs to would be helpful. Better yet, add it to the titles that appear in the search results... Or, separate the API docs... Or, require a choice as part of the search to filter which API results will be shown for (WHM, cPanel, or Both). Most times I only want results from one of these. 0 -
Currently all the WHM api calls are "whmapi1" so that's where that "1" comes into play. It's different than the other, older APIs that had version numbers. I do like the prefix idea! I'll pass that along. 0 -
Thanks for checking on this. So cPanel API version 1 = bad. WHM API version 1 = good. Got it. 0 -
Exactly - it's odd, but that's just how the naming worked out. I did pass along the prefix idea to the team just now, but I'm guessing that would require a major overhaul of the current API setup. 0
Please sign in to leave a comment.
Comments
14 comments