Softlayer API 用于订购虚拟服务器

Softlayer API for ordering Virtual Server

我想使用他们的 API 在 Softlayer 中订购虚拟服务器。我想订购一个装有 VCenter 的 Windows 盒子。当我直接从 Softlayer 客户门户订购 VS 时,我将 VCenter 视为系统附加组件。我不知道如何使用 Softlayer API 在订单参数中传递 VCenter 的参数。我正在使用软层 Python API。有谁知道该怎么做?我的订单模板如下所示:

order = {
'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest', 
'quantity': 1,
'virtualGuests': [
      {
        'hostname': 'test', 
        'domain': 'example.com',
      }
],
'location': 'sanjose',
'packageId': 46, 
'useHourlyPricing': True,
'prices': [
           {'id': 1640},  # 1 x 2.0 GHz Core
           {'id': 1644},  # 1 GB RAM
           {'id':  905},  # Reboot / Remote Console
           {'id':  272},  # 10 Mbps Public & Private Networks
           {'id':  613},  # 1000 GB Bandwidth
           {'id':   21},  # 1 IP Address
           {'id': 2202},  # 25 GB (SAN)
           {'id': 1684},  # CentOS 5 - Minimal Install (32 bit)
           {'id':   55},  # Host Ping Monitoring
           {'id':   57},  # Email and Ticket Notifications
           {'id':   58},  # Automated Notification Response
           {'id':  420},  # Unlimited SSL VPN Users & 1 PPTP VPN User per account
           {'id':  418}
]
}                                    client['Product_Order'].verifyOrder(order);

如果您希望在订单中添加附加组件,您只需在请求中添加该附加组件的价格。 要获取所有价格,您可以调用 SoftLayer_Product_Package::getItems 方法 http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItems

或SoftLayer_Product_Package::getItemPrices方法

请查看此文档

http://sldn.softlayer.com/blog/bpotter/Going-Further-SoftLayer-API-Python-Client-Part-3

希望对你有帮助

此致