用于订购Virtu的Softlayer API

2024-06-16 10:24:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我想订购一个虚拟服务器在软层使用他们的API。我想订购一个装有VCenter的Windows设备。当我直接从Softlayer客户门户订购VS时,我将VCenter视为一个系统附加组件。我不知道如何使用Softlayer API在订单参数中传递VCenter的参数。我使用的是Softlayer PythonAPI。有人知道怎么做吗?我的订单模板看起来像:

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);

Tags: 订单服务器apiid参数客户windowsorder
1条回答
网友
1楼 · 发布于 2024-06-16 10:24:20

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

或SoftLayer_Product_包::getItemPrices方法

请看一下这个文档

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

我希望有帮助

问候

相关问题 更多 >