-
Notifications
You must be signed in to change notification settings - Fork 11
Pools as entities #19
Comments
I don't have a lot of time available for this right now, but I would happily review a PR that added it :D |
@agospher4eg, what were you looking to have exposed for Pools in the integration? |
I want pools with total space and free space |
Interestingly enough, while the TrueNAS UI shows this information for pools, it's actually datasets that have this information in ZFS (or at least, the API that TrueNAS has), so it's a bit more involved as the upstream library doesn't yet have support for datasets. Now, I also own that library, so it's not a process problem to get that support, but more of a time problem right now. |
And for my, or someone else's, reference in the future,
Weirdly, it doesn't look like the API provides total space, but someone can compute it with |
A PR that needs some work is up in sdwilsh/aiotruenas-client#92 to add this to the library. I need to rethink some stuff there, but it's a solid starting point. |
v0.8.0 of the client library is out that includes Dataset support to provide the values you wanted, @agospher4eg. I'm not sure when I'll have time next to actually add support to the integration, but the hardest part of getting in the library is now done. |
I just finished merging in v0.8.0 of the library, so we're pretty close to having this. I'm planning to hold off on releasing the next version until we get this. I probably won't have time to do this for a few weeks still, but @colemamd might get to it before then! |
Great news! I`m waiting. I can help with testing =) |
I've been looking at this over the last couple of days, and I now have datasets working with |
Based on the tests at least, it looks like the I'm not sure what you mean about having to deal with It's worth noting that using bytes will result in a big, not-human-friendly number, but it's not hard to template that to something human readable if someone wanted to use it on a dashboard.
There's a native property on the datasets called |
This is what I meant. Was trying to get a more user-friendly
I was referencing a dump of |
Someone could use the raw |
|
There's an undocumented shell API at |
@colemamd, if you don't have the time to finish this off, I have some time available that I could finish off what you started if you wanted to upload it to your fork. |
I ran out of time a few months ago, started a new job, sorry about that. I have time now, if you give me a few days I can clean up what I had been working on and upload it. I do remember the one thing I was working on is that when you query the datasets, ALL datasets (i.e. child datasets) get pulled. When I was testing on my prod box it was pulling dozens of datasets so I was trying to figure out how to minimize how many get pulled into HA. We could just have all child datasets disabled by default in HA, then the user can go in and enable any that they do want. |
It would be great! Thank you!
|
I have plenty of projects to work on, so happy to let you finish it up. No worries on the delay, and I hope the new job is working out for you! |
I just uploaded a new branch to my fork, https://github.com/colemamd/hass-truenas/tree/datasets. I'm still trying to figure out how to change the depth of children datasets that are pulled, but the api docs are a bit lacking. |
Yeah, what I tend to do is grab an API call, and then take that data (with |
That's what I've been doing as well, but I'm having problems finding the right arguments to send with |
Passing arguments can be tricky, and I should probably improve the help/documentation for that script to make it clearer (especially because I think I've forgotten myself). If you have some python code that works, I can figure out what that command line should look like later tonight for you (and add the docs). |
Actually I've got a websocket browser extension I've been using to pass json. Edit: Just want to add I believe it's because the Edit2: Using |
Great work! Thank you! |
I think @colemamd is planning to add a bit more support for pools here :) |
I've got encryption status working now. What else are you looking for @agospher4eg? As previously mentioned, the API only provides available space and used space from the datasets, not pools. |
Alright, @colemamd, we can get merged in what you have, and deal with other additions later then :D |
Hi! You made great integration! I read aiotruenas-client and saw that you can list pools. Can you add pools to integration?
The text was updated successfully, but these errors were encountered: