Veeam Package ID's for VSIs
ryan@tycho ~ » python /Users/ryan/Sync/Work/API/python/Working/listPackages.py | egrep -i Veeam
9867 - Veeam Backup and Replication for VMware vSphere 10 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_VMWARE_VSPHERE_UP_TO_1VM
9863 - Veeam Backup and Replication for Microsoft Hyper-V 200 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_MICROSOFT_HYPERV_UP_TO_20VMS
10055 - Veeam Backup and Replication for VMware vSphere 25 pack --- VEEAM_BACKUP_AND_REPLICATION_FOR_MICROSOFT_HYPERV_25_PACK
9861 - Veeam Backup and Replication for Microsoft Hyper-V 100 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_MICROSOFT_HYPERV_UP_TO_10VMS
9873 - Veeam Backup and Replication for VMware vSphere 200 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_VMWARE_VSPHERE_UP_TO_20VMS
9857 - Veeam Backup and Replication for Microsoft Hyper-V 10 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_MICROSOFT_HYPERV_UP_TO_1VM
10053 - Veeam Backup and Replication for Microsoft Hyper-V 50 pack --- VEEAM_BACKUP_AND_REPLICATION_FOR_MICROSOFT_HYPERV_50_PACK
9871 - Veeam Backup and Replication for VMware vSphere 100 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_VMWARE_VSPHERE_UP_TO_10VMS
9859 - Veeam Backup and Replication for Microsoft Hyper-V 25 pack --- VEEAM_BACKUP_AND_RECOVERY_ENTERPRISE_9_X_MICROSOFT_HYPERV_UP_TO_5VMS
10057 - Veeam Backup and Replication for VMware vSphere 50 pack --- VEEAM_BACKUP_AND_REPLICATION_FOR_VMWARE_VSPHERE_50_PACK
In this case we're listing all the packages that can be ordered with VSIs:
import SoftLayer
from pprint import pprint as pp
class example():
def __init__(self):
self.client = SoftLayer.Client()
def main(self):
"""
Gets ALL packages, and prints their name and price descriptions
"""
mask = "mask[hourlyBillingAvailableFlag]"
result = self.client['Product_Package'].getAllObjects();
for product in result:
print str(product['id']) + " - " + product['name']
# result has a LOT of stuff in it, only print it out if you are ready
# pp.pprint(result)
def getPackage(self, package_id=0):
"""
Gets a specific package and prints out some useful information
"""
mask = "mask[items[prices]]"
# Not all packages are available in all locations, you can check that with getLocations()
# locations = self.client['Product_Package'].getLocations(id=package_id)
# pp(locations)
result = self.client['Product_Package'].getObject(mask=mask,id=package_id)
for item in result['items']:
print str(item['id']) + " - " + item['description'] + " --- " + item['keyName']
for prices in item['prices']:
print "\t" + str(prices['id']) + " - locationGroupId: " + str(prices['locationGroupId'])
# Will only get the server items for this package
# serverItems = self.client['Product_Package'].getActiveServerItems(id=package_id)
# print "SERVER ITEMS"
# pp(serverItems)
# Will only get the RAM items for the package
# ramItems = self.client['Product_Package'].getActiveRamItems(id=package_id)
# print "RAM ITEMS"
# pp(ramItems)
def getAllLocations(self):
mask = "mask[id,locations[id,name]]"
result = self.client['SoftLayer_Location_Group_Pricing'].getAllObjects(mask=mask)
pp(result)
if __name__ == "__main__":
main = example()
main.main()
main.getPackage(46)
# main.getAllLocations()
Package script taken from https://softlayer.github.io/python/list_packages/