如何引用 SoftLayer 的网络 Vlan?

How do I quote SoftLayer's Network Vlan?

如何引用 SoftLayer 的网络 Vlan? (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) 

我试过你的代码,它对我有用,你的问题是你的帐户受到一些限制我建议你联系 softlayer 销售人员以获得进一步的帮助。