How do I get these two values trough the new REST API?
files-total: Total user-visible file (inode) count, i.e., maximum number of user-visible files (inodes) that this referenced file system can currently hold. If the referenced file system is restricted or offline, a value of 0 is returned
files-used: Number of user-visible files (inodes) used in the referenced file system. If the referenced file system is restricted or offline, a value of 0 is returned
The descriptions and attribute-names are taken from the old ZAPI docs.
For reference (and because the new REST API documentation is awesome), you can look at the entire API documentation by going to "https://<cluster name/IP>/docs/api", which will allow you to interact with the API to try it out before writing code that utilizes it. You can also view the raw Swagger YAML file from the screenshot below:
I just did a "Ctrl+F" and searched for a couple key words from your post from the ZAPI documentation, and was able to find out the proper API call from there. Hope that helps!