I wrote the following logic to get the Snapshot Percentage, and am getting the below error. NOTE, I have tried this with both the Network_Storage
, and Network_Storage_Iscsi
and am seeing the same response for both cases. Is there a workaround or is this a bug?
def get_snapshot_space(sl_config, iscsi_identifier):
""" get the total number of Snapshot Space remaining"""
snapshot_percentage = SL.instance(sl_config).net.getSnapshotPercentage(id=iscsi_identifier);
print "Snapshot Space Used: \% %s " % snapshot_space;
ERROR:
snapshot_percentage = SL.instance(sl_config).net.getSnapshotPercentage(id=iscsi_identifier);
File "/usr/lib/python2.7/site-packages/SoftLayer-5.1.0-
py2.7.egg/SoftLayer/API.py", line 375, in call_handler
return self(name, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/SoftLayer-5.1.0-
py2.7.egg/SoftLayer/API.py", line 343, in call
return self.client.call(self.name, name, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/SoftLayer-5.1.0-
py2.7.egg/SoftLayer/API.py", line 246, in call
return self.transport(request)
File "/usr/lib/python2.7/site-packages/SoftLayer-5.1.0-
py2.7.egg/SoftLayer/transports.py", line 187, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(Client): Function ("getSnapshotPercentage") is not a valid method for this service
Also, I have noticed that on the softLayer Portal, the representation of the percentage is incorrect sometimes? It's been well over an hour since I have cleared all snapshots.
The method is currently deprecated so you could use an object mask to retrieve the bytesUsed and snapshotCapacityGb attributes.
The next script generates the snapshot space available that's displayed in the UI portal.
Regarding the snapshot space representation in the UI, it's updated each hour more or less.
I hope this could help you.