如何引用SoftLayer的网络版? (SoftLayer_Container_Product_Order_Network_Vlan) 你有什么想法? 我发现包裹号码似乎是571,包裹号码0不允许引用vlans。
$ python placeQuoteVLANTemplate.py
Traceback (most recent call last):
File "placeQuoteVLANTemplate.py", line 27, in <module>
placeQuote = client['Product_Order'].placeQuote(order)
File "/Library/Python/2.7/site-packages/SoftLayer/API.py", line 392, in call_handler
return self(name, *args, **kwargs)
File "/Library/Python/2.7/site-packages/SoftLayer/API.py", line 360, in call
return self.client.call(self.name, name, *args, **kwargs)
File "/Library/Python/2.7/site-packages/SoftLayer/API.py", line 263, in call
return self.transport(request)
File "/Library/Python/2.7/site-packages/SoftLayer/transports.py", line 195, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): At the moment this account is not permitted to order additional VLANs. To request an additional VLAN, please contact our sales team for assistance
$ cat placeQuoteVLANTemplate.py
import SoftLayer
import json
# account info
client = SoftLayer.create_client_from_env()
order = {
"orderContainers": [
{
"quantity": 1,
"name": "myNewVlan",
"complexType": "SoftLayer_Container_Product_Order_Network_Vlan",
'location': 449604, # Tokyo
'packageId': 571, # Network_VLAN
'prices': [
{'id':50751}, # Private VLAN
{'id':1093} # 64 Static Public IP Addresses
]
}
],
'quoteName': "Network_VLAN",
'sendQuoteEmailFlag': False
}
# placeQuote
placeQuote = client['Product_Order'].placeQuote(order)
#placeQuote = client['Product_Order'].verifyOrder(order)
#jsonstring = json.dumps(placeQuote,indent=4)
#print(jsonstring)
答案 0 :(得分:0)
我尝试了您的代码并且它对我有用,您的问题是对您的帐户有一些限制我建议您联系softlayer销售部门以获得进一步的帮助。