I need to access deleted VSI's to find their ID. I have the hostnames of the devices that were deleted. In essence, I need to take the hostnames of the deleted VSI's and find their ID. Here is my code (Python):
import SoftLayer
import json
USERNAME = 'set me'
API_KEY = 'set me'
client = SoftLayer.Client(username=USERNAME, api_key=API_KEY)
accountService = client['SoftLayer_Account']
objectMask= "mask[hostname,id]"
try:
response = accountService.getallTopLevelBillingItems(mask=objectMask)
print(json.dumps(response, sort_keys=True, indent=2, separators=(',', ': ')))
except:
print("Unable to get the VSIs")`