I need the free space available metric for the block volume. How to calculate it or fetch it using SDK or REST API.

GetVolume REST API Response Attributes are below.

AvailabilityDomain​
CompartmentId​
DefinedTags​
DisplayName​
FreeformTags​
IsHydrated​
TimeCreated​
​Id​
sizeInGBs​
sizeInMBs​
kmsKeyId​
VolumeGroupId​
LifecycleState​

1 Answers

0
Dimitri Manca On

Is the block volume attached to any Compute instance? If yes then you could leverage the Monitoring service by publishing the free space available as custom metric (https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/publishingcustommetrics.htm) from the attached Compute instance and then use the Monitoring API (https://docs.cloud.oracle.com/iaas/api/#/en/monitoring/20180401/) for fetching the free space available.