Hi seanwithin,
the URL seems a bit strange to me. I can get the snapshots by using this URL:
https://{prism_element_ip}:9440/PrismGateway/services/rest/v2.0/snapshots/?vm_uuid={vm_uuid}
Does it work with that one?
That is definitely different! I’m new to using the Nutanix API and didn’t know that the URL needed “PrismGateway/services/rest” in it. But it made me realize that I’m not looking for VM snapshots, but actually Local Snapshots for Entities in Data Protection. When I used your URL with a specific VM that i know has Local Snapshots in Data Protection the API returned with 0 entities found.
I guess I should explain that what I’m ultimately trying to do is to be able to see changes in cluster storage per VM (including any type of snapshot related to the VM), image, etc. I’m looking for a way to account for all of the storage usage to make sure that day over day, nothing is growing beyond normal means without us knowing about it.
I think you can get the usage of snapshots this way:
$ curl -u "Admin:Pa$$w0rd" -sk "https://{prism_element_ip}:9440/PrismGateway/services/rest/v2.0/protection_domains/{Protection_domain_name}" | jq .name,.usage_stats
"Protection_domain_name"
{
"lws_store_used_bytes": "0",
"dr.exclusive_snapshot_usage_bytes": "5311942656",
"hydration_space_bytes": "-1"
}
that means that the protection domain’s snapshot space usage is 5311942656 bytes, which is 4.94Gb. If i go to Prism - Data Protection, i see the same amount there.
I recommend to explore the Rest API options with the Rest API explorer that is built into Prism. You can click on the user name in Prism and then go to the Rest API explorer from there.
Great, thanks for the suggestion about the API explorer! That’ll be very helpful.
Do you have any suggestions as to where all I’ll need to look to find all objects on the cluster that consume storage space?
I think you will have to check components individually as i don’t think there is a place where all storage consumers are put together. I know that some people write their own scripts for such tasks, but i don’t have such a script. Maybe somebody else will share here.