I want to order SoftLayer's virtual server by python API.
by following API call=>
client['Product_Package'].getAllObjects(mask='id, name')
I found the pkg id for virtual server is 46.
Also, I found the prices id by following API call=>
client['Product_Package'].getItemPrices(id=46, mask='id, itemId, recurringFee, hourlyRecurringFee, item.description, item.keyName, categories.id')`
And ordering code is following=>
order = {
'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest',
'quantity': 1,
'virtualGuests': [
{'hostname': 'test-template', 'domain': 'example.com'}
],
'location': 449604, # Tokyo
'packageId': 46, # CCI Package
'prices': [
{'id':34183}, # 1000 GB Bandwidth
{'id':112483}, # 1 x 2.0 GHz Core
{'id':32578}, # 25 GB (SAN)
{'id':27023}, # Host Ping Monitoring
{'id':32500}, # Email and Ticket Notifications
{'id':31985}, # CentOS 5 - Minimal Install (32 bit)
{'id':27052}, # 10 Mbps Private Networks
{'id':34807}, # 1 IP Address
{'id':112985}, # 1 GB RAM
{'id':23070}, # Reboot / Remote Console
{'id':32627}, # Automated Notification Response
{'id':35310}, # Nessus Vulnerability Assessment & Reporting
{'id':33483}, # Unlimited SSL VPN Users & 1 PPTP VPN User per account
],
'imageTemplateId': templateId
}
client['SoftLayer_Product_Order'].verifyOrder(order)
However, there was following alert=>
Traceback (most recent call last):
File "./ordervsByimg.py", line 45, in <module>
result = client['SoftLayer_Product_Order'].verifyOrder(order)
File "/usr/lib64/python2.7/site-packages/SoftLayer/API.py", line 392, in call_handler
return self(name, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/SoftLayer/API.py", line 360, in call
return self.client.call(self.name, name, *args, **kwargs)
File "/usr/lib64/python2.7/site-packages/SoftLayer/API.py", line 263, in call
return self.transport(request)
File "/usr/lib64/python2.7/site-packages/SoftLayer/transports.py", line 195, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): The price for 1 x 2.0 GHz Core (#112483) is not valid for location tok02.
Could you please help me for solving this problem?