我试着订购了一台裸机,但我得到了那个错误
root@ubuntu:~# ruby array.rb
/usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/xmlrpc/client.rb:414:in `call': The location provided for this order is invalid. (XMLRPC::FaultException)
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/softlayer_api-3.0.2/lib/softlayer/Service.rb:267:in `call_softlayer_api_with_params'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/softlayer_api-3.0.2/lib/softlayer/Service.rb:196:in `method_missing'
from array.rb:20:in `<main>'我也尝试过使用lon02 (id 358694),但是我发现了同样的错误。
我想自动执行以下配置的订单:
Server:
Dual Intel Xeon E5-2650 (8 Cores, 2.00 GHz)
Second Processor Intel Xeon E5-2650 (8 Cores, 2.00 GHz)
RAM:
16 GB
Operating System:
Ubuntu Linux 14.04 LTS Trusty Tahr - Minimal Install (64 bit)
Disk Controller:
RAID
10 Hard Drives of type:
800 GB SSD (10 DWPD)
Disk 0-3 Raid 6. Disk 4 HotSpare - Disk 5-8 Raid 6 Disk 9 HotSpare
Public Bandwidth:
500 GB Bandwidth
Uplink Port Speeds:
1 Gbps Redundant Public & Private Network Uplinks
Private Network Port 1 Gbps Redundant Private Uplinks
Public Network Port 1 Gbps Redundant Public Uplinks
Power Supply:
Redundant Power Supply
Monitoring:
Host Ping and TCP Service Monitoring
Response:
Automated Reboot from Monitoring
VPN Management - Private Network:
Unlimited SSL VPN Users & 1 PPTP VPN User per account
Vulnerability Assessments & Management:
Nessus Vulnerability Assessment & Reporting
Primary IP Addresses:
1 IP Address
Notification:
Email and Ticket
Remote Management:
Reboot / KVM over IP这是我的代码片段:
require 'rubygems'
require 'softlayer_api'
$SL_API_USERNAME = "-------"
$SL_API_KEY = "------------------"
client = SoftLayer::Service.new("SoftLayer_Product_Order");
product={
"complexType"=>"SoftLayer_Container_Product_Order_Hardware_Server",
"quantity"=>1,
"hardware"=>[{"hostname"=>"dysa-ca-east-0-baremetal-uaa-test-ai", "domain"=>"dysa-ca-east", "primaryNetworkComponent"=>{"networkVlan"=>{"id"=>"888013"}}, "primaryBackendNetworkComponent"=>{"networkVlan"=>{"id"=>"888015"}}}],
"location"=>"448994",
"packageId"=>142,
"prices"=>[{"id"=>29899}, {"id"=>29899}, {"id"=>37622}, {"id"=>34742}, {"id"=>36037}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>33867}, {"id"=>26109}, {"id"=>25014}, {"id"=>34807}, {"id"=>34241}, {"id"=>32500}, {"id"=>34996}, {"id"=>33483}, {"id"=>35310}], "useHourlyPricing"=>false,
"storageGroups"=>[{"arrayTypeId"=>"4", "hardDrives"=>"[0,1,2,3]", "hotSpareDrives"=>"[4]"}, {"arrayTypeId"=>"4", "hardDrives"=>"[5,6,7,8]", "hotSpareDrives"=>"[9]"}]}
client.verifyOrder(product)你能帮帮我吗?非常感谢
发布于 2016-02-05 20:23:11
此请求可能会帮助您根据位置获取有效的商品价格:
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/200/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]
Method: GET其中:这些带有locationGroupId = null的价格ids被视为“标准价格”,接口将在内部为客户切换价格。但建议首先执行verifyOrder,以查看所需的顺序是否正常(费用可能会有所不同)。有关这方面的更多详细信息,请查看:
http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You
这是在PHP中使用itemPrices的另一个例子。
https://softlayer.github.io/php/get_required_price_id/
如果问题仍然存在,请打开SL票证,因为它可能是一个错误。
参考:
http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItemPrices http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getAllObjects http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package
发布于 2016-02-05 21:14:30
这是一个问题,您正在使用的包没有任何可用的数据中心,您可以通过运行此方法来验证:
http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions
下面是一个使用rest的示例:
https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/142/getRegions
method: GET这就是出现错误的原因:为该订单提供的位置无效。
我建议你在Softlayer的Portal中打开一个工单并报告这个问题,同时你可以尝试另一个包(如果你想要的话)。
问候
发布于 2016-02-12 22:50:16
部分解析使用了packageId=251,但订购的裸机具有10xRAID 0,每个裸机只有1个磁盘,而不是2xRAID 6:(以下代码中的什么错误?
require 'rubygems'
require 'softlayer_api'
$SL_API_USERNAME = "-----"
$SL_API_KEY = "-----"
client = SoftLayer::Service.new("SoftLayer_Product_Order");
product={
"complexType"=>"SoftLayer_Container_Product_Order_Hardware_Server",
"quantity"=>1,
"hardware"=>[{"hostname"=>"dys1-0-baremetal-uaa",
"domain"=>"softlayer.com",
"primaryNetworkComponent"=>{"networkVlan"=>{"id"=>"MY_VLAN_ID"}},
"primaryBackendNetworkComponent"=>{"networkVlan"=>{"id"=>"MY_VLAN_ID"}}}],
"location"=>"358694",
"packageId"=>251,
"prices"=>[{"id"=>50675},
{"id"=>37622},
{"id"=>49427},
{"id"=>141945},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50143},
{"id"=>50263},
{"id"=>26109},
{"id"=>25014},
{"id"=>34807},
{"id"=>50223},
{"id"=>34241},
{"id"=>32500},
{"id"=>34996},
{"id"=>33483},
{"id"=>35310}],
"useHourlyPricing"=>false,
"storageGroups"=>[{"arrayTypeId"=>4,
"hardDrives"=>[0,1,2,3],
"hotSpareDrives"=>[4]},
{"arrayTypeId"=>4,
"hardDrives"=>[5,6,7,8],
"hotSpareDrives"=>[9]}]
}
p client.verifyOrder(product)https://stackoverflow.com/questions/35223232
复制相似问题